diff --git a/.cproject b/.cproject deleted file mode 100644 index 173198bb74208c249e340effb523ee7b99162a7c..0000000000000000000000000000000000000000 --- a/.cproject +++ /dev/null @@ -1,318 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<?fileVersion 4.0.0?> - -<cproject> -<storageModule moduleId="org.eclipse.cdt.core.settings"> -<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.2028848925"> -<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2028848925" moduleId="org.eclipse.cdt.core.settings" name="Linux GCC"> -<externalSettings/> -<extensions> -<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> -<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> -<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> -<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> -<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> -</extensions> -</storageModule> -<storageModule moduleId="cdtBuildSystem" version="4.0.0"> -<configuration artifactName="sflphone" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.2028848925" name="Linux GCC" parent="org.eclipse.cdt.build.core.emptycfg"> -<folderInfo id="cdt.managedbuild.toolchain.gnu.base.2028848925.1702545013" name="/" resourcePath=""> -<toolChain id="cdt.managedbuild.toolchain.gnu.base.2089599304" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base"> -<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1774974985" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/> -<builder id="cdt.managedbuild.target.gnu.builder.base.466829147" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/> -<tool id="cdt.managedbuild.tool.gnu.archiver.base.740005240" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> -<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.63410449" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"> -<option id="gnu.cpp.compiler.option.include.paths.1295746905" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/list"/> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/string"/> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/map"/> -</option> -<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1521967404" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> -</tool> -<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.260142907" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base"> -<option id="gnu.c.compiler.option.include.paths.1990006641" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/list"/> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/string"/> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/map"/> -</option> -<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.124347870" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> -</tool> -<tool id="cdt.managedbuild.tool.gnu.c.linker.base.457097362" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/> -<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1227214045" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"> -<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.890036182" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> -<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> -<additionalInput kind="additionalinput" paths="$(LIBS)"/> -</inputType> -</tool> -<tool id="cdt.managedbuild.tool.gnu.assembler.base.157782839" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base"> -<option id="gnu.both.asm.option.include.paths.1462205363" superClass="gnu.both.asm.option.include.paths" valueType="includePath"> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/list"/> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/string"/> -<listOptionValue builtIn="false" value="/usr/include/c++/4.3/map"/> -</option> -<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1762206279" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> -</tool> -</toolChain> -</folderInfo> -<sourceEntries> -<entry excluding="sflphone-gtk" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> -</sourceEntries> -</configuration> -</storageModule> -<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> -<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> -<storageModule moduleId="scannerConfiguration"> -<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> -<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="makefileGenerator"> -<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2028848925;cdt.managedbuild.toolchain.gnu.base.2028848925.1702545013;cdt.managedbuild.tool.gnu.cpp.compiler.base.63410449;cdt.managedbuild.tool.gnu.cpp.compiler.input.1521967404"> -<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> -<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="makefileGenerator"> -<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -</scannerConfigBuildInfo> -<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2028848925;cdt.managedbuild.toolchain.gnu.base.2028848925.1702545013;cdt.managedbuild.tool.gnu.c.compiler.base.260142907;cdt.managedbuild.tool.gnu.c.compiler.input.124347870"> -<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> -<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="makefileGenerator"> -<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> -<buildOutputProvider> -<openAction enabled="true" filePath=""/> -<parser enabled="true"/> -</buildOutputProvider> -<scannerInfoProvider id="specsFile"> -<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> -<parser enabled="true"/> -</scannerInfoProvider> -</profile> -</scannerConfigBuildInfo> -</storageModule> -</cconfiguration> -</storageModule> -<storageModule moduleId="cdtBuildSystem" version="4.0.0"> -<project id="sflphone.null.1186992360" name="sflphone"/> -</storageModule> -</cproject> diff --git a/NEWS b/NEWS index 1c91178be2d44b1af63bad55da1af8f0ffd5dd44..63091e0855f0e0842010d4091379d52891af1815 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,14 @@ # SFLphone ################################################ +* 2010-03-25: 0.9.8 beta has been released + +* 2009-12-10: SFLphone 0.9.7 has been released + +* 2009-12-03: SFLphone 0.9.7~rc2 has been released + +* 2009-11-20: SFLphone 0.9.7~rc1 has been released + * 2009-10-27: SFLphone 0.9.7~beta has been released * 2009-07-27: SFLphone 0.9.6 has been released diff --git a/lang/ast/ast.po b/lang/ast/ast.po new file mode 100644 index 0000000000000000000000000000000000000000..e4e2ccba97825368db314c3789a4c89c43cc7cbb --- /dev/null +++ b/lang/ast/ast.po @@ -0,0 +1,1223 @@ +# Asturian translation for sflphone +# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 +# This file is distributed under the same license as the sflphone package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: sflphone\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-17 01:18+0000\n" +"Last-Translator: Xuacu Saturio <xuacusk8@gmail.com>\n" +"Language-Team: Asturian <ast@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../sflphone-client-gnome/src/accountlist.c:170 +msgid "Registered" +msgstr "Rexistráu" + +#: ../sflphone-client-gnome/src/accountlist.c:173 +msgid "Not Registered" +msgstr "Non rexistráu" + +#: ../sflphone-client-gnome/src/accountlist.c:176 +msgid "Trying..." +msgstr "Probando..." + +#: ../sflphone-client-gnome/src/accountlist.c:179 +#: ../sflphone-client-gnome/src/sflnotify.c:131 +#: ../sflphone-client-gnome/src/sflnotify.c:148 +msgid "Error" +msgstr "Fallu" + +#: ../sflphone-client-gnome/src/accountlist.c:182 +msgid "Authentication Failed" +msgstr "Falló n'autenticación" + +#: ../sflphone-client-gnome/src/accountlist.c:185 +msgid "Network unreachable" +msgstr "Rede nun alcanzable" + +#: ../sflphone-client-gnome/src/accountlist.c:188 +msgid "Host unreachable" +msgstr "Host nun alcanzable" + +#: ../sflphone-client-gnome/src/accountlist.c:191 +msgid "Stun configuration error" +msgstr "Error na configuración STUN" + +#: ../sflphone-client-gnome/src/accountlist.c:194 +msgid "Stun server invalid" +msgstr "Sirvidor STUN inválidu" + +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 +msgid "Invalid" +msgstr "Inválidu" + +#: ../sflphone-client-gnome/src/actions.c:114 +msgid "Using account" +msgstr "Usando la cuenta" + +#: ../sflphone-client-gnome/src/actions.c:121 +msgid "No registered accounts" +msgstr "Nun hai cuentes rexistráes" + +#: ../sflphone-client-gnome/src/actions.c:306 +msgid "" +"Unable to connect to the SFLphone server.\n" +"Make sure the daemon is running." +msgstr "" +"Nun se puede coneutar col sirvidor SFLphone.\n" +"Compruebe qu'el daemon tea funcionando." + +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 +msgid "Direct SIP call" +msgstr "Llamada SIP direuta" + +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/errors.c:29 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening playback device" +msgstr "" +"<b>Avisu ALSA</b>\n" +"\n" +"Error al abrir el preséu de reproducción" + +#: ../sflphone-client-gnome/src/errors.c:32 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening capture device" +msgstr "" +"<b>Avisu ALSA</b>\n" +"\n" +"Error al abrir el preséu de captura" + +#: ../sflphone-client-gnome/src/errors.c:35 +msgid "" +"Pulseaudio notification\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"<b>Avisu de Pulseaudio</b>\n" +"\n" +"Pulseaudio nun ta funcionando" + +#: ../sflphone-client-gnome/src/mainwindow.c:94 +msgid "There is one call in progress." +msgstr "Hai una llamada en cursu." + +#: ../sflphone-client-gnome/src/mainwindow.c:98 +msgid "There are calls in progress." +msgstr "Hai llamaes en cursu." + +#: ../sflphone-client-gnome/src/mainwindow.c:103 +msgid "Do you still want to quit?" +msgstr "¿Entá quier salir?" + +#: ../sflphone-client-gnome/src/mainwindow.c:331 +msgid "SFLphone Error" +msgstr "Error SFLphone" + +#: ../sflphone-client-gnome/src/mainwindow.c:450 +#, c-format +msgid "ZRTP is not supported by peer %s\n" +msgstr "El par %s nun sofita ZRTP\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:452 +msgid "Secure Communication Unavailable" +msgstr "La comunicación segura nun ta disponible" + +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 +msgid "Continue" +msgstr "Siguir" + +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 +msgid "Stop Call" +msgstr "Terminar llamada" + +#: ../sflphone-client-gnome/src/mainwindow.c:480 +#, c-format +msgid "" +"A %s error forced the call with %s to fall under unencrypted mode.\n" +"Exact reason: %s\n" +msgstr "" +"Un error de %s fizo que la llamada con %s pasara a mou ensin encriptar.\n" +"Razón esauta: %s\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:482 +msgid "ZRTP negotiation failed" +msgstr "Falló la negociación ZRTP" + +#: ../sflphone-client-gnome/src/mainwindow.c:500 +#, c-format +msgid "" +"%s wants to stop using secure communication. Confirm will resume " +"conversation without SRTP.\n" +msgstr "" +"%s quier dexar d'usar comunicación segura. Confirmar reaniciará la " +"conversación ensin SRTP.\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:502 +msgid "Confirm Go Clear" +msgstr "Confirmar mou en claro" + +#: ../sflphone-client-gnome/src/mainwindow.c:504 +msgid "Confirm" +msgstr "Confirmar" + +#: ../sflphone-client-gnome/src/sflnotify.c:71 +#: ../sflphone-client-gnome/src/sflnotify.c:91 +#, c-format +msgid "%s account : %s" +msgstr "%s cuenta : %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:75 +#, c-format +msgid "<i>From</i> %s" +msgstr "<i>De</i> %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:94 +#, c-format +msgid "%d voice mail" +msgid_plural "%d voice mails" +msgstr[0] "%d mensaxe de voz" +msgstr[1] "%d mensaxes de voz" + +#: ../sflphone-client-gnome/src/sflnotify.c:111 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "Llamando cola cuenta %s <i>%s</i>" + +#: ../sflphone-client-gnome/src/sflnotify.c:115 +msgid "Current account" +msgstr "Cuenta actual" + +#: ../sflphone-client-gnome/src/sflnotify.c:130 +msgid "You have no accounts set up" +msgstr "Nun hai cuentes configuraes" + +#: ../sflphone-client-gnome/src/sflnotify.c:147 +msgid "You have no registered accounts" +msgstr "Nun tien denguna cuenta rexistrada" + +#: ../sflphone-client-gnome/src/sflnotify.c:190 +#, c-format +msgid "" +"<i>With:</i> %s \n" +"using %s" +msgstr "" +"<i>Con:</i> %s\n" +"usando %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:205 +#, c-format +msgid "%s does not support ZRTP." +msgstr "%s nun tien sofitu pa ZRTP." + +#: ../sflphone-client-gnome/src/sflnotify.c:220 +#, c-format +msgid "ZRTP negotiation failed with %s" +msgstr "Falló la negociación ZRTP con %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:235 +#, c-format +msgid "<i>With:</i> %s" +msgstr "<i>Con:</i> %s" + +#: ../sflphone-client-gnome/src/sliders.c:162 +msgid "Speakers volume" +msgstr "Volume d'altavoces" + +#: ../sflphone-client-gnome/src/sliders.c:164 +msgid "Mic volume" +msgstr "Volume del micrófonu" + +#: ../sflphone-client-gnome/src/statusicon.c:128 +msgid "_Show main window" +msgstr "Amo_sar ventana principal" + +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Colgar" + +#: ../sflphone-client-gnome/src/statusicon.c:187 +msgid "SFLphone" +msgstr "SFLphone" + +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "Hai %d cuenta activa" +msgstr[1] "Hai %d cuentes actives" + +#: ../sflphone-client-gnome/src/toolbar.c:38 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 +msgid "Voicemail" +msgstr "Buzón de voz" + +#: ../sflphone-client-gnome/src/uimanager.c:121 +msgid "No address book selected" +msgstr "Nun s'escoyó una llibreta de direiciones" + +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 +msgid "Address book" +msgstr "Llibreta de direiciones" + +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format +msgid "Voicemail (%i)" +msgstr "Buzón de voz (%i)" + +#: ../sflphone-client-gnome/src/uimanager.c:396 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "" +"SFLphone ye un programa de VoIP compatible colos protocolos SIP ya IAX2." + +#: ../sflphone-client-gnome/src/uimanager.c:398 +msgid "About SFLphone" +msgstr "Tocante a SFLphone" + +#: ../sflphone-client-gnome/src/uimanager.c:800 +msgid "Call" +msgstr "Llamada" + +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 +msgid "_New call" +msgstr "Llamada _Nueva" + +#: ../sflphone-client-gnome/src/uimanager.c:802 +msgid "Place a new call" +msgstr "Facer una llamada nueva" + +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 +msgid "_Pick up" +msgstr "_Descolgar" + +#: ../sflphone-client-gnome/src/uimanager.c:804 +msgid "Answer the call" +msgstr "Contestar la llamada" + +#: ../sflphone-client-gnome/src/uimanager.c:806 +msgid "Finish the call" +msgstr "Finar la llamada" + +#: ../sflphone-client-gnome/src/uimanager.c:807 +msgid "O_n hold" +msgstr "_N'espera" + +#: ../sflphone-client-gnome/src/uimanager.c:808 +msgid "Place the call on hold" +msgstr "Poner la llamada n'espera" + +#: ../sflphone-client-gnome/src/uimanager.c:809 +msgid "O_ff hold" +msgstr "_Salir d'espera" + +#: ../sflphone-client-gnome/src/uimanager.c:810 +msgid "Place the call off hold" +msgstr "Sacar la llamada d'espera" + +#: ../sflphone-client-gnome/src/uimanager.c:811 +msgid "Configuration _Assistant" +msgstr "_Asistente de configuración" + +#: ../sflphone-client-gnome/src/uimanager.c:812 +msgid "Run the configuration assistant" +msgstr "Executar l'asistente de configuración" + +#: ../sflphone-client-gnome/src/uimanager.c:815 +msgid "Call your voicemail" +msgstr "Llamar al buzón de voz" + +#: ../sflphone-client-gnome/src/uimanager.c:816 +msgid "_Close" +msgstr "_Zarrar" + +#: ../sflphone-client-gnome/src/uimanager.c:817 +msgid "Minimize to system tray" +msgstr "Minimizar na bandexa de sistema" + +#: ../sflphone-client-gnome/src/uimanager.c:818 +msgid "_Quit" +msgstr "_Colar" + +#: ../sflphone-client-gnome/src/uimanager.c:819 +msgid "Quit the program" +msgstr "Colar del programa" + +#: ../sflphone-client-gnome/src/uimanager.c:822 +msgid "_Edit" +msgstr "_Editar" + +#: ../sflphone-client-gnome/src/uimanager.c:823 +msgid "_Copy" +msgstr "_Copiar" + +#: ../sflphone-client-gnome/src/uimanager.c:824 +msgid "Copy the selection" +msgstr "Copiar la seleición" + +#: ../sflphone-client-gnome/src/uimanager.c:825 +msgid "_Paste" +msgstr "A_pegar" + +#: ../sflphone-client-gnome/src/uimanager.c:826 +msgid "Paste the clipboard" +msgstr "Pegar el conteníu del cartafueyu" + +#: ../sflphone-client-gnome/src/uimanager.c:827 +msgid "Clear _history" +msgstr "Llimpiar _hestorial" + +#: ../sflphone-client-gnome/src/uimanager.c:828 +msgid "Clear the call history" +msgstr "Llimpiar l'hestorial de llamáes" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "_Accounts" +msgstr "_Cuentes" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "Edit your accounts" +msgstr "Editar les sos cuentes" + +#: ../sflphone-client-gnome/src/uimanager.c:831 +msgid "_Preferences" +msgstr "_Preferencies" + +#: ../sflphone-client-gnome/src/uimanager.c:832 +msgid "Change your preferences" +msgstr "Camudar les sos preferencies" + +#: ../sflphone-client-gnome/src/uimanager.c:835 +msgid "_View" +msgstr "_Ver" + +#: ../sflphone-client-gnome/src/uimanager.c:838 +msgid "_Help" +msgstr "_Aida" + +#: ../sflphone-client-gnome/src/uimanager.c:839 +msgid "Contents" +msgstr "Conteníu" + +#: ../sflphone-client-gnome/src/uimanager.c:840 +msgid "Open the manual" +msgstr "Abrir el manual" + +#: ../sflphone-client-gnome/src/uimanager.c:841 +msgid "About this application" +msgstr "Tocante a esta aplicación" + +#: ../sflphone-client-gnome/src/uimanager.c:849 +msgid "_Transfer" +msgstr "_Tresferir" + +#: ../sflphone-client-gnome/src/uimanager.c:850 +msgid "Transfer the call" +msgstr "Tresferir la llamada" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "G_rabar" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Grabar la conversación actual" + +#: ../sflphone-client-gnome/src/uimanager.c:853 +msgid "_Show toolbar" +msgstr "Amo_sar ferramientes" + +#: ../sflphone-client-gnome/src/uimanager.c:854 +msgid "Show the toolbar" +msgstr "Amuesa la barra de ferramientes" + +#: ../sflphone-client-gnome/src/uimanager.c:855 +msgid "_Dialpad" +msgstr "_Tecláu" + +#: ../sflphone-client-gnome/src/uimanager.c:856 +msgid "Show the dialpad" +msgstr "Amosar el tecláu pa marcar" + +#: ../sflphone-client-gnome/src/uimanager.c:857 +msgid "_Volume controls" +msgstr "_Controles de volume" + +#: ../sflphone-client-gnome/src/uimanager.c:858 +msgid "Show the volume controls" +msgstr "Amuesa los controles de volume" + +#: ../sflphone-client-gnome/src/uimanager.c:859 +msgid "_History" +msgstr "_Hestorial" + +#: ../sflphone-client-gnome/src/uimanager.c:860 +msgid "Calls history" +msgstr "Hestorial de llamáes" + +#: ../sflphone-client-gnome/src/uimanager.c:861 +msgid "_Address book" +msgstr "Llibret_a de direiciones" + +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 +msgid "On _Hold" +msgstr "_N'espera" + +#: ../sflphone-client-gnome/src/uimanager.c:1234 +msgid "_Call back" +msgstr "Tornar _Llamada" + +#: ../sflphone-client-gnome/src/uimanager.c:1390 +msgid "Edit phone number" +msgstr "Editar númberu de teléfonu" + +#: ../sflphone-client-gnome/src/uimanager.c:1402 +msgid "Edit the phone number before making a call" +msgstr "Editar el númberu de teléfonu enantes de llamar" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 +msgid "Account Parameters" +msgstr "Parámetros de cuenta" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 +msgid "_Alias" +msgstr "Nom_atu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 +msgid "_Protocol" +msgstr "_Protocolu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 +msgid "Unknown" +msgstr "Desconocíu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 +msgid "_Host name" +msgstr "Nome del _host" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 +msgid "_User name" +msgstr "Nome d'_usuariu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 +msgid "_Password" +msgstr "Cont_raseña" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 +msgid "Show password" +msgstr "Amosar contraseña" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 +msgid "_Voicemail number" +msgstr "Númberu del buzón de _voz" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "Nome d'_usuariu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 +msgid "Authentication" +msgstr "Autenticación" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 +msgid "Secret" +msgstr "Secretu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 +msgid "Credential" +msgstr "Credencial" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 +msgid "Authentication name" +msgstr "Nome d'autenticación" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 +msgid "Password" +msgstr "Contraseña" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 +msgid "Security" +msgstr "Seguridá" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 +msgid "Use TLS transport (sips)" +msgstr "Usar tresporte TLS (sips)" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 +msgid "SRTP key exchange" +msgstr "Intercambéu de clave SRTP" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 +msgid "Disabled" +msgstr "Desactiváu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 +msgid "Registration" +msgstr "Rexistru" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 +msgid "Registration expire" +msgstr "Fin del rexistu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 +msgid "_Comply with RFC 3263" +msgstr "_Cumplir con RFC 3263" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 +msgid "Network Interface" +msgstr "Interfaz de rede" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 +msgid "Local address" +msgstr "Direición llocal" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 +msgid "Local port" +msgstr "Puertu llocal" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 +msgid "Published address" +msgstr "Direición espublizada" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 +msgid "Using STUN" +msgstr "Usando STUN" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 +msgid "STUN server URL" +msgstr "URL del sirvidor STUN" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 +msgid "Same as local parameters" +msgstr "Igual que los parámetros llocales" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 +msgid "Set published address and port:" +msgstr "Afitar direición y puertu espublizaos:" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 +msgid "Published port" +msgstr "Puertu espublizáu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 +msgid "Account settings" +msgstr "Axustes de la cuenta" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 +msgid "Basic" +msgstr "Básicu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Códecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 +msgid "Advanced" +msgstr "Avanzáu" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"Esti perfil va usase cuando quiera coneutar col par remotu escribiendo una " +"URI sip como <b>sip:parremotu</b>. Los parámetros que conseñe equí, tamién " +"van usase si una llamada entrante o saliente nun concasa con cuenta dala." + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format +msgid "Server returned \"%s\" (%d)" +msgstr "El sirvidor devolvió \"%s\" (%d)" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 +msgid "Protocol" +msgstr "Protocolu" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 +msgid "Status" +msgstr "Estáu" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 +msgid "Accounts" +msgstr "Cuentes" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 +msgid "Configured Accounts" +msgstr "Cuentes Configuraes" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format +msgid "There is %d active account" +msgid_plural "There are %d active accounts" +msgstr[0] "Hai %d cuenta activa" +msgstr[1] "Hai %d cuentes actives" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 +msgid "You have no active account" +msgstr "Nun hai denguna cuenta activada" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 +msgid "General" +msgstr "Xeneral" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:312 +msgid "_Use Evolution address books" +msgstr "_Usar llibreta de direiciones d'Evolution" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:319 +msgid "Download limit :" +msgstr "Llende de descarga:" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "tarxetes" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" +msgstr "Amosar foto _del contautu, si ta disponible" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" +msgstr "Campos de les llibretes de direiciones d'Evolution" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:345 +msgid "_Work" +msgstr "_Trabayu" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:351 +msgid "_Home" +msgstr "_Casa" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:357 +msgid "_Mobile" +msgstr "_Movil" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:364 +msgid "Address Books" +msgstr "Llibretes de direiciones" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:368 +msgid "Select which Evolution address books to use" +msgstr "Esbille les llibretes de direiciones d'Evolution a usar" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 +msgid "Name" +msgstr "Nome" + +#: ../sflphone-client-gnome/src/config/assistant.c:75 +#, c-format +msgid "This assistant is now finished." +msgstr "Esti asistente yá finó." + +#: ../sflphone-client-gnome/src/config/assistant.c:77 +msgid "" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window." +msgstr "" +"Puede comprobar en cualisquier momentu l'estáu del rexistru, o camudar los " +"parámetros de les cuentes de so, na ventana Opciones/Cuentes." + +#: ../sflphone-client-gnome/src/config/assistant.c:80 +msgid "Alias" +msgstr "Nomatu" + +#: ../sflphone-client-gnome/src/config/assistant.c:84 +msgid "Server" +msgstr "Sirvidor" + +#: ../sflphone-client-gnome/src/config/assistant.c:88 +msgid "Username" +msgstr "Nome d'usuariu" + +#: ../sflphone-client-gnome/src/config/assistant.c:92 +msgid "Security: " +msgstr "Seguridá: " + +#: ../sflphone-client-gnome/src/config/assistant.c:94 +msgid "SRTP/ZRTP draft-zimmermann" +msgstr "SRTP/ZRTP draft-zimmermann" + +#: ../sflphone-client-gnome/src/config/assistant.c:96 +msgid "None" +msgstr "Denguna" + +#: ../sflphone-client-gnome/src/config/assistant.c:230 +msgid "SFLphone account creation wizard" +msgstr "Asistente SFLphone de creación de cuentes" + +#: ../sflphone-client-gnome/src/config/assistant.c:256 +msgid "Welcome to the Account creation wizard of SFLphone!" +msgstr "¡Bienllegáu al asistente de creación de cuentes de SFLphone!" + +#: ../sflphone-client-gnome/src/config/assistant.c:257 +msgid "This installation wizard will help you configure an account." +msgstr "" +"Esti asistente d'instalación echara-y un gabitu pa configurar una cuenta." + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "VoIP Protocols" +msgstr "Protocolos VoIP" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "Select an account type" +msgstr "Escueya una triba de cuenta" + +#: ../sflphone-client-gnome/src/config/assistant.c:273 +msgid "SIP (Session Initiation Protocol)" +msgstr "SIP (Session Initiation Protocol)" + +#: ../sflphone-client-gnome/src/config/assistant.c:275 +msgid "IAX2 (InterAsterix Exchange)" +msgstr "IAX2 (InterAsterix Exchange)" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Account" +msgstr "Cuenta" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Please select one of the following options" +msgstr "Escueya una de les siguientes opciones" + +#: ../sflphone-client-gnome/src/config/assistant.c:291 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "Crear una cuenta SIP/IAX2 de baldre en sflphone.org" + +#: ../sflphone-client-gnome/src/config/assistant.c:293 +msgid "Register an existing SIP or IAX2 account" +msgstr "Rexistrar una cuenta SIP o IAX2 esistente" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +msgid "SIP account settings" +msgstr "Axustes de cuenta SIP" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "Please fill the following information" +msgstr "Conseñe la información siguiente" + +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 +msgid "Secure communications with _ZRTP" +msgstr "Comunicación segura con _ZRTP" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "Optional email address" +msgstr "Corréu ellectrónicu opcional" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "This email address will be used to send your voicemail messages." +msgstr "" +"Estes señes de corréu van usase pa unviar los mensaxes del buzón de voz." + +#: ../sflphone-client-gnome/src/config/assistant.c:398 +msgid "_Email address" +msgstr "_Corréu" + +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "IAX2 account settings" +msgstr "Axustes de cuenta IAX2" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "Network Address Translation (NAT)" +msgstr "Conversión de Direición de Rede (NAT)" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "You should probably enable this if you are behind a firewall." +msgstr "Seique tenga qu'activar esto si ta tres d'un torgafueos." + +#: ../sflphone-client-gnome/src/config/assistant.c:506 +msgid "E_nable STUN" +msgstr "A_ctivar STUN" + +#: ../sflphone-client-gnome/src/config/assistant.c:513 +msgid "_STUN server" +msgstr "_Sirvidor STUN" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Account Registration" +msgstr "Rexistru de cuenta" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Congratulations!" +msgstr "¡Norabona!" + +#: ../sflphone-client-gnome/src/config/audioconf.c:600 +msgid "Frequency" +msgstr "Frecuencia" + +#: ../sflphone-client-gnome/src/config/audioconf.c:605 +msgid "Bitrate" +msgstr "Tasa de bits" + +#: ../sflphone-client-gnome/src/config/audioconf.c:610 +msgid "Bandwidth" +msgstr "Anchor de banda" + +#: ../sflphone-client-gnome/src/config/audioconf.c:688 +msgid "ALSA plugin" +msgstr "Complementu ALSA" + +#: ../sflphone-client-gnome/src/config/audioconf.c:710 +msgid "Output" +msgstr "Salida" + +#: ../sflphone-client-gnome/src/config/audioconf.c:732 +msgid "Input" +msgstr "Entrada" + +#: ../sflphone-client-gnome/src/config/audioconf.c:767 +msgid "_Voice Activity Detection" +msgstr "Detección d'actividá de _voz" + +#: ../sflphone-client-gnome/src/config/audioconf.c:777 +msgid "_Noise Reduction (Narrow-Band Companding)" +msgstr "Ame_norgar ruíu (Narrow-Band Companding)" + +#: ../sflphone-client-gnome/src/config/audioconf.c:813 +msgid "Sound Manager" +msgstr "Xestor de soníu" + +#: ../sflphone-client-gnome/src/config/audioconf.c:822 +msgid "_Pulseaudio" +msgstr "_Pulseaudio" + +#: ../sflphone-client-gnome/src/config/audioconf.c:826 +msgid "_ALSA" +msgstr "_ALSA" + +#: ../sflphone-client-gnome/src/config/audioconf.c:832 +msgid "ALSA settings" +msgstr "Axustes de ALSA" + +#: ../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Recordings" +msgstr "Grabaciones" + +#: ../sflphone-client-gnome/src/config/audioconf.c:857 +msgid "Destination folder" +msgstr "Carpeta de destín" + +#: ../sflphone-client-gnome/src/config/audioconf.c:861 +msgid "Select a folder" +msgstr "Seleicione una carpeta" + +#: ../sflphone-client-gnome/src/config/audioconf.c:867 +msgid "Ringtones" +msgstr "Tonos de llamada" + +#: ../sflphone-client-gnome/src/config/audioconf.c:873 +msgid "_Enable ringtones" +msgstr "_Activar tonos de llamada" + +#: ../sflphone-client-gnome/src/config/audioconf.c:879 +msgid "Choose a ringtone" +msgstr "Escueya un tono de llamada" + +#: ../sflphone-client-gnome/src/config/audioconf.c:885 +msgid "Audio Files" +msgstr "Ficheros de soníu" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:130 +msgid "URL Argument" +msgstr "URL Argumentu" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL" +msgstr "Ordes personalizáes pa llamáes entrantes con URL" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:138 +#, c-format +msgid "%s will be replaced with the passed URL." +msgstr "%s va trocase pola URL pasada." + +#: ../sflphone-client-gnome/src/config/hooks-config.c:141 +msgid "Trigger on specific _SIP header" +msgstr "Disparador pa una cabecera _SIP determinada" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:150 +msgid "Trigger on _IAX2 URL" +msgstr "Disparador pa una URL _IAX2" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run" +msgstr "O_rde a executar" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:165 +msgid "Phone number rewriting" +msgstr "Reescritura de númberu telefónicu" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:169 +msgid "_Prefix dialed numbers with" +msgstr "_Prefixar los númberos marcaos con" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 +msgid "Desktop Notifications" +msgstr "Notificaciones nel escritoriu" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 +msgid "_Enable notifications" +msgstr "_Activar notificaciones" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 +msgid "System Tray Icon" +msgstr "Iconu de la bandexa del sistema" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 +msgid "_Popup main window on incoming call" +msgstr "_Estenderexar ventana principal al recibir llamada" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 +msgid "Ne_ver popup main window" +msgstr "_Nunca estenderexar ventana principal" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 +msgid "Hide SFLphone window on _startup" +msgstr "Anubrir _ventana SFLphone nel entamu" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 +msgid "Calls History" +msgstr "Hestóricu de llamaes" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 +msgid "_Keep my history for at least" +msgstr "_Guardar el mio hestóricu polo menos" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 +msgid "days" +msgstr "díes" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 +msgid "Preferences" +msgstr "Preferencies" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 +msgid "Audio" +msgstr "Soníu" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 +msgid "Address Book" +msgstr "Llibreta de direiciones" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 +msgid "Hooks" +msgstr "Enganches" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 +msgid "Advanced options for TLS" +msgstr "Opciones avanzaes pa TLS" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:56 +msgid "TLS transport" +msgstr "Tresporte TLS" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:60 +msgid "" +"TLS transport can be used along with UDP for those calls that would\n" +"require secure sip transactions (aka SIPS). You can configure a different\n" +"TLS transport for each account. However, each of them will run on a " +"dedicated\n" +"port, different one from each other\n" +msgstr "" +"El tresporte TLS puede utilizase xunto con UDP para les llamaes que " +"necesiten\n" +"intercambéos SIP seguros (SIPS). Puede configurar un tresporte TLS distintu\n" +"pa cada cuenta. Por embargu, caún d'ellos va executase nun puertu dedicáu,\n" +"diferentes ente sigo.\n" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 +msgid "Certificate of Authority list" +msgstr "Llista de Certificaos d'Autoridá" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 +msgid "Choose a CA list file (optional)" +msgstr "Escueya un ficheru de llista de CA (opcional)" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 +msgid "Public endpoint certificate file" +msgstr "Ficheru de certificáu de par públicu" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 +msgid "Choose a public endpoint certificate (optional)" +msgstr "Escueye un certificáu públicu de par (opcional)" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 +msgid "Choose a private key file (optional)" +msgstr "Escueye un ficheru de clave privada (opcional)" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 +msgid "Password for the private key" +msgstr "Contraseña de la clave privada" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 +msgid "TLS protocol method" +msgstr "Métodu del protocolu TLS" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 +msgid "TLS cipher list" +msgstr "Llista de cifráu TLS" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 +msgid "Server name instance for outgoing TLS connection" +msgstr "Nome de sirvidor pa la conexón TLS saliente" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 +msgid "Negotiation timeout (sec:msec)" +msgstr "Tiempu de negociación (seg:mseg)" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 +msgid "Verify incoming certificates, as a server" +msgstr "Comprobar certificaos entrantes, como un sirvidor" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 +msgid "Verify certificates from answer, as a client" +msgstr "Comprobar certificaos de la respuesta, como un cliente" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 +msgid "Require certificate for incoming tls connections" +msgstr "Requerir certificáu pa les conexones TLS entrantes" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:49 +msgid "ZRTP Options" +msgstr "Opciones ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:69 +msgid "Send Hello Hash in S_DP" +msgstr "Unviar Hash de Hello en S_DP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:75 +msgid "Ask User to Confirm SAS" +msgstr "Pidir al usuariu que confirme SAS" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:81 +msgid "_Warn if ZRTP not supported" +msgstr "A_visar si nun hai sofitu ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:87 +msgid "Display SAS once for hold events" +msgstr "Amosar SAS una vegada pa eventos n'espera" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "Opciones ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:58 +msgid "Search all" +msgstr "Guetar todos" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:59 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:72 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:84 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:96 +msgid "Click here to change the search type" +msgstr "Calque equí pa camudar el tipu de gueta" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:71 +msgid "Search by missed call" +msgstr "Guetar por llamaes perdíes" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:83 +msgid "Search by incoming call" +msgstr "Guetar por llamaes entrantes" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:95 +msgid "Search by outgoing call" +msgstr "Guetar por llamaes salientes" + +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Error: Nun s'alcontraron codecs de soníu.\n" +#~ "\n" +#~ "</b> Los codecs de soníu de SFLphone han tar en <i>%s</i> o nel " +#~ "direutoriu <b>.sflphone</b> de la so carpeta personal ( <i>%s</i> )" + +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i cuenta configurada" +#~ msgstr[1] "%i cuentes configuraes" + +#~ msgid "Direct IP calls" +#~ msgstr "Llamaes IP direutes" diff --git a/lang/da/da.po b/lang/da/da.po index 1c011969aca5c2afa3b9a4cc76db3e748bcd6bc2..a6ed9863b0d7e8238745a49c0dc20e235782904f 100644 --- a/lang/da/da.po +++ b/lang/da/da.po @@ -7,68 +7,72 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-11-03 03:52+0000\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2010-01-04 19:10+0000\n" "Last-Translator: Jonas Fonseca <fonseca@diku.dk>\n" "Language-Team: Danish <da@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Registreret" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Ikke registreret" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "Forsøger..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Fejl" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Godkendelse mislykkedes" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Netværk kan ikke nås" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "Vært kan ikke nås" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Stun konfigureringsfejl" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Stun server ugyldig" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Ugyldig" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Benytter konto" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Ingen registrerede konti" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -76,23 +80,26 @@ msgstr "" "Forbindelse til SFLphone serveren kan ikke oprettes.\n" "Sørg for at server-dæmonen kører." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "Direkte IP opkald" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Fejl: Ingen audio-codec fundet\n" -"\n" -"</b>SFL audio-codecs skal installeres i <i>%s</i> eller i mappen <b>." -"sflphone</b> i dit hjemmekatalog (<i>%s</i>)" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -124,43 +131,43 @@ msgstr "" "\n" "PulseAudio er tilgængelig" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "Et igangværende opkald eksisterer" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "Igangværende opkald eksisterer" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "Ønsker du stadig at afslutte" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "SFLphone fejl" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "ZRTP er ikke understøttet af modtageren %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "Sikker kommunikation ikke tilgængelig" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "Fortsæt" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "Afslut opkald" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" @@ -170,11 +177,11 @@ msgstr "" "tilstand.\n" "Den præcise årsag: %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "ZRTP-forhandling mislykkedes" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " @@ -183,11 +190,11 @@ msgstr "" "%s ønsker at afslutte brugen af sikker kommunikation. Ved at godkende vil " "samtalen fortætte uden SRTP\n" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "Godkend sikkerhedsændring" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "Godkend" @@ -258,443 +265,465 @@ msgstr "Højtaler lydstyrke" msgid "Mic volume" msgstr "Mikrofon lydstyrke" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "_Vis hovedvindue" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Læg på" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "%i konto oprettet" -msgstr[1] "%i konti oprettet" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "aktiv konto" +msgstr[1] "aktiv konto" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Talebesked" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" -msgstr "" +msgstr "Ingen adressebog er valgt" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Adressebog" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "Talebesked" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone er en VoIP-klient kompatibel med SIP og IAX2 protokoller" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "Om SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "Afslut opkald" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "_Nyt opkald" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" -msgstr "" +msgstr "Lav et nyt opkald" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "_Svar" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" -msgstr "" +msgstr "Besvar opkaldet" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Læg på" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" -msgstr "" +msgstr "Afslut opkaldet" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "I _venteposition" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" -msgstr "" +msgstr "Sæt opkaldet i venteposition" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" -msgstr "" +msgstr "F_jern fra venteposition" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" -msgstr "" +msgstr "Fjern opkaldet fra venteposition" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "_Optag" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "Konfigurationsfil" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Stun konfigureringsfejl" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d indtalt besked" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" -msgstr "" +msgstr "_Luk" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" -msgstr "" +msgstr "Minimere til systembakken" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" -msgstr "" +msgstr "_Afslut" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" -msgstr "" +msgstr "Afslut programmet" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" -msgstr "" +msgstr "_Rediger" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" -msgstr "" +msgstr "_Kopier" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" -msgstr "" +msgstr "Kopier det valgte" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" -msgstr "" +msgstr "Inds_æt" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" -msgstr "" +msgstr "Indsæt indholdet af udklipsholderen" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "Opkaldshistorik" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Opkaldshistorik" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "Konti" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Nuværende konto" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Indstillinger" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "" +msgstr "Ændr dine indstillinger" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" -msgstr "" +msgstr "_Vis" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Hjem" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "Fortsæt" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" -msgstr "" +msgstr "Åbn manualen" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "Godkendelse" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" -msgstr "" +msgstr "_Overfør" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "" +msgstr "Overfør opkaldet" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Optag" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Optag den aktuelle samtale" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" -msgstr "" +msgstr "_Vis værktøjslinie" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" -msgstr "" +msgstr "Vis værktøjslinien" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" -msgstr "Deaktiveret" +msgstr "_Nummertastatur" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" -msgstr "" +msgstr "Vis nummertastaturet" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" -msgstr "" +msgstr "Vis _lydstyrke indstillinger" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" -msgstr "" +msgstr "Vis lydstyrke indstillingerne" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Opkaldshistorik" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Opkaldshistorik" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Adressebog" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "I _venteposition" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "_Besvar opkald" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "Ændre telefonnummer" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "Ændre telefonnummeret før opkald" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Kontoparametre" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Alias" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "_Protokol" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Ukendt" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "_Værtsnavn" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "_Brugernavn" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Adgangskode" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Adgangskode" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "_Nummer for talebesked" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "_Brugernavn" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "Godkendelse" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "Hemmelig" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "Legitimationsoplysning" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "Godkendelsesnavn" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Adgangskode" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "Sikkerhed" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "Benyt TLS transport (sips)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "SRTP-nøgleudveksling" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "Deaktiveret" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "Registrering" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "Forældelse af registrering" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "_Overhold RFC 3263" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "Netværk kan ikke nås" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "Lokal adresse" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "Lokal port" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "Offentliggjort adresse" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" -msgstr "Ved brug af STUN " +msgstr "Ved brug af STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "STUN serveradresse" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "Samme som lokale parametre" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "Konfigurer offentliggjort adresse og port:" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "Offentliggjort port" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Kontoindstillinger" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Grundlæggende" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Advanceret" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Netværk" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"Denne profil benyttes når du ønsker at kontakte en ekstern peer ved blot at " +"indtaste en sip-adresse såsom <b>sip:eksternpeer</b>. De indstillinger som " +"du definerer her vil også benyttes hvis ingen konto kan tilknyttes et " +"indgående eller udgående opkald." + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format msgid "Server returned \"%s\" (%d)" msgstr "Server svarede \"" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protokol" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Status" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Konti" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "Oprettede konti" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" -msgstr[0] " aktiv konto" -msgstr[1] " aktiv konto" +msgstr[0] "aktiv konto" +msgstr[1] "aktiv konto" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "Der er ingen aktive konti" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "Generelt" @@ -739,7 +768,7 @@ msgid "Select which Evolution address books to use" msgstr "Vælg hvilke af Evolutions adressekartoteker skal benyttes" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Navn" @@ -780,182 +809,178 @@ msgstr "SRTP/ZRTP draft-zimmermann" msgid "None" msgstr "Ingen" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "SFLphone-guiden til oprettelse af konto" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "Velkommen til kontooperettelsesvejledning for SFLphone" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" "Denne installeringsvejledning vil hjælpe dig med at konfigurere en konto" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "VoIP protokoller" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "Vælg en kontotype" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Konto" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "Vælg en af følgende indstillinger" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Opret en gratis SIP/IAX2 konto hos sflphone.org" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "Registrer en eksisterende SIP eller IAX2 konto" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "SIP kontoindstillinger" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "Udfyld venligst følgende information" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "Sikker kommunikation med _ZRTP" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Valgfri emailadresse" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "Denne emailadresse vil blive brugt til at sende dig indtalte beskeder" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "_Emailadresse" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "IAX2 kontoindstillinger" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "Du opfordres til at aktivere dette hvis du er bag en firewall" -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "_Benyt STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "_STUN server" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "Kontoregistrering" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Tillykke!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Frekvens" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Bithastighed" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Båndbredde" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "ALSA plugin" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Uddata" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Inddata" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "_Detektering af taleaktivitet" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "_Støjreducering (Narrow-Band Companding)" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "Lydhåndtering" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_PulseAudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "ALSA indstillinger" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codecs" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Optagelser" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Destinationsmappe" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Vælg en mappe" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "Ringetoner" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "Aktiver _ringetoner" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "Vælg en ringetone" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "Lydfiler" @@ -992,73 +1017,62 @@ msgstr "Omskrivning af telefonnummer" msgid "_Prefix dialed numbers with" msgstr "_Præfiks for indtastede numre" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" -"Denne profil benyttes når du ønsker at kontakte en ekstern peer ved blot at " -"indtaste en sip-adresse såsom <b>sip:eksternpeer</b>. De indstillinger som " -"du definerer her vil også benyttes hvis ingen konto kan tilknyttes et " -"indgående eller udgående opkald." - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "Meddelelser" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "_Aktiver meddelelser" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Systembakke-ikon" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "_Vis hovedvindue ved indgående opkald" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "Aldrig _pop-op hovedvindue" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "Skjul SFLphone vinduet ved _start" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Opkaldshistorik" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "_Gem min historik i mindst" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "dage" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Indstillinger" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Audio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Adressebog" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "Hooks" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "Direkte IP opkald" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "Advancerede indstillinger for TLS" @@ -1080,55 +1094,59 @@ msgstr "" "TLS transporter for de enkelte konti. Bemærk dog at de hver vil benytte\n" "en dedikeret port forskellig fra hinanden.\n" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "Autoritetscertifikatsliste" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "Vælg en fil med en autoritetscertifikatsliste (valgfri)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "Offentlig endpoint certifikatsfil" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "Vælg et offentligt endpoint-certifikat (valgfri)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "Vælg en privat nøglefil (valgfri)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "Adgangskode for den private nøgle" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "TLS protokolmetode" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "TLS cifferliste" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "Server navneinstans for udgående TLS forbindelse" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "Forhandlingstimeout" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "Udfør kontrol af indgående certifikater, som en server" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "Udfør kontrol af certifikater fra svar, som en klient" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "Kræv certifikat for indgående TLS forbindelser" @@ -1152,6 +1170,15 @@ msgstr "_Advar hvis ZRTP ikke understøttes" msgid "Display SAS once for hold events" msgstr "_Vis SAS en enkelt gang for vente-hændelser" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "ZRTP indstillinger" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Søg alle" @@ -1175,41 +1202,57 @@ msgstr "Søg i indgående opkald" msgid "Search by outgoing call" msgstr "Søg i udgående opkald" -#~ msgid "IP call - %s" -#~ msgstr "IP opkald - %s" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Fejl: Ingen audio-codec fundet\n" +#~ "\n" +#~ "</b>SFL audio-codecs skal installeres i <i>%s</i> eller i mappen <b>." +#~ "sflphone</b> i dit hjemmekatalog (<i>%s</i>)" + +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i konto oprettet" +#~ msgstr[1] "%i konti oprettet" + +#~ msgid "Direct IP calls" +#~ msgstr "Direkte IP opkald" + +#~ msgid "SIP Port" +#~ msgstr "SIP Port" #~ msgid "Codec" #~ msgstr "Kodning" -#~ msgid "Network" -#~ msgstr "Netværk" +#~ msgid "There " +#~ msgstr "Der " #~ msgid "Manually" #~ msgstr "Manuelt" -#~ msgid "There " -#~ msgstr "Der " - -#~ msgid "is " -#~ msgstr "er " +#~ msgid "s" +#~ msgstr "s" #~ msgid "are " #~ msgstr "er " -#~ msgid "s" -#~ msgstr "s" +#~ msgid "is " +#~ msgstr "er " #~ msgid "_Mute other applications during a call" #~ msgstr "_Dæmp andre programmer ved opkald" -#~ msgid "SIP Port" -#~ msgstr "SIP Port" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "Aktiver _talebeskedsmeddelelser" #~ msgid "UDP Transport" #~ msgstr "UDP transport" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "Aktiver _talebeskedsmeddelelser" +#~ msgid "IP call - %s" +#~ msgstr "IP opkald - %s" #~ msgid "Store SIP credentials as MD5 hash" #~ msgstr "Gem SIP-legitimationsoplysninger som _MD5-hash-værdi" diff --git a/lang/de/de.po b/lang/de/de.po index ca1afd15a46c3577ef7821d053d5730e495373e1..be328408cb600124a5dc0ad22e3a7f905e9fb6dc 100644 --- a/lang/de/de.po +++ b/lang/de/de.po @@ -7,68 +7,72 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" -"Last-Translator: Maxime Chambreuil <maxime.chambreuil@gmail.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2010-01-04 00:05+0000\n" +"Last-Translator: Jarosław Ogrodnik <nobodythere@gmail.com>\n" "Language-Team: SavoirFaire Linux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Registriert" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Nicht registriert" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "Am versuchen..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Fehler" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Authentifizierung fehlgeschlagen" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Kein netzwerk" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "Host unerreichbar" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Stun: Konfigurationsfehler" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Ungültiger Stun server" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Ungültig" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Mit Konto" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Kein registriertes Konto" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -76,23 +80,26 @@ msgstr "" "SFLphone Server kann nicht verbunden werden. Stellen Sie sicher, dass der " "Dämon läuft." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" +msgstr "Direkter SIP-Anruf" + +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Fehler: Kein Audio-Codec gefunden.\n" -"\n" -"</b> SFL Audio-Codecs müssen in <i>%s</i> oder <b>.sflphone</b> Ihres HOME-" -"Verzeichniss ( <i>%s</i> ) gespeichert werden." #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -124,65 +131,69 @@ msgstr "" "\n" "Pulseaudio nicht gestartet" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "Laufender Anruf." -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "Laufende Anrufe." -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "Bitte bestätigen, dass Sie die Anwendung beenden möchten" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "SFLphone Fehler" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" -msgstr "" +msgstr "ZRTP wird vom Nutzer %s nicht unterstützt\n" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "Sichere Verbindung nicht verfügbar" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "Weiter" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "Anruf beenden" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" +"Ein %s Fehler verhinderte die Verschlüsselung des Telefonats mit %s.\n" +"Genauer Grund: %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" -msgstr "" +msgstr "ZRTP Übertragung fehlgeschlagen" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" +"%s will die sichere Kommunikation beenden. Das Gespräch wird dann ohne SRTP " +"fortgesetzt.\n" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "Bestätigen" @@ -227,16 +238,18 @@ msgid "" "<i>With:</i> %s \n" "using %s" msgstr "" +"<i>Mit:</i> %s \n" +"unter Verwendung von %s" #: ../sflphone-client-gnome/src/sflnotify.c:205 #, c-format msgid "%s does not support ZRTP." -msgstr "" +msgstr "%s unterstützt ZRTP nicht." #: ../sflphone-client-gnome/src/sflnotify.c:220 #, c-format msgid "ZRTP negotiation failed with %s" -msgstr "" +msgstr "ZRTP-Übertragung mit %s schlug fehl" #: ../sflphone-client-gnome/src/sflnotify.c:235 #, c-format @@ -251,444 +264,461 @@ msgstr "Lautsprecher Lautstärke" msgid "Mic volume" msgstr "Mikro Lautstärke" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "_Hauptfenster anzeigen" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "A_uflegen" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "%i Konto konfiguriert" -msgstr[1] "%i Konten konfiguriert" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "aktive Konten" +msgstr[1] "aktive Konten" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Voicemail" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "Adressbuch" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Adressbuch" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "Voicemail (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone ist ein VoIP Client (kompatibel mit SIP und IAX2 Protokolle)" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "Über SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "_Anruf" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "_Neuer Anruf" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" -msgstr "" +msgstr "Einen neuen Anruf tätigen" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "_Abnehmen" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "A_uflegen" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" -msgstr "" +msgstr "Den Anruf beenden" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "in _Warteschleife" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "_Gespräch aufzeichnen" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "Einrichtungsdatei" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Stun: Konfigurationsfehler" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d Voice Nachricht" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "_Editieren" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" -msgstr "" +msgstr "Das Programm beenden" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Editieren" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "Entfernen Sie das ausgewählte Konto" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "Liste der vorherigen Anrufen _leeren" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Vorherigen Anrufen leeren" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "_Konten" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Aktuelles Konto" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Einstellungen" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "" +msgstr "Ihre Einstellungen ändern" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "_Anzeigen" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Hilfe" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "Weiter" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "Authentifizierung" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "Weiterleiten" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "Weiterleiten zu : " +msgstr "Weiterleiten zu :" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Gespräch aufzeichnen" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "_Wählscheibe" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "Lautstärke-Regler anzeigen" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "Lautstärke-Regler anzeigen" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Vorherige Anrufe" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Liste der vorherigen Anrufen" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Adressbuch" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "in _Warteschleife" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "_Zurückrufen" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "Nummer editieren" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "Nummer vor dem Anruf editieren" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Konto parameter" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Alias" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "_Protokoll" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Unbekannt" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "_Hostname" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "_Benutzername" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Passwort" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Passwort" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "_Voicemail Nummer" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "_Benutzername" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "Authentifizierung" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "Geheim" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "Authentifizierung Name" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Passwort" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "Sicherheit" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "Deaktiviert" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "Anmeldung" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "Kein netzwerk" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "Adresse (lokal)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "Port (lokal)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Kontoeinstellungen" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Allgemein" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Erweitert" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Netzwerk" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protokoll" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Status" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Konten" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "Konfigurierten Konten" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" -msgstr[0] " aktive Konten" -msgstr[1] " aktive Konten" +msgstr[0] "aktive Konten" +msgstr[1] "aktive Konten" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "Sie haben kein aktives Konto" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "Allgemein" @@ -733,7 +763,7 @@ msgid "Select which Evolution address books to use" msgstr "Adressbücher von Evolution zum verwenden auswählen" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Name" @@ -774,183 +804,179 @@ msgstr "SRTP/ZRTP draft-zimmermann" msgid "None" msgstr "Nichts" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "SFLphone Konto (Konfigurationsassistent)" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "Wilkommen zu SFLphone!" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" "The Installationsassistent wird Ihnen helfen, ein Konto zu konfigurieren." -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "VoIP Protokoll" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "Kontotyp auswählen" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterisk Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Konto" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "Bitte eine Option auswählen" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "SIP/IAX2 Konto bei sflphone.org erstellen lassen" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "Existierendes SIP/IAX2 Konto registrieren" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "Konfiguration des SIP Konto" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "Folgende Informationen bitte ausfühlen" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "Sichere Kommunikation mit _ZRTP" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Fakultative E-mail-Adresse" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" "Diese E-mail-Adresse wird benutzt, um Ihnen voicemail Meldungen zu schicken." -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "_Email" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "Konfiguration des IAX2 Konto" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "Sie sollten dieses einschalten, falls Sie hinter einer Firewall sind." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "STUN Ei_nschalten" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "_STUN Server" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "Konto Registrierung" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Gratulation!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Frequenz" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Bitrate" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Bandbreite" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "ALSA Plugin" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Ausgabe" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Eingabe" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "\"Voice Activity\" Erkennung" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "_Geräuschreduzierung (Narrow-Band Companding)" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "Sound Manager" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "ALSA Konfiguration" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codecs" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Aufnahmen" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Zielverzeichnis" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Verzeichnis auswählen" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "Klingeltöne" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "Klingeltöne _einschalten" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "Klingelton auswählen" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "Audio Dateien" @@ -987,69 +1013,62 @@ msgstr "Telefonnummer umformen" msgid "_Prefix dialed numbers with" msgstr "_Präfix vor Nummern einfügen" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "Desktopbenachrichtigungen" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "Benachrichtigungen _einschalten" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Benachrichtigungsfeld (\"System Tray\") Icon" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "Hauptfenster anzeigen wenn eingehendes Gespräch" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "_Hauptfenster nie anzeigen" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "_Unsichtbar beim Start" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Liste der vorherigen Anrufen" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "Tage" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Einstellungen" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Audio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Adressbuch" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "Hooks" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1067,55 +1086,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1139,6 +1162,15 @@ msgstr "_Warnung wenn ZRTP nicht unterstüzt" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "ZRTP Optionen" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Suche alle" @@ -1162,38 +1194,21 @@ msgstr "Suche nach eingehenden Anruf" msgid "Search by outgoing call" msgstr "Suche nach ausgehenden Anru" -#~ msgid "IP call - %s" -#~ msgstr "IP Anruf - %s" - -#~ msgid "Codec" -#~ msgstr "Codec" - -#~ msgid "Network" -#~ msgstr "Netzwerk" - -#~ msgid "Manually" -#~ msgstr "Manuell" - -#~ msgid "There " -#~ msgstr "Es " - -#~ msgid "is " -#~ msgstr "gibt " - -#~ msgid "are " -#~ msgstr "gibt " - -#~ msgid "_Mute other applications during a call" -#~ msgstr "_Während eines Anrufs andere Anwendungen stumm schalten" - -#~ msgid "SIP Port" -#~ msgstr "SIP Port" - -#~ msgid "UDP Transport" -#~ msgstr "UDP Transport" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Fehler: Kein Audio-Codec gefunden.\n" +#~ "\n" +#~ "</b> SFL Audio-Codecs müssen in <i>%s</i> oder <b>.sflphone</b> Ihres " +#~ "HOME-Verzeichniss ( <i>%s</i> ) gespeichert werden." -#~ msgid "Enable voicemail _notifications" -#~ msgstr "_Benachrichtigung für Voice Nachrichten" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i Konto konfiguriert" +#~ msgstr[1] "%i Konten konfiguriert" #~ msgctxt "account state" #~ msgid "Error" @@ -1231,6 +1246,9 @@ msgstr "Suche nach ausgehenden Anru" #~ msgid "Default account" #~ msgstr "Default Konto" +#~ msgid "Codec" +#~ msgstr "Codec" + #~ msgid "SFLphone KDE Client" #~ msgstr "SFLphone KDE Client" @@ -1410,6 +1428,9 @@ msgstr "Suche nach ausgehenden Anru" #~ msgid "Connection" #~ msgstr "Anbindung" +#~ msgid "SIP Port" +#~ msgstr "SIP Port" + #~ msgid "Trigger on specific SIP header" #~ msgstr "Bewirkung beim spezifischen SIP Header" @@ -1435,26 +1456,53 @@ msgstr "Suche nach ausgehenden Anru" #~ msgid "Attention:number of results exceeds max displayed." #~ msgstr "Warnung: Anzahl Resultate überschreit definiertes Maximum" +#~ msgid "IP call - %s" +#~ msgstr "IP Anruf - %s" + #~ msgid "%s - %s" #~ msgstr "%s - %s" #~ msgid "_Enable this account" #~ msgstr "_Einschalten" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "_Benachrichtigung für Voice Nachrichten" + #~ msgid "PulseAudio sound server" #~ msgstr "PulseAudio Sound Server" +#~ msgid "_Mute other applications during a call" +#~ msgstr "_Während eines Anrufs andere Anwendungen stumm schalten" + #~ msgid "Port" #~ msgstr "Port" +#~ msgid "Manually" +#~ msgstr "Manuell" + +#~ msgid "There " +#~ msgstr "Es " + +#~ msgid "are " +#~ msgstr "gibt " + +#~ msgid "is " +#~ msgstr "gibt " + +#~ msgid "UDP Transport" +#~ msgstr "UDP Transport" + #~ msgctxt "NAME OF TRANSLATORS" #~ msgid "Your names" #~ msgstr "" #~ "Ihre Namen, ,Launchpad Contributions:,Maxime Chambreuil,Sven Werlen, ," -#~ "Launchpad Contributions:,Maxime Chambreuil,Sven Werlen,Sven Werlen" +#~ "Launchpad Contributions:,Maxime Chambreuil,Sven Werlen,Sven Werlen, ," +#~ "Launchpad Contributions:,Funatiker,Jarosław Ogrodnik,Maxime Chambreuil," +#~ "Michael Keppler,Sven Werlen,Sven Werlen" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ "Ihre E-Mail-Adressen,,,maxime.chambreuil@gmail.com,,,,maxime." -#~ "chambreuil@gmail.com,,sven.werlen@gmail.com" +#~ "chambreuil@gmail.com,,sven.werlen@gmail.com,,,,nobodythere@gmail.com," +#~ "maxime.chambreuil@gmail.com,Bananeweizen@gmx.de,,sven.werlen@gmail.com" diff --git a/lang/el/el.po b/lang/el/el.po new file mode 100644 index 0000000000000000000000000000000000000000..76b3bf044534363b02ed94f2237dc87dd3dcc6ce --- /dev/null +++ b/lang/el/el.po @@ -0,0 +1,1209 @@ +# Greek translation for sflphone +# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010 +# This file is distributed under the same license as the sflphone package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sflphone\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2010-01-13 02:45+0000\n" +"Last-Translator: jarlaxl lamat <sztaasz@gmail.com>\n" +"Language-Team: Greek <el@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../sflphone-client-gnome/src/accountlist.c:170 +msgid "Registered" +msgstr "Εγγεγραμμένος" + +#: ../sflphone-client-gnome/src/accountlist.c:173 +msgid "Not Registered" +msgstr "Μη εγγεγραμμένος" + +#: ../sflphone-client-gnome/src/accountlist.c:176 +msgid "Trying..." +msgstr "Προσπαθώ..." + +#: ../sflphone-client-gnome/src/accountlist.c:179 +#: ../sflphone-client-gnome/src/sflnotify.c:131 +#: ../sflphone-client-gnome/src/sflnotify.c:148 +msgid "Error" +msgstr "Σφάλμα" + +#: ../sflphone-client-gnome/src/accountlist.c:182 +msgid "Authentication Failed" +msgstr "Αποτυχία πιστοποίησης" + +#: ../sflphone-client-gnome/src/accountlist.c:185 +msgid "Network unreachable" +msgstr "Μη προσβάσιμο δίκτυο" + +#: ../sflphone-client-gnome/src/accountlist.c:188 +msgid "Host unreachable" +msgstr "Μη προσβάσιμος υπολογιστής" + +#: ../sflphone-client-gnome/src/accountlist.c:191 +msgid "Stun configuration error" +msgstr "Σφάλμα ρύθμισης εξυπηρετητή STUN" + +#: ../sflphone-client-gnome/src/accountlist.c:194 +msgid "Stun server invalid" +msgstr "Ακυρος εξυπηρετητής STUN" + +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 +msgid "Invalid" +msgstr "Μη έγκυρο" + +#: ../sflphone-client-gnome/src/actions.c:114 +msgid "Using account" +msgstr "Χρήση λογαριασμού" + +#: ../sflphone-client-gnome/src/actions.c:121 +msgid "No registered accounts" +msgstr "Μη πιστοποιημένοι λογαριασμοί" + +#: ../sflphone-client-gnome/src/actions.c:306 +msgid "" +"Unable to connect to the SFLphone server.\n" +"Make sure the daemon is running." +msgstr "" +"Αδυναμία σύνδεσης στον εξυπηρετητη του SFLphone\n" +"Σιγουρευτείτε οτι τρέχει ο daemon" + +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 +msgid "Direct SIP call" +msgstr "Κλήση κατευθείαν SIP" + +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/errors.c:29 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening playback device" +msgstr "" +"Ειδοποίηση απο την ALSA:\n" +"\n" +"Σφάλμα κατα το άνοιγμα της συσκευής αναπαραγωγής" + +#: ../sflphone-client-gnome/src/errors.c:32 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening capture device" +msgstr "" +"Ειδοποίηση απο την ALSA:\n" +"\n" +"Σφάλμα κατα το άνοιγμα της συσκευής λήψης ήχου" + +#: ../sflphone-client-gnome/src/errors.c:35 +msgid "" +"Pulseaudio notification\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"Ειδοποίηση απο το Pulseaudio\n" +"\n" +"Tο Pulseaudio δεν τρέχει" + +#: ../sflphone-client-gnome/src/mainwindow.c:94 +msgid "There is one call in progress." +msgstr "Υπάρχει μια κλήση εν εξελίξει" + +#: ../sflphone-client-gnome/src/mainwindow.c:98 +msgid "There are calls in progress." +msgstr "Υπάρχουν κλήσεις εν εξελίξει" + +#: ../sflphone-client-gnome/src/mainwindow.c:103 +msgid "Do you still want to quit?" +msgstr "Να κλείσω σιγουρα;" + +#: ../sflphone-client-gnome/src/mainwindow.c:331 +msgid "SFLphone Error" +msgstr "Σφάλμα SFLphone" + +#: ../sflphone-client-gnome/src/mainwindow.c:450 +#, c-format +msgid "ZRTP is not supported by peer %s\n" +msgstr "Το πρωτόκολλο ZRTP δεν υποσττηρίζεται απο το peer %s\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:452 +msgid "Secure Communication Unavailable" +msgstr "Κρυπτογραφημένη επικοινωνια μη διαθέσιμη" + +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 +msgid "Continue" +msgstr "Συνέχεια" + +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 +msgid "Stop Call" +msgstr "Τερματισμός κλήσης" + +#: ../sflphone-client-gnome/src/mainwindow.c:480 +#, c-format +msgid "" +"A %s error forced the call with %s to fall under unencrypted mode.\n" +"Exact reason: %s\n" +msgstr "" +"Ενα %s σφάλμα ανάγκασε την κλήση με %s να τερματίσει υπο μη κρυπτογραφημένη " +"μορφή.\n" +"Ακριβής λόγος: %s\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:482 +msgid "ZRTP negotiation failed" +msgstr "Η διαπραγμάτευση ZRTP απέτυχε" + +#: ../sflphone-client-gnome/src/mainwindow.c:500 +#, c-format +msgid "" +"%s wants to stop using secure communication. Confirm will resume " +"conversation without SRTP.\n" +msgstr "" +"Ο/Η %s θέλει να σταματησει να χρησιμοποιεί κρυπτογραφημένη επικοινωνία. Η " +"επιβεβαιωση θα συνεχίσει τη συζήτηση αλλα χωρις κρυπτογράφηση\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:502 +msgid "Confirm Go Clear" +msgstr "Επιβεβαίωση Φύγε Καθαρισμός" + +#: ../sflphone-client-gnome/src/mainwindow.c:504 +msgid "Confirm" +msgstr "Επιβεβαίωση" + +#: ../sflphone-client-gnome/src/sflnotify.c:71 +#: ../sflphone-client-gnome/src/sflnotify.c:91 +#, c-format +msgid "%s account : %s" +msgstr "%s λογαριασμός %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:75 +#, c-format +msgid "<i>From</i> %s" +msgstr "<i>Από</i> %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:94 +#, c-format +msgid "%d voice mail" +msgid_plural "%d voice mails" +msgstr[0] "%d Μηνυμα τηλεφωνητή" +msgstr[1] "%d Μηνυματα τηλεφωνητή" + +#: ../sflphone-client-gnome/src/sflnotify.c:111 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "Κλήση μέ %s λογαριασμό <i>%s</i>" + +#: ../sflphone-client-gnome/src/sflnotify.c:115 +msgid "Current account" +msgstr "Τρέχων λογαριασμός" + +#: ../sflphone-client-gnome/src/sflnotify.c:130 +msgid "You have no accounts set up" +msgstr "Δεν έχετε θέσει λογαριασμούς" + +#: ../sflphone-client-gnome/src/sflnotify.c:147 +msgid "You have no registered accounts" +msgstr "Δεν έχετε κατοχυρομένους λογαριασμούς" + +#: ../sflphone-client-gnome/src/sflnotify.c:190 +#, c-format +msgid "" +"<i>With:</i> %s \n" +"using %s" +msgstr "" +"<i>Με:</i> %s \n" +"χρηση: %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:205 +#, c-format +msgid "%s does not support ZRTP." +msgstr "Ο %s δεν υποστηρίζει ZRTP" + +#: ../sflphone-client-gnome/src/sflnotify.c:220 +#, c-format +msgid "ZRTP negotiation failed with %s" +msgstr "Η ZRTP διαπραγμάτευση απέτυχε με %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:235 +#, c-format +msgid "<i>With:</i> %s" +msgstr "<i>Με:</i> %s" + +#: ../sflphone-client-gnome/src/sliders.c:162 +msgid "Speakers volume" +msgstr "Ένταση ηχείων" + +#: ../sflphone-client-gnome/src/sliders.c:164 +msgid "Mic volume" +msgstr "Ενταση μικροφώνου" + +#: ../sflphone-client-gnome/src/statusicon.c:128 +msgid "_Show main window" +msgstr "Δείξε το βα_σικό παράθυρο" + +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "Κλείστο _Η" + +#: ../sflphone-client-gnome/src/statusicon.c:187 +msgid "SFLphone" +msgstr "SFLphone" + +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "Χρήση λογαριασμού" +msgstr[1] "Χρήση λογαριασμού" + +#: ../sflphone-client-gnome/src/toolbar.c:38 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 +msgid "Voicemail" +msgstr "Τηλεφωνητής" + +#: ../sflphone-client-gnome/src/uimanager.c:121 +msgid "No address book selected" +msgstr "Κανένα βιβλίο διευθύνσεω δεν έχει επιλεχθεί" + +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 +msgid "Address book" +msgstr "Βιβλίο διευθύνσεων" + +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format +msgid "Voicemail (%i)" +msgstr "Τηλεφωνητής (%i)" + +#: ../sflphone-client-gnome/src/uimanager.c:396 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "" +"Το SFLphone ειναι ένα προγραμμα πελάτης VoIP συμβατό με SIP και ΙΑΧ2 " +"πρωτόκολλα" + +#: ../sflphone-client-gnome/src/uimanager.c:398 +msgid "About SFLphone" +msgstr "Σχετικά με το SFLphone" + +#: ../sflphone-client-gnome/src/uimanager.c:800 +msgid "Call" +msgstr "Κλήση" + +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 +msgid "_New call" +msgstr "_Νέα κλήση" + +#: ../sflphone-client-gnome/src/uimanager.c:802 +msgid "Place a new call" +msgstr "Κάντε μια νέα κλήση" + +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 +msgid "_Pick up" +msgstr "Σήκωστο _Π" + +#: ../sflphone-client-gnome/src/uimanager.c:804 +msgid "Answer the call" +msgstr "Σηκώστε το τηλέφωνο" + +#: ../sflphone-client-gnome/src/uimanager.c:806 +msgid "Finish the call" +msgstr "Κλέιστε το τηλέφωνο" + +#: ../sflphone-client-gnome/src/uimanager.c:807 +msgid "O_n hold" +msgstr "Σε α_ναμονή" + +#: ../sflphone-client-gnome/src/uimanager.c:808 +msgid "Place the call on hold" +msgstr "Βάλτε την κλήση σε αναμονή" + +#: ../sflphone-client-gnome/src/uimanager.c:809 +msgid "O_ff hold" +msgstr "Επανα_φορά" + +#: ../sflphone-client-gnome/src/uimanager.c:810 +msgid "Place the call off hold" +msgstr "Επαναφέρετε την κλήση σε αναμονή" + +#: ../sflphone-client-gnome/src/uimanager.c:811 +msgid "Configuration _Assistant" +msgstr "Οδηγός Ρυθμίσεων _Α" + +#: ../sflphone-client-gnome/src/uimanager.c:812 +msgid "Run the configuration assistant" +msgstr "Εκτέλεση του οδηγού ρύθμισης" + +#: ../sflphone-client-gnome/src/uimanager.c:815 +msgid "Call your voicemail" +msgstr "Κλήση προς τον τηλεφωνητή σας" + +#: ../sflphone-client-gnome/src/uimanager.c:816 +msgid "_Close" +msgstr "_Κλείσιμο" + +#: ../sflphone-client-gnome/src/uimanager.c:817 +msgid "Minimize to system tray" +msgstr "Ελαχιστοποίηση στη περιοχή ειδοποιήσεων" + +#: ../sflphone-client-gnome/src/uimanager.c:818 +msgid "_Quit" +msgstr "Έξοδος" + +#: ../sflphone-client-gnome/src/uimanager.c:819 +msgid "Quit the program" +msgstr "Τερματισμός του προγράμματος" + +#: ../sflphone-client-gnome/src/uimanager.c:822 +msgid "_Edit" +msgstr "_Επεξεργασία" + +#: ../sflphone-client-gnome/src/uimanager.c:823 +msgid "_Copy" +msgstr "Αντέγρα_ψε" + +#: ../sflphone-client-gnome/src/uimanager.c:824 +msgid "Copy the selection" +msgstr "Αντιγραφή της επιλογής" + +#: ../sflphone-client-gnome/src/uimanager.c:825 +msgid "_Paste" +msgstr "Ε_πικόλληση" + +#: ../sflphone-client-gnome/src/uimanager.c:826 +msgid "Paste the clipboard" +msgstr "Επικόλληση των περιεχομένων του προχείρου (clipboard)" + +#: ../sflphone-client-gnome/src/uimanager.c:827 +msgid "Clear _history" +msgstr "Καθαρισμός ιστορικού κλ_ησεων" + +#: ../sflphone-client-gnome/src/uimanager.c:828 +msgid "Clear the call history" +msgstr "Καθαρισμός του ιστορικού κλησεων" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "_Accounts" +msgstr "Λογαρι_ασμοί" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "Edit your accounts" +msgstr "Επεξεργασία των λογαριασμών σας" + +#: ../sflphone-client-gnome/src/uimanager.c:831 +msgid "_Preferences" +msgstr "_Προτιμήσεις" + +#: ../sflphone-client-gnome/src/uimanager.c:832 +msgid "Change your preferences" +msgstr "Αλλαγή των προτιμήσεων σας" + +#: ../sflphone-client-gnome/src/uimanager.c:835 +msgid "_View" +msgstr "_Προβολή" + +#: ../sflphone-client-gnome/src/uimanager.c:838 +msgid "_Help" +msgstr "_Βο_ηθεια" + +#: ../sflphone-client-gnome/src/uimanager.c:839 +msgid "Contents" +msgstr "Περιεχόμενα" + +#: ../sflphone-client-gnome/src/uimanager.c:840 +msgid "Open the manual" +msgstr "Άνοιγμα του εγχειριδίου" + +#: ../sflphone-client-gnome/src/uimanager.c:841 +msgid "About this application" +msgstr "Περί αυτής της εφαρμογής" + +#: ../sflphone-client-gnome/src/uimanager.c:849 +msgid "_Transfer" +msgstr "Με_ταφορά" + +#: ../sflphone-client-gnome/src/uimanager.c:850 +msgid "Transfer the call" +msgstr "Μεταφορά της κλήσης" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "Καταγ_ραφή" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Καταγραψτε τη τρέχουσα συνομιλία" + +#: ../sflphone-client-gnome/src/uimanager.c:853 +msgid "_Show toolbar" +msgstr "Εμφάνι_ση γραμμής εργαλείων" + +#: ../sflphone-client-gnome/src/uimanager.c:854 +msgid "Show the toolbar" +msgstr "Εμφάνιση της γραμμής εργαλείων" + +#: ../sflphone-client-gnome/src/uimanager.c:855 +msgid "_Dialpad" +msgstr "Πληκτρολόγιο _δ" + +#: ../sflphone-client-gnome/src/uimanager.c:856 +msgid "Show the dialpad" +msgstr "Εμφάνιση του πληκτρολογίου" + +#: ../sflphone-client-gnome/src/uimanager.c:857 +msgid "_Volume controls" +msgstr "Ένταση ήχων" + +#: ../sflphone-client-gnome/src/uimanager.c:858 +msgid "Show the volume controls" +msgstr "Δείξε τις ρυθμίσεις για την ένταση ήχων" + +#: ../sflphone-client-gnome/src/uimanager.c:859 +msgid "_History" +msgstr "Ιστορικό _Η" + +#: ../sflphone-client-gnome/src/uimanager.c:860 +msgid "Calls history" +msgstr "Ιστορικό κλήσεων" + +#: ../sflphone-client-gnome/src/uimanager.c:861 +msgid "_Address book" +msgstr "Βιβλίο διευθύνσεων _Α" + +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 +msgid "On _Hold" +msgstr "Κλ_ηση σε αναμονή" + +#: ../sflphone-client-gnome/src/uimanager.c:1234 +msgid "_Call back" +msgstr "Κλήση" + +#: ../sflphone-client-gnome/src/uimanager.c:1390 +msgid "Edit phone number" +msgstr "Επεξεργσία τηελφωνικού αριθμού" + +#: ../sflphone-client-gnome/src/uimanager.c:1402 +msgid "Edit the phone number before making a call" +msgstr "Επεξεργσία τηελφωνικού αριθμού προ της κλήσης" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 +msgid "Account Parameters" +msgstr "Παράμετροι λογαρισμού" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 +msgid "_Alias" +msgstr "Ψευδώνυμο" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 +msgid "_Protocol" +msgstr "_Πρωτοκολλο" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 +msgid "Unknown" +msgstr "'Αγνωστο" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 +msgid "_Host name" +msgstr "Εξυπηρετητής παρόχου" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 +msgid "_User name" +msgstr "Ονομα χρήστη" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 +msgid "_Password" +msgstr "Συνθηματικό" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 +msgid "Show password" +msgstr "Εμφάνιση συνθηματικού" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 +msgid "_Voicemail number" +msgstr "Αριθμός τηλεφωνητή" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "Ονομα χρήστη" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 +msgid "Authentication" +msgstr "Ταυτοποίηση" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 +msgid "Secret" +msgstr "Απόρρητο" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 +msgid "Credential" +msgstr "Πιστοποιητικό" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 +msgid "Authentication name" +msgstr "Όνομα εξακρίβωσης" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 +msgid "Password" +msgstr "Συνθηματικό" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 +msgid "Security" +msgstr "Ασφάλεια" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 +msgid "Use TLS transport (sips)" +msgstr "Χρήση TLS" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 +msgid "SRTP key exchange" +msgstr "Ανταλλαγή κλειδιών SRTP" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 +msgid "Disabled" +msgstr "Απενεργοποιημένο" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 +msgid "Registration" +msgstr "Εγγραφή" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 +msgid "Registration expire" +msgstr "Λήξη εγγραφής" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 +msgid "_Comply with RFC 3263" +msgstr "Συμβατότητα με RFC 3263" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 +msgid "Network Interface" +msgstr "Συσκευή δικτύου" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 +msgid "Local address" +msgstr "Τοπική διεύθυνση δικτύου" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 +msgid "Local port" +msgstr "Τοπική θύρα δικτύου" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 +msgid "Published address" +msgstr "Δημοσιευμένη διευθυνση" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 +msgid "Using STUN" +msgstr "Χρήση STUN" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 +msgid "STUN server URL" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 +msgid "Same as local parameters" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 +msgid "Set published address and port:" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 +msgid "Published port" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 +msgid "Account settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 +msgid "Basic" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 +msgid "Advanced" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format +msgid "Server returned \"%s\" (%d)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 +msgid "Protocol" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 +msgid "Status" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 +msgid "Accounts" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 +msgid "Configured Accounts" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format +msgid "There is %d active account" +msgid_plural "There are %d active accounts" +msgstr[0] "" +msgstr[1] "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 +msgid "You have no active account" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 +msgid "General" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:312 +msgid "_Use Evolution address books" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:319 +msgid "Download limit :" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:345 +msgid "_Work" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:351 +msgid "_Home" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:357 +msgid "_Mobile" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:364 +msgid "Address Books" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:368 +msgid "Select which Evolution address books to use" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 +msgid "Name" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:75 +#, c-format +msgid "This assistant is now finished." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:77 +msgid "" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:80 +msgid "Alias" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:84 +msgid "Server" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:88 +msgid "Username" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:92 +msgid "Security: " +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:94 +msgid "SRTP/ZRTP draft-zimmermann" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:96 +msgid "None" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:230 +msgid "SFLphone account creation wizard" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:256 +msgid "Welcome to the Account creation wizard of SFLphone!" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:257 +msgid "This installation wizard will help you configure an account." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "VoIP Protocols" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "Select an account type" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:273 +msgid "SIP (Session Initiation Protocol)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:275 +msgid "IAX2 (InterAsterix Exchange)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Account" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Please select one of the following options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:291 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:293 +msgid "Register an existing SIP or IAX2 account" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +msgid "SIP account settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "Please fill the following information" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 +msgid "Secure communications with _ZRTP" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "Optional email address" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:398 +msgid "_Email address" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "IAX2 account settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "You should probably enable this if you are behind a firewall." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:506 +msgid "E_nable STUN" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:513 +msgid "_STUN server" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Account Registration" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Congratulations!" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:600 +msgid "Frequency" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:605 +msgid "Bitrate" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:610 +msgid "Bandwidth" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:688 +msgid "ALSA plugin" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:710 +msgid "Output" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:732 +msgid "Input" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:767 +msgid "_Voice Activity Detection" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:777 +msgid "_Noise Reduction (Narrow-Band Companding)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:813 +msgid "Sound Manager" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:822 +msgid "_Pulseaudio" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:826 +msgid "_ALSA" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:832 +msgid "ALSA settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Recordings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:857 +msgid "Destination folder" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:861 +msgid "Select a folder" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:867 +msgid "Ringtones" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:873 +msgid "_Enable ringtones" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:879 +msgid "Choose a ringtone" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:885 +msgid "Audio Files" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:130 +msgid "URL Argument" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:138 +#, c-format +msgid "%s will be replaced with the passed URL." +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:141 +msgid "Trigger on specific _SIP header" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:150 +msgid "Trigger on _IAX2 URL" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:165 +msgid "Phone number rewriting" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:169 +msgid "_Prefix dialed numbers with" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 +msgid "Desktop Notifications" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 +msgid "_Enable notifications" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 +msgid "System Tray Icon" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 +msgid "_Popup main window on incoming call" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 +msgid "Ne_ver popup main window" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 +msgid "Hide SFLphone window on _startup" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 +msgid "Calls History" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 +msgid "_Keep my history for at least" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 +msgid "days" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 +msgid "Preferences" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 +msgid "Audio" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 +msgid "Address Book" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 +msgid "Hooks" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 +msgid "Advanced options for TLS" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:56 +msgid "TLS transport" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:60 +msgid "" +"TLS transport can be used along with UDP for those calls that would\n" +"require secure sip transactions (aka SIPS). You can configure a different\n" +"TLS transport for each account. However, each of them will run on a " +"dedicated\n" +"port, different one from each other\n" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 +msgid "Certificate of Authority list" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 +msgid "Choose a CA list file (optional)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 +msgid "Public endpoint certificate file" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 +msgid "Choose a public endpoint certificate (optional)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 +msgid "Choose a private key file (optional)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 +msgid "Password for the private key" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 +msgid "TLS protocol method" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 +msgid "TLS cipher list" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 +msgid "Server name instance for outgoing TLS connection" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 +msgid "Negotiation timeout (sec:msec)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 +msgid "Verify incoming certificates, as a server" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 +msgid "Verify certificates from answer, as a client" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 +msgid "Require certificate for incoming tls connections" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:49 +msgid "ZRTP Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:69 +msgid "Send Hello Hash in S_DP" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:75 +msgid "Ask User to Confirm SAS" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:81 +msgid "_Warn if ZRTP not supported" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:87 +msgid "Display SAS once for hold events" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:58 +msgid "Search all" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:59 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:72 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:84 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:96 +msgid "Click here to change the search type" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:71 +msgid "Search by missed call" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:83 +msgid "Search by incoming call" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:95 +msgid "Search by outgoing call" +msgstr "" + +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Σφάλμα: Δεν βρέθηκαν codecs ήχου\n" +#~ "\n" +#~ "</b>Οι codecs ήχου SFL πρέπει να βρίσκονται στον <i>%s</i> είτε στον <b>." +#~ "sflphone</b> φάκελο στον προσωπικο φάκελο ( <i>%s</i> )" + +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "Ο %i λογαριασμός ρυθμίστηκε" +#~ msgstr[1] "Οι %i λογαριασμοί ρυθμίστηκαν" diff --git a/lang/es/es.po b/lang/es/es.po index a40c09ce90e8d1106ba4f53f66c7d832e4701a63..c390d2931ebc2be0938258d27c1bcf30c8fdbafd 100644 --- a/lang/es/es.po +++ b/lang/es/es.po @@ -9,68 +9,72 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" -"Last-Translator: Maxime Chambreuil <maxime.chambreuil@gmail.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-17 23:18+0000\n" +"Last-Translator: Jorge E. Gómez <jorge@jorgee.net>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Registrado" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "No registrado" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "Intentando..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Error" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Falló la autenticación" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Red Inaccesible" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "_Parte del servidor" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Error de configuración Stun" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Servidor stun inválido" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Inválido" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Usando la cuenta" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Ninguna cuenta registrada" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -78,23 +82,26 @@ msgstr "" "Incapaz de conectar con el servidor SFLphone.\n" " Asegúrese que el demonio esté funcionando." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "Llamadas IP directas" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Error: Codecs de audio no encontrados.\n" -"\n" -"</b> Los codecs de audio de SFLphone deben estar en <i>%s</i> o en el " -"directorio <b>.sflphone</b> de su carpeta personal( <i>%s</i> )" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -126,43 +133,43 @@ msgstr "" "\n" "Pulseaudio no está funcionando" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." -msgstr "No hay llamada en curso" +msgstr "Hay una llamada en curso" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "Hay llamadas en curso." -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" -msgstr "Aún quiere salir ?" +msgstr "¿Aún quiere salir?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "Error SFLphone" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "ZRTP no es compatible con %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "Comunicación segura no disponible" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "Seguir" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "Terminar llamada" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" @@ -171,11 +178,11 @@ msgstr "" "Un error de %s obliga la llamada con %s a caer bajo un modo decifrado.\n" "Razón exacta: %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "Negociación ZRTP fracasada" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " @@ -184,11 +191,11 @@ msgstr "" "%s quiere parar la comunicación segura. Confirmar reanudará la conversación " "sin SRTP.\n" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "Confirmar" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "Confirmar" @@ -259,443 +266,465 @@ msgstr "Volumen de altavoces" msgid "Mic volume" msgstr "Volumen del micrófono" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "Mostrar ventana principal" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Colgar" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "%i cuenta configurada" -msgstr[1] "%i cuentas configuradas" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "Hay %d cuenta activada" +msgstr[1] "Hay %d cuentas activadas" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Mensaje de voz" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "Libreta de contactos" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Libreta de contactos" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "Mensaje de voz (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone es un teléfono VoIP compatible con los protocolos SIP y IAX2" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "Sobre SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "_Llamar" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "_Nueva llamada" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" -msgstr "" +msgstr "Realizar un nuevo llamado" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "_Descolgar" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Colgar" +msgstr "Responder el llamado" -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" -msgstr "" +msgstr "Finalizar el llamado" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "En _Espera" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" -msgstr "" +msgstr "Poner el llamado en espera" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "Seguir" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "G_rabar" +msgstr "Sacar el llamado de espera" -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "Archivo de configuración" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Error de configuración Stun" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d mensaje de voz" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" -msgstr "" +msgstr "_Cerrar" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" -msgstr "" +msgstr "Minimizar al área de notificación" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "_Editar" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" -msgstr "" +msgstr "Salir del programa" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Editar" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" -msgstr "" +msgstr "_Copiar" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "Eliminar la cuenta seleccionada" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" -msgstr "" +msgstr "_Pegar" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" -msgstr "" +msgstr "Pegar el contenido del portapapeles" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "_Limpiar historial" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Limpiar historial" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "_Cuentas" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Cuenta actual" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Preferencias" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "" +msgstr "Cambiar sus preferencias" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "_Ver" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Ayuda" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "Seguir" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" -msgstr "" +msgstr "Abrir el manual" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "Autentificación" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "Transferir" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "Transferir a : " +msgstr "Transferir a :" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "G_rabar" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Grabar la conversación actual" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" -msgstr "" +msgstr "_Mostrar barra de herramientas" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" -msgstr "" +msgstr "Mostrar barra de herramientas" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "Desactivado" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" -msgstr "" +msgstr "Mostrar el teclado de marcado" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "_Controles de volumen" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "_Controles de volumen" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Historia de Llamada" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Historia de Llamada" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Libreta de contactos" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "En _Espera" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "_Llamar" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "Editar número de teléfono" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "Editar el número de teléfono antes de llamar" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Parámetros de cuenta" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Alias" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "_Protocolo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Desconocido" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "_Nombre de equipo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "_Usuario" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Contraseña" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Contraseña" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "_Número de buzón de voz" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "_Usuario" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "Autentificación" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "Secreto" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "Informaciónes" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "Nombre de autentificación" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Contraseña" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "Seguridad" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "Usa transporte TLS (sips)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "Intercambió de clave SRTP" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "Desactivado" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "Registración" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "Registracíon expira" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "_Cumplir con RFC 3263" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "Red Inaccesible" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "Dirección local" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "Puerto local" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "Dirección publicada" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" -msgstr "Usando STUN " +msgstr "Usando STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "URL del servidor STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "Igual que parámetros locales" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "Publicar dirección y puerto:" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "Puerto publicado" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Configuración de cuentas" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Básico" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Códecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Avanzado" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Red" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"Este perfil es utilizado cuando usted quiere alcanzar al par remoto " +"escribiendo el URI sip así como <b>sip:parremoto</b>. Los parámetros que " +"usted define aqui serán también utilizados si ninguná cuenta puede ser " +"igualada a una llamada entrante o saliente." + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format msgid "Server returned \"%s\" (%d)" -msgstr "Servidor contesta \"" +msgstr "El servidor contesta \"%s\" (%d)" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protocolo" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Estado" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Cuentas" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "Cuentas Configuradas" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" -msgstr[0] " cuenta activada" -msgstr[1] " cuenta activada" +msgstr[0] "Hay %d cuenta activada" +msgstr[1] "Hay %d cuentas activadas" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "No tienes ninguna cuenta activada" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "General" @@ -740,7 +769,7 @@ msgid "Select which Evolution address books to use" msgstr "Seleccione la libreta de contactos de Evolution a usar" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Nombre" @@ -781,181 +810,177 @@ msgstr "SRTP/ZRTP draft-zimmermann" msgid "None" msgstr "Ninguno" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "Asistente de creación de cuentas" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" -msgstr "¡Bienvenido al asistente de configuración de cuentas de SFLphone" +msgstr "¡Bienvenido al asistente de creación de cuentas de SFLphone!" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "Este asistente de instalación le ayudará a configurar una cuenta." -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "Protocolos VoIP" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "Escoja un tipo de cuenta" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Cuenta" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "Por favor, elija una de las siguientes opciones" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Crear una cuenta SIP/IAX2 gratis en sflphone.org" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "Registrar una cuenta SIP o IAX2 existente" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "Configuración de cuenta SIP" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "Por favor, ingrese la siguiente información" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" -msgstr "Communicaciòn segura con _ZRTP" +msgstr "Comunicación segura con _ZRTP" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Dirección de correo opcional" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "Esta dirección de correo se usará para mandar sus mensajes de voz" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "_Correo" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "Configuración de cuenta IAX2" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Conversión de Dirección de Red (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "Probablemente tiene que activar esto si está detrás de un cortafuegos." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "A_ctivar STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "_Servidor STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "Registro de cuenta" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "¡Enhorabuena!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Frecuencia" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Tasa de transferencia" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Ancho de banda" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "Plugin ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Salida" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Entrada" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "_Detección de actividad de voz" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "_Reducción de ruido" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "Gestor de audio" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "Configuración de ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Códecs" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Grabaciones" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Carpeta de destino" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Seleccione una carpeta" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "Tonos de llamada" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "_Habilitar tonos de llamada" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" -msgstr "Elija un tono de llmada" +msgstr "Elija un tono de llamada" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "Archivos de Audio" @@ -992,76 +1017,65 @@ msgstr "Reescritura de número de teléfono" msgid "_Prefix dialed numbers with" msgstr "_Prefijar los números marcados con" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" -"Este perfil es utilizado cuando usted quiere alcanzar al par remoto " -"escribiendo el URI sip así como <b>sip:parremoto</b>. Los parámetros que " -"usted define aqui serán también utilizados si ninguná cuenta puede ser " -"igualada a una llamada entrante o saliente." - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "Notificación de escritorio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "_Activar notificaciones" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Icono de bandeja del sistema" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "_Popup ventana principal al recibir llamadas" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "_Nunca mostrar ventana principal" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "Esconder SFLphone al principio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Historia de llamadas" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "_Guardar mi historia por lo menos" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "días" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Preferencias" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Sonido" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Libreta de Direcciones" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "Disparadores" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "Llamadas IP directas" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" -msgstr "Opciones avanzadas por TLS" +msgstr "Opciones avanzadas para TLS" #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:56 msgid "TLS transport" @@ -1080,57 +1094,61 @@ msgstr "" "diferente transporte TLS para cada cuenta. De cualquier forma, cada uno de " "ellos usará un puerto dedicado, diferente el uno del otro.\n" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "Lista de Certificados de Autoridad" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "Escoge un archivo de lista de CA (opcional)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "Archivo del certificado del par público" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "Escoge un certificado de par público (opcional)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "Escoge un archivo de clave privada" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "Contraseña de clave privada" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "Método de protocolo TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "Lista de cifrado TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" -msgstr "Nombre del servidor para conección TLS saliente" +msgstr "Nombre del servidor para la conexión TLS saliente" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" -msgstr "Negociación expirada" +msgstr "Negociación expirada (seg:mseg)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "Checar certificados entrantes, como un servidor" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "Checar certificados de la respuesta, como cliente" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" -msgstr "Requiere certificado para conecciones TLS entrantes" +msgstr "Requiere certificado para conexiones TLS entrantes" #: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:49 msgid "ZRTP Options" @@ -1152,6 +1170,15 @@ msgstr "_Prevenir si ZRTP no es compatible" msgid "Display SAS once for hold events" msgstr "Presentar SAS una vez para eventos en espera" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "Opciones ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Buscar todos" @@ -1161,7 +1188,7 @@ msgstr "Buscar todos" #: ../sflphone-client-gnome/src/contacts/searchbar.c:84 #: ../sflphone-client-gnome/src/contacts/searchbar.c:96 msgid "Click here to change the search type" -msgstr "Haz clic aqui para cambiar el type de busqueda" +msgstr "Pulse aqui para cambiar el tipo de busqueda" #: ../sflphone-client-gnome/src/contacts/searchbar.c:71 msgid "Search by missed call" @@ -1175,44 +1202,24 @@ msgstr "Buscar en llamadas entrantes" msgid "Search by outgoing call" msgstr "Buscar en llamadas salientes" -#~ msgid "IP call - %s" -#~ msgstr "Llamada IP - %s" - -#~ msgid "Codec" -#~ msgstr "Códec" - -#~ msgid "Network" -#~ msgstr "Red" - -#~ msgid "Manually" -#~ msgstr "Manualmente" - -#~ msgid "There " -#~ msgstr "Alla " - -#~ msgid "is " -#~ msgstr "es " - -#~ msgid "are " -#~ msgstr "son " - -#~ msgid "s" -#~ msgstr "s" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "Silenciar otras aplicaciones durante una llamada" - -#~ msgid "SIP Port" -#~ msgstr "Puerto SIP" - -#~ msgid "UDP Transport" -#~ msgstr "Transporte UDP" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Error: Codecs de audio no encontrados.\n" +#~ "\n" +#~ "</b> Los codecs de audio de SFLphone deben estar en <i>%s</i> o en el " +#~ "directorio <b>.sflphone</b> de su carpeta personal( <i>%s</i> )" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "Activar _notificaciones de mensajes de voz" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i cuenta configurada" +#~ msgstr[1] "%i cuentas configuradas" -#~ msgid "Store SIP credentials as MD5 hash" -#~ msgstr "Guarda informaciòn SIP como hash MD5" +#~ msgid "Direct IP calls" +#~ msgstr "Llamadas IP directas" #~ msgctxt "account state" #~ msgid "Registered" @@ -1241,6 +1248,9 @@ msgstr "Buscar en llamadas salientes" #~ msgid "SFLphone KDE Client" #~ msgstr "Cliente KDE de SFLphone" +#~ msgid "Codec" +#~ msgstr "Códec" + #~ msgid "Main screen" #~ msgstr "Pantalla principal" @@ -1296,6 +1306,9 @@ msgstr "Buscar en llamadas salientes" #~ msgid "PulseAudio" #~ msgstr "PulseAudio" +#~ msgid "SIP Port" +#~ msgstr "Puerto SIP" + #~ msgctxt "End of 'Keep my history for at least n days.'" #~ msgid "days" #~ msgstr "días" @@ -1452,12 +1465,18 @@ msgstr "Buscar en llamadas salientes" #~ msgid "Attention:number of results exceeds max displayed." #~ msgstr "Cuidado:número de resultatos excede el maximo a mostrar." +#~ msgid "IP call - %s" +#~ msgstr "Llamada IP - %s" + #~ msgid "_Account creation wizard" #~ msgstr "Asistente de configuración de cuentas" #~ msgid "_Enable this account" #~ msgstr "_Habilitar esta cuenta" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "Activar _notificaciones de mensajes de voz" + #~ msgctxt "Beginning of 'Keep my history for at least n days.'" #~ msgid "_Keep my history for at least" #~ msgstr "_Guardar mi historia por lo menos" @@ -1465,6 +1484,9 @@ msgstr "Buscar en llamadas salientes" #~ msgid "PulseAudio sound server" #~ msgstr "Servidor de sonido Pulseaudio" +#~ msgid "_Mute other applications during a call" +#~ msgstr "Silenciar otras aplicaciones durante una llamada" + #~ msgid "User" #~ msgstr "Usuario" @@ -1770,13 +1792,36 @@ msgstr "Buscar en llamadas salientes" #~ "\"Más\" o \"Menos\". Edita la cuenta seleccionada con el formulario a la " #~ "derecha." +#~ msgid "Manually" +#~ msgstr "Manualmente" + +#~ msgid "s" +#~ msgstr "s" + +#~ msgid "There " +#~ msgstr "Alla " + +#~ msgid "Store SIP credentials as MD5 hash" +#~ msgstr "Guarda informaciòn SIP como hash MD5" + +#~ msgid "UDP Transport" +#~ msgstr "Transporte UDP" + +#~ msgid "are " +#~ msgstr "son " + +#~ msgid "is " +#~ msgstr "es " + #~ msgctxt "NAME OF TRANSLATORS" #~ msgid "Your names" #~ msgstr "" #~ "Maxime Chambreuil, ,Launchpad Contributions:,Andres Mujica,Maxime " #~ "Chambreuil, ,Launchpad Contributions:,Andres Mujica,Maxime Chambreuil, ," #~ "Launchpad Contributions:,Andres Mujica,Maxime Chambreuil, ,Launchpad " -#~ "Contributions:,Andres Mujica,Maxime Chambreuil" +#~ "Contributions:,Andres Mujica,Maxime Chambreuil, ,Launchpad Contributions:," +#~ "Andres Mujica,Jorge E. Gómez,Maxime Chambreuil,Nicolás M. Zahlut,Xuacu " +#~ "Saturio" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" @@ -1784,4 +1829,6 @@ msgstr "Buscar en llamadas salientes" #~ "maxime.chambreuil@savoirfairelinux.com,,,andres.mujica@seaq.com.co,maxime." #~ "chambreuil@gmail.com,,,andres.mujica@seaq.com.co,maxime.chambreuil@gmail." #~ "com,,,andres.mujica@seaq.com.co,maxime.chambreuil@gmail.com,,,andres." -#~ "mujica@seaq.com.co,maxime.chambreuil@gmail.com" +#~ "mujica@seaq.com.co,maxime.chambreuil@gmail.com,,,andres.mujica@seaq.com." +#~ "co,jorge@jorgee.net,maxime.chambreuil@gmail.com,nzahlut@live.com," +#~ "xuacusk8@gmail.com" diff --git a/lang/fr/fr.po b/lang/fr/fr.po index c7ace4f55b20cd568eb48572c1eb71af406ac753..2647cf64f4c344807c6d4ef88ae2da48f74f273d 100644 --- a/lang/fr/fr.po +++ b/lang/fr/fr.po @@ -9,68 +9,72 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" -"Last-Translator: Maxime Chambreuil <maxime.chambreuil@gmail.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-12 14:56+0000\n" +"Last-Translator: Pierre Slamich <pierre.slamich@gmail.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2009-11-12 18:12+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Enregistré" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Non Enregistré" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "En cours..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Erreur" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Erreur d'authentification" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Réseau non trouvé" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "Serveur introuvable" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Erreur de configuration Stun" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Serveur Stun invalide" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Non valide" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Utilise le compte" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Pas de compte enregistré" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -78,23 +82,26 @@ msgstr "" "Impossible de se connecter au serveur SFLphone.\n" " Assurez-vous que le démon est lancé." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "Appel direct SIP" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Erreur: Aucun codec audio trouvé.\n" -"\n" -"</b> Les codecs audio SFL doivent être soit dans <i>%s</i> soit dans le " -"répertoire <b>.sflphone</b> de votre répertoire racine( <i>%s</i> )" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -126,43 +133,43 @@ msgstr "" "\n" "Pulseaudio n'est pas lancé" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "Vous avez un appel en cours." -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "Vous avez des appels en cours." -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "Voulez-vous quitter?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "Erreur SFLphone" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "ZRTP n'est pas supporté par %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "Communications sécurisées non disponibles" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "Continuer" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "Arrêter l'appel" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" @@ -171,11 +178,11 @@ msgstr "" "L'appel avec %s est passé en mode non-crypté à cause d'une erreur %s.\n" "Raison exacte: %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "Erreur d'authentification" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " @@ -184,11 +191,11 @@ msgstr "" "%s ne désire plus utiliser la communication sécurisée. Confirmer que vous " "voulez continuer sans ZRTP.\n" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "Confirmer Communication en clair" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "Confirmer" @@ -259,448 +266,466 @@ msgstr "Volume des hauts-parleurs" msgid "Mic volume" msgstr "Volume du micro" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "_Afficher la fenêtre principale" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Raccrocher" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "%i compte configuré" -msgstr[1] "%i comptes configurés" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "%d compte actif" +msgstr[1] "%d comptes actifs" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Boite vocale" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "Aucun carnet d'adresses sélectionné" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Carnet d'adresses" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 #, c-format msgid "Voicemail (%i)" msgstr "Boite vocale (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "" "SFLphone est un client VoIP compatible avec les protocoles SIP et IAX2." -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "A propos de SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "Actions" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "_Nouvel appel" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "Appeler" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "_Décrocher" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "Répondre à l'appel" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Raccrocher" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "Terminer l'appel" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "Mettre en attente" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "Mettre l'appel en attente" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "Reprendre" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "Reprendre l'appel" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "Enregistrer" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "Enregistrer la conversation courante" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "_Assistant de configuration" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Lancer l'assistant de configuration" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "Appeler la boite vocale" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "_Fermer" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "Minimiser dans la barre des tâches" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "_Quitter" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "Quitter le programme" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Editer" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "_Copier" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "Copier la sélection" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "C_oller" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" -msgstr "" +msgstr "Coller le contenu du presse-papiers" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "Effacer l'_historique" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Effacer l'historique" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "Co_mptes" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Éditer les comptes" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Préférences" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "Modifier les préférences" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "A_ffichage" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "A_ide" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "Sommaire" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "Ouvrir le manuel" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "À propos de cette application" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "Transférer" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "Transférer à : " +msgstr "Transférer à :" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "Enregistrer" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Enregistrer la conversation courante" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "Afficher la _barre d'outil" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "Afficher la barre d'outil" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "_Clavier" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "Afficher le clavier" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "Contrôle du _volume" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "Afficher les controles du volume" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Historique" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Historique d'appels" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Carnet d'adresses" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "_Mettre en attente" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "_Rappeler" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "Éditer le numéro" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "Éditer le numéro de téléphone avant d'appeler" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Paramètres du Compte" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "A_lias" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "P_rotocole" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Inconnu" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "_Serveur" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "Usa_ger" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Mot de passe" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 -#, fuzzy +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" -msgstr "Mot de passe" +msgstr "Afficher le mot de passe" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "_Boite vocale #" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "Usa_ger" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "Identification" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "Mot de passe" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "Informations" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "Nom d'authentification" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Mot de passe" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "Sécurité" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "Utiliser un transport TLS (sips)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "Échange de clé SRTP" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "Désactivé" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "Expiration d'enregistrement" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "Expiration d'enregistrement" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "Respecter RFC 3263" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "Interface réseau" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "Adresse locale" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "Port local" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "Adresse de publication" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" -msgstr "Utiliser STUN " +msgstr "Utiliser STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "URL du serveur STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "Identique aux paramètres locaux" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "Configurer l'adresse et le port à publier" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "Port de publication" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Paramètre des comptes" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Général" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Avancé" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Réseau" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"Ce profil est utilisé quand vous voulez appeler directement quelqu'un en " +"composant une adresse SIP telle que: <b>sip:remotepeer</b>. Ces paramètres " +"sont aussi utilisé si aucun compte ne peut être attribué à un appel entrant " +"ou sortant." + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "Le serveur a répondu \"%s\" (%d)" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protocole" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Statut" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Comptes" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "Comptes Configurés" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" -msgstr[0] " %d compte actif" -msgstr[1] " %d comptes actifs" +msgstr[0] "%d compte actif" +msgstr[1] "%d comptes actifs" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "Vous n'avez aucun compte actif" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "Général" @@ -745,7 +770,7 @@ msgid "Select which Evolution address books to use" msgstr "Sélectionnez les carnets d'adresses d'Evolution à utiliser" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Nom" @@ -786,183 +811,179 @@ msgstr "SRTP/ZRTP draft-zimmermann" msgid "None" msgstr "Aucun" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "Assistant de création de compte de SFLphone" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "Bienvenue dans l'assistant de création de compte de SFLphone !" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "Cet assistant vous guidera dans la configuration d'un compte." -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "Protocoles VoIP" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "Sélectionnez un type de compte" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Compte" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "Veuillez sélectionner une des options suivantes" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Créer un compte SIP/IAX2 gratuit sur sflphone.org" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "Enregistrer un compte SIP ou IAX2 existant" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "Paramètres de compte SIP" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "Veuillez remplir les champs suivants" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "Communications sécurisées avec _ZRTP" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Adresse courriel optionnelle" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "Vos messages vocaux seront envoyés par courriel à cette adresse." -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "A_dresse courriel" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "Paramètres de compte IAX2" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" "Vous devriez probablement activer cette option si vous vous trouvez derrière " "un pare-feu." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "A_ctiver STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "S_erveur STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "Enregistrement du compte" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Félicitations!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Fréquence" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Bitrate" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Bande passante" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "Greffon ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Sortie" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Entrée" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "Détection de l'activité de la voix" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "Réduction du bruit (Compresseur extenseur LBR)" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "Interface Audio" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "Paramètres ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codecs" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Enregistrements" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Dossier de destination" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Choisissez un dossier" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "Sonneries" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "_Activer les sonneries" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "Sélectionner une sonnerie" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "Fichier Audio" @@ -999,73 +1020,62 @@ msgstr "Réécriture des numéros appelés" msgid "_Prefix dialed numbers with" msgstr "_Préfixer les numéros composés par" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" -"Ce profil est utilisé quand vous voulez appeler directement quelqu'un en " -"composant une adresse SIP telle que: <b>sip:remotepeer</b>. Ces paramètres " -"sont aussi utilisé si aucun compte ne peut être attribué à un appel entrant " -"ou sortant." - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "Notifications de Bureau" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "_Activer les notifications" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Icône dans la barre des tâches" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "Faire apparaître la fenêtre _principale lors d'appel entrant" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "Ne _jamais afficher la fenêtre principale" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "_Cacher la fenêtre de SFLphone au démarrage" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Historique des appels" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "Garder mon historique au moins" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "jours" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Préférences" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Audio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Carnet d'adresse" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "Ancrage" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "Appels IP" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "Options avancées TLS" @@ -1087,55 +1097,59 @@ msgstr "" "TLS différent pour chaque compte. Cependant, chacun écoutera sur un port " "différent.\n" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "Liste des autorités de certification" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "Choisir une liste d'AC (optionnel)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "Fichier de certificats de l'extrémité public" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "Sélectionner le certificat de l'extrémité public" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "Choisir une clé privée (optionnel)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "Mot de passe pour la clé privée" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "Méthode pour TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "Liste de cryptogramme TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "Instance du serveur pour les connections TLS sortantes" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "Expiration de la négociation" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "En tant que serveur, vérifier les certificats entrants" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "En tant que client, vérifier les certificats dans les réponses" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "Exiger un certificat pour les connexions TLS entrantes" @@ -1159,6 +1173,15 @@ msgstr "_Avertir si ZRTP n'est pas supporté" msgid "Display SAS once for hold events" msgstr "Afficher le SAS seulement une fois sur les mises en attente" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "Options de ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Rechercher dans tous" @@ -1182,48 +1205,24 @@ msgstr "Rechercher dans les appels entrants" msgid "Search by outgoing call" msgstr "Rechercher dans les appels sortants" -#~ msgid "Configuration File" -#~ msgstr "Fichier de configuration" - -#~ msgid "Store SIP credentials as MD5 hash" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" #~ msgstr "" -#~ "Stocker les informations d'authentification sour forme encryptée (MD5)" - -#~ msgid "IP call - %s" -#~ msgstr "Appel IP - %s" - -#~ msgid "Codec" -#~ msgstr "Codec" - -#~ msgid "Network" -#~ msgstr "Réseau" - -#~ msgid "Manually" -#~ msgstr "Manuelle" - -#~ msgid "There " -#~ msgstr "Il y " - -#~ msgid "is " -#~ msgstr "a " - -#~ msgid "are " -#~ msgstr "a " - -#~ msgid "s" -#~ msgstr "s" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "Éteindre le _son des autres applications lors d'un appel" - -#~ msgid "SIP Port" -#~ msgstr "Port SIP" +#~ "<b>Erreur: Aucun codec audio trouvé.\n" +#~ "\n" +#~ "</b> Les codecs audio SFL doivent être soit dans <i>%s</i> soit dans le " +#~ "répertoire <b>.sflphone</b> de votre répertoire racine( <i>%s</i> )" -#~ msgid "UDP Transport" -#~ msgstr "Transport UDP" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i compte configuré" +#~ msgstr[1] "%i comptes configurés" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "Activer les notifications de boîte _vocale" +#~ msgid "Direct IP calls" +#~ msgstr "Appels IP" #~ msgctxt "account state" #~ msgid "Registered" @@ -1286,6 +1285,9 @@ msgstr "Rechercher dans les appels sortants" #~ msgid "Default account" #~ msgstr "Compte par défaut" +#~ msgid "Codec" +#~ msgstr "Codec" + #~ msgid "SFLphone KDE Client" #~ msgstr "SFLphone Client KDE" @@ -1475,6 +1477,9 @@ msgstr "Rechercher dans les appels sortants" #~ msgid "Clear history" #~ msgstr "Effacer l'historique" +#~ msgid "SIP Port" +#~ msgstr "Port SIP" + #~ msgid "Trigger on specific SIP header" #~ msgstr "Déclencher sur un entête SIP spécifique" @@ -1496,15 +1501,24 @@ msgstr "Rechercher dans les appels sortants" #~ msgid "Attention:number of results exceeds max displayed." #~ msgstr "Attention:tous les résultats ne sont pas affichés." +#~ msgid "IP call - %s" +#~ msgstr "Appel IP - %s" + #~ msgid "_Account creation wizard" #~ msgstr "_Assistant de création de compte" #~ msgid "_Enable this account" #~ msgstr "Activer ce compte" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "Activer les notifications de boîte _vocale" + #~ msgid "PulseAudio sound server" #~ msgstr "Serveur de son PulseAudio" +#~ msgid "_Mute other applications during a call" +#~ msgstr "Éteindre le _son des autres applications lors d'un appel" + #~ msgid "Port" #~ msgstr "Port" @@ -1817,12 +1831,38 @@ msgstr "Rechercher dans les appels sortants" #~ msgid "Registration _expire" #~ msgstr "Expiration d'enregistrement" +#~ msgid "Manually" +#~ msgstr "Manuelle" + +#~ msgid "s" +#~ msgstr "s" + +#~ msgid "UDP Transport" +#~ msgstr "Transport UDP" + +#~ msgid "Configuration File" +#~ msgstr "Fichier de configuration" + +#~ msgid "There " +#~ msgstr "Il y " + +#~ msgid "are " +#~ msgstr "a " + +#~ msgid "is " +#~ msgstr "a " + +#~ msgid "Store SIP credentials as MD5 hash" +#~ msgstr "" +#~ "Stocker les informations d'authentification sour forme encryptée (MD5)" + #~ msgctxt "NAME OF TRANSLATORS" #~ msgid "Your names" #~ msgstr "" #~ "Jérémy Quentin, ,Launchpad Contributions:,Emmanuel Milou,Maxime " #~ "Chambreuil, ,Launchpad Contributions:,Emmanuel Milou,Maxime Chambreuil, ," -#~ "Launchpad Contributions:,Emmanuel Milou,Maxime Chambreuil" +#~ "Launchpad Contributions:,Emmanuel Milou,Maxime Chambreuil, ,Launchpad " +#~ "Contributions:,Emmanuel Milou,Maxime Chambreuil,Pierre Slamich" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" @@ -1830,4 +1870,5 @@ msgstr "Rechercher dans les appels sortants" #~ "jeremy.quentin@savoirfairelinux.com,,,emmanuel.milou@savoirfairelinux.com," #~ "maxime.chambreuil@gmail.com,,,emmanuel.milou@savoirfairelinux.com,maxime." #~ "chambreuil@gmail.com,,,emmanuel.milou@savoirfairelinux.com,maxime." -#~ "chambreuil@gmail.com" +#~ "chambreuil@gmail.com,,,emmanuel.milou@savoirfairelinux.com,maxime." +#~ "chambreuil@gmail.com,pierre.slamich@gmail.com" diff --git a/lang/it/it.po b/lang/it/it.po index cf8644aea926a034434257d7637e4c5c02e5a84c..7c22d150530b413d5f736c5221c2cad11c96e0f5 100644 --- a/lang/it/it.po +++ b/lang/it/it.po @@ -7,68 +7,72 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-14 17:47+0000\n" -"Last-Translator: Maxime Chambreuil <maxime.chambreuil@gmail.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-09 20:05+0000\n" +"Last-Translator: Maurizio Porrato <Unknown>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Registrato" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Non registrato" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "Registrazione in corso..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Errore" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Autenticazione fallita" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Rete irraggiungibile" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "Host non raggiungibile" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Errore di configurazione STUN" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Server STUN non valido" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Non valido" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Account in uso:" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Nessun account registrato" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -76,23 +80,26 @@ msgstr "" "Impossibile connettersi al server SFLphone.\n" "Accertarsi che il demone sia in esecuzione." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" +msgstr "Chiamata SIP diretta" + +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Errore: Non è stato trovato alcun codec audio.</b>\n" -"\n" -"I codec audio SFL devono trovarsi in <i>%s</i> o nella sottocartella <b>." -"sflphone</b> della cartella home dell'utente (</i>%s</i>)" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -121,65 +128,65 @@ msgstr "" "Notifica PulseAudio\n" "PulseAudio non è in esecuzione" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "C'è una chiamata in corso." -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "Ci sono chiamate in corso." -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "Vuoi veramente uscire?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "Errore SFLphone" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" -msgstr "" +msgstr "Termina la chiamata" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" -msgstr "" +msgstr "Negoziazione ZRTP fallita" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -228,17 +235,17 @@ msgstr "" #: ../sflphone-client-gnome/src/sflnotify.c:205 #, c-format msgid "%s does not support ZRTP." -msgstr "" +msgstr "%s non supporta ZRTP." #: ../sflphone-client-gnome/src/sflnotify.c:220 #, c-format msgid "ZRTP negotiation failed with %s" -msgstr "" +msgstr "Negoziazione ZRTP fallita con %s" #: ../sflphone-client-gnome/src/sflnotify.c:235 #, c-format msgid "<i>With:</i> %s" -msgstr "" +msgstr "<i>Con:</i> %s" #: ../sflphone-client-gnome/src/sliders.c:162 msgid "Speakers volume" @@ -248,445 +255,461 @@ msgstr "Volume altoparlante" msgid "Mic volume" msgstr "Volume microfono" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "Mostra la finestra principale" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Chiudi" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "%i account configurato" -msgstr[1] "%i account configurati" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "Account predefinito" +msgstr[1] "Account predefinito" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Segreteria telefonica" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "Rubrica" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Rubrica" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "Segreteria telefonica (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone è un client VoIP compatibile con i protocolli SIP e IAX2." -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "Informazioni su SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "_Chiama" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "Chiama" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" -msgstr "" +msgstr "Effettua una nuova chiamata" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "Rispondi" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Chiudi" +msgstr "Rispondi alla chiamata" -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" -msgstr "" +msgstr "Termina la chiamata" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "Attesa" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" -msgstr "" +msgstr "Metti in attesa la chiamata" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "_Registra" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Errore di configurazione STUN" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d messaggio vocale" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "_Modifica" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Modifica" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "Elimina l'account selezionato" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "Cancella la cronologia" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Cancella la cronologia" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "_Account" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Account attivo" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Preferenze" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "" +msgstr "Modifica le preferenze" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "_Visualizza" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Aiuto" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "Inoltra" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "Inoltra a: " +msgstr "Inoltra a:" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Registra" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Regista la conversazione in corso" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "Mostra tastiera" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" -msgstr "" +msgstr "Mostra la tastiera" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "Mostra i controlli del volume" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "Mostra i controlli del volume" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Cronologia" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Cronologia chiamate" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Rubrica" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "Attesa" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Parametri account" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Pseudonimo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "_Protocollo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Sconosciuto" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "Nome _host" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "Nome _utente" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Password" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Password" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "Numero segreteria telefonica" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "Nome _utente" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" -msgstr "" +msgstr "Autenticazione" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Password" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "Scadenza registrazione" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "Rete irraggiungibile" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Impostazioni dell'account" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Generale" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codec" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Avanzate" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Rete" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protocollo" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Stato" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Account" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "Account configurati" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" msgstr[1] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "" @@ -731,7 +754,7 @@ msgid "Select which Evolution address books to use" msgstr "Selezionare la rubrica di Evolution da usare" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Nome" @@ -770,184 +793,180 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "" "Benvenuti alla procedura guidata per la creazione di un account SFLphone" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "Questa procedura permetterà di configurare un account." -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "Protocolli VoIP" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "Selezionare un tipo di account" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Account" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "Scegliere una delle seguenti opzioni" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Creare un account SIP/IAX2 gratuito su sflphone.org" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "Registrare un account SIP o IAX2 esistente" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "Impostazioni account SIP" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Indirizzo email opzionale" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" "L'indirizzo email sarà usato per l'invio dei messaggi della segreteria " "telefonica." -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "Indirizzo _email" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "Impostazioni account IAX2" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "Dovrebbe essere abilitato se ci si trova dietro ad un firewall." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "Abilita STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "Server STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "Registrazione account" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Congratulazioni!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Frequenza" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Bitrate" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Banda" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "Plugin ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Uscita" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Ingresso" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "Impostazioni ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codec" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Registrazioni" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Cartella di destinazione" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Seleziona una cartella" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "Suonerie" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "Abilita suonerie" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "Selezionare una suoneria" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "File audio" @@ -984,69 +1003,62 @@ msgstr "Riscrittura numero telefonico" msgid "_Prefix dialed numbers with" msgstr "Prefisso da aggiungere ai numeri da chiamare" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "Notifiche" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "Abilita notifiche" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Icona per area di notifica" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "Mostra la finestra principale all'arrivo delle chiamate" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "Non mostrare mai la finestra principale" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "Nascondi la finestra di SFLphone all'avvio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Cronologia chiamate" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "Mantieni la cronologia per almeno" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "giorni" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Preferenze" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Audio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Rubrica" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1064,55 +1076,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1136,6 +1152,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Cerca tra tutte le chiamate" @@ -1159,24 +1183,25 @@ msgstr "Cerca tra le chiamate ricevute" msgid "Search by outgoing call" msgstr "Cerca tra le chiamate effettuate" -#~ msgid "IP call - %s" -#~ msgstr "Chiamata IP diretta - %s" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Errore: Non è stato trovato alcun codec audio.</b>\n" +#~ "\n" +#~ "I codec audio SFL devono trovarsi in <i>%s</i> o nella sottocartella <b>." +#~ "sflphone</b> della cartella home dell'utente (</i>%s</i>)" + +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i account configurato" +#~ msgstr[1] "%i account configurati" #~ msgid "Codec" #~ msgstr "Codec" -#~ msgid "Network" -#~ msgstr "Rete" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "Spegni l'audio delle altre applicazioni durante una chiamata" - -#~ msgid "SIP Port" -#~ msgstr "SIP Port" - -#~ msgid "Enable voicemail _notifications" -#~ msgstr "Abilita notifiche messaggi vocali" - #~ msgid "(C) 2009 Savoir-faire Linux" #~ msgstr "(C) 2009 Savoir-faire Linux" @@ -1228,15 +1253,15 @@ msgstr "Cerca tra le chiamate effettuate" #~ msgid "Enable notifications" #~ msgstr "Attiva le notifiche" +#~ msgid "SIP Port" +#~ msgstr "SIP Port" + #~ msgid "Port" #~ msgstr "Port" #~ msgid "PulseAudio sound server" #~ msgstr "Server audio PulseAudio" -#~ msgid "Default account" -#~ msgstr "Account predefinito" - #~ msgid "You have an incoming call from" #~ msgstr "Chiamata in arrivo da" @@ -1255,6 +1280,9 @@ msgstr "Cerca tra le chiamate effettuate" #~ msgid "_Enable this account" #~ msgstr "Abilita questo account" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "Abilita notifiche messaggi vocali" + #~ msgid "Voicemail number" #~ msgstr "Numero segreteria telefonica" @@ -1297,9 +1325,15 @@ msgstr "Cerca tra le chiamate effettuate" #~ msgid "Prefix dialed numbers with" #~ msgstr "Prefisso da aggiungere al numero da chiamare" +#~ msgid "_Mute other applications during a call" +#~ msgstr "Spegni l'audio delle altre applicazioni durante una chiamata" + #~ msgid "Keep my history for at least" #~ msgstr "Mantieni la cronologia per almeno" +#~ msgid "IP call - %s" +#~ msgstr "Chiamata IP diretta - %s" + #~ msgid "Registration _expire" #~ msgstr "Scadenza registrazione" @@ -1321,10 +1355,11 @@ msgstr "Cerca tra le chiamate effettuate" #~ msgstr "" #~ ",Launchpad Contributions:,Maurizio Porrato,Maxime Chambreuil, ,Launchpad " #~ "Contributions:,Maurizio Porrato,Maxime Chambreuil, ,Launchpad " +#~ "Contributions:,Maurizio Porrato,Maxime Chambreuil, ,Launchpad " #~ "Contributions:,Maurizio Porrato,Maxime Chambreuil" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ ",,,maxime.chambreuil@gmail.com,,,,maxime.chambreuil@gmail.com,,,,maxime." -#~ "chambreuil@gmail.com" +#~ "chambreuil@gmail.com,,,,maxime.chambreuil@gmail.com" diff --git a/lang/ja/ja.po b/lang/ja/ja.po new file mode 100644 index 0000000000000000000000000000000000000000..88481019c372952906a2bd4ffffea50b202a3d2f --- /dev/null +++ b/lang/ja/ja.po @@ -0,0 +1,1222 @@ +# Japanese translation for sflphone +# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 +# This file is distributed under the same license as the sflphone package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: sflphone\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-23 22:50+0000\n" +"Last-Translator: Launchpad Translations Administrators <rosetta@launchpad." +"net>\n" +"Language-Team: Japanese <ja@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../sflphone-client-gnome/src/accountlist.c:170 +msgid "Registered" +msgstr "登録しました" + +#: ../sflphone-client-gnome/src/accountlist.c:173 +msgid "Not Registered" +msgstr "登録できません" + +#: ../sflphone-client-gnome/src/accountlist.c:176 +msgid "Trying..." +msgstr "検索中..." + +#: ../sflphone-client-gnome/src/accountlist.c:179 +#: ../sflphone-client-gnome/src/sflnotify.c:131 +#: ../sflphone-client-gnome/src/sflnotify.c:148 +msgid "Error" +msgstr "エラー" + +#: ../sflphone-client-gnome/src/accountlist.c:182 +msgid "Authentication Failed" +msgstr "認証に失敗" + +#: ../sflphone-client-gnome/src/accountlist.c:185 +msgid "Network unreachable" +msgstr "ネットワークに接続できません" + +#: ../sflphone-client-gnome/src/accountlist.c:188 +msgid "Host unreachable" +msgstr "ホストに接続できません" + +#: ../sflphone-client-gnome/src/accountlist.c:191 +msgid "Stun configuration error" +msgstr "構成エラー" + +#: ../sflphone-client-gnome/src/accountlist.c:194 +msgid "Stun server invalid" +msgstr "サーバー無効" + +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 +msgid "Invalid" +msgstr "無効" + +#: ../sflphone-client-gnome/src/actions.c:114 +msgid "Using account" +msgstr "アカウント使用中" + +#: ../sflphone-client-gnome/src/actions.c:121 +msgid "No registered accounts" +msgstr "アカウント登録されていません" + +#: ../sflphone-client-gnome/src/actions.c:306 +msgid "" +"Unable to connect to the SFLphone server.\n" +"Make sure the daemon is running." +msgstr "" +"SFLphoneサーバに接続できません\n" +"デーモンを確認してください。" + +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 +msgid "Direct SIP call" +msgstr "ダイレクトSIPコール" + +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/errors.c:29 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening playback device" +msgstr "" +"ALSA通知\n" +"\n" +"再生デバイスエラー" + +#: ../sflphone-client-gnome/src/errors.c:32 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening capture device" +msgstr "" +"ALSA通知\n" +"\n" +"再生ディバイスエラー" + +#: ../sflphone-client-gnome/src/errors.c:35 +msgid "" +"Pulseaudio notification\n" +"\n" +"Pulseaudio is not running" +msgstr "" +"Pulseaudio通知\n" +"\n" +"Pulseaudioが動いていません。" + +#: ../sflphone-client-gnome/src/mainwindow.c:94 +msgid "There is one call in progress." +msgstr "呼び出し中" + +#: ../sflphone-client-gnome/src/mainwindow.c:98 +msgid "There are calls in progress." +msgstr "呼び出し中" + +#: ../sflphone-client-gnome/src/mainwindow.c:103 +msgid "Do you still want to quit?" +msgstr "キャンセルしますか?" + +#: ../sflphone-client-gnome/src/mainwindow.c:331 +msgid "SFLphone Error" +msgstr "SFLphoneエラー" + +#: ../sflphone-client-gnome/src/mainwindow.c:450 +#, c-format +msgid "ZRTP is not supported by peer %s\n" +msgstr "ZRTPが%sにサポートされていません。\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:452 +msgid "Secure Communication Unavailable" +msgstr "安全なコミュニケーションが利用できません。" + +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 +msgid "Continue" +msgstr "次へ" + +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 +msgid "Stop Call" +msgstr "電話をやめてください" + +#: ../sflphone-client-gnome/src/mainwindow.c:480 +#, c-format +msgid "" +"A %s error forced the call with %s to fall under unencrypted mode.\n" +"Exact reason: %s\n" +msgstr "" +"A %s エラーは非暗号化されているため%sの呼び出しを強制終了しました。\n" +"正確な理由:%s\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:482 +msgid "ZRTP negotiation failed" +msgstr "ZRTP交渉失敗" + +#: ../sflphone-client-gnome/src/mainwindow.c:500 +#, c-format +msgid "" +"%s wants to stop using secure communication. Confirm will resume " +"conversation without SRTP.\n" +msgstr "" +"%sはセキュリティーで保護された通信を使うのをやめてください。SRTPなしで会話が" +"再開するのを確認してください。\n" + +#: ../sflphone-client-gnome/src/mainwindow.c:502 +msgid "Confirm Go Clear" +msgstr "クリアを確認してください。" + +#: ../sflphone-client-gnome/src/mainwindow.c:504 +msgid "Confirm" +msgstr "確認" + +#: ../sflphone-client-gnome/src/sflnotify.c:71 +#: ../sflphone-client-gnome/src/sflnotify.c:91 +#, c-format +msgid "%s account : %s" +msgstr "%s アカウント: %s" + +#: ../sflphone-client-gnome/src/sflnotify.c:75 +#, c-format +msgid "<i>From</i> %s" +msgstr "</i> %sから <i>" + +#: ../sflphone-client-gnome/src/sflnotify.c:94 +#, c-format +msgid "%d voice mail" +msgid_plural "%d voice mails" +msgstr[0] "%d ボイスメール" + +#: ../sflphone-client-gnome/src/sflnotify.c:111 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "%s アカウント<i>%s</i>を呼び出し中" + +#: ../sflphone-client-gnome/src/sflnotify.c:115 +msgid "Current account" +msgstr "現在のアカウント" + +#: ../sflphone-client-gnome/src/sflnotify.c:130 +msgid "You have no accounts set up" +msgstr "アカウントが設定されていません" + +#: ../sflphone-client-gnome/src/sflnotify.c:147 +msgid "You have no registered accounts" +msgstr "アカウント登録されていません" + +#: ../sflphone-client-gnome/src/sflnotify.c:190 +#, c-format +msgid "" +"<i>With:</i> %s \n" +"using %s" +msgstr "" +"<i>で:</i> %s\n" +" %sを使ってください。" + +#: ../sflphone-client-gnome/src/sflnotify.c:205 +#, c-format +msgid "%s does not support ZRTP." +msgstr "%s はZRTPをサポートできていません。" + +#: ../sflphone-client-gnome/src/sflnotify.c:220 +#, c-format +msgid "ZRTP negotiation failed with %s" +msgstr "ZRTP交渉%sで失敗しました" + +#: ../sflphone-client-gnome/src/sflnotify.c:235 +#, c-format +msgid "<i>With:</i> %s" +msgstr "<i>With:</i> %s" + +#: ../sflphone-client-gnome/src/sliders.c:162 +msgid "Speakers volume" +msgstr "スピーカーの音量" + +#: ../sflphone-client-gnome/src/sliders.c:164 +msgid "Mic volume" +msgstr "マイク音量" + +#: ../sflphone-client-gnome/src/statusicon.c:128 +msgid "_Show main window" +msgstr "メインウィンドウを開く" + +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "通話を切る(_H)" + +#: ../sflphone-client-gnome/src/statusicon.c:187 +msgid "SFLphone" +msgstr "SFLフォン" + +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "%dアクティブアカウント" + +#: ../sflphone-client-gnome/src/toolbar.c:38 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 +msgid "Voicemail" +msgstr "ボイスメール" + +#: ../sflphone-client-gnome/src/uimanager.c:121 +msgid "No address book selected" +msgstr "アドレス帳が選択されていません" + +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 +msgid "Address book" +msgstr "アドレス帳" + +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format +msgid "Voicemail (%i)" +msgstr "ボイスメール(%i)" + +#: ../sflphone-client-gnome/src/uimanager.c:396 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "SFLフォンはVoIPクライアントとSIP、IAX2プロトコルと互換性があります" + +#: ../sflphone-client-gnome/src/uimanager.c:398 +msgid "About SFLphone" +msgstr "SFLフォンに関して" + +#: ../sflphone-client-gnome/src/uimanager.c:800 +msgid "Call" +msgstr "呼び出し" + +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 +msgid "_New call" +msgstr "通話先" + +#: ../sflphone-client-gnome/src/uimanager.c:802 +msgid "Place a new call" +msgstr "発信します" + +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 +msgid "_Pick up" +msgstr "選択" + +#: ../sflphone-client-gnome/src/uimanager.c:804 +msgid "Answer the call" +msgstr "応答する" + +#: ../sflphone-client-gnome/src/uimanager.c:806 +msgid "Finish the call" +msgstr "通話終了" + +#: ../sflphone-client-gnome/src/uimanager.c:807 +msgid "O_n hold" +msgstr "保留" + +#: ../sflphone-client-gnome/src/uimanager.c:808 +msgid "Place the call on hold" +msgstr "保留中" + +#: ../sflphone-client-gnome/src/uimanager.c:809 +msgid "O_ff hold" +msgstr "保留解除" + +#: ../sflphone-client-gnome/src/uimanager.c:810 +msgid "Place the call off hold" +msgstr "保留を解除する" + +#: ../sflphone-client-gnome/src/uimanager.c:811 +msgid "Configuration _Assistant" +msgstr "構成アシスタント" + +#: ../sflphone-client-gnome/src/uimanager.c:812 +msgid "Run the configuration assistant" +msgstr "構成アシスタントを起動します" + +#: ../sflphone-client-gnome/src/uimanager.c:815 +msgid "Call your voicemail" +msgstr "ボイスメールに電話をしてください" + +#: ../sflphone-client-gnome/src/uimanager.c:816 +msgid "_Close" +msgstr "閉じる(_C)" + +#: ../sflphone-client-gnome/src/uimanager.c:817 +msgid "Minimize to system tray" +msgstr "システムトレイを最小化する" + +#: ../sflphone-client-gnome/src/uimanager.c:818 +msgid "_Quit" +msgstr "終了(_Q)" + +#: ../sflphone-client-gnome/src/uimanager.c:819 +msgid "Quit the program" +msgstr "プログラムの終了" + +#: ../sflphone-client-gnome/src/uimanager.c:822 +msgid "_Edit" +msgstr "編集(_E)" + +#: ../sflphone-client-gnome/src/uimanager.c:823 +msgid "_Copy" +msgstr "コピー(_C)" + +#: ../sflphone-client-gnome/src/uimanager.c:824 +msgid "Copy the selection" +msgstr "選択範囲をコピー" + +#: ../sflphone-client-gnome/src/uimanager.c:825 +msgid "_Paste" +msgstr "貼り付け(_P)" + +#: ../sflphone-client-gnome/src/uimanager.c:826 +msgid "Paste the clipboard" +msgstr "クリップボードに貼り付け" + +#: ../sflphone-client-gnome/src/uimanager.c:827 +msgid "Clear _history" +msgstr "履歴消去" + +#: ../sflphone-client-gnome/src/uimanager.c:828 +msgid "Clear the call history" +msgstr "通話履歴消去" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "_Accounts" +msgstr "アカウント(_A)" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "Edit your accounts" +msgstr "アカウント編集" + +#: ../sflphone-client-gnome/src/uimanager.c:831 +msgid "_Preferences" +msgstr "基本設定" + +#: ../sflphone-client-gnome/src/uimanager.c:832 +msgid "Change your preferences" +msgstr "基本設定の変更" + +#: ../sflphone-client-gnome/src/uimanager.c:835 +msgid "_View" +msgstr "表示(_V)" + +#: ../sflphone-client-gnome/src/uimanager.c:838 +msgid "_Help" +msgstr "ヘルプ(_H)" + +#: ../sflphone-client-gnome/src/uimanager.c:839 +msgid "Contents" +msgstr "目次" + +#: ../sflphone-client-gnome/src/uimanager.c:840 +msgid "Open the manual" +msgstr "手動で開く" + +#: ../sflphone-client-gnome/src/uimanager.c:841 +msgid "About this application" +msgstr "アプリケーションについて" + +#: ../sflphone-client-gnome/src/uimanager.c:849 +msgid "_Transfer" +msgstr "転送" + +#: ../sflphone-client-gnome/src/uimanager.c:850 +msgid "Transfer the call" +msgstr "通話転送" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "録音(_R)" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "現在の会話を録音中" + +#: ../sflphone-client-gnome/src/uimanager.c:853 +msgid "_Show toolbar" +msgstr "ツールバーの表示" + +#: ../sflphone-client-gnome/src/uimanager.c:854 +msgid "Show the toolbar" +msgstr "ツールバーの表示" + +#: ../sflphone-client-gnome/src/uimanager.c:855 +msgid "_Dialpad" +msgstr "ダイアルパッド(_D)" + +#: ../sflphone-client-gnome/src/uimanager.c:856 +msgid "Show the dialpad" +msgstr "ダイヤルパッドの表示" + +#: ../sflphone-client-gnome/src/uimanager.c:857 +msgid "_Volume controls" +msgstr "ボリュームコントロール" + +#: ../sflphone-client-gnome/src/uimanager.c:858 +msgid "Show the volume controls" +msgstr "音量調整の表示" + +#: ../sflphone-client-gnome/src/uimanager.c:859 +msgid "_History" +msgstr "履歴(_H)" + +#: ../sflphone-client-gnome/src/uimanager.c:860 +msgid "Calls history" +msgstr "通話履歴" + +#: ../sflphone-client-gnome/src/uimanager.c:861 +msgid "_Address book" +msgstr "アドレス帳" + +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 +msgid "On _Hold" +msgstr "保留中" + +#: ../sflphone-client-gnome/src/uimanager.c:1234 +msgid "_Call back" +msgstr "折り返し電話をする" + +#: ../sflphone-client-gnome/src/uimanager.c:1390 +msgid "Edit phone number" +msgstr "電話番号の編集" + +#: ../sflphone-client-gnome/src/uimanager.c:1402 +msgid "Edit the phone number before making a call" +msgstr "電話をする前に電話番号の編集をする" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 +msgid "Account Parameters" +msgstr "アカウントパラメーター" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 +msgid "_Alias" +msgstr "別名(_A)" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 +msgid "_Protocol" +msgstr "プロトコル" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 +msgid "Unknown" +msgstr "不明" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 +msgid "_Host name" +msgstr "ホスト名" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 +msgid "_User name" +msgstr "ユーザー名" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 +msgid "_Password" +msgstr "パスワード(_P):" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 +msgid "Show password" +msgstr "パスワードを表示" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 +msgid "_Voicemail number" +msgstr "ボイスメールの番号" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "ユーザー名" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 +msgid "Authentication" +msgstr "認証" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 +msgid "Secret" +msgstr "シークレット" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 +msgid "Credential" +msgstr "資格情報" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 +msgid "Authentication name" +msgstr "名前の認証" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 +msgid "Password" +msgstr "パスワード" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 +msgid "Security" +msgstr "セキュリティ" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 +msgid "Use TLS transport (sips)" +msgstr "TLS トランスポートを使用" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 +msgid "SRTP key exchange" +msgstr "SRTP キー交換" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 +msgid "Disabled" +msgstr "無効" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 +msgid "Registration" +msgstr "登録" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 +msgid "Registration expire" +msgstr "登録期間切れ" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 +msgid "_Comply with RFC 3263" +msgstr "RFC 3263に準拠" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 +msgid "Network Interface" +msgstr "ネットワークインターフェース" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 +msgid "Local address" +msgstr "ローカルアドレス" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 +msgid "Local port" +msgstr "ローカルポート" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 +msgid "Published address" +msgstr "アドレス公開" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 +msgid "Using STUN" +msgstr "STUN使用" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 +msgid "STUN server URL" +msgstr "STUNサーバーのURL" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 +msgid "Same as local parameters" +msgstr "ローカルパラメータと同様" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 +msgid "Set published address and port:" +msgstr "公開アドレスとポートの設定" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 +msgid "Published port" +msgstr "公開ポート" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 +msgid "Account settings" +msgstr "アカウントの設定" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 +msgid "Basic" +msgstr "基本設定" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "コーデック" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 +msgid "Advanced" +msgstr "詳細設定" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"<b>sip:remotepeer</b>.のようなsip URI を入力し単にリモートピアに達成したい時" +"にこのプロファイルが使用可能\r\n" +"着信通話または発信通話を照合できないアカウントであれば設定も可能" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format +msgid "Server returned \"%s\" (%d)" +msgstr "サーバーが\"%s\" (%d)を返しました" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 +msgid "Protocol" +msgstr "プロトコル" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 +msgid "Status" +msgstr "状態" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 +msgid "Accounts" +msgstr "アカウント" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 +msgid "Configured Accounts" +msgstr "アカウント設定済み" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format +msgid "There is %d active account" +msgid_plural "There are %d active accounts" +msgstr[0] "%dアクティブアカウント" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 +msgid "You have no active account" +msgstr "アクティブアカウントが存在しません" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 +msgid "General" +msgstr "全般" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:312 +msgid "_Use Evolution address books" +msgstr "展開アドレス帳の使用" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:319 +msgid "Download limit :" +msgstr "ダウンロードの制限" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "カード" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" +msgstr "可能であれば連絡先の写真を表示" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" +msgstr "展開アドレス帳の項目" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:345 +msgid "_Work" +msgstr "勤務先" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:351 +msgid "_Home" +msgstr "自宅" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:357 +msgid "_Mobile" +msgstr "携帯" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:364 +msgid "Address Books" +msgstr "アドレス帳" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:368 +msgid "Select which Evolution address books to use" +msgstr "展開アドレス帳使用の選択" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 +msgid "Name" +msgstr "名前" + +#: ../sflphone-client-gnome/src/config/assistant.c:75 +#, c-format +msgid "This assistant is now finished." +msgstr "アシスタントは現在終了" + +#: ../sflphone-client-gnome/src/config/assistant.c:77 +msgid "" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window." +msgstr "" +"登録状況の確認またはオプション/アカウントウィンドウでアカウントパラメータを変" +"更できます" + +#: ../sflphone-client-gnome/src/config/assistant.c:80 +msgid "Alias" +msgstr "別名" + +#: ../sflphone-client-gnome/src/config/assistant.c:84 +msgid "Server" +msgstr "サーバー" + +#: ../sflphone-client-gnome/src/config/assistant.c:88 +msgid "Username" +msgstr "ユーザー名" + +#: ../sflphone-client-gnome/src/config/assistant.c:92 +msgid "Security: " +msgstr "セキュリティー " + +#: ../sflphone-client-gnome/src/config/assistant.c:94 +msgid "SRTP/ZRTP draft-zimmermann" +msgstr "SRTP/ZRTP草稿" + +#: ../sflphone-client-gnome/src/config/assistant.c:96 +msgid "None" +msgstr "なし" + +#: ../sflphone-client-gnome/src/config/assistant.c:230 +msgid "SFLphone account creation wizard" +msgstr "SFLフォンアカウント作成ウィザード" + +#: ../sflphone-client-gnome/src/config/assistant.c:256 +msgid "Welcome to the Account creation wizard of SFLphone!" +msgstr "SFLフォンのアカウント作成ウィザードへようこそ" + +#: ../sflphone-client-gnome/src/config/assistant.c:257 +msgid "This installation wizard will help you configure an account." +msgstr "このインストールウィザードはアカウント作成を助けます" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "VoIP Protocols" +msgstr "VoIPプロトコル" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "Select an account type" +msgstr "勘定タイプの選択" + +#: ../sflphone-client-gnome/src/config/assistant.c:273 +msgid "SIP (Session Initiation Protocol)" +msgstr "SIP(セッション開始プロトコル)" + +#: ../sflphone-client-gnome/src/config/assistant.c:275 +msgid "IAX2 (InterAsterix Exchange)" +msgstr "IAX2(アスタリスク変換)" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Account" +msgstr "アカウント" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Please select one of the following options" +msgstr "オプションに従い1つ選択してください" + +#: ../sflphone-client-gnome/src/config/assistant.c:291 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "無料SIP/IAX2アカウントをsflフォン組織に作成" + +#: ../sflphone-client-gnome/src/config/assistant.c:293 +msgid "Register an existing SIP or IAX2 account" +msgstr "SIPまたは IAX2アカウントの存在を登録" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +msgid "SIP account settings" +msgstr "SIPアカウント設定" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "Please fill the following information" +msgstr "情報を入力してください" + +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 +msgid "Secure communications with _ZRTP" +msgstr "ZRTPセキュリティーで保護された通信" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "Optional email address" +msgstr "任意のメールアドレス" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "This email address will be used to send your voicemail messages." +msgstr "このメールアドレスはボイスメールメッセージに送られます" + +#: ../sflphone-client-gnome/src/config/assistant.c:398 +msgid "_Email address" +msgstr "Eメールアドレス" + +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "IAX2 account settings" +msgstr "IAX2アカウント設定" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "Network Address Translation (NAT)" +msgstr "ネットワークアドレス変換(NAT)" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "You should probably enable this if you are behind a firewall." +msgstr "ファイアウォールの内側であれば接続できます" + +#: ../sflphone-client-gnome/src/config/assistant.c:506 +msgid "E_nable STUN" +msgstr "STUN有効(E)" + +#: ../sflphone-client-gnome/src/config/assistant.c:513 +msgid "_STUN server" +msgstr "STUNサーバー" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Account Registration" +msgstr "アカウント登録" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Congratulations!" +msgstr "設定完了" + +#: ../sflphone-client-gnome/src/config/audioconf.c:600 +msgid "Frequency" +msgstr "周波数" + +#: ../sflphone-client-gnome/src/config/audioconf.c:605 +msgid "Bitrate" +msgstr "ビットレート" + +#: ../sflphone-client-gnome/src/config/audioconf.c:610 +msgid "Bandwidth" +msgstr "帯域幅" + +#: ../sflphone-client-gnome/src/config/audioconf.c:688 +msgid "ALSA plugin" +msgstr "ALSAプラグイン" + +#: ../sflphone-client-gnome/src/config/audioconf.c:710 +msgid "Output" +msgstr "出力" + +#: ../sflphone-client-gnome/src/config/audioconf.c:732 +msgid "Input" +msgstr "入力" + +#: ../sflphone-client-gnome/src/config/audioconf.c:767 +msgid "_Voice Activity Detection" +msgstr "ボイスアクティビティ検出" + +#: ../sflphone-client-gnome/src/config/audioconf.c:777 +msgid "_Noise Reduction (Narrow-Band Companding)" +msgstr "ノイズ除去" + +#: ../sflphone-client-gnome/src/config/audioconf.c:813 +msgid "Sound Manager" +msgstr "サウンドマネージャー" + +#: ../sflphone-client-gnome/src/config/audioconf.c:822 +msgid "_Pulseaudio" +msgstr "パルスオーディオ" + +#: ../sflphone-client-gnome/src/config/audioconf.c:826 +msgid "_ALSA" +msgstr "ALSA" + +#: ../sflphone-client-gnome/src/config/audioconf.c:832 +msgid "ALSA settings" +msgstr "ALSA設定" + +#: ../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Recordings" +msgstr "録音" + +#: ../sflphone-client-gnome/src/config/audioconf.c:857 +msgid "Destination folder" +msgstr "インストール先フォルダ" + +#: ../sflphone-client-gnome/src/config/audioconf.c:861 +msgid "Select a folder" +msgstr "フォルダの選択" + +#: ../sflphone-client-gnome/src/config/audioconf.c:867 +msgid "Ringtones" +msgstr "着信音" + +#: ../sflphone-client-gnome/src/config/audioconf.c:873 +msgid "_Enable ringtones" +msgstr "着信音可能" + +#: ../sflphone-client-gnome/src/config/audioconf.c:879 +msgid "Choose a ringtone" +msgstr "着信音選択" + +#: ../sflphone-client-gnome/src/config/audioconf.c:885 +msgid "Audio Files" +msgstr "音声ファイル" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:130 +msgid "URL Argument" +msgstr "URL 引数" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL" +msgstr "URL着信履歴ユーザー設定コマンド" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:138 +#, c-format +msgid "%s will be replaced with the passed URL." +msgstr "%sはURLに置き換え" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:141 +msgid "Trigger on specific _SIP header" +msgstr "特定SIPヘッダーのトリガ" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:150 +msgid "Trigger on _IAX2 URL" +msgstr "IAX2 URLのトリガ" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run" +msgstr "実行するコマンド" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:165 +msgid "Phone number rewriting" +msgstr "電話番号書き換え" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:169 +msgid "_Prefix dialed numbers with" +msgstr "プレフィックス番号" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 +msgid "Desktop Notifications" +msgstr "デスクトップ通知" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 +msgid "_Enable notifications" +msgstr "通知可能" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 +msgid "System Tray Icon" +msgstr "システムトレイアイコン" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 +msgid "_Popup main window on incoming call" +msgstr "着信通話のポップアップメインウィンドウ" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 +msgid "Ne_ver popup main window" +msgstr "ポップアップメインウィンドウ非表示" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 +msgid "Hide SFLphone window on _startup" +msgstr "起動SFLphoneウィンドウ非表示" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 +msgid "Calls History" +msgstr "着信履歴" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 +msgid "_Keep my history for at least" +msgstr "最後の着信履歴の保護" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 +msgid "days" +msgstr "曜日" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 +msgid "Preferences" +msgstr "基本設定" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 +msgid "Audio" +msgstr "音声" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 +msgid "Address Book" +msgstr "アドレス帳" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 +msgid "Hooks" +msgstr "フック" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 +msgid "Advanced options for TLS" +msgstr "TLSの詳細設定オプション" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:56 +msgid "TLS transport" +msgstr "TLS転送" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:60 +msgid "" +"TLS transport can be used along with UDP for those calls that would\n" +"require secure sip transactions (aka SIPS). You can configure a different\n" +"TLS transport for each account. However, each of them will run on a " +"dedicated\n" +"port, different one from each other\n" +msgstr "" +"通話はセキュリティーで保護されたSIPトランザクションの要求によりTLS転送はUDPを" +"使用できます。\n" +"それぞれのアカウントでTLS転送を確認してください。そうするとそれぞれ専用ポー" +"ト、異なったものに実行できます。\n" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 +msgid "Certificate of Authority list" +msgstr "j証明機関の一覧" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 +msgid "Choose a CA list file (optional)" +msgstr "CAリストファイルの選択" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 +msgid "Public endpoint certificate file" +msgstr "公式エンドポイント証明ファイル" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 +msgid "Choose a public endpoint certificate (optional)" +msgstr "公式エンドポイント証明の選択" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 +msgid "Choose a private key file (optional)" +msgstr "個人キーファイルの選択" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 +msgid "Password for the private key" +msgstr "プライベートキーのパスワード" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 +msgid "TLS protocol method" +msgstr "TLSプロトコルメソッド" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 +msgid "TLS cipher list" +msgstr "TLS暗号一覧" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 +msgid "Server name instance for outgoing TLS connection" +msgstr "TLS接続発信サーバー名インスタンス" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 +msgid "Negotiation timeout (sec:msec)" +msgstr "ネゴシエーションタイムアウト" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 +msgid "Verify incoming certificates, as a server" +msgstr "サーバーの証明受信の確認" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 +msgid "Verify certificates from answer, as a client" +msgstr "クライアント応答証明の確認" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 +msgid "Require certificate for incoming tls connections" +msgstr "受信tls接続のための証明要求" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:49 +msgid "ZRTP Options" +msgstr "ZRTPオプション" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:69 +msgid "Send Hello Hash in S_DP" +msgstr "SDPでハローハッシュ送信" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:75 +msgid "Ask User to Confirm SAS" +msgstr "ユーザーへSAS確認" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:81 +msgid "_Warn if ZRTP not supported" +msgstr "ZRTPがサポートされているかどうか警告" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:87 +msgid "Display SAS once for hold events" +msgstr "イベント管理のためSAS表示" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "ZRTPオプション" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:58 +msgid "Search all" +msgstr "すべて検索" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:59 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:72 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:84 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:96 +msgid "Click here to change the search type" +msgstr "検索の種類を変更するにはここをクリックしてください" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:71 +msgid "Search by missed call" +msgstr "不在着信の検索" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:83 +msgid "Search by incoming call" +msgstr "受信通話の検索" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:95 +msgid "Search by outgoing call" +msgstr "発信通話の検索" + +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>エラー:音声コーデック見当たりません。\n" +#~ "\n" +#~ "</b>SFL音声コーデックはホームディレクトリー( <i>%s</i> )の<i>%s</i>か<b>." +#~ "sflphone</b>に 置いてください。" + +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%iアカウント構成日" + +#~ msgid "Direct IP calls" +#~ msgstr "ダイレクトIPコール" + +#~ msgid "IP call - %s" +#~ msgstr "IP 電話 -%s" + +#~ msgid "Codec" +#~ msgstr "コーデック" diff --git a/lang/ko/ko.po b/lang/ko/ko.po index c7ebb3c80fea05d48123044557c037e1a7ef3bb9..240e28e87a82c136e2653923fc0b593f866b5b0b 100644 --- a/lang/ko/ko.po +++ b/lang/ko/ko.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" "PO-Revision-Date: 2009-10-26 20:46+0000\n" "Last-Translator: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>\n" "Language-Team: Korean <ko@li.org>\n" @@ -18,74 +18,85 @@ msgstr "" "X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "등록했습니다" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." msgstr "" -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" #: ../sflphone-client-gnome/src/errors.c:29 @@ -109,65 +120,65 @@ msgid "" "Pulseaudio is not running" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -236,445 +247,458 @@ msgstr "" msgid "Mic volume" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:132 +#: ../sflphone-client-gnome/src/statusicon.c:189 #, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" +msgid "%i active account" +msgid_plural "%i active accounts" msgstr[0] "" -msgstr[1] "" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 #, c-format msgid "Voicemail (%i)" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +msgid "_User-agent" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "" @@ -719,7 +743,7 @@ msgid "Select which Evolution address books to use" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "" @@ -758,181 +782,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "" @@ -969,69 +989,62 @@ msgstr "" msgid "_Prefix dialed numbers with" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1049,55 +1062,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1121,6 +1138,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "" diff --git a/lang/pl/pl.po b/lang/pl/pl.po index 6d2a4515bef5e5fb3cb82c6f409335a53e3f7a4e..35a0d85ed08f798f5d85b6e9397406dfbc08533d 100644 --- a/lang/pl/pl.po +++ b/lang/pl/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" "PO-Revision-Date: 2009-11-04 12:08+0000\n" "Last-Translator: Mariusz Bednarz <mbednarz@bedmar.pl>\n" "Language-Team: Polish <pl@li.org>\n" @@ -19,57 +19,61 @@ msgstr "" "X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Zarejestrowany" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Nie zarejestrowany" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "Próbuję ..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Błąd" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Autoryzacja nie powiodła się" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Sieć niedostępna" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "Wybrany host jest niedostępny" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Niepoprawny" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Używane konto" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Brak zarejestrowanych kont" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -77,18 +81,25 @@ msgstr "" "Nie można połączyć się z serwerem SFLphone.\n" "Upewnij się, że został uruchomiony daemon SFLphone" -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" #: ../sflphone-client-gnome/src/errors.c:29 @@ -118,65 +129,65 @@ msgstr "" "Informacja Pulseaudio\n" "Pulseaudio nie zostało uruchomione" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -245,434 +256,449 @@ msgstr "" msgid "Mic volume" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "" -msgstr[1] "" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "Używane konto" +msgstr[1] "Używane konto" +msgstr[2] "Używane konto" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 #, c-format msgid "Voicemail (%i)" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d głosowa wiadomość" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Brak zarejestrowanych kont" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +msgid "_User-agent" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "Sieć niedostępna" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" @@ -680,12 +706,12 @@ msgstr[0] "" msgstr[1] "" msgstr[2] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "" @@ -730,7 +756,7 @@ msgid "Select which Evolution address books to use" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "" @@ -769,181 +795,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "" @@ -980,69 +1002,62 @@ msgstr "" msgid "_Prefix dialed numbers with" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1060,55 +1075,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1132,6 +1151,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "" diff --git a/lang/pt/pt.po b/lang/pt/pt.po index ef406f9445d8e15fc11370bfebd328e752863004..c76af4cb49819c27a9489ccb0eff1a32ae745847 100644 --- a/lang/pt/pt.po +++ b/lang/pt/pt.po @@ -7,85 +7,96 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-03 18:09+0000\n" "Last-Translator: Maxime Chambreuil <maxime.chambreuil@gmail.com>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Registado" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Não Registado" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Erro" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Autenticação Falhou" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "A rede está inacessível" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "A máquina está inacessível" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Inválido" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." msgstr "" -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" #: ../sflphone-client-gnome/src/errors.c:29 @@ -109,65 +120,65 @@ msgid "" "Pulseaudio is not running" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -236,445 +247,461 @@ msgstr "" msgid "Mic volume" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Desligar" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "" -msgstr[1] "" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "Adicionar uma nova conta" +msgstr[1] "Adicionar uma nova conta" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Correio de voz" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "Livro de endereços" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Livro de endereços" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "Correio de voz (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "_Chamar" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Desligar" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "_Gravar" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "_Editar" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Editar" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "Remover a conta seleccionada" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "Histórico de chamadas" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Histórico de chamadas" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "_Contas" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Preferências" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "_Ver" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Ajuda" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "Transferir" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" msgstr "Transferir" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Gravar" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "Marca_dor" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Histórico" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Histórico de chamadas" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Livro de endereços" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Nomear" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "_Protocolo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Desconhecido" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Senha" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Senha" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "Utilizador" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Senha" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "A rede está inacessível" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Configurações da conta" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Básico" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Avançado" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Rede" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protocolo" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Estado" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Contas" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" msgstr[1] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "Geral" @@ -719,7 +746,7 @@ msgid "Select which Evolution address books to use" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Nome" @@ -758,181 +785,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "Protocolos VoIP" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Conta" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Endereço de email opcional" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "_Servidor STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Parabéns!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Frequência" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Taxa de Dados" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Largura de Banda" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Saída" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Entrada" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codecs" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Gravações" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Pasta de destino" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Seleccione uma pasta" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "Ficheiros Áudio" @@ -969,69 +992,62 @@ msgstr "" msgid "_Prefix dialed numbers with" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Ícone de Notificação" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Histórico de Chamadas" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "dias" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Preferências" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Áudio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Livro de Endereços" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1049,55 +1065,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1121,6 +1141,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "" @@ -1144,15 +1172,6 @@ msgstr "" msgid "Search by outgoing call" msgstr "" -#~ msgid "Codec" -#~ msgstr "Codec" - -#~ msgid "Network" -#~ msgstr "Rede" - -#~ msgid "SIP Port" -#~ msgstr "Porta SIP" - #~ msgid "Email address" #~ msgstr "Endereço de correiro electrónico" @@ -1162,6 +1181,9 @@ msgstr "" #~ msgid "Jérémy Quentin" #~ msgstr "Jérémy Quentin" +#~ msgid "Codec" +#~ msgstr "Codec" + #~ msgid "Incoming call" #~ msgstr "Chamada recebida" @@ -1177,9 +1199,6 @@ msgstr "" #~ msgid "Remove" #~ msgstr "Remover" -#~ msgid "Add a new account" -#~ msgstr "Adicionar uma nova conta" - #~ msgid "Add" #~ msgstr "Adicionar" @@ -1228,6 +1247,9 @@ msgstr "" #~ msgid "Work" #~ msgstr "Trabalho" +#~ msgid "SIP Port" +#~ msgstr "Porta SIP" + #~ msgid "Advanced Settings" #~ msgstr "Configurações Avançadas" @@ -1240,10 +1262,11 @@ msgstr "" #~ ",Launchpad Contributions:,Maxime Chambreuil, ,Launchpad Contributions:," #~ "Maxime Chambreuil,Tiago Silva, ,Launchpad Contributions:,Maxime " #~ "Chambreuil,Tiago Silva, ,Launchpad Contributions:,Maxime Chambreuil,Tiago " -#~ "Silva" +#~ "Silva, ,Launchpad Contributions:,Maxime Chambreuil,Tiago Silva" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ ",,maxime.chambreuil@gmail.com,,,maxime.chambreuil@gmail.com,,,,maxime." -#~ "chambreuil@gmail.com,,,,maxime.chambreuil@gmail.com," +#~ "chambreuil@gmail.com,,,,maxime.chambreuil@gmail.com,,,,maxime." +#~ "chambreuil@gmail.com," diff --git a/lang/pt_BR/pt_BR.po b/lang/pt_BR/pt_BR.po index 0a5429e6c0323561c75343ee5b5b977440bb1ae2..f2ce14eb7cfd2381eeb5edda81fe07f35a8ae1f5 100644 --- a/lang/pt_BR/pt_BR.po +++ b/lang/pt_BR/pt_BR.po @@ -7,68 +7,72 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" -"Last-Translator: kalib <kalibslack@gmail.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2010-01-22 22:19+0000\n" +"Last-Translator: Ricardo Martins <ricardo.macedo@yahoo.com.br>\n" "Language-Team: Brazilian Portuguese <pt_BR@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Registrado" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Não Registrado" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "Tentando..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Erro" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "A autenticação falhou" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "A rede está inacessível" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "A máquina está inacessível" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Erro de configuração no stun" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Servidor stun inválido" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "Inválido" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "Utilizando conta" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "Sem contas registradas" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -76,23 +80,26 @@ msgstr "" "Incapaz de conectar ao servidor SFLphone.\n" "Tenha certeza de que o daemon está rodando." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "Ligações IP diretas" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Erro: Não foram encontrados codecs de áudio.\n" -"\n" -"</b> Os codecs de áudio do SFL tem de ser movidos para o diretório <i>%s</i> " -"ou para o diretório <b>.sflphone</b> em seu home( <i>%s</i> )" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -124,43 +131,43 @@ msgstr "" "\n" "Pulseaudio não está rodando" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "Existe uma ligação em progresso" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "Existem ligações em progresso" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "Você ainda deseja sair?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "Erro no SFLphone" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "ZRTP não é suportado pelo peer %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "Comunicação Segura Indisponível" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "Continuar" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "Finalizar Chamada" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" @@ -169,11 +176,11 @@ msgstr "" "Um erro %s forçou a ligação com %s a mudar para um modo não encriptado.\n" "Motivo exato: %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "Negociação ZRTP falhou" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " @@ -182,11 +189,11 @@ msgstr "" "%s deseja finalizar a utilização de comunicação segura. A confirmação irá " "retomar sem SRTP.\n" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "Confirmar Vá Limpar" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "Confirmar" @@ -257,443 +264,465 @@ msgstr "Volume dos auto-falantes" msgid "Mic volume" msgstr "Volume do microfone" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "_Apresentar janela principal" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Desligar" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "%i conta configurada" -msgstr[1] "%i contas configuradas" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "conta ativa" +msgstr[1] "conta ativa" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "Correio de voz" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "Catálogo de endereços" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Catálogo de endereços" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "Correio de voz (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone é um cliente VoIP compatível com os protocolos SIP e IAX2." -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "Sobre o SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "_Chamar" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "_Nova ligação" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" -msgstr "" +msgstr "Faz uma nova chamada" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "_Atender" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Desligar" +msgstr "Responder a chamada" -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" -msgstr "" +msgstr "Terminar a chamada" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "Em _Espera" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" -msgstr "" +msgstr "Colocar a chamada em espera" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "_Gravar" +msgstr "Encerrar a chamada em espera" -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "Arquivo de Configuração" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Erro de configuração no stun" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d mensagem de voz" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" -msgstr "" +msgstr "_Fechar" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" -msgstr "" +msgstr "Minimizar para a bandeja do sistema" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" -msgstr "_Editar" +msgstr "_Sair" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" -msgstr "" +msgstr "Sair do programa" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Editar" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" -msgstr "" +msgstr "_Copiar" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "Remover a conta selecionada" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" -msgstr "" +msgstr "_Colar" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" -msgstr "" +msgstr "Colar o conteúdo da Área de Transferência" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "Limpar _histórico" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "Limpar histórico" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "_Contas" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "Conta atual" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "Preferências" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "" +msgstr "Altera as suas preferências" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "_Exibir" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Ajuda" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "Continuar" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" -msgstr "" +msgstr "Abrir o manual" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "Autenticação" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "Transferir" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "Transfirir para: " +msgstr "Transfirir para:" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Gravar" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Gravar a conversação atual" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" -msgstr "" +msgstr "_Exibir barra de ferramentas" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" -msgstr "" +msgstr "Mostra a barra de ferramentas" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "Desabilitado" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "_Controle de Volumes" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "Exibir controles de volume" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "Histórico" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "Histórico de chamadas" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Catálogo de endereços" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "Em _Espera" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "_Ligar de volta" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "Editar número de telefone" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "Edite o número de telefone antes de fazer uma ligação" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Parâmetros de conta" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Apelido" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "_Protocolo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Desconhecido" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "_Nome do host" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "_Nome do usuário" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "_Senha" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Senha" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "_Senha da caixa postal de voz" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "_Nome do usuário" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "Autenticação" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "Segredo" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "Credencial" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "Nome de autenticação" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Senha" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "Segurança" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "Use transporte TLS (sips)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "Troca de chave SRTP" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "Desabilitado" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "Registro" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "Registro expira" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "_De acordo com RFC 3263" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "A rede está inacessível" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "Endereço local" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "Porta local" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "Endereço publicado" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" -msgstr "Utilizando STUN " +msgstr "Utilizando STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "URL do servidor STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "Igual aos parâmetros locais" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "Indique endereço e portas publicadas" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "Porta publicada" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "Configurações da conta" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Básico" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codecs" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "Avançado" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Rede" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"Este perfil é utilizado quando você deseja alcançar um ponto remoto " +"simplesmente digitando um URI sip como <b>sip:remotepeer</b>. As " +"configurações que você definir aqui também serão utilizadas se nenhuma conta " +"puder ser combinada a uma chamada de entrada ou de saída." + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format msgid "Server returned \"%s\" (%d)" -msgstr "Servidor retornou \"" +msgstr "O Servidor retornou \"%s\" (%d)" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Protocolo" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Estado" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "Contas" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "Contas Configuradas" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" -msgstr[0] " conta ativa" -msgstr[1] " conta ativa" +msgstr[0] "conta ativa" +msgstr[1] "conta ativa" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "Você não possui uma conta ativa" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "Geral" @@ -738,7 +767,7 @@ msgid "Select which Evolution address books to use" msgstr "Selecione qual catálogo de endereços do Evolution deseja utilizar" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Nome" @@ -779,184 +808,180 @@ msgstr "SRTP/ZRTP rascunho-zimmermann" msgid "None" msgstr "Nenhum" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "Assistente de criação de contas do SFLphone" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "Bem vindo ao assistente de criação de contas do SFLphone!" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "Este assistente de instalação irá lhe ajudar a configurar uma conta." -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "Protocolos VoIP" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "Selecione um tipo de conta" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "Conta" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "Por favor, selecione uma das seguintes opções" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "Criar uma conta gratuita SIP/IAX2 em sflphone.org" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "Registrar uma conta SIP ou IAX2 existente" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "Configurações de conta SIP" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "Por favor, preencha as informações a seguir" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "Comunicações seguras com _ZRTP" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "Endereço de e-mail opcional" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" "Este endereço de email será utilizado para enviar as mensagens de voz em sua " "caixa postal." -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "_endereço de email" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "Configurações de conta IAX2" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" "Você provavelmente precise habilitar isto se estiver por trás de um firewall." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "Ha_bilitar STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "_Servidor STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "Registro de conta" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Parabéns!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Frequência" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Taxa de bits" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "Largura de banda" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "Plugin ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "Saída" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "Entrada" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "_Detecção de atividade de voz" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "_Redução de ruído (Utilização de banda-estreita)" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "Gerenciador de Som" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "Configurações do ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codecs" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Gravações" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "Pasta de destino" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "Selecione uma pasta" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "Ringtones" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "_Habilitar ringtones" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "Escolha um ringtone" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "Arquivos de Áudio" @@ -993,73 +1018,62 @@ msgstr "Reescrevendo número do telefone" msgid "_Prefix dialed numbers with" msgstr "_Prefixo de números discados com" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" -"Este perfil é utilizado quando você deseja alcançar um ponto remoto " -"simplesmente digitando um URI sip como <b>sip:remotepeer</b>. As " -"configurações que você definir aqui também serão utilizadas se nenhuma conta " -"puder ser combinada a uma chamada de entrada ou de saída." - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "Notificações de Desktop" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "_Habilitar notificações" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "Ícone da bandeja do sistema" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "_Popup na janela principal ao receber ligação" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "Nu_nca apresentar popup na janela principal" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "Esconder o SFLphone na _inicialização" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "Histórico de Chamadas" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "_Manter meu histórico por pelo ao menos" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "dias" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "Preferências" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "Áudio" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Catálogo de endereços" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "Ganchos" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "Ligações IP diretas" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "Opções avançadas para o TLS" @@ -1083,55 +1097,59 @@ msgstr "" "funcionar em uma\n" "porta dedicada, uma diferente da outra\n" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "Certificado da lista de Autoridades" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "Escolha um arquivo de lista CA (opcional)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "Arquivo certificado endpoint público" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "Escolha um certificado endpoint público (opcional)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "Escolha um arquivo de chave privada (opcional)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "Senha para a chave privada" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "Método do protocolo TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "Lista de cifras TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "Instância de nome do servidor para saída da conexão TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "Tempo de negociação expirado (seg:mseg)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "Verificar os certificados de entrada, como um servidor" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "Verificar certificados de resposta, como um cliente" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "Requer certificado para conexões tls entrantes" @@ -1155,6 +1173,15 @@ msgstr "_Alerta se o ZRTP não é suportado" msgid "Display SAS once for hold events" msgstr "Apresenta o SAS uma vez para realizar eventos" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "Opções ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Buscar todos" @@ -1178,48 +1205,31 @@ msgstr "Buscar por ligações recebidas" msgid "Search by outgoing call" msgstr "Buscar por ligações feitas" -#~ msgid "IP call - %s" -#~ msgstr "Ligação IP - %s" - -#~ msgid "Codec" -#~ msgstr "Codec" - -#~ msgid "Network" -#~ msgstr "Rede" - -#~ msgid "Manually" -#~ msgstr "Manualmente" - -#~ msgid "There " -#~ msgstr "Ali " - -#~ msgid "is " -#~ msgstr "está " - -#~ msgid "are " -#~ msgstr "estão " - -#~ msgid "s" -#~ msgstr "s" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "_Silenciar outras aplicações durante uma ligação" - -#~ msgid "SIP Port" -#~ msgstr "Porta SIP" - -#~ msgid "UDP Transport" -#~ msgstr "Transporte UDP" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Erro: Não foram encontrados codecs de áudio.\n" +#~ "\n" +#~ "</b> Os codecs de áudio do SFL tem de ser movidos para o diretório <i>%s</" +#~ "i> ou para o diretório <b>.sflphone</b> em seu home( <i>%s</i> )" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "Habilitar _notificações de correio de voz" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i conta configurada" +#~ msgstr[1] "%i contas configuradas" -#~ msgid "Store SIP credentials as MD5 hash" -#~ msgstr "Armazenar as credenciais SIP como hash MD5" +#~ msgid "Direct IP calls" +#~ msgstr "Ligações IP diretas" #~ msgid "Stun Server" #~ msgstr "Servidor STUN" +#~ msgid "Codec" +#~ msgstr "Codec" + #~ msgid "(C) 2009 Savoir-faire Linux" #~ msgstr "(C) 2009 Savoir-faire Linux" @@ -1274,6 +1284,9 @@ msgstr "Buscar por ligações feitas" #~ msgid "Enable notifications" #~ msgstr "Habilitar notificações" +#~ msgid "SIP Port" +#~ msgstr "Porta SIP" + #~ msgid "NAT Traversal" #~ msgstr "NAT Traversal" @@ -1458,6 +1471,9 @@ msgstr "Buscar por ligações feitas" #~ msgid "Prefix dialed numbers with" #~ msgstr "Números discado com o prefixo" +#~ msgid "IP call - %s" +#~ msgstr "Ligação IP - %s" + #~ msgid "_Account creation wizard" #~ msgstr "_Assistante de criação de conta" @@ -1482,19 +1498,50 @@ msgstr "Buscar por ligações feitas" #~ "Pressionando \"aplicar\" a camada de rede será reiniciada. De outra forma " #~ "o SFKPhone teria que ser reiniciado." +#~ msgid "Enable voicemail _notifications" +#~ msgstr "Habilitar _notificações de correio de voz" + #~ msgid "PulseAudio sound server" #~ msgstr "Servidor de som PulseAudio" +#~ msgid "_Mute other applications during a call" +#~ msgstr "_Silenciar outras aplicações durante uma ligação" + +#~ msgid "Manually" +#~ msgstr "Manualmente" + +#~ msgid "There " +#~ msgstr "Ali " + +#~ msgid "are " +#~ msgstr "estão " + +#~ msgid "is " +#~ msgstr "está " + +#~ msgid "s" +#~ msgstr "s" + +#~ msgid "UDP Transport" +#~ msgstr "Transporte UDP" + +#~ msgid "Store SIP credentials as MD5 hash" +#~ msgstr "Armazenar as credenciais SIP como hash MD5" + #~ msgctxt "NAME OF TRANSLATORS" #~ msgid "Your names" #~ msgstr "" #~ ",Launchpad Contributions:,Maxime Chambreuil,kalib, ,Launchpad " #~ "Contributions:,Maxime Chambreuil,kalib, ,Launchpad Contributions:,Maxime " -#~ "Chambreuil,kalib, ,Launchpad Contributions:,Maxime Chambreuil,kalib" +#~ "Chambreuil,kalib, ,Launchpad Contributions:,Maxime Chambreuil,kalib, ," +#~ "Launchpad Contributions:,André Gondim,Maxime Chambreuil,Ricardo Martins," +#~ "kalib" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ ",,maxime.chambreuil@gmail.com,kalibslack@gmail.com,,,maxime." #~ "chambreuil@gmail.com,kalibslack@gmail.com,,,maxime.chambreuil@gmail.com," -#~ "kalibslack@gmail.com,,,maxime.chambreuil@gmail.com,kalibslack@gmail.com" +#~ "kalibslack@gmail.com,,,maxime.chambreuil@gmail.com,kalibslack@gmail.com,,," +#~ "andregondim@ubuntu.com,maxime.chambreuil@gmail.com,ricardo.macedo@yahoo." +#~ "com.br,kalibslack@gmail.com" diff --git a/lang/ru/ru.po b/lang/ru/ru.po index 14b3aa5dd8b52a0d5e0d4baafc1ee6278b5fe18f..fb4c0f42bfd11b97773fd704b87e6ee5dbc3c74c 100644 --- a/lang/ru/ru.po +++ b/lang/ru/ru.po @@ -7,92 +7,100 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.6\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-12-08 20:46+0000\n" -"Last-Translator: Hussein Abdallah <hussein.abdallah@savoirfairelinux.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2010-02-12 23:19+0000\n" +"Last-Translator: Lortonix <Unknown>\n" "Language-Team: Savoir-Faire Linux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: \n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" +"X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "Зарегистрирован" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "Не зарегистрирован" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." -msgstr "Подключение..." +msgstr "Пытаюсь..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "Ошибка" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "Аутентификация не удалась" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "Сеть недоступна" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" -msgstr "Узел сети недоступен" +msgstr "Узел недоступен" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Ошибка конфигурации Stun" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Неверный сервер Stun" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" -msgstr "Ошибка" +msgstr "Неверный" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" -msgstr "Используется учетная запись" +msgstr "Использовать аккаунт" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" -msgstr "Нет зарегистрированных учëтных записей" +msgstr "У вас нет зарегистрированных аккаунтов" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." msgstr "" "Невозможно подключиться к SFLphone-серверу.\n" -"Проверьте если демон работает." +"Убедитесь что он работает." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "Прямые IP-звонки" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>Ошибка: звуковые кодеки не найдены.\n" -"\n" -"</b> Звуковые кодеки SFL должны находиться в <i>%s</i> или в <b>.sflphone</" -"b> каталоге в вашем домашнем каталоге( <i>%s</i> )" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -100,9 +108,9 @@ msgid "" "\n" "Error while opening playback device" msgstr "" -"<b>ALSA-nпредупреждение</b>\n" +"<b>Предупреждение ALSA</b>\n" "\n" -"Ошибка во время активирования устройства проигрывания" +"Ошибка при попытке открытия устройства воспроизведения звука" #: ../sflphone-client-gnome/src/errors.c:32 msgid "" @@ -110,9 +118,9 @@ msgid "" "\n" "Error while opening capture device" msgstr "" -"<b>ALSA-nпредупреждение</b>\n" +"<b>Предупреждение ALSA</b>\n" "\n" -"Ошибка во время активирования устройства входа" +"Ошибка при попытке открытия устройства захвата звука" #: ../sflphone-client-gnome/src/errors.c:35 msgid "" @@ -122,71 +130,72 @@ msgid "" msgstr "" "<b>Предупреждение Pulseaudio</b>\n" "\n" -"Pulseaudio не работает" +"Pulseaudio не запущен" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." -msgstr "Один текущий разговор." +msgstr "Звонок ещё не окончен." -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." -msgstr "Несколько текущих разговоров." +msgstr "Несколько звонков ещё не окончены." -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "Вы уверенны что хотите выйти?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "Ошибка SFLphone." -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "ZRTP не поддерживается устройством %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" -msgstr "Зашифрованная связь недоступна" +msgstr "Зашифрованная связь недоступна." -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "Продолжить" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" -msgstr "Закончить звонок" +msgstr "Завершить вызов" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -"Из-за ошибки %s переговор с %s перейдëт в не зашифрованный режим.\n" +"Из-за возникновения ошибки %s разговор с %s перейдëт в не зашифрованный " +"режим.\n" "Точная причина: %s\n" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "Неудачный обмен информации ZRTP" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -"%s хочет остановить зашифрованную связь. В случае подтверждения переговор " -"продолжится без SRTP.\n" +"%s хочет отказаться от использования зашифрованной связи. В случае " +"подтверждения разговор продолжится без SRTP.\n" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "Подтвердить переход на незашифрованную связь" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "Подтвердить" @@ -212,19 +221,19 @@ msgstr[2] "%d голосовые письма" #: ../sflphone-client-gnome/src/sflnotify.c:111 #, c-format msgid "Calling with %s account <i>%s</i>" -msgstr "Звонок с учëтной записью %s <i>%s</i>" +msgstr "Вызов %s с помощью аккаунта <i>%s</i>" #: ../sflphone-client-gnome/src/sflnotify.c:115 msgid "Current account" -msgstr "Нынешняя учëтная запись" +msgstr "Текущий аккаунт" #: ../sflphone-client-gnome/src/sflnotify.c:130 msgid "You have no accounts set up" -msgstr "Вы не настроили ни одной учëтной записи" +msgstr "У вас нет настроенных аккаунтов" #: ../sflphone-client-gnome/src/sflnotify.c:147 msgid "You have no registered accounts" -msgstr "У вас нет зарегистрированных учëтных записей" +msgstr "У вас нет зарегистрированных аккаунтов" #: ../sflphone-client-gnome/src/sflnotify.c:190 #, c-format @@ -232,7 +241,7 @@ msgid "" "<i>With:</i> %s \n" "using %s" msgstr "" -"<i>с</i> %s\n" +"<i>с:</i> %s\n" "используя %s" #: ../sflphone-client-gnome/src/sflnotify.c:205 @@ -256,447 +265,469 @@ msgstr "Громкость" #: ../sflphone-client-gnome/src/sliders.c:164 msgid "Mic volume" -msgstr "Громкость микрофона" +msgstr "Чувствительность микрофона" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "_Показать главное окно" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "_Положить трубку" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "Настроена одна учëтная запись" -msgstr[1] "Настроены %i учëтные записи" -msgstr[2] "Настроены %i учëтные записи" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "%d активный аккаунт" +msgstr[1] "%d активных аккаунтов" +msgstr[2] "действующий аккаунт" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" -msgstr "Автоответчик" +msgstr "Голосовая почта" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" -msgstr "Нет выбранных адресных книг" +msgstr "Адресная книга не выбрана" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "Адресная книга" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" -msgstr "Автоответчик (%i)" +msgstr "Голосовая почта (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone - SIP и IAX2-совместимый VoIP-клиент" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" -msgstr "О SFLphone" +msgstr "О программе SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" -msgstr "_Звонок" +msgstr "_Вызов" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" -msgstr "_Новый звонок" +msgstr "_Новый вызов" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" -msgstr "Позвонить" +msgstr "Сделать новый вызов" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "_Взять трубку" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" -msgstr "Ответить" - -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "_Положить трубку" +msgstr "Ответить на вызов" -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" -msgstr "Закончить звонок" +msgstr "Завершить вызов" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" -msgstr "_Удержать звонок" +msgstr "_Удерживать вызов" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" -msgstr "Удержать звонок" +msgstr "Поставить вызов на удержание" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" -msgstr "_Возобновить разговор" +msgstr "_Снять вызов с удержания" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" -msgstr "Возобновить разговор" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "Записать" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "Записать переговор" +msgstr "Поставить вызов на удержание" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "Мастер настройки" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Запустить мастер настройки" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" -msgstr "%d голосовое письмо" +msgstr "Прослушивание голосовой почты" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "_Закрыть" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" -msgstr "Уменьшить в значок" +msgstr "Свернуть в трей" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" -msgstr "_Правка" +msgstr "В_ыход" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "Выйти из программы" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "_Правка" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "_Копировать" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" -msgstr "Копировать видимое" +msgstr "Копировать выделенное" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" -msgstr "_Вставить" +msgstr "В_ставить" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "Вставить из буфера обмена" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" -msgstr "_Стереть журнал" +msgstr "Очистить журнал" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" -msgstr "Очистить историю" +msgstr "Очистить журнал вызовов" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" -msgstr "_Учëтные записи" +msgstr "_Аккаунты" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" -msgstr "Изменить ваши учëтные записи" +msgstr "Нстройка аккаунта" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" -msgstr "_Предпочтения" +msgstr "_Настройки" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "Изменить ваши предпочтении" +msgstr "Изменить ваши настройки" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "_Вид" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "_Помощь" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" -msgstr "Продолжить" +msgstr "Содержание" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" -msgstr "Открыть справочник " +msgstr "Открыть руководство пользователя" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" -msgstr "Идентификация" +msgstr "О программе" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" -msgstr "Переслать звонок на другой номер" +msgstr "Переадресация вызова" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "Переслать звонок на другой номер" +msgstr "Переадресовать вызов" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Запись" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "Записать текущий разговор" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" -msgstr "Показать панель инструментов" +msgstr "Показать _панель инструментов" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" -msgstr "Показать панель инструментов" +msgstr "Показывать панель инструментов" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" -msgstr "Панель набора номера" +msgstr "_Номеронабиратель" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" -msgstr "Показать панель набора номера" +msgstr "Показывать _номеронабиратель" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" -msgstr "_Настройки громкости" +msgstr "Настройки _громкости" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" -msgstr "_Настройки громкости" +msgstr "Показывать настройки _громкости" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" -msgstr "Журнал" +msgstr "Журнал вызовов" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" -msgstr "Журнал звонков" +msgstr "История вызовов" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "Адресная книга" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" -msgstr "_Удержать звонок" +msgstr "_Удерживать звонок" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" -msgstr "_Перезвонить" +msgstr "Обратный вызов" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" -msgstr "Мобильный телефон" +msgstr "Изменить номер телефона" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" -msgstr "Изменить номер телефона перед звонком" +msgstr "Изменить номер телефона перед вызовом" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "Параметры учетной записи" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "_Псевдоним" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "Пр_отокол" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "Неизвестный" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "Имя или IP-адрес _сервера" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" -msgstr "Имя или _номер пользователя" +msgstr "Имя пользователя" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "Па_роль" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "Показать пароль" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" -msgstr "Номер _автоответчика #" +msgstr "Номер _голосовой почты" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "Имя пользователя" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" -msgstr "Идентификация" +msgstr "Аутентификация" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" -msgstr "Секретный" +msgstr "Пароль" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "Параметры доступа" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "Имя для аутентификации" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "Пароль" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "Безопасность" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" -msgstr "Использовать TLS-транспорт (sips)" +msgstr "Использовать протокол TLS" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" -msgstr "Обмена ключей SRTP" +msgstr "Обмен ключами SRTP" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "Отключен" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "Регистрация" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" -msgstr "Срок истечения регистрации" +msgstr "Истек срок регистрации" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "_Соотвествует RFC 3263" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" -msgstr "Сетевые настройки" +msgstr "Сетевой интерфейс" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "Локальный адрес" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "Локальный порт" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" -msgstr "Сетевые настройки для Интернета" +msgstr "Публичный адрес" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" -msgstr "Использует STUN " +msgstr "Использовать STUN" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "URL STUN-сервера" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "Использовать локальный адрес и порт" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" -msgstr "Настроить видимый адрес и порт :" +msgstr "Настроить публичный адрес и порт:" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "Публичный порт" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" -msgstr "Настройки учëтной записи" +msgstr "Настройки аккаунта" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "Основные" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Кодеки" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" -msgstr "Дополнительные" +msgstr "Дополнительно" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "Сеть" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" +"Эти настройки используется, когда вы хотите совершить вызов просто набрав " +"SIP URI-адрес вида <b>sip:удалëнное устройство</b>. Эти настройки так-же " +"будут использованы если не будет подходящего аккаунта для входящего или " +"исходящего вызова." -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format msgid "Server returned \"%s\" (%d)" -msgstr "Сервер ответил \"" +msgstr "Ответ сервера \"%s\" (%d)" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "Протокол" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "Статус" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" -msgstr "Учётные записи" +msgstr "Аккаунты" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" -msgstr "Настроенные учëтные записи" +msgstr "Настройка аккаунтов" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" -msgstr[0] "Одна действующая учëтная запись" -msgstr[1] "%d действующих учëтных записей" -msgstr[2] "%d действующих учëтных записей" +msgstr[0] "%d активный аккаунт" +msgstr[1] "%d активных аккаунтов" +msgstr[2] "действующий аккаунт" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" -msgstr "У вас нет активной учëтной записи" +msgstr "У вас нет активного аккаунта" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "Общие настройки" @@ -706,7 +737,7 @@ msgstr "_Использовать адресную книгу Evolution" #: ../sflphone-client-gnome/src/config/addressbook-config.c:319 msgid "Download limit :" -msgstr "Показывать не более " +msgstr "Ограничение скорости скачивания:" #: ../sflphone-client-gnome/src/config/addressbook-config.c:327 msgid "cards" @@ -718,7 +749,7 @@ msgstr "_Показать фотографию контакта (если име #: ../sflphone-client-gnome/src/config/addressbook-config.c:341 msgid "Fields from Evolution's address books" -msgstr "Исполоьзовать следующие номера из адресной книги Evolution" +msgstr "Использовать следующие поля из адресной книги Evolution:" #: ../sflphone-client-gnome/src/config/addressbook-config.c:345 msgid "_Work" @@ -741,7 +772,7 @@ msgid "Select which Evolution address books to use" msgstr "Выбрать адресную книгу Evolution:" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "Имя" @@ -756,7 +787,7 @@ msgid "" "parameters in the Options/Accounts window." msgstr "" "Вы можете в любое время проверить статус регистрации или изменить параметры " -"ваших учëтных записей в меню Правка / Учëтные записи" +"ваших аккаунтов в меню Правка / Аккаунты." #: ../sflphone-client-gnome/src/config/assistant.c:80 msgid "Alias" @@ -768,11 +799,11 @@ msgstr "Сервер" #: ../sflphone-client-gnome/src/config/assistant.c:88 msgid "Username" -msgstr "Пользователь" +msgstr "Имя пользователя" #: ../sflphone-client-gnome/src/config/assistant.c:92 msgid "Security: " -msgstr "Безопасность:" +msgstr "Безопасность " #: ../sflphone-client-gnome/src/config/assistant.c:94 msgid "SRTP/ZRTP draft-zimmermann" @@ -782,183 +813,182 @@ msgstr "SRTP/ZRTP draft-zimmermann" msgid "None" msgstr "Нет" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" -msgstr "Мастер настройки SFLphone" +msgstr "Мастер создания аккаунта SFLphone" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" -msgstr "Добро пожаловать в SFLphone!" +msgstr "Добро пожаловать в мастер создания аккаунта SFLphone!" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." -msgstr "Этот мастер установки поможет вам настроить вашу учëтную запись" +msgstr "Этот мастер установки поможет вам настроить ваш аккаунт." -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "VoIP-протоколы" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" -msgstr "Выберите тип учëтной записи" +msgstr "Выберите тип аккаунта" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP (Session Initiation Protocol)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2 (InterAsterix Exchange)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" -msgstr "Учëтная запись" +msgstr "Аккаунт" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" -msgstr "Введите пожалуйста следующие данные" +msgstr "Выберите одну из следующих возможностей" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" -msgstr "Создать бесплатную SIP/IAX2-учëтную запись на sflphone.org" +msgstr "Создать бесплатный SIP/IAX2-аккаунт на sflphone.org" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" -msgstr "Зарегистрировать существующею SIP или IAX2 учëтную запись" +msgstr "Использовать существующий SIP или IAX2 аккаунт" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" -msgstr "Настройка учëтной записи SIP" +msgstr "Настройка SIP-аккаунта" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "Введите пожалуйста следующие данные" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "Защищëнная связь с _ZRTP" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" -msgstr "Электронный адрес (необязательный)" +msgstr "e-mail" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." -msgstr "Этот электронный адрес будет использоваться для речевых сообщений" +msgstr "" +"Этот электронный адрес будет использоваться для отправки сообщений голосовой " +"почты" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "_Адрес эл. почты" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" -msgstr "Настройка учëтной записи IAX2" +msgstr "Настройка IAX2-аккаунта" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "Network Address Translation (NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." -msgstr "Вы наверное должны это включить если вы находитесь за сетевым экраном." +msgstr "" +"Возможно нужно выбрать эту опцию если вы находитесь за сетевым экраном." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "Включить STUN" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "_STUN-сервер" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" -msgstr "Регистрация учëтной записи" +msgstr "Регистрация аккаунта" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "Поздравляем!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "Частота" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "Битрейт" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" -msgstr "Пропускная способность" +msgstr "Полоса пропускания" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "ALSA-плагин" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" -msgstr "Выход" +msgstr "Аудиовыход" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" -msgstr "Вход" +msgstr "Аудиовход" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" -msgstr "Включить детектор тишины" +msgstr "Детектор тишины (VAD)" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "Шумоподавление" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "Менеджер звука" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "_Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "_ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "Настройка ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Кодеки" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "Записи" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" -msgstr "Папка назначения" +msgstr "Сохранять в" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" -msgstr "Выберите папку" +msgstr "Выберите каталог" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" -msgstr "Звонки" +msgstr "Рингтоны" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" -msgstr "Включить звонок" +msgstr "Включить рингтон" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" -msgstr "Выберите звонок" +msgstr "Выберать рингтон" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" -msgstr "Звуковые файлы" +msgstr "Аудио файлы" #: ../sflphone-client-gnome/src/config/hooks-config.c:130 msgid "URL Argument" @@ -966,7 +996,7 @@ msgstr "Передача URL" #: ../sflphone-client-gnome/src/config/hooks-config.c:135 msgid "Custom commands on incoming calls with URL" -msgstr "Пользовательские команды при входящих вызовах с URL" +msgstr "Пользовательская команда при входящих вызовах с URL" #: ../sflphone-client-gnome/src/config/hooks-config.c:138 #, c-format @@ -987,82 +1017,71 @@ msgstr "_Выполнить команду:" #: ../sflphone-client-gnome/src/config/hooks-config.c:165 msgid "Phone number rewriting" -msgstr "Переписка номера телефона" +msgstr "Префикс" #: ../sflphone-client-gnome/src/config/hooks-config.c:169 msgid "_Prefix dialed numbers with" -msgstr "Добавить перед на набранными номерами" +msgstr "Добавить префикс перед номером" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" -"Этот профиль используется когда вы хотите достичь удалëнное устройство " -"просто набрав SIP URI (адрес) типа <b>sip:удалëнное устройство</b>. Эти " -"настройки так-же будут использованы если не будет подходящего аккаунта для " -"входящего или выходящего звонка." - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" -msgstr "Извещения на рабочем столе" +msgstr "Всплывающие уведомления" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" -msgstr "Включить звонок" +msgstr "Показывать всплывающие уведомления" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" -msgstr "Поведение окна SFLPhone" +msgstr "Значок в системном трее" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" -msgstr "_Показать главное окно при входящем звонке" +msgstr "_Показать главное окно при входящем вызове" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" -msgstr "Никогда не показывать главное окно" +msgstr "_Никогда не показывать главное окно" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" -msgstr "Спрятать окно SFLphone при пуске" +msgstr "Скрывать SFLphone при запуске в трей" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" -msgstr "Журнал звонков" +msgstr "Журнал вызовов" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" -msgstr "Со_хранить мой журнал звонков как минимум в течении" +msgstr "_Хранить журнал вызовов в течении" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "дней" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" -msgstr "Предпочтения" +msgstr "Настройка" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" -msgstr "Звук" +msgstr "Аудио" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "Адресная книга" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" -msgstr "Зацепки" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "Прямые IP-звонки" +msgstr "Прочее" #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" -msgstr "Дополнительные опции для TLS" +msgstr "Дополнительные настройки для TLS" #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:56 msgid "TLS transport" @@ -1081,55 +1100,59 @@ msgstr "" "каждого аккаунта (но каждый из них будет использовать свой выделенный " "порт).\n" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" -msgstr "Список центра сертификации" +msgstr "Список центров сертификации" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" -msgstr "Выберите файл Центра сертификации (необязательный)" +msgstr "Выберите файл Центра сертификации (необязательно)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "Файл с публичным сертификатом" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" -msgstr "Выберите публичный сертификат (необязательный)" +msgstr "Выберите публичный сертификат (необязательно)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" -msgstr "Выберите файл с секретным ключом (необязательно)" +msgstr "Выберите файл с приватным ключом (необязательно)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" -msgstr "Пароль для секретного ключа" +msgstr "Пароль для приватного ключа" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "Метод протокола TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "Список шифров TLS" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" -msgstr "Имя сервера для выходящих TLS-подключений." +msgstr "Имя сервера для исходящих TLS-подключений" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "Время ожидания соединения (сек:мсек)" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" -msgstr "Проверять входящие сертификаты (в качестве сервера)" +msgstr "Проверять входящие сертификаты как сервер" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" -msgstr "Проверять входящие сертификаты (в качестве клиента)" +msgstr "Проверять входящие сертификаты как клиент" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "Требовать сертификат для входящих TLS-подключений" @@ -1153,6 +1176,15 @@ msgstr "_Предупредить если ZRTP не пддерживается" msgid "Display SAS once for hold events" msgstr "Показать SAS один раз" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +#, fuzzy +msgid "SDES Options" +msgstr "Опции ZRTP" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "Искать все" @@ -1162,58 +1194,39 @@ msgstr "Искать все" #: ../sflphone-client-gnome/src/contacts/searchbar.c:84 #: ../sflphone-client-gnome/src/contacts/searchbar.c:96 msgid "Click here to change the search type" -msgstr "Нажмите, чтобы изменить тип поиска" +msgstr "Нажмите сюда, чтобы изменить тип поиска" #: ../sflphone-client-gnome/src/contacts/searchbar.c:71 msgid "Search by missed call" -msgstr "Поиск по пропущенным вызовам" +msgstr "Поиск в пропущенных вызовах" #: ../sflphone-client-gnome/src/contacts/searchbar.c:83 msgid "Search by incoming call" -msgstr "Поиск по входящим вызовам" +msgstr "Поиск в входящих вызовах" #: ../sflphone-client-gnome/src/contacts/searchbar.c:95 msgid "Search by outgoing call" -msgstr "Поиск по исходящим вызовам" - -#~ msgid "IP call - %s" -#~ msgstr "IP звонок - %s" - -#~ msgid "Codec" -#~ msgstr "Codec" - -#~ msgid "Network" -#~ msgstr "Сеть" - -#~ msgid "Manually" -#~ msgstr "Вручную" +msgstr "Поиск в исходящих вызовах" -#~ msgid "There " -#~ msgstr "Здесь " - -#~ msgid "is " -#~ msgstr "Зарегестрирован " - -#~ msgid "are " -#~ msgstr "Зарегестрированны " - -#~ msgid "s" -#~ msgstr "a" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "Приглушать звук других програм во время звонка" - -#~ msgid "SIP Port" -#~ msgstr "SIP-порт" - -#~ msgid "UDP Transport" -#~ msgstr "Транспорт UDP" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>Ошибка: звуковые кодеки не найдены.\n" +#~ "\n" +#~ "</b> Звуковые кодеки SFL должны находиться в <i>%s</i> или в <b>." +#~ "sflphone</b> каталоге в вашем домашнем каталоге( <i>%s</i> )" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "Включить предупреждения о речевых сообщениях" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "%i аккаунт настроен" +#~ msgstr[1] "%i аккаунтов настроено" +#~ msgstr[2] "%i аккаунтов настроены" -#~ msgid "Store SIP credentials as MD5 hash" -#~ msgstr "Записать параметры доступа SIP с шифровкой MD5." +#~ msgid "Direct IP calls" +#~ msgstr "Прямые IP-вызовы" #~ msgid "Account creation wizard" #~ msgstr "Мастер настройки SFLphone" @@ -1221,6 +1234,9 @@ msgstr "Поиск по исходящим вызовам" #~ msgid "Voicemail number" #~ msgstr "Номер автоответчика #" +#~ msgid "Codec" +#~ msgstr "Codec" + #~ msgid "Display volume controls" #~ msgstr "_Настройки громкости" @@ -1266,21 +1282,33 @@ msgstr "Поиск по исходящим вызовам" #~ msgid "Sound manager" #~ msgstr "Менеджер звука" +#~ msgid "SIP Port" +#~ msgstr "SIP-порт" + #~ msgid "Command to run" #~ msgstr "Выполнить команду:" #~ msgid "Prefix dialed numbers with" #~ msgstr "Добавить перед на набранными номерами" +#~ msgid "IP call - %s" +#~ msgstr "IP звонок - %s" + #~ msgid "_Account creation wizard" #~ msgstr "Мастер настройки SFLphone" #~ msgid "_Enable this account" #~ msgstr "_Включить" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "Включить предупреждения о речевых сообщениях" + #~ msgid "PulseAudio sound server" #~ msgstr "Сервер звука PulseAudio" +#~ msgid "_Mute other applications during a call" +#~ msgstr "Приглушать звук других програм во время звонка" + #~ msgid "Port" #~ msgstr "Порт" @@ -1456,6 +1484,27 @@ msgstr "Поиск по исходящим вызовам" #~ msgid "Enable notifications" #~ msgstr "Включить уведомления" +#~ msgid "Manually" +#~ msgstr "Вручную" + +#~ msgid "UDP Transport" +#~ msgstr "Транспорт UDP" + +#~ msgid "There " +#~ msgstr "Здесь " + +#~ msgid "Store SIP credentials as MD5 hash" +#~ msgstr "Записать параметры доступа SIP с шифровкой MD5." + +#~ msgid "s" +#~ msgstr "a" + +#~ msgid "are " +#~ msgstr "Зарегестрированны " + +#~ msgid "is " +#~ msgstr "Зарегестрирован " + #~ msgctxt "NAME OF TRANSLATORS" #~ msgid "Your names" #~ msgstr "" @@ -1464,11 +1513,14 @@ msgstr "Поиск по исходящим вызовам" #~ "Sergei Sedov, ,Launchpad Contributions:,Emmanuel Milou,Hussein Abdallah," #~ "Hussein Abdallah,Maxime Chambreuil,Pavlo Kucheriavyi,Sergei Sedov, ," #~ "Launchpad Contributions:,Emmanuel Milou,Hussein Abdallah,Hussein Abdallah," -#~ "Maxime Chambreuil,Pavlo Kucheriavyi,Sergey Sedov" +#~ "Maxime Chambreuil,Pavlo Kucheriavyi,Sergey Sedov, ,Launchpad " +#~ "Contributions:,DMG,Emmanuel Milou,Hussein Abdallah,Hussein Abdallah," +#~ "Lortonix,Maxime Chambreuil,Pavlo Kucheriavyi,Sergey Sedov" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ ",,,,,emmanuel.milou@savoirfairelinux.com,,maxime.chambreuil@gmail.com,,,,," #~ "emmanuel.milou@savoirfairelinux.com,,,maxime.chambreuil@gmail.com,,,,," -#~ "emmanuel.milou@savoirfairelinux.com,,,maxime.chambreuil@gmail.com,," +#~ "emmanuel.milou@savoirfairelinux.com,,,maxime.chambreuil@gmail.com,,,,,," +#~ "emmanuel.milou@savoirfairelinux.com,,,,maxime.chambreuil@gmail.com,," diff --git a/lang/sflphone.pot b/lang/sflphone.pot index 8fd477d58564f569288946c0cc0852a4611ef0b6..62ec100dd6c791ad700d0d468c90b27adcbbdc48 100644 --- a/lang/sflphone.pot +++ b/lang/sflphone.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,74 +17,85 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." msgstr "" -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" #: ../sflphone-client-gnome/src/errors.c:29 @@ -108,65 +119,65 @@ msgid "" "Pulseaudio is not running" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -235,446 +246,460 @@ msgstr "" msgid "Mic volume" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:132 +#: ../sflphone-client-gnome/src/statusicon.c:189 #, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" +msgid "%i active account" +msgid_plural "%i active accounts" msgstr[0] "" msgstr[1] "" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 #, c-format msgid "Voicemail (%i)" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +msgid "_User-agent" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" msgstr[1] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "" @@ -719,7 +744,7 @@ msgid "Select which Evolution address books to use" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "" @@ -758,181 +783,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "" @@ -969,69 +990,62 @@ msgstr "" msgid "_Prefix dialed numbers with" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1049,55 +1063,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1121,6 +1139,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "" diff --git a/lang/tr/tr.po b/lang/tr/tr.po new file mode 100644 index 0000000000000000000000000000000000000000..36459e4c7194e4383edb3264ca609019e055057f --- /dev/null +++ b/lang/tr/tr.po @@ -0,0 +1,1172 @@ +# Turkish translation for sflphone +# Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 +# This file is distributed under the same license as the sflphone package. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: sflphone\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-30 08:56+0000\n" +"Last-Translator: zeugma <Unknown>\n" +"Language-Team: Turkish <tr@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" +"X-Generator: Launchpad (build Unknown)\n" + +#: ../sflphone-client-gnome/src/accountlist.c:170 +msgid "Registered" +msgstr "Kayıtlı" + +#: ../sflphone-client-gnome/src/accountlist.c:173 +msgid "Not Registered" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:176 +msgid "Trying..." +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:179 +#: ../sflphone-client-gnome/src/sflnotify.c:131 +#: ../sflphone-client-gnome/src/sflnotify.c:148 +msgid "Error" +msgstr "Hata" + +#: ../sflphone-client-gnome/src/accountlist.c:182 +msgid "Authentication Failed" +msgstr "Kimlik Doğrulama Başarısız" + +#: ../sflphone-client-gnome/src/accountlist.c:185 +msgid "Network unreachable" +msgstr "Ağ erişilemez durumda" + +#: ../sflphone-client-gnome/src/accountlist.c:188 +msgid "Host unreachable" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:191 +msgid "Stun configuration error" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:194 +msgid "Stun server invalid" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 +msgid "Invalid" +msgstr "Geçersiz" + +#: ../sflphone-client-gnome/src/actions.c:114 +msgid "Using account" +msgstr "" + +#: ../sflphone-client-gnome/src/actions.c:121 +msgid "No registered accounts" +msgstr "" + +#: ../sflphone-client-gnome/src/actions.c:306 +msgid "" +"Unable to connect to the SFLphone server.\n" +"Make sure the daemon is running." +msgstr "" + +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 +msgid "Direct SIP call" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/errors.c:29 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening playback device" +msgstr "" + +#: ../sflphone-client-gnome/src/errors.c:32 +msgid "" +"ALSA notification\n" +"\n" +"Error while opening capture device" +msgstr "" + +#: ../sflphone-client-gnome/src/errors.c:35 +msgid "" +"Pulseaudio notification\n" +"\n" +"Pulseaudio is not running" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:94 +msgid "There is one call in progress." +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:98 +msgid "There are calls in progress." +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:103 +msgid "Do you still want to quit?" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:331 +msgid "SFLphone Error" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:450 +#, c-format +msgid "ZRTP is not supported by peer %s\n" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:452 +msgid "Secure Communication Unavailable" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 +msgid "Continue" +msgstr "Devam et" + +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 +msgid "Stop Call" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:480 +#, c-format +msgid "" +"A %s error forced the call with %s to fall under unencrypted mode.\n" +"Exact reason: %s\n" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:482 +msgid "ZRTP negotiation failed" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:500 +#, c-format +msgid "" +"%s wants to stop using secure communication. Confirm will resume " +"conversation without SRTP.\n" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:502 +msgid "Confirm Go Clear" +msgstr "" + +#: ../sflphone-client-gnome/src/mainwindow.c:504 +msgid "Confirm" +msgstr "Onayla" + +#: ../sflphone-client-gnome/src/sflnotify.c:71 +#: ../sflphone-client-gnome/src/sflnotify.c:91 +#, c-format +msgid "%s account : %s" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:75 +#, c-format +msgid "<i>From</i> %s" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:94 +#, c-format +msgid "%d voice mail" +msgid_plural "%d voice mails" +msgstr[0] "" +msgstr[1] "" + +#: ../sflphone-client-gnome/src/sflnotify.c:111 +#, c-format +msgid "Calling with %s account <i>%s</i>" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:115 +msgid "Current account" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:130 +msgid "You have no accounts set up" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:147 +msgid "You have no registered accounts" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:190 +#, c-format +msgid "" +"<i>With:</i> %s \n" +"using %s" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:205 +#, c-format +msgid "%s does not support ZRTP." +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:220 +#, c-format +msgid "ZRTP negotiation failed with %s" +msgstr "" + +#: ../sflphone-client-gnome/src/sflnotify.c:235 +#, c-format +msgid "<i>With:</i> %s" +msgstr "" + +#: ../sflphone-client-gnome/src/sliders.c:162 +msgid "Speakers volume" +msgstr "" + +#: ../sflphone-client-gnome/src/sliders.c:164 +msgid "Mic volume" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:128 +msgid "_Show main window" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:187 +msgid "SFLphone" +msgstr "SFLphone" + +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "" + +#: ../sflphone-client-gnome/src/toolbar.c:38 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 +msgid "Voicemail" +msgstr "Sesli mesaj" + +#: ../sflphone-client-gnome/src/uimanager.c:121 +msgid "No address book selected" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 +msgid "Address book" +msgstr "Adres Defteri" + +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format +msgid "Voicemail (%i)" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:396 +msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:398 +msgid "About SFLphone" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:800 +msgid "Call" +msgstr "Çağrı" + +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 +msgid "_New call" +msgstr "_Yeni çağrı" + +#: ../sflphone-client-gnome/src/uimanager.c:802 +msgid "Place a new call" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 +msgid "_Pick up" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:804 +msgid "Answer the call" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:806 +msgid "Finish the call" +msgstr "Aramayı sonlandır" + +#: ../sflphone-client-gnome/src/uimanager.c:807 +msgid "O_n hold" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:808 +msgid "Place the call on hold" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:809 +msgid "O_ff hold" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:810 +msgid "Place the call off hold" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:811 +msgid "Configuration _Assistant" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:812 +msgid "Run the configuration assistant" +msgstr "Yapılandırma sihirbazını çalıştır" + +#: ../sflphone-client-gnome/src/uimanager.c:815 +msgid "Call your voicemail" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:816 +msgid "_Close" +msgstr "_Kapat" + +#: ../sflphone-client-gnome/src/uimanager.c:817 +msgid "Minimize to system tray" +msgstr "Sistem çubuğuna küçült" + +#: ../sflphone-client-gnome/src/uimanager.c:818 +msgid "_Quit" +msgstr "_Çık" + +#: ../sflphone-client-gnome/src/uimanager.c:819 +msgid "Quit the program" +msgstr "Programdan çık" + +#: ../sflphone-client-gnome/src/uimanager.c:822 +msgid "_Edit" +msgstr "_Düzenle" + +#: ../sflphone-client-gnome/src/uimanager.c:823 +msgid "_Copy" +msgstr "_Kopyala" + +#: ../sflphone-client-gnome/src/uimanager.c:824 +msgid "Copy the selection" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:825 +msgid "_Paste" +msgstr "_Yapıştır" + +#: ../sflphone-client-gnome/src/uimanager.c:826 +msgid "Paste the clipboard" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:827 +msgid "Clear _history" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:828 +msgid "Clear the call history" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "_Accounts" +msgstr "_Hesaplar" + +#: ../sflphone-client-gnome/src/uimanager.c:829 +msgid "Edit your accounts" +msgstr "Hesaplarınızı düzenleyin" + +#: ../sflphone-client-gnome/src/uimanager.c:831 +msgid "_Preferences" +msgstr "_Tercihler" + +#: ../sflphone-client-gnome/src/uimanager.c:832 +msgid "Change your preferences" +msgstr "Tercihlerinizi değiştirin" + +#: ../sflphone-client-gnome/src/uimanager.c:835 +msgid "_View" +msgstr "_Göster" + +#: ../sflphone-client-gnome/src/uimanager.c:838 +msgid "_Help" +msgstr "_Yardım" + +#: ../sflphone-client-gnome/src/uimanager.c:839 +msgid "Contents" +msgstr "İçerikler" + +#: ../sflphone-client-gnome/src/uimanager.c:840 +msgid "Open the manual" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:841 +msgid "About this application" +msgstr "Bu uygulama hakkında" + +#: ../sflphone-client-gnome/src/uimanager.c:849 +msgid "_Transfer" +msgstr "_Transfer" + +#: ../sflphone-client-gnome/src/uimanager.c:850 +msgid "Transfer the call" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "_Kayıt" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 +msgid "_Show toolbar" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:854 +msgid "Show the toolbar" +msgstr "Araç çubuğunu göster" + +#: ../sflphone-client-gnome/src/uimanager.c:855 +msgid "_Dialpad" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:856 +msgid "Show the dialpad" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:857 +msgid "_Volume controls" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:858 +msgid "Show the volume controls" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:859 +msgid "_History" +msgstr "_Geçmiş" + +#: ../sflphone-client-gnome/src/uimanager.c:860 +msgid "Calls history" +msgstr "Arama geçmişi" + +#: ../sflphone-client-gnome/src/uimanager.c:861 +msgid "_Address book" +msgstr "_Adres defteri" + +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 +msgid "On _Hold" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:1234 +msgid "_Call back" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:1390 +msgid "Edit phone number" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:1402 +msgid "Edit the phone number before making a call" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 +msgid "Account Parameters" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 +msgid "_Alias" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 +msgid "_Protocol" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 +msgid "Unknown" +msgstr "Bilinmiyor" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 +msgid "_Host name" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 +msgid "_User name" +msgstr "_Kullanıcı adı" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 +msgid "_Password" +msgstr "_Parola" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 +msgid "Show password" +msgstr "Parolayı göster" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 +msgid "_Voicemail number" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "_Kullanıcı adı" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 +msgid "Authentication" +msgstr "Kimlik Doğrulama" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 +msgid "Secret" +msgstr "Gizli" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 +msgid "Credential" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 +msgid "Authentication name" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 +msgid "Password" +msgstr "Parola" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 +msgid "Security" +msgstr "Güvenlik" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 +msgid "Use TLS transport (sips)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 +msgid "SRTP key exchange" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 +msgid "Disabled" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 +msgid "Registration" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 +msgid "Registration expire" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 +msgid "_Comply with RFC 3263" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 +msgid "Network Interface" +msgstr "Ağ Arayüzü" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 +msgid "Local address" +msgstr "Yerel adres" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 +msgid "Local port" +msgstr "Yerel port" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 +msgid "Published address" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 +msgid "Using STUN" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 +msgid "STUN server URL" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 +msgid "Same as local parameters" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 +msgid "Set published address and port:" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 +msgid "Published port" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 +msgid "Account settings" +msgstr "Hesap ayarları" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 +msgid "Basic" +msgstr "Basit" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Çözücüler" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 +msgid "Advanced" +msgstr "Gelişmiş" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 +#, c-format +msgid "Server returned \"%s\" (%d)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 +msgid "Protocol" +msgstr "İletişim Kuralları" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 +msgid "Status" +msgstr "Durum" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 +msgid "Accounts" +msgstr "Hesaplar" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 +msgid "Configured Accounts" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 +#, c-format +msgid "There is %d active account" +msgid_plural "There are %d active accounts" +msgstr[0] "" +msgstr[1] "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 +msgid "You have no active account" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:306 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 +msgid "General" +msgstr "Genel" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:312 +msgid "_Use Evolution address books" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:319 +msgid "Download limit :" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:327 +msgid "cards" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:333 +msgid "_Display contact photo if available" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:341 +msgid "Fields from Evolution's address books" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:345 +msgid "_Work" +msgstr "_İş" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:351 +msgid "_Home" +msgstr "_Başlangıç" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:357 +msgid "_Mobile" +msgstr "_Hareketli" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:364 +msgid "Address Books" +msgstr "Adres Defterleri" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:368 +msgid "Select which Evolution address books to use" +msgstr "" + +#: ../sflphone-client-gnome/src/config/addressbook-config.c:404 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 +msgid "Name" +msgstr "İsim" + +#: ../sflphone-client-gnome/src/config/assistant.c:75 +#, c-format +msgid "This assistant is now finished." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:77 +msgid "" +"You can at any time check your registration state or modify your accounts " +"parameters in the Options/Accounts window." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:80 +msgid "Alias" +msgstr "Rumuz" + +#: ../sflphone-client-gnome/src/config/assistant.c:84 +msgid "Server" +msgstr "Sunucu" + +#: ../sflphone-client-gnome/src/config/assistant.c:88 +msgid "Username" +msgstr "Kullanıcı adı" + +#: ../sflphone-client-gnome/src/config/assistant.c:92 +msgid "Security: " +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:94 +msgid "SRTP/ZRTP draft-zimmermann" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:96 +msgid "None" +msgstr "Hiçbiri" + +#: ../sflphone-client-gnome/src/config/assistant.c:230 +msgid "SFLphone account creation wizard" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:256 +msgid "Welcome to the Account creation wizard of SFLphone!" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:257 +msgid "This installation wizard will help you configure an account." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "VoIP Protocols" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:271 +msgid "Select an account type" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:273 +msgid "SIP (Session Initiation Protocol)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:275 +msgid "IAX2 (InterAsterix Exchange)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Account" +msgstr "Hesap" + +#: ../sflphone-client-gnome/src/config/assistant.c:289 +msgid "Please select one of the following options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:291 +msgid "Create a free SIP/IAX2 account on sflphone.org" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:293 +msgid "Register an existing SIP or IAX2 account" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +msgid "SIP account settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "Please fill the following information" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 +msgid "Secure communications with _ZRTP" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "Optional email address" +msgstr "isteğe bağlı e-posta adresi" + +#: ../sflphone-client-gnome/src/config/assistant.c:390 +msgid "This email address will be used to send your voicemail messages." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:398 +msgid "_Email address" +msgstr "_E-Posta adresi" + +#: ../sflphone-client-gnome/src/config/assistant.c:420 +msgid "IAX2 account settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "Network Address Translation (NAT)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:497 +msgid "You should probably enable this if you are behind a firewall." +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:506 +msgid "E_nable STUN" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:513 +msgid "_STUN server" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Account Registration" +msgstr "" + +#: ../sflphone-client-gnome/src/config/assistant.c:527 +msgid "Congratulations!" +msgstr "Tebrikler!" + +#: ../sflphone-client-gnome/src/config/audioconf.c:600 +msgid "Frequency" +msgstr "Frekans" + +#: ../sflphone-client-gnome/src/config/audioconf.c:605 +msgid "Bitrate" +msgstr "Veri akış hızı" + +#: ../sflphone-client-gnome/src/config/audioconf.c:610 +msgid "Bandwidth" +msgstr "Band Genişliği" + +#: ../sflphone-client-gnome/src/config/audioconf.c:688 +msgid "ALSA plugin" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:710 +msgid "Output" +msgstr "Çıkış" + +#: ../sflphone-client-gnome/src/config/audioconf.c:732 +msgid "Input" +msgstr "Giriş" + +#: ../sflphone-client-gnome/src/config/audioconf.c:767 +msgid "_Voice Activity Detection" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:777 +msgid "_Noise Reduction (Narrow-Band Companding)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:813 +msgid "Sound Manager" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:822 +msgid "_Pulseaudio" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:826 +msgid "_ALSA" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:832 +msgid "ALSA settings" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:853 +msgid "Recordings" +msgstr "Kayıtlar" + +#: ../sflphone-client-gnome/src/config/audioconf.c:857 +msgid "Destination folder" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:861 +msgid "Select a folder" +msgstr "Bir klasör seç" + +#: ../sflphone-client-gnome/src/config/audioconf.c:867 +msgid "Ringtones" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:873 +msgid "_Enable ringtones" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:879 +msgid "Choose a ringtone" +msgstr "" + +#: ../sflphone-client-gnome/src/config/audioconf.c:885 +msgid "Audio Files" +msgstr "Ses Dosyaları" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:130 +msgid "URL Argument" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:135 +msgid "Custom commands on incoming calls with URL" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:138 +#, c-format +msgid "%s will be replaced with the passed URL." +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:141 +msgid "Trigger on specific _SIP header" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:150 +msgid "Trigger on _IAX2 URL" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:155 +msgid "Command to _run" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:165 +msgid "Phone number rewriting" +msgstr "" + +#: ../sflphone-client-gnome/src/config/hooks-config.c:169 +msgid "_Prefix dialed numbers with" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 +msgid "Desktop Notifications" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 +msgid "_Enable notifications" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 +msgid "System Tray Icon" +msgstr "Sistem Tepsisi Simgesi" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 +msgid "_Popup main window on incoming call" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 +msgid "Ne_ver popup main window" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 +msgid "Hide SFLphone window on _startup" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 +msgid "Calls History" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 +msgid "_Keep my history for at least" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 +msgid "days" +msgstr "gün" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 +msgid "Preferences" +msgstr "Tercihler" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 +msgid "Audio" +msgstr "Ses" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 +msgid "Address Book" +msgstr "Adres Defteri" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 +msgid "Hooks" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 +msgid "Advanced options for TLS" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:56 +msgid "TLS transport" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:60 +msgid "" +"TLS transport can be used along with UDP for those calls that would\n" +"require secure sip transactions (aka SIPS). You can configure a different\n" +"TLS transport for each account. However, each of them will run on a " +"dedicated\n" +"port, different one from each other\n" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 +msgid "Certificate of Authority list" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 +msgid "Choose a CA list file (optional)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 +msgid "Public endpoint certificate file" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 +msgid "Choose a public endpoint certificate (optional)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 +msgid "Choose a private key file (optional)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 +msgid "Password for the private key" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 +msgid "TLS protocol method" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 +msgid "TLS cipher list" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 +msgid "Server name instance for outgoing TLS connection" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 +msgid "Negotiation timeout (sec:msec)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 +msgid "Verify incoming certificates, as a server" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 +msgid "Verify certificates from answer, as a client" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 +msgid "Require certificate for incoming tls connections" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:49 +msgid "ZRTP Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:69 +msgid "Send Hello Hash in S_DP" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:75 +msgid "Ask User to Confirm SAS" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:81 +msgid "_Warn if ZRTP not supported" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:87 +msgid "Display SAS once for hold events" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:58 +msgid "Search all" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:59 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:72 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:84 +#: ../sflphone-client-gnome/src/contacts/searchbar.c:96 +msgid "Click here to change the search type" +msgstr "Arama türünü değiştirmek için buraya tıklayın" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:71 +msgid "Search by missed call" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:83 +msgid "Search by incoming call" +msgstr "" + +#: ../sflphone-client-gnome/src/contacts/searchbar.c:95 +msgid "Search by outgoing call" +msgstr "" diff --git a/lang/zh_CN/zh_CN.po b/lang/zh_CN/zh_CN.po index bfc3429d51dec35ea9728985f2d0967e8ad86bd1..6ebdc78a32ac65fa0f53ad456433ce766434a526 100644 --- a/lang/zh_CN/zh_CN.po +++ b/lang/zh_CN/zh_CN.po @@ -8,68 +8,72 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" -"Last-Translator: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2010-02-28 01:32+0000\n" +"Last-Translator: wzssyqa <wzssyqa@gmail.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "已注册" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "未注册" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "正在连接..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "注册失败" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "认证失败" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "网络连接失败" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "服务器连接失败" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Stun配置有误" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Stun服务器无效" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "无效" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "使用账户" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "没有已注册帐户" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -77,23 +81,26 @@ msgstr "" "连接SFLphone服务器失败.\n" "请检查daemon是否还在运行." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>错误:无法找到codecs编码文件.\n" -"\n" -"</b> SFL声音codecs文件应位于<i>%s</i> 或 位于主目录( <i>%s</i> )的<b>." -"sflphone</b>目录下" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -125,65 +132,65 @@ msgstr "" "\n" "Pulseaudio未运行" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "有一个电话正在处理" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "有电话正在处理中" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "确认要退出?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "SFLphone出错" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "安全通信不可用" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "继续" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "停止呼叫" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "确认" @@ -251,443 +258,460 @@ msgstr "扬声器音量" msgid "Mic volume" msgstr "话筒音量" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "显示主窗口(S)" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "挂断(_H)" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "已配置了%i个账户" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "默认帐户" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "语音信箱" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "地址簿" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "地址簿" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "语音信箱 (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone是一个VoIP客户端,它兼容SIP和IAX2协议." -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "关于SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "电话(_C)" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "新电话(_N)" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "接听(_P)" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "挂断(_H)" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "保持(_H)" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "恢复通话" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "录音(_R)" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Stun配置有误" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d 个语音信息" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" -msgstr "编辑(_E)" +msgstr "退出(_Q)" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "编辑(_E)" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "删除所选账户" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "清空历史记录(_H)" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "清空历史记录" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "账户(_A)" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "当前帐户" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" -msgstr "首选项" +msgstr "首选项(_P)" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" -msgstr "" +msgstr "更改您的首选项" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "查看(_V)" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "帮助(_H)" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "继续" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "身份验证" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "转接" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "转给: " +msgstr "转给:" + +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "录音(_R)" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "禁用" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "音量控制(V)" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "音量控制(V)" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "历史" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "呼叫记录" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "地址簿" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "保持(_H)" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "回叫(_C)" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "编辑电话号码" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "拨出电话前编辑电话号码" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "帐户相关参数" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "别名(A)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "协议(P)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "未知" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "主机名(H)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "用户名(U)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "密码(P)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "密码" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "语音信箱号码(V)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "用户名(U)" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "身份验证" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "密码" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "安全" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "禁用" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "注册" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "网络连接失败" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "帐户设置" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "Codecs编码" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "网络" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "协议" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "状态" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "帐户" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "已配置帐户" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" +msgstr[1] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "常用配置" @@ -732,7 +756,7 @@ msgid "Select which Evolution address books to use" msgstr "选择使用如下Evolution地址薄" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "名称" @@ -771,181 +795,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "SFLphone账户创建向导" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "欢迎使用SFLphone帐户创建向导!" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "安装向导将帮助您配置帐户" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "VoIP协议" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "选择帐户类型" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP(会话初始化协议)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2(Asterisk内部交换协议)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "帐户" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "请选择以下选项中的一个" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "在sflphone.org上创建免费的SIP/IAX2帐户" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "注册已存在的SIP或IAX2帐户" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "SIP帐户设置" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "请填写以下信息" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "可选邮件地址" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "这个邮件地址将被用来发送您的语音邮箱消息" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "邮件地址(E)" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "IAX2帐户设置" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "网络地址解析(NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "如果你使用网络使用防火墙,你很有可能需要设定此项." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "使用STUN(n)" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "STUN服务器(S)" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "帐户注册" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "恭喜!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "频率" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "比率" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "带宽" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "ALSA插件" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "输出" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "输入" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "声音状态检测(V)" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "降噪处理-窄频压缩(N)" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "音频管理器" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "ALSA设置" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "Codecs编码" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "记录" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "目标文件夹" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "选择文件夹" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "铃声" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "启用铃声(E)" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "选择铃声" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "音频文件" @@ -982,69 +1002,62 @@ msgstr "重设电话号码" msgid "_Prefix dialed numbers with" msgstr "号码前缀(P)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "桌面提示" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "启用提示(E)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "系统托盘图标" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "来电时弹出主窗口(P)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "从不弹出主窗口(v)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "在启动时隐藏SFLphone主窗口" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "拨号历史" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "首选项" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "地址簿" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "钩键" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1062,55 +1075,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1134,6 +1151,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "查询所有" @@ -1157,23 +1182,20 @@ msgstr "从来电中查询" msgid "Search by outgoing call" msgstr "从拨出电话中查询" -#~ msgid "IP call - %s" -#~ msgstr "IP 电话 - %s" - -#~ msgid "Codec" -#~ msgstr "编码" - -#~ msgid "Network" -#~ msgstr "网络" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "当有来电时静音其它应用程序(c)" - -#~ msgid "SIP Port" -#~ msgstr "SIP端口号" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>错误:无法找到codecs编码文件.\n" +#~ "\n" +#~ "</b> SFL声音codecs文件应位于<i>%s</i> 或 位于主目录( <i>%s</i> )的<b>." +#~ "sflphone</b>目录下" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "启用语音邮箱提示(n)" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "已配置了%i个账户" #~ msgid "Account creation wizard" #~ msgstr "帐户创建向导" @@ -1192,8 +1214,8 @@ msgstr "从拨出电话中查询" #~ "account." #~ msgstr "当您检查完选定的设置, 请点击\"结束\"来创建帐户" -#~ msgid "Default account" -#~ msgstr "默认帐户" +#~ msgid "Codec" +#~ msgstr "编码" #~ msgid "SFLphone KDE Client" #~ msgstr "SFLphone KDE客户端" @@ -1381,6 +1403,9 @@ msgstr "从拨出电话中查询" #~ msgid "On start" #~ msgstr "正在启动" +#~ msgid "SIP Port" +#~ msgstr "SIP端口号" + #~ msgid "Trigger on specific SIP header" #~ msgstr "激活指定的SIP头" @@ -1396,12 +1421,21 @@ msgstr "从拨出电话中查询" #~ msgid "Attention:number of results exceeds max displayed." #~ msgstr "注意:结果超过可显示的最大值" +#~ msgid "IP call - %s" +#~ msgstr "IP 电话 - %s" + #~ msgid "_Enable this account" #~ msgstr "启用该账户(E)" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "启用语音邮箱提示(n)" + #~ msgid "PulseAudio sound server" #~ msgstr "PulseAudio服务器" +#~ msgid "_Mute other applications during a call" +#~ msgstr "当有来电时静音其它应用程序(c)" + #~ msgid "Port" #~ msgstr "端口" @@ -1702,7 +1736,8 @@ msgstr "从拨出电话中查询" #~ "Yun Liu, ,Launchpad Contributions:,Aron Xu,Yun Liu, ,Launchpad " #~ "Contributions:,Aron Xu,Yinghua Wang,Yun Liu,rainofchaos, ,Launchpad " #~ "Contributions:,Aron Xu,Yinghua Wang,Yun Liu,冯超, ,Launchpad " -#~ "Contributions:,Aron Xu,Emmanuel Milou,Yun Liu,冯超,王英华" +#~ "Contributions:,Aron Xu,Emmanuel Milou,Yun Liu,冯超,王英华, ,Launchpad " +#~ "Contributions:,Aron Xu,Emmanuel Milou,Yun Liu,wzssyqa,冯超,王英华" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" @@ -1710,4 +1745,5 @@ msgstr "从拨出电话中查询" #~ "yunliu2000@gmail.com,,,happyaron.xu@gmail.com,,,,happyaron.xu@gmail.com,,," #~ "rainofchaos@gmail.com,,,happyaron.xu@gmail.com,,,rainofchaos@gmail.com,,,," #~ "emmanuel.milou@savoirfairelinux.com,,rainofchaos@gmail.com," -#~ "wantinghard@gmail.com" +#~ "wantinghard@gmail.com,,,,emmanuel.milou@savoirfairelinux.com,," +#~ "wzssyqa@gmail.com,rainofchaos@gmail.com,wantinghard@gmail.com" diff --git a/lang/zh_HK/zh_HK.po b/lang/zh_HK/zh_HK.po index 0e4afca0c52ab6cb04c97d2e67f3c4fd39c9c273..4acf258abd3121087e7fcf25f2b954951b3fcff9 100644 --- a/lang/zh_HK/zh_HK.po +++ b/lang/zh_HK/zh_HK.po @@ -8,68 +8,72 @@ msgid "" msgstr "" "Project-Id-Version: SFLphone 0.9.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-03 18:09+0000\n" "Last-Translator: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>\n" "Language-Team: SavoirFaireLinux Inc <sflphoneteam@savoirfairelinux.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "已註冊" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "未註冊" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "正在連接..." -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "註冊失敗" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "網路連線失敗" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "伺服器連線失敗" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "Stun配置有誤" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "Stun伺服器無效" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "無效" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "使用賬戶" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "沒有已註冊帳戶" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." @@ -77,23 +81,26 @@ msgstr "" "連接SFLphone伺服器失敗.\n" "請核查daemon是否正在運行." -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" -"<b>錯誤:無法找到音訊編碼檔案.\n" -"\n" -"</b> SFL聲音編碼檔案應該位于<i>%s</i> 或者位于主目錄( <i>%s</i> )的<b>." -"sflphone</b>目錄下" #: ../sflphone-client-gnome/src/errors.c:29 msgid "" @@ -125,65 +132,65 @@ msgstr "" "\n" "Pulseaudio未運行" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "有一個電話正在處理中." -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "有電話正在處理中." -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "確認要退出?" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "SFLphone 出錯" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -251,443 +258,460 @@ msgstr "揚聲器音量" msgid "Mic volume" msgstr "話筒音量" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "顯示主窗口(S)" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "放下(H)" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "SFLphone" -#: ../sflphone-client-gnome/src/statusicon.c:132 -#, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" -msgstr[0] "已配置了%i個賬戶" +#: ../sflphone-client-gnome/src/statusicon.c:189 +#, fuzzy, c-format +msgid "%i active account" +msgid_plural "%i active accounts" +msgstr[0] "默認帳戶" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "語音郵件" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "地址簿" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "地址簿" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 +#, c-format msgid "Voicemail (%i)" msgstr "語音郵件 (%i)" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "SFLphone是一個VoIP客戶端,它兼容SIP和IAX2协议." -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "有關SFLphone" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "電話" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "新電話(N)" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "撥出(P)" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "放下(H)" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "待机" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "恢复通話" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "記錄(R)" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "Stun配置有誤" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "%d 個語音郵件" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "編輯(E)" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "編輯(E)" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "刪除所選賬戶" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "清空曆史記錄(C)" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "清空曆史記錄" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "帳戶(A)" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "當前帳戶" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "屬性" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "查看(V)" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "幫助(H)" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "轉接" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" -msgstr "轉給: " +msgstr "轉給:" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "記錄(R)" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "顯示撥號鍵盤" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "音量控制(V)" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "音量控制(V)" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "歷史" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "呼叫記錄" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "地址簿" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "待机" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "回叫(C)" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "編輯電話號碼" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "撥出電話前編輯電話號碼" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "帳戶相關參數" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "別稱(A)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "協議(P)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "未知" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "主机名稱(H)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "使用者名稱(U)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "密碼(P)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "密碼" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "語音郵箱(V)" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +#, fuzzy +msgid "_User-agent" +msgstr "使用者名稱(U)" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "密碼" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "網路連線失敗" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "帳戶設置" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "編碼" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "協議" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "狀態" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "帳戶" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "已配置帳戶" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" +msgstr[1] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "常用配置" @@ -732,7 +756,7 @@ msgid "Select which Evolution address books to use" msgstr "選擇使用如下Evolution地址薄" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "名稱" @@ -771,181 +795,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "SFLphone賬戶創建嚮導" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "歡迎使用SFLphone帳戶創建嚮導!" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "安裝向導將幫助您配置帳戶" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "VoIP協議" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "選擇帳戶類型" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "SIP(會話初始化協議)" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "IAX2(Asterisk內部交換協議)" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "帳戶" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "請選擇以下選項中的一個" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "在sflphone.org上創建免費的SIP/IAX2帳戶" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "註冊已存在的SIP或IAX2帳戶" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "SIP帳戶配置" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "請填寫如下信息" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "可選郵件地址" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "這個郵件地址將被用來發送您的語音" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "郵件地址(E)" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "IAX2帳戶配置" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "网络地址解析(NAT)" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "如果你使用網路防火牆,你很有可能需要設定該項." -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "啟用STUN(n)" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "STUN伺服器(S)" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "帳戶註冊" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "恭喜!" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "顰律" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "比率" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "顰寬" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "ALSA插件" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "輸出" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "輸入" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "聲音狀態檢測(V)" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "降噪處理-窄頻壓縮(N)" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "聲音管理器" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "Pulseaudio" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "ALSA" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "ALSA 配置" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "編碼" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "記錄" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "目標文件夾" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "選擇文件夾" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "鈴聲" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "啟動鈴聲(E)" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "鈴聲選擇" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "音訊檔案" @@ -982,69 +1002,62 @@ msgstr "重設電話號碼" msgid "_Prefix dialed numbers with" msgstr "號碼前綴(P)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "桌面提示" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "啟動提示(E)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "系統托盤圖標" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "來電話時彈出主視窗(P)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "從不彈出主視窗(v)" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "在啟動時隱藏SFLphone主窗口" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "打電話歷史" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "屬性" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "地址簿" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "鉤鍵" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1062,55 +1075,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1134,6 +1151,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "查詢所有" @@ -1157,20 +1182,20 @@ msgstr "從來電中查詢" msgid "Search by outgoing call" msgstr "從撥出電話中查詢" -#~ msgid "IP call - %s" -#~ msgstr "IP電話- %s" - -#~ msgid "Codec" -#~ msgstr "編碼" - -#~ msgid "_Mute other applications during a call" -#~ msgstr "當有來電時靜音其它應用程序(c)" - -#~ msgid "SIP Port" -#~ msgstr "SIP端口" +#~ msgid "" +#~ "<b>Error: No audio codecs found.\n" +#~ "\n" +#~ "</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>." +#~ "sflphone</b> directory in your home( <i>%s</i> )" +#~ msgstr "" +#~ "<b>錯誤:無法找到音訊編碼檔案.\n" +#~ "\n" +#~ "</b> SFL聲音編碼檔案應該位于<i>%s</i> 或者位于主目錄( <i>%s</i> )的<b>." +#~ "sflphone</b>目錄下" -#~ msgid "Enable voicemail _notifications" -#~ msgstr "啟用語音郵箱提示(n)" +#~ msgid "%i account configured" +#~ msgid_plural "%i accounts configured" +#~ msgstr[0] "已配置了%i個賬戶" #~ msgid "Account creation wizard" #~ msgstr "帳戶創建向導" @@ -1189,8 +1214,8 @@ msgstr "從撥出電話中查詢" #~ "account." #~ msgstr "當您檢查完選定的設置,請點擊\"結束\"來創建帳戶" -#~ msgid "Default account" -#~ msgstr "默認帳戶" +#~ msgid "Codec" +#~ msgstr "編碼" #~ msgid "SFLphone KDE Client" #~ msgstr "SFLphone KDE客戶端" @@ -1375,6 +1400,9 @@ msgstr "從撥出電話中查詢" #~ msgid "On start" #~ msgstr "正在啟動" +#~ msgid "SIP Port" +#~ msgstr "SIP端口" + #~ msgid "Trigger on specific SIP header" #~ msgstr "激活指定的SIP頭" @@ -1390,15 +1418,24 @@ msgstr "從撥出電話中查詢" #~ msgid "Attention:number of results exceeds max displayed." #~ msgstr "注意:結果超過可顯示的最大值" +#~ msgid "IP call - %s" +#~ msgstr "IP電話- %s" + #~ msgid "_Account creation wizard" #~ msgstr "帳戶創建向導(A)" #~ msgid "_Enable this account" #~ msgstr "啟用該賬戶(E)" +#~ msgid "Enable voicemail _notifications" +#~ msgstr "啟用語音郵箱提示(n)" + #~ msgid "PulseAudio sound server" #~ msgstr "PulseAudio聲音伺服器" +#~ msgid "_Mute other applications during a call" +#~ msgstr "當有來電時靜音其它應用程序(c)" + #~ msgid "Port" #~ msgstr "端口" @@ -1697,10 +1734,12 @@ msgstr "從撥出電話中查詢" #~ msgstr "" #~ "Yun Liu, ,Launchpad Contributions:,Yun Liu, ,Launchpad Contributions:," #~ "Emmanuel Milou,Yun Liu, ,Launchpad Contributions:,Emmanuel Milou,Yun " -#~ "Liu, ,Launchpad Contributions:,Emmanuel Milou,Yun Liu" +#~ "Liu, ,Launchpad Contributions:,Emmanuel Milou,Yun Liu, ,Launchpad " +#~ "Contributions:,Emmanuel Milou,Yun Liu" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ "yunliu2000@gmail.com,,,,,,emmanuel.milou@savoirfairelinux.com,,,,emmanuel." -#~ "milou@savoirfairelinux.com,,,,emmanuel.milou@savoirfairelinux.com," +#~ "milou@savoirfairelinux.com,,,,emmanuel.milou@savoirfairelinux.com,,,," +#~ "emmanuel.milou@savoirfairelinux.com," diff --git a/lang/zh_TW/zh_TW.po b/lang/zh_TW/zh_TW.po index f7992fe2b8f76bbd50a4020b21be7c9adf76de4e..0e64a8ba796429f97236ee146e83a68516c78609 100644 --- a/lang/zh_TW/zh_TW.po +++ b/lang/zh_TW/zh_TW.po @@ -7,85 +7,96 @@ msgid "" msgstr "" "Project-Id-Version: sflphone\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-12-03 10:22-0500\n" -"PO-Revision-Date: 2009-10-26 20:46+0000\n" +"POT-Creation-Date: 2010-03-02 10:23-0500\n" +"PO-Revision-Date: 2009-12-03 18:12+0000\n" "Last-Translator: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>\n" "Language-Team: Traditional Chinese <zh_TW@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Launchpad-Export-Date: 2009-12-03 15:32+0000\n" +"X-Launchpad-Export-Date: 2010-03-01 23:16+0000\n" "X-Generator: Launchpad (build Unknown)\n" -#: ../sflphone-client-gnome/src/accountlist.c:175 +#: ../sflphone-client-gnome/src/accountlist.c:170 msgid "Registered" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:178 +#: ../sflphone-client-gnome/src/accountlist.c:173 msgid "Not Registered" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:181 +#: ../sflphone-client-gnome/src/accountlist.c:176 msgid "Trying..." msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:184 +#: ../sflphone-client-gnome/src/accountlist.c:179 #: ../sflphone-client-gnome/src/sflnotify.c:131 #: ../sflphone-client-gnome/src/sflnotify.c:148 msgid "Error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:187 +#: ../sflphone-client-gnome/src/accountlist.c:182 msgid "Authentication Failed" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:190 +#: ../sflphone-client-gnome/src/accountlist.c:185 msgid "Network unreachable" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:193 +#: ../sflphone-client-gnome/src/accountlist.c:188 msgid "Host unreachable" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:196 +#: ../sflphone-client-gnome/src/accountlist.c:191 msgid "Stun configuration error" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:199 +#: ../sflphone-client-gnome/src/accountlist.c:194 msgid "Stun server invalid" msgstr "" -#: ../sflphone-client-gnome/src/accountlist.c:202 +#: ../sflphone-client-gnome/src/accountlist.c:197 +msgid "Ready" +msgstr "" + +#: ../sflphone-client-gnome/src/accountlist.c:200 msgid "Invalid" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:98 +#: ../sflphone-client-gnome/src/actions.c:114 msgid "Using account" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:104 +#: ../sflphone-client-gnome/src/actions.c:121 msgid "No registered accounts" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:285 +#: ../sflphone-client-gnome/src/actions.c:306 msgid "" "Unable to connect to the SFLphone server.\n" "Make sure the daemon is running." msgstr "" -#: ../sflphone-client-gnome/src/actions.c:589 -#: ../sflphone-client-gnome/src/actions.c:911 +#: ../sflphone-client-gnome/src/actions.c:607 +#: ../sflphone-client-gnome/src/actions.c:931 msgid "Direct SIP call" msgstr "" -#: ../sflphone-client-gnome/src/actions.c:1103 -#, c-format -msgid "" -"<b>Error: No audio codecs found.\n" -"\n" -"</b> SFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</" -"b> directory in your home( <i>%s</i> )" +#: ../sflphone-client-gnome/src/callable_obj.c:379 +msgid "today at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:382 +msgid "yesterday at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:384 +msgid "%A at %R" +msgstr "" + +#: ../sflphone-client-gnome/src/callable_obj.c:388 +msgid "%x at %R" msgstr "" #: ../sflphone-client-gnome/src/errors.c:29 @@ -109,65 +120,65 @@ msgid "" "Pulseaudio is not running" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:73 +#: ../sflphone-client-gnome/src/mainwindow.c:94 msgid "There is one call in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:77 +#: ../sflphone-client-gnome/src/mainwindow.c:98 msgid "There are calls in progress." msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:86 +#: ../sflphone-client-gnome/src/mainwindow.c:103 msgid "Do you still want to quit?" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:298 +#: ../sflphone-client-gnome/src/mainwindow.c:331 msgid "SFLphone Error" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:392 +#: ../sflphone-client-gnome/src/mainwindow.c:450 #, c-format msgid "ZRTP is not supported by peer %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:393 +#: ../sflphone-client-gnome/src/mainwindow.c:452 msgid "Secure Communication Unavailable" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:394 -#: ../sflphone-client-gnome/src/mainwindow.c:416 +#: ../sflphone-client-gnome/src/mainwindow.c:454 +#: ../sflphone-client-gnome/src/mainwindow.c:484 msgid "Continue" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:395 -#: ../sflphone-client-gnome/src/mainwindow.c:417 -#: ../sflphone-client-gnome/src/mainwindow.c:431 +#: ../sflphone-client-gnome/src/mainwindow.c:455 +#: ../sflphone-client-gnome/src/mainwindow.c:485 +#: ../sflphone-client-gnome/src/mainwindow.c:506 msgid "Stop Call" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:414 +#: ../sflphone-client-gnome/src/mainwindow.c:480 #, c-format msgid "" "A %s error forced the call with %s to fall under unencrypted mode.\n" "Exact reason: %s\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:415 +#: ../sflphone-client-gnome/src/mainwindow.c:482 msgid "ZRTP negotiation failed" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:428 +#: ../sflphone-client-gnome/src/mainwindow.c:500 #, c-format msgid "" "%s wants to stop using secure communication. Confirm will resume " "conversation without SRTP.\n" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:429 +#: ../sflphone-client-gnome/src/mainwindow.c:502 msgid "Confirm Go Clear" msgstr "" -#: ../sflphone-client-gnome/src/mainwindow.c:430 +#: ../sflphone-client-gnome/src/mainwindow.c:504 msgid "Confirm" msgstr "" @@ -236,445 +247,459 @@ msgstr "" msgid "Mic volume" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:96 +#: ../sflphone-client-gnome/src/statusicon.c:128 msgid "_Show main window" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:131 +#: ../sflphone-client-gnome/src/statusicon.c:135 +#: ../sflphone-client-gnome/src/uimanager.c:805 +#: ../sflphone-client-gnome/src/uimanager.c:1119 +#: ../sflphone-client-gnome/src/uimanager.c:1161 +msgid "_Hang up" +msgstr "" + +#: ../sflphone-client-gnome/src/statusicon.c:187 msgid "SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/statusicon.c:132 +#: ../sflphone-client-gnome/src/statusicon.c:189 #, c-format -msgid "%i account configured" -msgid_plural "%i accounts configured" +msgid "%i active account" +msgid_plural "%i active accounts" msgstr[0] "" -msgstr[1] "" #: ../sflphone-client-gnome/src/toolbar.c:38 -#: ../sflphone-client-gnome/src/uimanager.c:693 -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:770 +#: ../sflphone-client-gnome/src/uimanager.c:814 msgid "Voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:117 +#: ../sflphone-client-gnome/src/uimanager.c:121 msgid "No address book selected" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:137 -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:144 +#: ../sflphone-client-gnome/src/uimanager.c:862 msgid "Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:279 +#: ../sflphone-client-gnome/src/uimanager.c:327 #, c-format msgid "Voicemail (%i)" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:342 +#: ../sflphone-client-gnome/src/uimanager.c:396 msgid "SFLphone is a VoIP client compatible with SIP and IAX2 protocols." msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:345 +#: ../sflphone-client-gnome/src/uimanager.c:398 msgid "About SFLphone" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:719 +#: ../sflphone-client-gnome/src/uimanager.c:800 msgid "Call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 -#: ../sflphone-client-gnome/src/uimanager.c:1184 +#: ../sflphone-client-gnome/src/uimanager.c:801 +#: ../sflphone-client-gnome/src/uimanager.c:1311 msgid "_New call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:720 +#: ../sflphone-client-gnome/src/uimanager.c:802 msgid "Place a new call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 -#: ../sflphone-client-gnome/src/uimanager.c:979 +#: ../sflphone-client-gnome/src/uimanager.c:803 +#: ../sflphone-client-gnome/src/uimanager.c:1107 msgid "_Pick up" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:721 +#: ../sflphone-client-gnome/src/uimanager.c:804 msgid "Answer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:722 -#: ../sflphone-client-gnome/src/uimanager.c:991 -#: ../sflphone-client-gnome/src/uimanager.c:1032 -msgid "_Hang up" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:722 +#: ../sflphone-client-gnome/src/uimanager.c:806 msgid "Finish the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:807 msgid "O_n hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:723 +#: ../sflphone-client-gnome/src/uimanager.c:808 msgid "Place the call on hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:809 msgid "O_ff hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:724 +#: ../sflphone-client-gnome/src/uimanager.c:810 msgid "Place the call off hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:725 -#: ../sflphone-client-gnome/src/uimanager.c:1015 -msgid "_Record" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:725 -msgid "Record the current conversation" -msgstr "" - -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:811 msgid "Configuration _Assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:726 +#: ../sflphone-client-gnome/src/uimanager.c:812 msgid "Run the configuration assistant" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:727 +#: ../sflphone-client-gnome/src/uimanager.c:815 msgid "Call your voicemail" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:816 msgid "_Close" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:728 +#: ../sflphone-client-gnome/src/uimanager.c:817 msgid "Minimize to system tray" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:818 msgid "_Quit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:729 +#: ../sflphone-client-gnome/src/uimanager.c:819 msgid "Quit the program" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:732 +#: ../sflphone-client-gnome/src/uimanager.c:822 msgid "_Edit" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:823 msgid "_Copy" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:733 +#: ../sflphone-client-gnome/src/uimanager.c:824 msgid "Copy the selection" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:825 msgid "_Paste" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:734 +#: ../sflphone-client-gnome/src/uimanager.c:826 msgid "Paste the clipboard" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:827 msgid "Clear _history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:735 +#: ../sflphone-client-gnome/src/uimanager.c:828 msgid "Clear the call history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "_Accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:736 +#: ../sflphone-client-gnome/src/uimanager.c:829 msgid "Edit your accounts" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:831 msgid "_Preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:737 +#: ../sflphone-client-gnome/src/uimanager.c:832 msgid "Change your preferences" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:740 +#: ../sflphone-client-gnome/src/uimanager.c:835 msgid "_View" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:743 +#: ../sflphone-client-gnome/src/uimanager.c:838 msgid "_Help" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:839 msgid "Contents" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:744 +#: ../sflphone-client-gnome/src/uimanager.c:840 msgid "Open the manual" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:745 +#: ../sflphone-client-gnome/src/uimanager.c:841 msgid "About this application" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:849 msgid "_Transfer" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:751 +#: ../sflphone-client-gnome/src/uimanager.c:850 msgid "Transfer the call" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:851 +#: ../sflphone-client-gnome/src/uimanager.c:1143 +msgid "_Record" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:852 +msgid "Record the current conversation" +msgstr "" + +#: ../sflphone-client-gnome/src/uimanager.c:853 msgid "_Show toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:752 +#: ../sflphone-client-gnome/src/uimanager.c:854 msgid "Show the toolbar" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:855 msgid "_Dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:753 +#: ../sflphone-client-gnome/src/uimanager.c:856 msgid "Show the dialpad" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:857 msgid "_Volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:754 +#: ../sflphone-client-gnome/src/uimanager.c:858 msgid "Show the volume controls" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:859 msgid "_History" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:755 +#: ../sflphone-client-gnome/src/uimanager.c:860 msgid "Calls history" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:756 +#: ../sflphone-client-gnome/src/uimanager.c:861 msgid "_Address book" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1003 -#: ../sflphone-client-gnome/src/uimanager.c:1044 +#: ../sflphone-client-gnome/src/uimanager.c:1131 +#: ../sflphone-client-gnome/src/uimanager.c:1173 msgid "On _Hold" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1107 +#: ../sflphone-client-gnome/src/uimanager.c:1234 msgid "_Call back" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1258 +#: ../sflphone-client-gnome/src/uimanager.c:1390 msgid "Edit phone number" msgstr "" -#: ../sflphone-client-gnome/src/uimanager.c:1269 +#: ../sflphone-client-gnome/src/uimanager.c:1402 msgid "Edit the phone number before making a call" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:180 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:241 msgid "Account Parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:189 -#: ../sflphone-client-gnome/src/config/assistant.c:314 -#: ../sflphone-client-gnome/src/config/assistant.c:427 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 +#: ../sflphone-client-gnome/src/config/assistant.c:315 +#: ../sflphone-client-gnome/src/config/assistant.c:428 msgid "_Alias" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:197 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:258 msgid "_Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:215 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:276 msgid "Unknown" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:225 -#: ../sflphone-client-gnome/src/config/assistant.c:322 -#: ../sflphone-client-gnome/src/config/assistant.c:435 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:286 +#: ../sflphone-client-gnome/src/config/assistant.c:323 +#: ../sflphone-client-gnome/src/config/assistant.c:436 msgid "_Host name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:233 -#: ../sflphone-client-gnome/src/config/assistant.c:330 -#: ../sflphone-client-gnome/src/config/assistant.c:443 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:294 +#: ../sflphone-client-gnome/src/config/assistant.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:444 msgid "_User name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:250 -#: ../sflphone-client-gnome/src/config/assistant.c:346 -#: ../sflphone-client-gnome/src/config/assistant.c:458 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:311 +#: ../sflphone-client-gnome/src/config/assistant.c:347 +#: ../sflphone-client-gnome/src/config/assistant.c:459 msgid "_Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:270 -#: ../sflphone-client-gnome/src/config/assistant.c:363 -#: ../sflphone-client-gnome/src/config/assistant.c:473 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:331 +#: ../sflphone-client-gnome/src/config/assistant.c:364 +#: ../sflphone-client-gnome/src/config/assistant.c:474 msgid "Show password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:274 -#: ../sflphone-client-gnome/src/config/assistant.c:368 -#: ../sflphone-client-gnome/src/config/assistant.c:478 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:335 +#: ../sflphone-client-gnome/src/config/assistant.c:369 +#: ../sflphone-client-gnome/src/config/assistant.c:479 msgid "_Voicemail number" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:361 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:343 +msgid "_User-agent" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:431 msgid "Authentication" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:362 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:432 msgid "Secret" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:605 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:686 msgid "Credential" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:640 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:720 msgid "Authentication name" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:651 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:731 msgid "Password" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:674 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:321 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:790 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1187 msgid "Security" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:687 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:333 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:801 msgid "Use TLS transport (sips)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:693 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:338 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:807 msgid "SRTP key exchange" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:699 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:344 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:813 msgid "Disabled" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:795 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:888 msgid "Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:800 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:892 msgid "Registration expire" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:809 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:901 msgid "_Comply with RFC 3263" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:816 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:234 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:920 msgid "Network Interface" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:830 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:249 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:933 msgid "Local address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:880 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:301 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1000 msgid "Local port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:893 -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:928 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1037 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1068 msgid "Published address" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:899 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1041 msgid "Using STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:906 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1048 msgid "STUN server URL" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:914 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1056 msgid "Same as local parameters" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:917 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1059 msgid "Set published address and port:" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:936 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1077 msgid "Published port" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1027 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1144 msgid "Account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1046 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1166 msgid "Basic" msgstr "" -#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1051 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1174 +#: ../sflphone-client-gnome/src/config/audioconf.c:913 +msgid "Codecs" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1182 msgid "Advanced" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:164 +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1195 +msgid "Network" +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountconfigdialog.c:1360 +msgid "" +"This profile is used when you want to reach a remote peer simply by typing a " +"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " +"also be used if no account can be matched to an incoming or outgoing call." +msgstr "" + +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:131 #, c-format msgid "Server returned \"%s\" (%d)" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:389 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:421 msgid "Protocol" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:396 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:429 msgid "Status" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:474 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:511 msgid "Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:484 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:521 msgid "Configured Accounts" msgstr "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:501 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:538 #, c-format msgid "There is %d active account" msgid_plural "There are %d active accounts" msgstr[0] "" +msgstr[1] "" -#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:507 +#: ../sflphone-client-gnome/src/config/accountlistconfigdialog.c:544 msgid "You have no active account" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:306 -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:556 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:291 msgid "General" msgstr "" @@ -719,7 +744,7 @@ msgid "Select which Evolution address books to use" msgstr "" #: ../sflphone-client-gnome/src/config/addressbook-config.c:404 -#: ../sflphone-client-gnome/src/config/audioconf.c:577 +#: ../sflphone-client-gnome/src/config/audioconf.c:595 msgid "Name" msgstr "" @@ -758,181 +783,177 @@ msgstr "" msgid "None" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:229 +#: ../sflphone-client-gnome/src/config/assistant.c:230 msgid "SFLphone account creation wizard" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:255 +#: ../sflphone-client-gnome/src/config/assistant.c:256 msgid "Welcome to the Account creation wizard of SFLphone!" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:256 +#: ../sflphone-client-gnome/src/config/assistant.c:257 msgid "This installation wizard will help you configure an account." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "VoIP Protocols" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:270 +#: ../sflphone-client-gnome/src/config/assistant.c:271 msgid "Select an account type" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:272 +#: ../sflphone-client-gnome/src/config/assistant.c:273 msgid "SIP (Session Initiation Protocol)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:274 +#: ../sflphone-client-gnome/src/config/assistant.c:275 msgid "IAX2 (InterAsterix Exchange)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:288 +#: ../sflphone-client-gnome/src/config/assistant.c:289 msgid "Please select one of the following options" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:290 +#: ../sflphone-client-gnome/src/config/assistant.c:291 msgid "Create a free SIP/IAX2 account on sflphone.org" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:292 +#: ../sflphone-client-gnome/src/config/assistant.c:293 msgid "Register an existing SIP or IAX2 account" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 +#: ../sflphone-client-gnome/src/config/assistant.c:307 msgid "SIP account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:306 -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:307 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "Please fill the following information" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:376 -#: ../sflphone-client-gnome/src/config/assistant.c:405 +#: ../sflphone-client-gnome/src/config/assistant.c:377 +#: ../sflphone-client-gnome/src/config/assistant.c:406 msgid "Secure communications with _ZRTP" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "Optional email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:389 +#: ../sflphone-client-gnome/src/config/assistant.c:390 msgid "This email address will be used to send your voicemail messages." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:397 +#: ../sflphone-client-gnome/src/config/assistant.c:398 msgid "_Email address" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:419 +#: ../sflphone-client-gnome/src/config/assistant.c:420 msgid "IAX2 account settings" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "Network Address Translation (NAT)" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:496 +#: ../sflphone-client-gnome/src/config/assistant.c:497 msgid "You should probably enable this if you are behind a firewall." msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:505 +#: ../sflphone-client-gnome/src/config/assistant.c:506 msgid "E_nable STUN" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:512 +#: ../sflphone-client-gnome/src/config/assistant.c:513 msgid "_STUN server" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Account Registration" msgstr "" -#: ../sflphone-client-gnome/src/config/assistant.c:526 +#: ../sflphone-client-gnome/src/config/assistant.c:527 msgid "Congratulations!" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:582 +#: ../sflphone-client-gnome/src/config/audioconf.c:600 msgid "Frequency" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:587 +#: ../sflphone-client-gnome/src/config/audioconf.c:605 msgid "Bitrate" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:592 +#: ../sflphone-client-gnome/src/config/audioconf.c:610 msgid "Bandwidth" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:670 +#: ../sflphone-client-gnome/src/config/audioconf.c:688 msgid "ALSA plugin" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:692 +#: ../sflphone-client-gnome/src/config/audioconf.c:710 msgid "Output" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:714 +#: ../sflphone-client-gnome/src/config/audioconf.c:732 msgid "Input" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:749 +#: ../sflphone-client-gnome/src/config/audioconf.c:767 msgid "_Voice Activity Detection" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:759 +#: ../sflphone-client-gnome/src/config/audioconf.c:777 msgid "_Noise Reduction (Narrow-Band Companding)" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:800 +#: ../sflphone-client-gnome/src/config/audioconf.c:813 msgid "Sound Manager" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:809 +#: ../sflphone-client-gnome/src/config/audioconf.c:822 msgid "_Pulseaudio" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:813 +#: ../sflphone-client-gnome/src/config/audioconf.c:826 msgid "_ALSA" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:819 +#: ../sflphone-client-gnome/src/config/audioconf.c:832 msgid "ALSA settings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:836 -msgid "Codecs" -msgstr "" - -#: ../sflphone-client-gnome/src/config/audioconf.c:865 +#: ../sflphone-client-gnome/src/config/audioconf.c:853 msgid "Recordings" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:869 +#: ../sflphone-client-gnome/src/config/audioconf.c:857 msgid "Destination folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:873 +#: ../sflphone-client-gnome/src/config/audioconf.c:861 msgid "Select a folder" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:879 +#: ../sflphone-client-gnome/src/config/audioconf.c:867 msgid "Ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:885 +#: ../sflphone-client-gnome/src/config/audioconf.c:873 msgid "_Enable ringtones" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:891 +#: ../sflphone-client-gnome/src/config/audioconf.c:879 msgid "Choose a ringtone" msgstr "" -#: ../sflphone-client-gnome/src/config/audioconf.c:897 +#: ../sflphone-client-gnome/src/config/audioconf.c:885 msgid "Audio Files" msgstr "" @@ -969,69 +990,62 @@ msgstr "" msgid "_Prefix dialed numbers with" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:225 -msgid "" -"This profile is used when you want to reach a remote peer simply by typing a " -"sip URI such as <b>sip:remotepeer</b>. The settings you define here will " -"also be used if no account can be matched to an incoming or outgoing call." -msgstr "" - -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:440 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:146 msgid "Desktop Notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:444 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:151 msgid "_Enable notifications" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:450 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:158 msgid "System Tray Icon" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:453 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:168 +msgid "Show SFLphone in the system tray" +msgstr "" + +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:175 msgid "_Popup main window on incoming call" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:457 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:181 msgid "Ne_ver popup main window" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:463 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:191 msgid "Hide SFLphone window on _startup" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:469 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:205 msgid "Calls History" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:472 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:209 msgid "_Keep my history for at least" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:483 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:224 msgid "days" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:536 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:270 msgid "Preferences" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:561 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:297 msgid "Audio" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:566 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:303 msgid "Address Book" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:571 +#: ../sflphone-client-gnome/src/config/preferencesdialog.c:309 msgid "Hooks" msgstr "" -#: ../sflphone-client-gnome/src/config/preferencesdialog.c:581 -msgid "Direct IP calls" -msgstr "" - #: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:38 msgid "Advanced options for TLS" msgstr "" @@ -1049,55 +1063,59 @@ msgid "" "port, different one from each other\n" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:103 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +msgid "Global TLS listener (all accounts)" +msgstr "" + +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:122 msgid "Certificate of Authority list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:107 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:126 msgid "Choose a CA list file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:131 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:147 msgid "Public endpoint certificate file" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:135 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:151 msgid "Choose a public endpoint certificate (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:159 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:174 msgid "Choose a private key file (optional)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:181 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:195 msgid "Password for the private key" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:204 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:218 msgid "TLS protocol method" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:238 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:252 msgid "TLS cipher list" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:247 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:261 msgid "Server name instance for outgoing TLS connection" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:255 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:269 msgid "Negotiation timeout (sec:msec)" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:272 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:286 msgid "Verify incoming certificates, as a server" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:278 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:292 msgid "Verify certificates from answer, as a client" msgstr "" -#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:284 +#: ../sflphone-client-gnome/src/config/tlsadvanceddialog.c:298 msgid "Require certificate for incoming tls connections" msgstr "" @@ -1121,6 +1139,14 @@ msgstr "" msgid "Display SAS once for hold events" msgstr "" +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:131 +msgid "SDES Options" +msgstr "" + +#: ../sflphone-client-gnome/src/config/zrtpadvanceddialog.c:156 +msgid "Fallback on RTP on SDES failure" +msgstr "" + #: ../sflphone-client-gnome/src/contacts/searchbar.c:58 msgid "Search all" msgstr "" @@ -1149,10 +1175,11 @@ msgstr "" #~ msgstr "" #~ ",Launchpad Contributions:, ,Launchpad Contributions:,Emmanuel Milou, ," #~ "Launchpad Contributions:,Emmanuel Milou, ,Launchpad Contributions:," -#~ "Emmanuel Milou" +#~ "Emmanuel Milou, ,Launchpad Contributions:,Emmanuel Milou" #~ msgctxt "EMAIL OF TRANSLATORS" #~ msgid "Your emails" #~ msgstr "" #~ ",,,,emmanuel.milou@savoirfairelinux.com,,,emmanuel.milou@savoirfairelinux." -#~ "com,,,emmanuel.milou@savoirfairelinux.com" +#~ "com,,,emmanuel.milou@savoirfairelinux.com,,,emmanuel." +#~ "milou@savoirfairelinux.com" diff --git a/sflphone-client-gnome/.cproject b/sflphone-client-gnome/.cproject index c737a8d2a3d901d4d129b40dec43c82fb7d29ac2..4bd6c53fcc49d613f82568415578133ef6365f2e 100644 --- a/sflphone-client-gnome/.cproject +++ b/sflphone-client-gnome/.cproject @@ -4,7 +4,7 @@ <cproject> <storageModule moduleId="org.eclipse.cdt.core.settings"> <cconfiguration id="cdt.managedbuild.toolchain.gnu.base.666814495"> -<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.666814495" moduleId="org.eclipse.cdt.core.settings" name="Linux GCC"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.666814495" moduleId="org.eclipse.cdt.core.settings" name="Release"> <externalSettings/> <extensions> <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> @@ -15,20 +15,21 @@ </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> -<configuration artifactName="sflphone-gtk" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.666814495" name="Linux GCC" parent="org.eclipse.cdt.build.core.emptycfg"> +<configuration artifactName="sflphone-gtk" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.666814495" name="Release" parent="org.eclipse.cdt.build.core.emptycfg"> <folderInfo id="cdt.managedbuild.toolchain.gnu.base.666814495.1839755914" name="/" resourcePath=""> <toolChain id="cdt.managedbuild.toolchain.gnu.base.1195789621" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base"> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1493285969" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/> -<builder id="cdt.managedbuild.target.gnu.builder.base.421214348" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/> +<builder id="cdt.managedbuild.target.gnu.builder.base.421214348" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="-1" superClass="cdt.managedbuild.target.gnu.builder.base"/> <tool id="cdt.managedbuild.tool.gnu.archiver.base.1558364998" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.731757910" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"/> <tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1299938473" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base"> <option id="gnu.c.compiler.option.include.paths.1303328171" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> -<listOptionValue builtIn="false" value=""${workspace_loc:/sflphone-gtk}""/> -<listOptionValue builtIn="false" value=""${workspace_loc:/sflphone-gtk/src}""/> <listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/> <listOptionValue builtIn="false" value="/usr/include/glib-2.0"/> <listOptionValue builtIn="false" value="/usr/include/dbus-1.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnome-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnomeui-2.0"/> +<listOptionValue builtIn="false" value="/usr/include"/> </option> <option id="gnu.c.compiler.option.preprocessor.def.symbols.1676995808" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols"> <listOptionValue builtIn="false" value=""ICONS_DIR="/usr/share/sflphone\""/> @@ -38,6 +39,14 @@ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1938301835" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.linker.base.981882139" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"> +<option id="gnu.c.link.option.paths.137448498" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"> +<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/dbus-1.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnome-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnomeui-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnome-2.0/libgnome"/> +</option> <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1274984809" superClass="cdt.managedbuild.tool.gnu.c.linker.input"> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> <additionalInput kind="additionalinput" paths="$(LIBS)"/> @@ -57,6 +66,7 @@ <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> <storageModule moduleId="scannerConfiguration"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> @@ -139,6 +149,393 @@ <parser enabled="true"/> </scannerInfoProvider> </profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1995189473;cdt.managedbuild.config.gnu.exe.debug.1995189473.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.44474984;cdt.managedbuild.tool.gnu.c.compiler.input.1565605211"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.666814495;cdt.managedbuild.toolchain.gnu.base.666814495.1839755914;cdt.managedbuild.tool.gnu.c.compiler.base.1299938473;cdt.managedbuild.tool.gnu.c.compiler.input.1938301835"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +</cconfiguration> +<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1995189473"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1995189473" moduleId="org.eclipse.cdt.core.settings" name="Debug"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="sflphone-client-gnome" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1995189473" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug"> +<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1995189473." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1423428378" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.285066138" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/> +<builder id="cdt.managedbuild.target.gnu.builder.exe.debug.100968868" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="-1" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/> +<tool id="cdt.managedbuild.tool.gnu.archiver.base.417731669" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.187669799" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug"> +<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1648950260" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> +<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.1642920658" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.44474984" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug"> +<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.228151721" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.exe.debug.option.debugging.level.676359726" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> +<option id="gnu.c.compiler.option.include.paths.1167204962" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> +<listOptionValue builtIn="false" value="/usr/include"/> +<listOptionValue builtIn="false" value="/usr/include/glib-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/gtk-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/dbus-1.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnome-2.0"/> +<listOptionValue builtIn="false" value="/usr/include/libgnomeui-2.0"/> +</option> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1565605211" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1289604635" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"> +<option id="gnu.c.link.option.paths.1262921055" name="Library search path (-L)" superClass="gnu.c.link.option.paths"/> +<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.861769146" superClass="cdt.managedbuild.tool.gnu.c.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.172868928" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug"/> +<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.210816158" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1667826927" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +</toolChain> +</folderInfo> +</configuration> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1995189473;cdt.managedbuild.config.gnu.exe.debug.1995189473.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.44474984;cdt.managedbuild.tool.gnu.c.compiler.input.1565605211"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> <scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.666814495;cdt.managedbuild.toolchain.gnu.base.666814495.1839755914;cdt.managedbuild.tool.gnu.c.compiler.base.1299938473;cdt.managedbuild.tool.gnu.c.compiler.input.1938301835"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> diff --git a/sflphone-client-gnome/.project b/sflphone-client-gnome/.project index 8c74f4d116d9937d808985d8e6ff97bef8780536..10b183e3bf7491cfcc954b90245cc5252a4fe068 100644 --- a/sflphone-client-gnome/.project +++ b/sflphone-client-gnome/.project @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>sflphone-gtk</name> + <name>sflphone-client-gnome</name> <comment></comment> <projects> </projects> @@ -23,7 +23,7 @@ </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.buildArguments</key> - <value></value> + <value>-j</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.buildCommand</key> diff --git a/sflphone-client-gnome/.settings/org.eclipse.cdt.core.prefs b/sflphone-client-gnome/.settings/org.eclipse.cdt.core.prefs index 923efa5204c06e39c83cd785e6f39b9cc7741f51..ed89bea14460d0c3a260f4b65a05db93ab7ed0e5 100644 --- a/sflphone-client-gnome/.settings/org.eclipse.cdt.core.prefs +++ b/sflphone-client-gnome/.settings/org.eclipse.cdt.core.prefs @@ -1,4 +1,4 @@ -#Thu Mar 26 14:05:05 EDT 2009 +#Fri Feb 26 15:32:40 EST 2010 eclipse.preferences.version=1 org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80 @@ -67,6 +67,7 @@ org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initial org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert @@ -87,6 +88,7 @@ org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initia org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert @@ -119,10 +121,11 @@ org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=inser org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=insert +org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert @@ -134,6 +137,7 @@ org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not inser org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert +org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false diff --git a/sflphone-client-gnome/.settings/org.eclipse.cdt.ui.prefs b/sflphone-client-gnome/.settings/org.eclipse.cdt.ui.prefs index 9281ecd41f6b758197d07f8869691d0953314ea4..c3a02722d10ec788e674fbee2750915052b6a0d7 100644 --- a/sflphone-client-gnome/.settings/org.eclipse.cdt.ui.prefs +++ b/sflphone-client-gnome/.settings/org.eclipse.cdt.ui.prefs @@ -1,4 +1,4 @@ -#Thu Mar 26 14:05:05 EDT 2009 +#Fri Feb 26 15:30:12 EST 2010 eclipse.preferences.version=1 -formatter_profile=org.eclipse.cdt.ui.default.gnu_profile +formatter_profile=_GNU - SFLphone formatter_settings_version=1 diff --git a/sflphone-client-gnome/README b/sflphone-client-gnome/README index 368bd98433516b06b421fa39da13845fdf35adf7..cdba125509b00f4bd810ac78564c5a8bc6606088 100644 --- a/sflphone-client-gnome/README +++ b/sflphone-client-gnome/README @@ -1,5 +1,5 @@ Welcome to SFLphone! -Refer to the development site for further information: http://dev.savoirfairelinux.net/sflphone +Refer to the development site for further information: https://projects.savoirfairelinux.com/projects/show/sflphone Thank you diff --git a/sflphone-client-gnome/VERSION b/sflphone-client-gnome/VERSION index 06fa200552505d51e9a42251eb6ed4432c78ce90..53cdfba097a32837dc5677c91e725e0471b96d61 100644 --- a/sflphone-client-gnome/VERSION +++ b/sflphone-client-gnome/VERSION @@ -1 +1 @@ -0.9.7~beta +0.9.8~beta diff --git a/sflphone-client-gnome/configure.ac b/sflphone-client-gnome/configure.ac index f64a87384a524a50853ace3014dbbdf71104275d..0fbddbfe684d75eb206c7c84d24c8307204ddb0e 100644 --- a/sflphone-client-gnome/configure.ac +++ b/sflphone-client-gnome/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([SFLphone],[0.9.7~beta],[sflphoneteam@savoirfairelinux.com],[sflphone-client-gnome]) +AC_INIT([SFLphone],[0.9.8~beta],[sflphoneteam@savoirfairelinux.com],[sflphone-client-gnome]) AM_CONFIG_HEADER(config.h) LT_INIT diff --git a/sflphone-client-gnome/doc/C/sflphone.xml b/sflphone-client-gnome/doc/C/sflphone.xml index 64861bea86727339f40c9243d92b5e718a580399..050baa8da344e9fb1b3936d9a4c4731d79d80b03 100644 --- a/sflphone-client-gnome/doc/C/sflphone.xml +++ b/sflphone-client-gnome/doc/C/sflphone.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ <!ENTITY app "SFLphone"> - <!ENTITY appversion "0.9.7"> + <!ENTITY appversion "0.9.8~beta"> <!ENTITY docversion "1.0"> ]> @@ -17,6 +17,7 @@ <year>2007</year> <year>2008</year> <year>2009</year> + <year>2010</year> <holder>Savoir-faire Linux</holder> </copyright> @@ -73,6 +74,16 @@ </authorgroup> <revhistory> + <revision> + <revnumber>SFLphone Manual v1.0.1</revnumber> + <date>March 2010</date> + <revdescription> + <para role="author">SFLphone team</para> + <para role="publisher">Savoir-faire Linux</para> + <para>Minor changes</para> + </revdescription> + </revision> + <revision> <revnumber>SFLphone Manual v1.0</revnumber> <date>September 2009</date> @@ -239,7 +250,7 @@ <title>Registration</title> <para>You may set the expires header for a contact.</para> <para>It basically represents the duration your registration will remain active. If you don't register again within that time, calls will no longer be routed to you. It should not be used as a keepalive mechanism though. The default value is 600 seconds (ten minutes).</para> - <note>Some VoIP services requires that you set this value at at least 1600 seconds (e.g. the French VoIP server freephonie.net). + <note><para>Some VoIP services requires that you set this value at at least 1600 seconds (e.g. the French VoIP server freephonie.net).</para> </note> </sect3> <sect3 id="accounts_stun"> @@ -258,11 +269,11 @@ <term><guilabel>Set published address and port</guilabel></term> <listitem> <itemizedlist> - <listitem>Using STUN + <listitem><para>Using STUN</para> <para>If enabled, the core will try to initialize an UDP transport on the mapped address/port number that the NAT (Network Address Translator) has allocated to <application>SFLphone</application>.</para></listitem> - <listitem>Same as local parameters + <listitem><para>Same as local parameters</para> </listitem> - <listitem>Manually + <listitem><para>Manually</para> </listitem> </itemizedlist> </listitem> @@ -304,7 +315,7 @@ <para>The following features are available with both SIP and IAX2 accounts.</para> - <sect2 label="Dialing a number"> + <sect2><title>Dialing a number</title> <!-- ==== Figure ==== --> <figure id="dial-fig"> <title>Dial button</title> @@ -333,11 +344,11 @@ </figure> <!-- ==== End of Figure ==== --> - <para>Keyboard shortcut to perform this action: <accel>NUMPAD</accel> or almost any keys.</para> + <para>Keyboard shortcut to perform this action: <guimenuitem><accel>NUMPAD</accel></guimenuitem> or almost any keys.</para> </sect2> - <sect2 label="Calling a number"> + <sect2><title>Calling a number</title> <!-- ==== Figure ==== --> <figure id="call-fig"> @@ -352,11 +363,11 @@ </figure> <!-- ==== End of Figure ==== --> - <para>Keyboard shortcut to perform this action: <accel>Enter</accel>.</para> + <para>Keyboard shortcut to perform this action: <guimenuitem><accel>Enter</accel></guimenuitem>.</para> </sect2> - <sect2 label="Answering a call"> + <sect2><title>Answering a call</title> <!-- ==== Figure ==== --> <figure id="answer-fig"> <title>Answer button</title> @@ -370,10 +381,10 @@ </figure> <!-- ==== End of Figure ==== --> - <para>Keyboard shortcut to perform this action: <accel>Enter</accel>.</para> + <para>Keyboard shortcut to perform this action: <guimenuitem><accel>Enter</accel></guimenuitem>.</para> </sect2> - <sect2 label="Hanging up a call"> + <sect2><title>Hanging up a call</title> <!-- ==== Figure ==== --> <figure id="hangup-fig"> <title>Hangup button</title> @@ -387,10 +398,10 @@ </figure> <!-- ==== End of Figure ==== --> - <para>Keyboard shortcut to perform this action: <accel>ESC</accel>.</para> + <para>Keyboard shortcut to perform this action: <guimenuitem><accel>ESC</accel></guimenuitem>.</para> </sect2> - <sect2 label="Refusing a call"> + <sect2><title>Refusing a call</title> <para>When you refuse a call, your caller is automatically redirected to your voicemail box, if applicable.</para> @@ -407,11 +418,11 @@ </figure> <!-- ==== End of Figure ==== --> - <para>Keyboard shortcut to perform this action: <accel>ESC</accel>.</para> + <para>Keyboard shortcut to perform this action: <guimenuitem><accel>ESC</accel></guimenuitem>.</para> </sect2> - <sect2 label="Holding on/off a call"> + <sect2><title>Holding on/off a call</title> <!-- ==== Figure ==== --> <figure id="holdon-fig"> <title>Hold on button</title> @@ -438,7 +449,7 @@ <!-- ==== End of Figure ==== --> </sect2> - <sect2 label="Transfering a call"> + <sect2><title>Transfering a call</title> <!-- ==== Figure ==== --> <figure id="transfer-fig"> <title>Transfer button</title> @@ -466,11 +477,11 @@ </figure> <!-- ==== End of Figure ==== --> - <para>And press <accel>Enter</accel>. Clicking again on the transfer button cancels the transfer.</para> + <para>And press <guimenuitem><accel>Enter</accel></guimenuitem>. Clicking again on the transfer button cancels the transfer.</para> </sect2> - <sect2 label="Record a call"> + <sect2><title>Record a call</title> <para>Go to <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem> <guimenuitem>Audio</guimenuitem></menuchoice> to configure the recordings destination folder.</para> @@ -501,9 +512,9 @@ <!-- ==== End of Figure ==== --> </sect2> - <sect2 label="Voicemail quick dial"> + <sect2><title>Voicemail quick dial</title> - <caution>This feature is available only if you fill out the voicemail number information for your default account.</caution> + <caution><para>This feature is available only if you fill out the voicemail number information for your default account.</para></caution> <!-- ==== Figure ==== --> <figure id="voicemail-fig"> @@ -520,7 +531,7 @@ </sect2> - <sect2 id="directip" label="Direct IP calls"> + <sect2 id="directip"><title>Direct IP calls</title> <para>A direct IP call is a call established between two peers without any accounts. When dialing, such a call must prefixed with <guilabel>sip:</guilabel>.</para> <para>Direct IP calls use SIP protocol to establish communication and RTP to transport data. It is right now not available with IAX2.</para> @@ -528,14 +539,14 @@ <para>Go to <menuchoice><guimenu>Edit</guimenu><guimenuitem>Preferences</guimenuitem> <guimenuitem>Direct IP calls</guimenuitem></menuchoice> to configure the advanced security features for this kind of calls.</para> </sect2> - <sect2 id="conferencecall" label="Conference calls"> + <sect2 id="conferencecall"><title>Conference calls</title> <para>SFLphone now supports conference call hosting integrating server like features in a simple GUI. </para> <para> <itemizedlist> <listitem> - <guilabel>Create a conference</guilabel> + <para><guilabel>Create a conference</guilabel></para> <para>To host a conference, simply drag and drop one call on another. Additional participants are added the same way, dragging a call on the @@ -567,7 +578,7 @@ <!-- ==== End of Figure ==== --> </listitem> <listitem> - <guilabel>Leave a conference</guilabel> + <para><guilabel>Leave a conference</guilabel></para> <para> SFLphone conference model let you leave a conference that you are currently hosting to answer any other incoming @@ -601,7 +612,7 @@ <!-- ==== End of Figure ==== --> </listitem> <listitem> - <guilabel>Multiple conference</guilabel> + <para><guilabel>Multiple conference</guilabel></para> <para> SFLphone supports multiple conferences running simultaneously. Two conferences can be joined the same way @@ -610,7 +621,7 @@ </para> </listitem> <listitem> - <guilabel>Hangup/Hold a conference</guilabel> + <para><guilabel>Hangup/Hold a conference</guilabel></para> <para> Select the conference icon and press hangup/hold button on the toolbar. The selected action is applied on every @@ -720,10 +731,11 @@ </varlistentry> </variablelist> </sect3> - </sect2> - <sect2 id="accounts_tls"> + </sect2> + <sect2 id="accounts_tls"> <title>TLS</title> - </sect2> + <para>TODO</para> + </sect2> </sect1> @@ -734,12 +746,12 @@ ALSA and PulseAudio native interfaces are available. </para> - <sect2 label="Pulseaudio"> + <sect2><title>Pulseaudio</title> <para> </para> </sect2> - <sect2 label="ALSA"> + <sect2><title>ALSA</title> <para> </para> </sect2> @@ -751,27 +763,27 @@ <para> <itemizedlist> <listitem> - <guilabel>PCMU/PCMA</guilabel> + <para><guilabel>PCMU/PCMA</guilabel></para> <para> ITU-T telephony standard PCM formats, 8kHz, 64 kbit/s, using logarithmic byte compression algorithm. </para> </listitem> <listitem> - <guilabel>GSM</guilabel> + <para><guilabel>GSM</guilabel></para> <para> Global System for Mobile communications (GSM) narrowband 8kHz standard based on linear prediction encoding. </para> </listitem> <listitem> - <guilabel>G722</guilabel> + <para><guilabel>G722</guilabel></para> <para> ITU-T standard wideband 16kHz standard based on linear prediction. </para> </listitem> <listitem> - <guilabel>SPEEX</guilabel> + <para><guilabel>SPEEX</guilabel></para> <para> High quality voice encoding/decoding available in narrowband 8kHz, wideband 16kHz (HD Voice), @@ -781,7 +793,7 @@ </para> </listitem> <listitem> - <guilabel>CELT</guilabel> + <para><guilabel>CELT</guilabel></para> <para> </para> @@ -827,9 +839,9 @@ <listitem><para> You may use one or all of these following information from your contact.</para> <itemizedlist> - <listitem>Work phone number</listitem> - <listitem>Home phone number</listitem> - <listitem>Mobile phone number</listitem> + <listitem><para>Work phone number</para></listitem> + <listitem><para>Home phone number</para></listitem> + <listitem><para>Mobile phone number</para></listitem> </itemizedlist> </listitem> </varlistentry> @@ -876,7 +888,7 @@ <sect2> <title>General</title> <para>This section provides the user general settings regarding the application.</para> - <sect3 label="Desktop Notifications"> + <sect3><title>Desktop Notifications</title> <!-- ==== Figure ==== --> <figure id="desktop-notif-settings-fig"> <title>Desktop notifications options</title> @@ -931,7 +943,7 @@ </variablelist> </sect3> - <sect3 label="System Tray Icon"> + <sect3><title>System Tray Icon</title> <!-- ==== Figure ==== --> <figure id="systemtray-settings-fig"> <title>System tray options</title> @@ -971,7 +983,7 @@ </sect3> - <sect3 label="Calls history"> + <sect3><title>Calls history</title> <!-- ==== Figure ==== --> <figure id="callshistory-settings-fig"> <title>Calls history options</title> @@ -995,7 +1007,7 @@ </variablelist> </sect3> - <sect3 label="Configuration File"> + <sect3><title>Configuration File</title> <!-- ==== Figure ==== --> <figure id="configfile-settings-fig"> <title>Configuration file options</title> @@ -1024,6 +1036,7 @@ <sect2> <title>Audio</title> + <para>TODO</para> </sect2> <sect2> @@ -1034,10 +1047,12 @@ <sect2> <title>Hooks</title> + <para>TODO</para> </sect2> <sect2> <title>Network</title> + <para>TODO</para> </sect2> <sect2> diff --git a/sflphone-client-gnome/man/sflphone-client-gnome.pod b/sflphone-client-gnome/man/sflphone-client-gnome.pod index eb27a15f4cd3de4aeef42e8dbe9a571bd7e4e2c8..471c8b7c93f4bf8ca1467c13611ce3090d53f98e 100644 --- a/sflphone-client-gnome/man/sflphone-client-gnome.pod +++ b/sflphone-client-gnome/man/sflphone-client-gnome.pod @@ -14,11 +14,11 @@ B<sflphone-client-gnome> is a GTK+ client for SFLphone; it communicates with the =head1 BUGS -Please report bugs at http://dev.savoirfairelinux.net/sflphone/newticket. +Please report bugs at https://projects.savoirfairelinux.com/projects/sflphone/issues/new. =head1 AUTHORS -B<sflphone-client-gnome> is developed in Montreal by Savoir-Faire Linux Inc. The active developers are Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> and Yun Liu <yun.liu@savoirfairelinux.com>. +B<sflphone-client-gnome> is developed in Montreal by Savoir-Faire Linux Inc. This manual page was written by Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>. diff --git a/sflphone-client-gnome/sflphone.desktop.in b/sflphone-client-gnome/sflphone.desktop.in index 606bc1f53a0a35faa3fd3d17ae2e0b449f3fb306..05f5b087f8f1a14bd7b7b36a275a784241bea3e2 100644 --- a/sflphone-client-gnome/sflphone.desktop.in +++ b/sflphone-client-gnome/sflphone.desktop.in @@ -1,10 +1,11 @@ [Desktop Entry] -Name=VoIP Client SFLphone -GenericName=Telephone +Name=SFLphone +GenericName=VoIP Client +X-GNOME-FullName=SFLphone VoIP Client Comment=Call and receive calls with SIP or IAX protocols Exec=sflphone-client-gnome Icon=sflphone.svg StartupNotify=true Terminal=false Type=Application -Categories=Network;Telephony; +Categories=Network;Gnome;Telephony; diff --git a/sflphone-client-gnome/src/Makefile.am b/sflphone-client-gnome/src/Makefile.am index 1f2eb25028fb0feb0338cbd606698395e788fb82..30e2a818e627c7026da2018fa058ffb532345f00 100644 --- a/sflphone-client-gnome/src/Makefile.am +++ b/sflphone-client-gnome/src/Makefile.am @@ -24,11 +24,13 @@ sflphone_client_gnome_SOURCES = \ sliders.c \ statusicon.c \ codeclist.c \ - reqaccount.c + reqaccount.c \ + shortcuts.c noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ reqaccount.h errors.h sflphone_const.h uimanager.h \ - accountlist.h sliders.h statusicon.h callable_obj.h conference_obj.h + accountlist.h sliders.h statusicon.h callable_obj.h conference_obj.h \ + shortcuts.h sflphone_client_gnome_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(LIBSEXY_LIBS) $(LOG4C) diff --git a/sflphone-client-gnome/src/accountlist.c b/sflphone-client-gnome/src/accountlist.c index 6a7e9d7a16329138751b139ba1ce7aaa8b6e270e..d02e23c5feb91879a430ff6ec20d4df3e41acaad 100644 --- a/sflphone-client-gnome/src/accountlist.c +++ b/sflphone-client-gnome/src/accountlist.c @@ -25,87 +25,84 @@ GQueue * accountQueue; /* GCompareFunc to compare a accountID (gchar* and a account_t) */ -gint -is_accountID_struct ( gconstpointer a, gconstpointer b) -{ - account_t * c = (account_t*)a; - if(strcmp(c->accountID, (gchar*) b) == 0) - { - return 0; - } - else - { - return 1; - } +gint is_accountID_struct ( gconstpointer a, gconstpointer b) { + + account_t * c = (account_t*)a; + if(strcmp(c->accountID, (gchar*) b) == 0) + { + return 0; + } + else + { + return 1; + } } /* GCompareFunc to get current call (gchar* and a account_t) */ -gint -get_state_struct ( gconstpointer a, gconstpointer b) -{ - account_t * c = (account_t*)a; - if( c->state == *((account_state_t*)b)) - { - return 0; - } - else - { - return 1; - } +gint get_state_struct ( gconstpointer a, gconstpointer b) { + + account_t * c = (account_t*)a; + if( c->state == *((account_state_t*)b)) + { + return 0; + } + else + { + return 1; + } } -void -account_list_init () -{ - accountQueue = g_queue_new (); +void account_list_init () { + + accountQueue = g_queue_new (); } -void + void account_list_clean () { - g_queue_free (accountQueue); + g_queue_free (accountQueue); } -void + void account_list_add (account_t * c) { - g_queue_push_tail (accountQueue, (gpointer *) c); + g_queue_push_tail (accountQueue, (gpointer *) c); } -void + void account_list_add_at_nth (account_t * c, guint pos) { - g_queue_push_nth (accountQueue, (gpointer *) c, pos); + g_queue_push_nth (accountQueue, (gpointer *) c, pos); } -void + void account_list_remove (const gchar * accountID) { - GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); - if (c) - { - g_queue_remove(accountQueue, c->data); - } + GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); + if (c) + { + g_queue_remove(accountQueue, c->data); + } } -account_t * + account_t * account_list_get_by_state (account_state_t state ) { - GList * c = g_queue_find_custom (accountQueue, &state, get_state_struct); - if (c) - { - return (account_t *)c->data; - } - else - { - return NULL; - } + GList * c = g_queue_find_custom (accountQueue, &state, get_state_struct); + if (c) + { + return (account_t *)c->data; + } + else + { + return NULL; + } } -account_t * + account_t * account_list_get_by_id(gchar * accountID) { GList * c = g_queue_find_custom (accountQueue, accountID, is_accountID_struct); @@ -119,103 +116,104 @@ account_list_get_by_id(gchar * accountID) } } -guint -account_list_get_size ( ) -{ - return g_queue_get_length (accountQueue); +guint account_list_get_size (void) { + + return g_queue_get_length (accountQueue); } -account_t * -account_list_get_nth ( guint n ) -{ - return g_queue_peek_nth (accountQueue, n); +account_t * account_list_get_nth (guint n) { + + return g_queue_peek_nth (accountQueue, n); } -account_t* + account_t* account_list_get_current( ) { - account_t *current; - - // No account registered - if (account_list_get_registered_accounts () == 0) - return NULL; - - // if we are here, it means that we have at least one registered account in the list - // So we get the first one - current = account_list_get_by_state (ACCOUNT_STATE_REGISTERED); - if (!current) - return NULL; - - return current; + account_t *current; + + // No account registered + if (account_list_get_registered_accounts () == 0) + return NULL; + + // if we are here, it means that we have at least one registered account in the list + // So we get the first one + current = account_list_get_by_state (ACCOUNT_STATE_REGISTERED); + if (!current) + return NULL; + + return current; } void account_list_set_current (account_t *current) { - gpointer acc; - guint pos; - - // 2 steps: - // 1 - retrieve the index of the current account in the Queue - // 2 - then set it as first - pos = account_list_get_position (current); - if (pos > 0) - { + gpointer acc; + guint pos; + + // 2 steps: + // 1 - retrieve the index of the current account in the Queue + // 2 - then set it as first + pos = account_list_get_position (current); + if (pos > 0) + { acc = g_queue_pop_nth(accountQueue, pos); g_queue_push_nth(accountQueue, acc, 0); - } + } } -const gchar * account_state_name(account_state_t s) +const gchar * account_state_name (account_state_t s) { - gchar * state; - switch(s) - { - case ACCOUNT_STATE_REGISTERED: - state = _("Registered"); - break; - case ACCOUNT_STATE_UNREGISTERED: - state = _("Not Registered"); - break; - case ACCOUNT_STATE_TRYING: - state = _("Trying..."); - break; - case ACCOUNT_STATE_ERROR: - state = _("Error"); - break; - case ACCOUNT_STATE_ERROR_AUTH: - state = _("Authentication Failed"); - break; - case ACCOUNT_STATE_ERROR_NETWORK: - state = _("Network unreachable"); - break; - case ACCOUNT_STATE_ERROR_HOST: - state = _("Host unreachable"); - break; - case ACCOUNT_STATE_ERROR_CONF_STUN: - state = _("Stun configuration error"); - break; - case ACCOUNT_STATE_ERROR_EXIST_STUN: - state = _("Stun server invalid"); - break; - default: - state = _("Invalid"); - break; - } - return state; + gchar * state; + switch(s) + { + case ACCOUNT_STATE_REGISTERED: + state = _("Registered"); + break; + case ACCOUNT_STATE_UNREGISTERED: + state = _("Not Registered"); + break; + case ACCOUNT_STATE_TRYING: + state = _("Trying..."); + break; + case ACCOUNT_STATE_ERROR: + state = _("Error"); + break; + case ACCOUNT_STATE_ERROR_AUTH: + state = _("Authentication Failed"); + break; + case ACCOUNT_STATE_ERROR_NETWORK: + state = _("Network unreachable"); + break; + case ACCOUNT_STATE_ERROR_HOST: + state = _("Host unreachable"); + break; + case ACCOUNT_STATE_ERROR_CONF_STUN: + state = _("Stun configuration error"); + break; + case ACCOUNT_STATE_ERROR_EXIST_STUN: + state = _("Stun server invalid"); + break; + case IP2IP_PROFILE_STATUS: + state = _("Ready"); + break; + default: + state = _("Invalid"); + break; + } + return state; } -void + void account_list_clear ( ) { - g_queue_free (accountQueue); - accountQueue = g_queue_new (); + g_queue_free (accountQueue); + accountQueue = g_queue_new (); } -void + void account_list_move_up(guint index) { - DEBUG ("index = %i\n", index); + DEBUG ("index = %i\n", index); if(index != 0) { @@ -224,7 +222,7 @@ account_list_move_up(guint index) } } -void + void account_list_move_down(guint index) { if(index != accountQueue->length) @@ -234,135 +232,135 @@ account_list_move_down(guint index) } } -guint + guint account_list_get_registered_accounts( void ) { - guint res = 0; - unsigned int i; - for(i=0;i<account_list_get_size();i++) - { - if( account_list_get_nth( i ) -> state == ( ACCOUNT_STATE_REGISTERED )) - res ++; - } - DEBUG(" %d registered accounts" , res ); - return res; + guint res = 0; + unsigned int i; + for(i=0;i<account_list_get_size();i++) + { + if( account_list_get_nth( i ) -> state == ( ACCOUNT_STATE_REGISTERED )) + res ++; + } + DEBUG(" %d registered accounts" , res ); + return res; } gchar* account_list_get_current_id( void ){ - account_t *current; + account_t *current; - current = account_list_get_current (); - if (current) - return current->accountID; - else - return ""; + current = account_list_get_current (); + if (current) + return current->accountID; + else + return ""; } int account_list_get_sip_account_number( void ){ - int n; - guint size, i; - account_t *current; + int n; + guint size, i; + account_t *current; - size = account_list_get_size(); - n = 0; - for( i=0; i<size ;i++ ){ - current = account_list_get_nth( i ); - if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "SIP" ) == 0 ) - n++; - } + size = account_list_get_size(); + n = 0; + for( i=0; i<size ;i++ ){ + current = account_list_get_nth( i ); + if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "SIP" ) == 0 ) + n++; + } - return n; + return n; } int account_list_get_iax_account_number( void ){ - int n; - guint size, i; - account_t *current; + int n; + guint size, i; + account_t *current; - size = account_list_get_size(); - n = 0; - for( i=0; i<size ;i++ ){ - current = account_list_get_nth( i ); - if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "IAX" ) == 0 ) - n++; - } + size = account_list_get_size(); + n = 0; + for( i=0; i<size ;i++ ){ + current = account_list_get_nth( i ); + if( strcmp(g_hash_table_lookup(current->properties, ACCOUNT_TYPE), "IAX" ) == 0 ) + n++; + } - return n; + return n; } gchar * account_list_get_ordered_list (void) { - gchar *order=""; - guint i; - - for( i=0; i < account_list_get_size(); i++ ) - { - account_t * account = NULL; - account = account_list_get_nth(i); - if (account != NULL) { - order = g_strconcat (order, account->accountID, "/", NULL); - } - } - return order; + gchar *order=""; + guint i; + + for( i=0; i < account_list_get_size(); i++ ) + { + account_t * account = NULL; + account = account_list_get_nth(i); + if (account != NULL) { + order = g_strconcat (order, account->accountID, "/", NULL); + } + } + return order; } guint account_list_get_position (account_t *account) { - guint size, i; - account_t *tmp; - - size = account_list_get_size (); - for (i=0; i<size; i++) - { - tmp = account_list_get_nth (i); - if (g_strcasecmp (tmp->accountID, account->accountID) == 0) - { - return i; - } - } - // Not found - return -1; + guint size, i; + account_t *tmp; + + size = account_list_get_size (); + for (i=0; i<size; i++) + { + tmp = account_list_get_nth (i); + if (g_strcasecmp (tmp->accountID, account->accountID) == 0) + { + return i; + } + } + // Not found + return -1; } gboolean current_account_has_mailbox (void) { - account_t *current; + account_t *current; - // Check if the current account has a voicemail number configured + // Check if the current account has a voicemail number configured + + current = account_list_get_current (); + if (current) + { + if (g_strcasecmp (g_hash_table_lookup (current->properties, ACCOUNT_MAILBOX), "") != 0) + return TRUE; + } - current = account_list_get_current (); - if (current) - { - if (g_strcasecmp (g_hash_table_lookup (current->properties, ACCOUNT_MAILBOX), "") != 0) - return TRUE; - } - - return FALSE; + return FALSE; } void current_account_set_message_number (guint nb) { - account_t *current; - + account_t *current; + current = account_list_get_current (); - if (current) - { + if (current) + { current->_messages_number = nb; } } guint current_account_get_message_number (void) { - account_t *current; - + account_t *current; + current = account_list_get_current (); - if (current) - { + if (current) + { return current->_messages_number; } else @@ -371,12 +369,13 @@ guint current_account_get_message_number (void) gboolean current_account_has_new_message (void) { - account_t *current; - + account_t *current; + current = account_list_get_current (); - if (current) - { + if (current) + { return (current->_messages_number > 0); } return FALSE; } + diff --git a/sflphone-client-gnome/src/accountlist.h b/sflphone-client-gnome/src/accountlist.h index 9823a9a387b259c3b187571b150565a4d6384639..bb2de673190d891264292e33e245b8d1924e57ad 100644 --- a/sflphone-client-gnome/src/accountlist.h +++ b/sflphone-client-gnome/src/accountlist.h @@ -50,8 +50,9 @@ typedef enum /** Stun server configuration error. The account is not registered */ ACCOUNT_STATE_ERROR_CONF_STUN, /** Stun server is not existing. The account is not registered */ - ACCOUNT_STATE_ERROR_EXIST_STUN - + ACCOUNT_STATE_ERROR_EXIST_STUN, + /** IP profile status **/ + IP2IP_PROFILE_STATUS } account_state_t; /** @struct account_t @@ -71,6 +72,8 @@ typedef struct { GHashTable * properties; GPtrArray * credential_information; + /* The codec list */ + GQueue *codecs; guint _messages_number; } account_t; diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index fe433aace6d95232e475767fef3308462ccfc69d..b5b21c8791a57ec3351401f7d6de2686033fd20b 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -31,6 +31,17 @@ #include <sys/types.h> #include <unistd.h> +#include <netinet/in.h> +#include <arpa/nameser.h> +#include <resolv.h> + +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/ioctl.h> +#include <linux/if.h> + + + GHashTable * ip2ip_profile=NULL; void @@ -80,6 +91,10 @@ static gboolean _is_direct_call(callable_obj_t * c) { return 1; } + if(g_str_has_prefix (c->_peer_number, "sips:")) { + return 1; + } + return 0; } @@ -172,18 +187,17 @@ static hashtable_free(gpointer key, gpointer value, gpointer user_data) } /** Internal to actions: Fill account list */ - void -sflphone_fill_account_list(gboolean toolbarInitialized) -{ +void sflphone_fill_account_list (void) { gchar** array; gchar** accountID; unsigned int i; int count; + GQueue *codeclist; count = current_account_get_message_number (); - account_list_clear ( ); + account_list_clear (); array = (gchar **)dbus_account_list(); if(array) @@ -193,6 +207,7 @@ sflphone_fill_account_list(gboolean toolbarInitialized) account_t * a = g_new0(account_t,1); a->accountID = g_strdup(*accountID); a->credential_information = NULL; + // TODO Clean codec list QUEUE account_list_add(a); } g_strfreev (array); @@ -211,7 +226,6 @@ sflphone_fill_account_list(gboolean toolbarInitialized) */ /* Fill the actual array of credentials */ - int number_of_credential = dbus_get_number_of_credential(a->accountID); if(number_of_credential) { a->credential_information = g_ptr_array_new(); @@ -221,7 +235,7 @@ sflphone_fill_account_list(gboolean toolbarInitialized) int credential_index; for(credential_index = 0; credential_index < number_of_credential; credential_index++) { - GHashTable * credential_information = dbus_get_credential(a->accountID, credential_index); + GHashTable * credential_information = dbus_get_credential (a->accountID, credential_index); g_ptr_array_add(a->credential_information, credential_information); } @@ -262,6 +276,9 @@ sflphone_fill_account_list(gboolean toolbarInitialized) { a->state = ACCOUNT_STATE_ERROR_EXIST_STUN; } + else if (strcmp (status, "READY") == 0) { + a->state = IP2IP_PROFILE_STATUS; + } else { a->state = ACCOUNT_STATE_INVALID; @@ -278,10 +295,12 @@ sflphone_fill_account_list(gboolean toolbarInitialized) // Set the current account message number current_account_set_message_number (count); + + sflphone_fill_codec_list (); } -gboolean sflphone_init() -{ +gboolean sflphone_init() { + if(!dbus_connect ()){ main_window_error_message(_("Unable to connect to the SFLphone server.\nMake sure the daemon is running.")); @@ -299,18 +318,15 @@ gboolean sflphone_init() history = calltab_init(TRUE, HISTORY); account_list_init (); - codec_list_init(); - conferencelist_init(); + codec_capabilities_load (); + conferencelist_init (); // Fetch the configured accounts - sflphone_fill_account_list(FALSE); + sflphone_fill_account_list (); // Fetch the ip2ip profile sflphone_fill_ip2ip_profile(); - // Fetch the audio codecs - sflphone_fill_codec_list(); - // Fetch the conference list // sflphone_fill_conference_list(); @@ -1054,61 +1070,86 @@ sflphone_rec_call() // DEBUG("sflphone_get_current_codec_name: %s",codname); } -/* Internal to action - get the codec list */ - void -sflphone_fill_codec_list() -{ - codec_list_clear(); +void sflphone_fill_codec_list () { + guint account_list_size; + guint i; + account_t *current = NULL; gchar** codecs = NULL; - codecs = (gchar**)dbus_codec_list(); - gchar** order = (gchar**)dbus_get_active_codec_list(); - gchar** details; - gchar** pl; - if (codecs != NULL) - { - for(pl=order; *order; order++) - { - codec_t * c = g_new0(codec_t, 1); - c->_payload = atoi(*order); - details = (gchar **)dbus_codec_details(c->_payload); - - //DEBUG("Codec details: %s / %s / %s / %s",details[0],details[1],details[2],details[3]); - - c->name = details[0]; - c->is_active = TRUE; - c->sample_rate = atoi(details[1]); - c->_bitrate = atof(details[2]); - c->_bandwidth = atof(details[3]); - codec_list_add(c); - } + account_list_size = account_list_get_size (); - for(pl=codecs; *codecs; codecs++) + for (i=0; i<account_list_size; i++) { - details = (gchar **)dbus_codec_details(atoi(*codecs)); - if(codec_list_get_by_payload((gconstpointer)(size_t)atoi(*codecs))!=NULL){ - // does nothing - the codec is already in the list, so is active. - } - else{ - codec_t* c = g_new0(codec_t, 1); - c->_payload = atoi(*codecs); - c->name = details[0]; - c->is_active = FALSE; - c->sample_rate = atoi(details[1]); - c->_bitrate = atof(details[2]); - c->_bandwidth = atof(details[3]); - codec_list_add(c); - } - } - } - if( codec_list_get_size() == 0) { + current = account_list_get_nth (i); + if (current) { + sflphone_fill_codec_list_per_account (¤t); + } + } + + /* + if (codec_list_get_size() == 0) { - gchar* markup = g_markup_printf_escaped(_("<b>No audio codecs found.</b>\n\nSFL audio codecs have to be placed in <i>%s</i> or in the <b>.sflphone</b> directory in your home (<i>%s</i>)"), CODECS_DIR, g_get_home_dir()); - main_window_error_message( markup ); + // Error message + ERROR ("No audio codecs found"); dbus_unregister(getpid()); exit(0); + }*/ +} + +void sflphone_fill_codec_list_per_account (account_t **account) { + + gchar **order; + gchar** details; + gchar** pl; + gchar *accountID; + GQueue *codeclist; + gboolean active = FALSE; + + order = (gchar**) dbus_get_active_codec_list ((*account)->accountID); + codeclist = (*account)->codecs; + + // First clean the list + codec_list_clear (&codeclist); + + for (pl=order; *order; order++) + { + codec_t * cpy; + // Each account will have a copy of the system-wide capabilities + codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) atoi (*order), NULL), &cpy); + if (cpy) { + cpy->is_active = TRUE; + codec_list_add (cpy, &codeclist); + } + else + ERROR ("Couldn't find codec \n"); } + + // Test here if we just added some active codec. + active = (codeclist->length == 0) ? TRUE : FALSE; + + guint caps_size = codec_list_get_size (), i=0; + + for (i=0; i<caps_size; i++) { + + codec_t * current_cap = capabilities_get_nth (i); + // Check if this codec has already been enabled for this account + if (codec_list_get_by_payload ( (gconstpointer) current_cap->_payload, codeclist) == NULL) { + // codec_t *cpy; + // codec_create_new_from_caps (current_cap, &cpy); + current_cap->is_active = active; + codec_list_add (current_cap, &codeclist); + } + else { + } + + } + + (*account)->codecs = codeclist; + + // call dbus function with array of strings + codec_list_update_to_daemon (*account); + } void sflphone_fill_call_list (void) @@ -1175,7 +1216,6 @@ void sflphone_fill_conference_list(void) calltree_add_conference (current_calls, conf); } } - } void sflphone_fill_history (void) @@ -1272,16 +1312,36 @@ void sflphone_save_history (void) } void -sflphone_srtp_on( callable_obj_t * c) +sflphone_srtp_sdes_on(callable_obj_t * c) { - c->_srtp_state = SRTP_STATE_SAS_UNCONFIRMED; + + c->_srtp_state = SRTP_STATE_SDES_SUCCESS; + + calltree_update_call(current_calls, c, NULL); + update_actions(); +} + + void +sflphone_srtp_sdes_off(callable_obj_t * c) +{ + c->_srtp_state = SRTP_STATE_UNLOCKED; + + calltree_update_call(current_calls, c, NULL); + update_actions(); +} + + + void +sflphone_srtp_zrtp_on( callable_obj_t * c) +{ + c->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; calltree_update_call(current_calls, c, NULL); update_actions(); } void -sflphone_srtp_off( callable_obj_t * c ) +sflphone_srtp_zrtp_off( callable_obj_t * c ) { c->_srtp_state = SRTP_STATE_UNLOCKED; calltree_update_call(current_calls, c, NULL); @@ -1289,23 +1349,23 @@ sflphone_srtp_off( callable_obj_t * c ) } void -sflphone_srtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified) +sflphone_srtp_zrtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified) { if(c == NULL) { DEBUG("Panic callable obj is NULL in %s at %d", __FILE__, __LINE__); } c->_sas = g_strdup(sas); if(verified == TRUE) { - c->_srtp_state = SRTP_STATE_SAS_CONFIRMED; + c->_srtp_state = SRTP_STATE_ZRTP_SAS_CONFIRMED; } else { - c->_srtp_state = SRTP_STATE_SAS_UNCONFIRMED; + c->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; } calltree_update_call(current_calls, c, NULL); update_actions(); } void -sflphone_zrtp_not_supported( callable_obj_t * c ) +sflphone_srtp_zrtp_not_supported( callable_obj_t * c ) { DEBUG("ZRTP not supported"); main_window_zrtp_not_supported(c); @@ -1351,3 +1411,37 @@ sflphone_call_state_changed( callable_obj_t * c, const gchar * description, cons calltree_update_call(current_calls, c, NULL); update_actions(); } + + +void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr) { + + struct ifreq ifr; + int fd; + int err; + // static char iface_addr[18]; + char *tmp_addr; + + struct sockaddr_in *saddr_in; + struct in_addr *addr_in; + + if((fd = socket (AF_INET, SOCK_DGRAM,0)) < 0) + DEBUG("getInterfaceAddrFromName error could not open socket\n"); + + memset (&ifr, 0, sizeof (struct ifreq)); + + strcpy (ifr.ifr_name, iface_name); + ifr.ifr_addr.sa_family = AF_INET; + + if((err = ioctl(fd, SIOCGIFADDR, &ifr)) < 0) + DEBUG("getInterfaceAddrFromName use default interface (0.0.0.0)\n"); + + + saddr_in = (struct sockaddr_in *)&ifr.ifr_addr; + addr_in = &(saddr_in->sin_addr); + + tmp_addr = (char *)addr_in; + + snprintf(*iface_addr, sizeof(*iface_addr), "%d.%d.%d.%d", + UC(tmp_addr[0]), UC(tmp_addr[1]), UC(tmp_addr[2]), UC(tmp_addr[3])); + +} diff --git a/sflphone-client-gnome/src/actions.h b/sflphone-client-gnome/src/actions.h index 41e3ab2ef244812b2e8e044dde175b56ac0849ce..2d956ddb8073899245301cc042904f1cfb91ceb6 100644 --- a/sflphone-client-gnome/src/actions.h +++ b/sflphone-client-gnome/src/actions.h @@ -30,6 +30,8 @@ #include <errors.h> #include <conference_obj.h> +#define UC(b) (((int)b)&0xff) + /** @file actions.h * @brief General functions that change the state of the application. * All of these functions are called when dbus signals are triggered. Exceptions @@ -177,7 +179,10 @@ void sflphone_set_current_account(); /** * Initialialize the codecs data structure */ -void sflphone_fill_codec_list(); +void sflphone_fill_codec_list (); + +void sflphone_fill_codec_list_per_account (account_t **); + void sflphone_add_participant(); @@ -191,50 +196,82 @@ void sflphone_fill_history (void); void sflphone_save_history (void); +/** + * Action called when two single call are dragged on together to create a new conference + */ void sflphone_join_participant(const gchar* sel_callID, const gchar* drag_callID); +/** + * Action called when a new participant is dragged in + */ void sflphone_add_participant(const gchar* callID, const gchar* confID); +/** + * Action called when a conference participant is draged out + */ void sflphone_detach_participant(const gchar* callID); +/** + * Action called when two conference are merged together + */ void sflphone_join_conference(const gchar* sel_confID, const gchar* drag_confID); -/** Nofity that the communication is - * now secured. + +/** + * Nofity that the communication is + * now secured using SRTP/SDES. + * @param c* The current call + */ +void sflphone_srtp_sdes_on(callable_obj_t * c); + +/** + * Notify that the SRTP/SDES session + * is not secured + */ + +/** + * Nofity that the communication is + * now secured using ZRTP. * @param c* The current call */ -void sflphone_srtp_on( callable_obj_t * c); +void sflphone_srtp_zrtp_on( callable_obj_t * c); -/** Called when the RTP session goes +/** + * Called when the ZRTP session goes * unsecured. * @param c* The current call */ -void sflphone_srtp_off( callable_obj_t * c ); +void sflphone_srtp_zrtp_off( callable_obj_t * c ); -/** Called when the sas has been computed +/** + * Called when the sas has been computed * and is ready to be displayed. * @param c* The current call * @param sas* The Short Authentication String * @param verified* Weather the SAS was confirmed or not. */ -void sflphone_srtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified); +void sflphone_srtp_zrtp_show_sas( callable_obj_t * c, const gchar* sas, const gboolean verified); -/** Called when the remote peer does not support ZRTP +/** + * Called when the remote peer does not support ZRTP * @param c* The current call */ -void sflphone_zrtp_not_supported( callable_obj_t * c ); +void sflphone_srtp_zrtp_not_supported( callable_obj_t * c ); -/** Called when user wants to confirm go clear request. +/** + * Called when user wants to confirm go clear request. * @param c* The call to confirm the go clear request. */ void sflphone_set_confirm_go_clear( callable_obj_t * c ); -/** Called when user wants to confirm go clear request. +/** + * Called when user wants to confirm go clear request. * @param c* The call to confirm the go clear request. */ void sflphone_confirm_go_clear( callable_obj_t * c ); -/** Called when user wants to clear. +/** + * Called when user wants to clear. * @param c* The call on which to go clear */ void sflphone_request_go_clear(void); @@ -247,8 +284,10 @@ void sflphone_request_go_clear(void); * @param description A textual description of the code * @param code The status code as in SIP or IAX */ - void sflphone_call_state_changed(callable_obj_t * c, const gchar * description, const guint code); - +/** + * Resolve an interface address given its name + */ +void sflphone_get_interface_addr_from_name(char *iface_name, char **iface_addr); #endif diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c index 240488b70fb08bd5da55ee62e5484f57d6a71ed0..ea6840bc9b04f4d1614f03a2bd6248614ca8ce6b 100644 --- a/sflphone-client-gnome/src/callable_obj.c +++ b/sflphone-client-gnome/src/callable_obj.c @@ -22,6 +22,10 @@ #include <sflphone_const.h> #include <time.h> +#define UNIX_DAY 86400 +#define UNIX_WEEK 86400 * 6 +#define UNIX_TWO_DAYS 86400 * 2 + gint is_callID_callstruct ( gconstpointer a, gconstpointer b) { callable_obj_t * c = (callable_obj_t*)a; @@ -89,7 +93,7 @@ gchar* call_get_audio_codec (callable_obj_t *obj) if (obj) { audio_codec = dbus_get_current_codec_name (obj); - codec = codec_list_get_by_name (audio_codec); + codec = codec_list_get_by_name (audio_codec, NULL); if (codec){ samplerate = codec->sample_rate; format = g_markup_printf_escaped ("%s/%i", audio_codec, samplerate); @@ -356,19 +360,35 @@ gchar* get_history_id_from_state (history_state_t state) } } -gchar* get_formatted_start_timestamp (callable_obj_t *obj) -{ +gchar* get_formatted_start_timestamp (callable_obj_t *obj) { + struct tm* ptr; - time_t lt; + time_t lt, now; unsigned char str[100]; if (obj) { + // Fetch the current timestamp + (void) time (&now); lt = obj->_time_start; - ptr = localtime(<); + + ptr = localtime (<); + + if (now - lt < UNIX_WEEK) { + if (now-lt < UNIX_DAY) { + strftime((char *)str, 100, N_("today at %R"), (const struct tm *)ptr); + } else { + if (now - lt < UNIX_TWO_DAYS) { + strftime((char *)str, 100, N_("yesterday at %R"), (const struct tm *)ptr); + } else { + strftime((char *)str, 100, N_("%A at %R"), (const struct tm *)ptr); + } + } + } else { + strftime((char *)str, 100, N_("%x at %R"), (const struct tm *)ptr); + } // result function of the current locale - strftime((char *)str, 100, "%x %X", (const struct tm *)ptr); return g_markup_printf_escaped("\n%s\n" , str); } return ""; diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h index 21311d8da72c9b81402a58b637883d13a421ffc6..4325b6b345a9781eaaf04eb25c460dc8d0c8fa68 100644 --- a/sflphone-client-gnome/src/callable_obj.h +++ b/sflphone-client-gnome/src/callable_obj.h @@ -62,8 +62,7 @@ typedef enum /** @enum call_state_t * This enum have all the states a call can take. */ -typedef enum -{ +typedef enum { CALL_STATE_INVALID = 0, CALL_STATE_INCOMING, CALL_STATE_RINGING, @@ -73,17 +72,18 @@ typedef enum CALL_STATE_FAILURE, CALL_STATE_BUSY, CALL_STATE_TRANSFERT, - CALL_STATE_RECORD + CALL_STATE_RECORD, } call_state_t; -typedef enum -{ - SRTP_STATE_UNLOCKED = 0, - SRTP_STATE_SAS_CONFIRMED, - SRTP_STATE_SAS_UNCONFIRMED, - SRTP_STATE_SAS_SIGNED, +typedef enum { + SRTP_STATE_UNLOCKED = 0, + SRTP_STATE_SDES_SUCCESS, + SRTP_STATE_ZRTP_SAS_CONFIRMED, + SRTP_STATE_ZRTP_SAS_UNCONFIRMED, + SRTP_STATE_ZRTP_SAS_SIGNED, } srtp_state_t; + /** @struct callable_obj_t * @brief Call information. * This struct holds information about a call. @@ -105,7 +105,7 @@ typedef struct { gchar* _sas; // The Short Authentication String that should be displayed gboolean _zrtp_confirmed; // Override real state. Used for hold/unhold // since rtp session is killed each time and - // libzrtpcpp does not remember state (yet?). + // libzrtpcpp does not remember state (yet?) /** * The information about the person we are talking */ @@ -135,8 +135,8 @@ typedef struct { */ GPtrArray * _error_dialogs; - /* The audio codec used for this call, if applicable */ - gchar *_audio_codec; + /* The audio codec used for this call, if applicable */ + gchar *_audio_codec; } callable_obj_t; diff --git a/sflphone-client-gnome/src/codeclist.c b/sflphone-client-gnome/src/codeclist.c index c36e40aefe7c9b23070aee6a399a5ee0bde2c7f2..88136547d4430a69c324425b91b2968826e1a768 100644 --- a/sflphone-client-gnome/src/codeclist.c +++ b/sflphone-client-gnome/src/codeclist.c @@ -24,169 +24,275 @@ #include "dbus.h" -GQueue * codecQueue = NULL; +GQueue * codecsCapabilities = NULL; -gint + gint is_name_codecstruct (gconstpointer a, gconstpointer b) { - codec_t * c = (codec_t *)a; - if(strcmp(c->name, (const gchar *)b)==0) - return 0; - else - return 1; + codec_t * c = (codec_t *)a; + if(strcmp(c->name, (const gchar *)b)==0) + return 0; + else + return 1; } -gint + gint is_payload_codecstruct (gconstpointer a, gconstpointer b) { - codec_t * c = (codec_t *)a; - if(c->_payload == GPOINTER_TO_INT(b)) - return 0; - else - return 1; + codec_t * c = (codec_t *)a; + if(c->_payload == GPOINTER_TO_INT(b)) + return 0; + else + return 1; } -void -codec_list_init() -{ - codecQueue = g_queue_new(); +void codec_list_init (GQueue **queue) { + + // Create the queue object that will contain the audio codecs + *queue = g_queue_new(); } -void -codec_list_clear () -{ - g_queue_free (codecQueue); - codecQueue = g_queue_new(); +void codec_capabilities_load (void) { + + gchar **codecs = NULL, **pl = NULL, **specs = NULL; + guint payload; + + // Create the queue object that will contain the global list of audio codecs + if (codecsCapabilities != NULL) + g_queue_free (codecsCapabilities); + + codecsCapabilities = g_queue_new(); + + // This is a global list inherited by all accounts + codecs = (gchar**) dbus_codec_list (); + + // Add the codecs in the list + for (pl=codecs; *codecs; codecs++) { + + codec_t *c; + payload = atoi (*codecs); + specs = (gchar **) dbus_codec_details (payload); + codec_create_new_with_specs (payload, specs, TRUE, &c); + g_queue_push_tail (codecsCapabilities, (gpointer*) c); + } + + // If we didn't load any codecs, problem ... + if (g_queue_get_length (codecsCapabilities) == 0) { + + // Error message + ERROR ("No audio codecs found"); + dbus_unregister(getpid()); + exit(0); + } } -void -codec_list_add(codec_t * c) -{ - g_queue_push_tail (codecQueue, (gpointer *) c); +void account_create_codec_list (account_t **acc) { + + gchar **order = NULL; + GQueue *_codecs; + + _codecs = (*acc)->codecs; + if (_codecs != NULL) + g_queue_free (_codecs); + + _codecs = g_queue_new (); + // _codecs = g_queue_copy (codecsCapabilities); + + (*acc)->codecs = _codecs; + // order = (gchar**) dbus_get_active_codec_list (acc->accountID); } +void account_set_codec_list (account_t **acc) { + // Reset the codec list + // account_create_codec_list (a); + +} + +void codec_create_new (gint payload, gboolean active, codec_t **c) { + + codec_t *codec; + gchar **specs; + + codec = g_new0 (codec_t, 1); + codec->_payload = payload; + specs = (gchar **) dbus_codec_details (payload); + codec->name = specs[0]; + codec->sample_rate = atoi (specs[1]); + codec->_bitrate = atoi (specs[2]); + codec->_bandwidth = atoi (specs[3]); + codec->is_active = active; + + *c = codec; +} + +void codec_create_new_with_specs (gint payload, gchar **specs, gboolean active, codec_t **c) { + + codec_t *codec; + + codec = g_new0 (codec_t, 1); + codec->_payload = payload; + codec->name = specs[0]; + codec->sample_rate = atoi (specs[1]); + codec->_bitrate = atoi (specs[2]); + codec->_bandwidth = atoi (specs[3]); + codec->is_active = active; + + *c = codec; +} + +void codec_create_new_from_caps (codec_t *original, codec_t **copy) { + + codec_t *codec; + + codec = g_new0 (codec_t, 1); + codec->_payload = original->_payload; + codec->name = original->name; + codec->sample_rate = original->sample_rate; + codec->_bitrate = original->_bitrate; + codec->_bandwidth = original->_bandwidth; + codec->is_active = original->is_active; + + *copy = codec; +} + + +void codec_list_clear (GQueue **queue) { + + if (*queue != NULL) + g_queue_free (*queue); + + *queue = g_queue_new(); +} + +/*void codec_list_clear (void) { + + g_queue_free (codecsCapabilities); + codecsCapabilities = g_queue_new(); +}*/ + +void codec_list_add(codec_t * c, GQueue **queue) { + + // Add a codec to a specific list + g_queue_push_tail (*queue, (gpointer *) c); +} + +void codec_set_active (codec_t **c) { -void -codec_set_active(codec_t * c) -{ - if(c) { - DEBUG("%s set active", c->name); - c->is_active = TRUE; + DEBUG("%s set active", (*c)->name); + (*c)->is_active = TRUE; } } -void -codec_set_inactive(codec_t * c) -{ - - if(c) - c->is_active = FALSE; +void codec_set_inactive (codec_t **c) { + + if(c){ + DEBUG("%s set active", (*c)->name); + (*c)->is_active = FALSE; + } } -guint -codec_list_get_size() -{ - return g_queue_get_length(codecQueue); +guint codec_list_get_size () { + + // The system wide codec list and the one per account have exactly the same size + // The only difference may be the order and the enabled codecs + return g_queue_get_length (codecsCapabilities); } -codec_t* -codec_list_get_by_name( const gchar* name) -{ - GList * c = g_queue_find_custom(codecQueue, name, is_name_codecstruct); - if(c) - return (codec_t *)c->data; - else - return NULL; +codec_t* codec_list_get_by_name (gconstpointer name, GQueue *q) { + + // If NULL is passed as argument, we look into the global capabilities + if (q == NULL) + q = codecsCapabilities; + + GList * c = g_queue_find_custom (q, name, is_name_codecstruct); + if(c) + return (codec_t *)c->data; + else + return NULL; } -codec_t* -codec_list_get_by_payload(gconstpointer payload) -{ - GList * c = g_queue_find_custom(codecQueue, payload, is_payload_codecstruct); - if(c) - return (codec_t *)c->data; - else - return NULL; +codec_t* codec_list_get_by_payload (gconstpointer payload, GQueue *q) { + + // If NULL is passed as argument, we look into the global capabilities + if (q == NULL) + q = codecsCapabilities; + + GList * c = g_queue_find_custom (q, payload, is_payload_codecstruct); + if(c) + return (codec_t *)c->data; + else + return NULL; } -codec_t* -codec_list_get_nth(guint index) -{ - return g_queue_peek_nth(codecQueue, index); +codec_t* codec_list_get_nth (guint index, GQueue *q) { + return g_queue_peek_nth (q, index); } -void -codec_set_prefered_order(guint index) -{ - codec_t * prefered = codec_list_get_nth(index); - g_queue_pop_nth(codecQueue, index); - g_queue_push_head(codecQueue, prefered); +codec_t* capabilities_get_nth (guint index) { + + return g_queue_peek_nth (codecsCapabilities, index); } -/** - * - */ -void -codec_list_move_codec_up(guint index) -{ - DEBUG("Codec list Size: %i \n",codec_list_get_size()); - if(index != 0) +void codec_set_prefered_order (guint index, GQueue *q) { + + codec_t * prefered = codec_list_get_nth (index, q); + g_queue_pop_nth (q, index); + g_queue_push_head (q, prefered); +} + +void codec_list_move_codec_up (guint index, GQueue **q) { + + DEBUG("Codec list Size: %i \n", codec_list_get_size ()); + + GQueue *tmp = *q; + + if (index != 0) { - gpointer codec = g_queue_pop_nth(codecQueue, index); - g_queue_push_nth(codecQueue, codec, index-1); + gpointer codec = g_queue_pop_nth (tmp, index); + g_queue_push_nth (tmp, codec, index-1); } - // DEBUG - unsigned int i; - DEBUG("Codec list"); - for(i=0; i < codecQueue->length; i++) - DEBUG("%s", codec_list_get_nth(i)->name); + *q = tmp; + } -/** - * - */ -void -codec_list_move_codec_down(guint index) -{ - DEBUG("Codec list Size: %i \n",codec_list_get_size()); - if(index != codecQueue->length) +void codec_list_move_codec_down (guint index, GQueue **q) { + + DEBUG("Codec list Size: %i \n",codec_list_get_size()); + + GQueue *tmp = *q; + + if (index != tmp->length) { - gpointer codec = g_queue_pop_nth(codecQueue, index); - g_queue_push_nth(codecQueue, codec, index+1); + gpointer codec = g_queue_pop_nth (tmp, index); + g_queue_push_nth (tmp, codec, index+1); } + + *q = tmp; - // PRINT - unsigned int i; - DEBUG("Codec list"); - for(i=0; i < codecQueue->length; i++) - DEBUG("%s", codec_list_get_nth(i)->name); } -/** - * - */ -void -codec_list_update_to_daemon() -{ - // String listing of all codecs payloads +void codec_list_update_to_daemon (account_t *acc) { + + // String listing codecs payloads const gchar** codecList; // Length of the codec list - int length = codecQueue->length; + int length = acc->codecs->length; // Initiate double array char list for one string codecList = (void*)malloc(sizeof(void*)); // Get all codecs in queue - int i, c = 0; - DEBUG("List of active codecs :"); + int c = 0; + unsigned int i = 0; + for(i = 0; i < length; i++) { - codec_t* currentCodec = codec_list_get_nth(i); + codec_t* currentCodec = codec_list_get_nth (i, acc->codecs); // Assert not null if(currentCodec) { @@ -202,7 +308,6 @@ codec_list_update_to_daemon() // Put payload string in char array sprintf(payload, "%d", currentCodec->_payload); strcpy((char*)*(codecList+c), payload); - DEBUG(" %s", *(codecList+c)); c++; } } @@ -213,7 +318,7 @@ codec_list_update_to_daemon() *(codecList+c) = NULL; // call dbus function with array of strings - dbus_set_active_codec_list(codecList); + dbus_set_active_codec_list (codecList, acc->accountID); // Delete memory for(i = 0; i < c; i++) { @@ -221,3 +326,7 @@ codec_list_update_to_daemon() } free(codecList); } + +GQueue* get_system_codec_list (void) { + return codecsCapabilities; +} diff --git a/sflphone-client-gnome/src/codeclist.h b/sflphone-client-gnome/src/codeclist.h index 3b75296b42d2e9d4baf1f407663c74a60c7f9a7a..4a1a5f5dda31f0fb04e12591f142bc931b849778 100644 --- a/sflphone-client-gnome/src/codeclist.h +++ b/sflphone-client-gnome/src/codeclist.h @@ -21,6 +21,7 @@ #define __CODECLIST_H__ #include <gtk/gtk.h> +#include <accountlist.h> /** @file codeclist.h * @brief A list to hold codecs. */ @@ -47,32 +48,42 @@ typedef struct { */ /** - * This function initialize the codec list. + * This function initialize a specific codec list. */ -void codec_list_init(); +void codec_list_init (GQueue **q); /** - * This function empty and free the codec list. + * This function initialize the system wide codec list. */ -void codec_list_clear(); +void codec_capabilities_load (void); + +/** + * This function empty and free a specific codec list. + */ +void codec_list_clear (GQueue **q); + +/** + * This function empty and free the system wide codec list. + */ +void system_codec_list_clear (void); /** * This function append an codec to list. * @param c The codec you want to add */ -void codec_list_add(codec_t * c); +void codec_list_add (codec_t * c, GQueue **q); /** * Set a codec active. An active codec will be used for codec negociation * @param name The string description of the codec */ -void codec_set_active(codec_t * c); +void codec_set_active (codec_t **c); /** * Set a codec inactive. An active codec won't be used for codec negociation * @param name The string description of the codec */ -void codec_set_inactive(codec_t * c); +void codec_set_inactive(codec_t **c); /** * Return the number of codecs in the list @@ -85,38 +96,73 @@ guint codec_list_get_size(); * @param name The string description of the codec * @return codec_t* A codec or NULL */ -codec_t * codec_list_get_by_name(const gchar * name); +codec_t * codec_list_get_by_name(gconstpointer name, GQueue *q); /** * Return the codec at the nth position in the list * @param index The position of the codec you want * @return codec_t* A codec or NULL */ -codec_t* codec_list_get_nth(guint index); +codec_t* codec_list_get_nth (guint index, GQueue *q); +codec_t* capabilities_get_nth (guint index); /** * Set the prefered codec first in the codec list * @param index The position in the list of the prefered codec */ -void codec_set_prefered_order(guint index); +void codec_set_prefered_order (guint index, GQueue *q); /** * Move the codec from an unit up in the codec_list * @param index The current index in the list */ -void codec_list_move_codec_up(guint index); +void codec_list_move_codec_up (guint index, GQueue **q); /** * Move the codec from an unit down in the codec_list * @param index The current index in the list */ -void codec_list_move_codec_down(guint index); +void codec_list_move_codec_down (guint index, GQueue **q); /** * Notify modifications on codecs to the server */ -void codec_list_update_to_daemon(); +void codec_list_update_to_daemon (account_t *acc); + +codec_t* codec_list_get_by_payload (gconstpointer payload, GQueue *q); + +GQueue* get_system_codec_list (void); + +/** + * Instanciate a new codecs with the given payload. + * Fetches codec specification through D-Bus + * + * @param payload The unique RTP payload + * @param active Whether or not this codec should active (checked) + * @param c A pointer to receive the new codec instance + */ +void codec_create_new (gint payload, gboolean active, codec_t **c); + +/* + * Instanciate a new codec with the given specification + * + * @param payload The unique RTP payload + * @param specs A list of codec specifications. Ordered: name, sample rate, bit rate, bandwith + * @param active Whether or not this codec should active (checked) + * @param c A pointer to receive the new codec instance + */ +void codec_create_new_with_specs (gint payload, gchar **specs, gboolean active, codec_t **c); + + +void codec_create_new_from_caps (codec_t *original, codec_t **copy); +/* + * Attach a codec list to a specific account + * + * @param acc A pointer on the account to modify + */ +void account_create_codec_list (account_t **acc); -codec_t* codec_list_get_by_payload(gconstpointer payload); #endif + + diff --git a/sflphone-client-gnome/src/config/Makefile.am b/sflphone-client-gnome/src/config/Makefile.am index 3a4f01d7d7c5047c27768e044030ded027e5577e..e39b6dde1120a4b2c752df735a3c348c0ecbbf9c 100644 --- a/sflphone-client-gnome/src/config/Makefile.am +++ b/sflphone-client-gnome/src/config/Makefile.am @@ -4,6 +4,7 @@ noinst_LTLIBRARIES = libconfig.la libconfig_la_SOURCES = \ addressbook-config.c \ + shortcuts-config.c \ assistant.c \ preferencesdialog.c \ accountlistconfigdialog.c \ diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.c b/sflphone-client-gnome/src/config/accountconfigdialog.c index 0c16fea5c38b1536395d91d9a0f913ce3aed4123..63f9d9d141326298fc8eef3d5c96207b829a40b3 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountconfigdialog.c @@ -22,6 +22,7 @@ #include <actions.h> #include <mainwindow.h> #include <accountlist.h> +#include <audioconf.h> #include <accountconfigdialog.h> #include <zrtpadvanceddialog.h> #include <tlsadvanceddialog.h> @@ -56,16 +57,18 @@ GtkWidget * entryUsername; GtkWidget * entryHostname; GtkWidget * entryPassword; GtkWidget * entryMailbox; +GtkWidget * entryUseragent; GtkWidget * entryResolveNameOnlyOnce; GtkWidget * expireSpinBox; GtkListStore * credentialStore; GtkWidget * deleteCredButton; GtkWidget * treeViewCredential; -GtkWidget * scrolledWindowCredential; +// GtkWidget * scrolledWindowCredential; GtkWidget * advancedZrtpButton; GtkWidget * keyExchangeCombo; GtkWidget * useSipTlsCheckBox; +GtkWidget * localAddressEntry; GtkWidget * publishedAddressEntry; GtkWidget * localAddressLabel; GtkWidget * localAddressCombo; @@ -86,14 +89,18 @@ GtkWidget * displayNameEntry; GtkWidget * security_tab; GtkWidget * advanced_tab; - + +GtkWidget * overrtp; + +GHashTable * directIpCallsProperties = NULL; + // Credentials enum { - COLUMN_CREDENTIAL_REALM, - COLUMN_CREDENTIAL_USERNAME, - COLUMN_CREDENTIAL_PASSWORD, - COLUMN_CREDENTIAL_DATA, - COLUMN_CREDENTIAL_COUNT + COLUMN_CREDENTIAL_REALM, + COLUMN_CREDENTIAL_USERNAME, + COLUMN_CREDENTIAL_PASSWORD, + COLUMN_CREDENTIAL_DATA, + COLUMN_CREDENTIAL_COUNT }; /* @@ -105,17 +112,16 @@ static void show_password_cb (GtkWidget *widget, gpointer data) } /* Signal to protocolComboBox 'changed' */ - void -change_protocol_cb (account_t * currentAccount UNUSED) -{ - gchar * protocol = gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); - - if (g_strcasecmp(protocol, "IAX") == 0) { - gtk_widget_hide(security_tab); - gtk_widget_hide(advanced_tab); +void change_protocol_cb (account_t *currentAccount UNUSED) { + + gchar *protocol = gtk_combo_box_get_active_text (GTK_COMBO_BOX (protocolComboBox)); + + if (g_strcasecmp (protocol, "IAX") == 0) { + gtk_widget_hide (security_tab); + gtk_widget_hide (advanced_tab); } else { - gtk_widget_show(security_tab); - gtk_widget_show(advanced_tab); + gtk_widget_show (security_tab); + gtk_widget_show (advanced_tab); } } @@ -129,17 +135,91 @@ is_iax_enabled(void) return FALSE; } -static void update_credential_cb(GtkWidget *widget, gpointer data UNUSED) + + void +select_dtmf_type( void ) { - GtkTreeIter iter; - gtk_tree_model_get_iter_from_string ((GtkTreeModel *) credentialStore, &iter, "0"); - gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "column")); - // g_print ("set password to %s\n", (gchar *) gtk_entry_get_text(GTK_ENTRY(widget))); - gtk_list_store_set (GTK_LIST_STORE (credentialStore), &iter, column, (gchar *) gtk_entry_get_text(GTK_ENTRY(widget)), -1); + + DEBUG("DTMF selection changed\n"); + + if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(overrtp) ) ) + { + // dbus_set_audio_manager( ALSA ); + DEBUG("Selected DTMF over RTP"); + } + else { + + // dbus_set_audio_manager( PULSEAUDIO ); + DEBUG("Selected DTMF over SIP"); + } + } -static GtkWidget * create_basic_tab(account_t **a) +static GPtrArray* getNewCredential (GHashTable * properties) { + + GtkTreeIter iter; + gboolean valid; + gint row_count = 0; + + valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(credentialStore), &iter); + + GPtrArray *credential_array = g_ptr_array_new (); + + gchar *username; + gchar *realm; + gchar *password; + GHashTable * new_table; + + gtk_tree_model_get (GTK_TREE_MODEL(credentialStore), &iter, + COLUMN_CREDENTIAL_REALM, &realm, + COLUMN_CREDENTIAL_USERNAME, &username, + COLUMN_CREDENTIAL_PASSWORD, &password, + -1); + + g_hash_table_insert(properties, g_strdup(ACCOUNT_REALM), realm); + g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username); + + // Do not change the password if nothing has been changed by the user + if (g_strcasecmp (password, PW_HIDDEN) != 0) + g_hash_table_insert(properties, g_strdup(ACCOUNT_PASSWORD), password); + + valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); + + while (valid) { + gtk_tree_model_get (GTK_TREE_MODEL(credentialStore), &iter, + COLUMN_CREDENTIAL_REALM, &realm, + COLUMN_CREDENTIAL_USERNAME, &username, + COLUMN_CREDENTIAL_PASSWORD, &password, + -1); + + DEBUG ("Row %d: %s %s %s", row_count, username, password, realm); + + new_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); + g_hash_table_insert(new_table, g_strdup(ACCOUNT_REALM), realm); + g_hash_table_insert(new_table, g_strdup(ACCOUNT_USERNAME), username); + g_hash_table_insert(new_table, g_strdup(ACCOUNT_PASSWORD), password); + + g_ptr_array_add (credential_array, new_table); + + row_count ++; + + valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); + } + + return credential_array; +} + +static void update_credential_cb(GtkWidget *widget, gpointer data UNUSED) { + GtkTreeIter iter; + gtk_tree_model_get_iter_from_string ((GtkTreeModel *) credentialStore, &iter, "0"); + gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "column")); + // g_print ("set password to %s\n", (gchar *) gtk_entry_get_text(GTK_ENTRY(widget))); + gtk_list_store_set (GTK_LIST_STORE (credentialStore), &iter, column, (gchar *) gtk_entry_get_text(GTK_ENTRY(widget)), -1); +} + +static GtkWidget* create_basic_tab (account_t **a) { + GtkWidget * frame; GtkWidget * table; account_t *currentAccount; @@ -150,15 +230,16 @@ static GtkWidget * create_basic_tab(account_t **a) #endif // Default settings - gchar * curAccountID = ""; - gchar * curAccountEnabled = "true"; - gchar * curAccountType = "SIP"; - gchar * curAlias = ""; - gchar * curUsername = ""; - gchar * curHostname = ""; - gchar * curPassword = ""; + gchar *curAccountID = ""; + gchar *curAccountEnabled = "true"; + gchar *curAccountType = "SIP"; + gchar *curAlias = ""; + gchar *curUsername = ""; + gchar *curHostname = ""; + gchar *curPassword = ""; /* TODO: add curProxy, and add boxes for Proxy support */ - gchar * curMailbox = ""; + gchar *curMailbox = ""; + gchar *curUseragent = ""; currentAccount = *a; @@ -174,16 +255,17 @@ static GtkWidget * create_basic_tab(account_t **a) curPassword = g_hash_table_lookup(currentAccount->properties, ACCOUNT_PASSWORD); curUsername = g_hash_table_lookup(currentAccount->properties, ACCOUNT_USERNAME); curMailbox = g_hash_table_lookup(currentAccount->properties, ACCOUNT_MAILBOX); + curUseragent = g_hash_table_lookup(currentAccount->properties, ACCOUNT_USERAGENT); } - + gnome_main_section_new (_("Account Parameters"), &frame); gtk_widget_show(frame); - table = gtk_table_new (7, 2 , FALSE/* homogeneous */); + table = gtk_table_new (8, 2 , FALSE/* homogeneous */); gtk_table_set_row_spacings( GTK_TABLE(table), 10); gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_widget_show(table); + gtk_widget_show (table); gtk_container_add( GTK_CONTAINER( frame) , table ); label = gtk_label_new_with_mnemonic (_("_Alias")); @@ -244,16 +326,16 @@ static GtkWidget * create_basic_tab(account_t **a) gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUsername); gtk_entry_set_text(GTK_ENTRY(entryUsername), curUsername); gtk_table_attach ( GTK_TABLE( table ), entryUsername, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - g_signal_connect(G_OBJECT (entryUsername), "changed", G_CALLBACK (update_credential_cb), NULL); - g_object_set_data (G_OBJECT (entryUsername), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); + g_signal_connect(G_OBJECT (entryUsername), "changed", G_CALLBACK (update_credential_cb), NULL); + g_object_set_data (G_OBJECT (entryUsername), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); label = gtk_label_new_with_mnemonic (_("_Password")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); #if GTK_CHECK_VERSION(2,16,0) entryPassword = gtk_entry_new(); - GtkSettings *settings = gtk_settings_get_default (); - //g_object_set (G_OBJECT (settings), "gtk-entry-password-hint-timeout", 600, NULL); + GtkSettings *settings = gtk_settings_get_default (); + //g_object_set (G_OBJECT (settings), "gtk-entry-password-hint-timeout", 600, NULL); gtk_entry_set_icon_from_stock (GTK_ENTRY (entryPassword), GTK_ENTRY_ICON_PRIMARY, GTK_STOCK_DIALOG_AUTHENTICATION); #else entryPassword = sexy_icon_entry_new(); @@ -264,12 +346,12 @@ static GtkWidget * create_basic_tab(account_t **a) gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryPassword); gtk_entry_set_text(GTK_ENTRY(entryPassword), curPassword); gtk_table_attach ( GTK_TABLE( table ), entryPassword, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - g_signal_connect (G_OBJECT (entryPassword), "changed", G_CALLBACK (update_credential_cb), NULL); - g_object_set_data (G_OBJECT (entryPassword), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); - + g_signal_connect (G_OBJECT (entryPassword), "changed", G_CALLBACK (update_credential_cb), NULL); + g_object_set_data (G_OBJECT (entryPassword), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); + clearTextCheckbox = gtk_check_button_new_with_mnemonic (_("Show password")); - g_signal_connect (clearTextCheckbox, "toggled", G_CALLBACK (show_password_cb), entryPassword); - gtk_table_attach (GTK_TABLE (table), clearTextCheckbox, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + g_signal_connect (clearTextCheckbox, "toggled", G_CALLBACK (show_password_cb), entryPassword); + gtk_table_attach (GTK_TABLE (table), clearTextCheckbox, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); label = gtk_label_new_with_mnemonic (_("_Voicemail number")); gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); @@ -279,6 +361,15 @@ static GtkWidget * create_basic_tab(account_t **a) gtk_entry_set_text(GTK_ENTRY(entryMailbox), curMailbox); gtk_table_attach ( GTK_TABLE( table ), entryMailbox, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new_with_mnemonic (_("_User-agent")); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + entryUseragent = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryUseragent); + gtk_entry_set_text (GTK_ENTRY (entryUseragent), curUseragent); + gtk_table_attach ( GTK_TABLE( table ), entryUseragent, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + gtk_widget_show_all( table ); gtk_container_set_border_width (GTK_CONTAINER(table), 10); @@ -288,129 +379,128 @@ static GtkWidget * create_basic_tab(account_t **a) static void fill_treeview_with_credential (GtkListStore * credentialStore, account_t * account) { - GtkTreeIter iter; - gtk_list_store_clear(credentialStore); - gtk_list_store_append (credentialStore, &iter); - - /* This is the default, undeletable credential */ - gchar * authentication_name = g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME); - gchar * realm = g_hash_table_lookup(account->properties, ACCOUNT_REALM); - if (realm == NULL || (g_strcmp0(realm, "") == 0)) { - realm = g_strdup("*"); - } - - if((authentication_name == NULL) || (g_strcmp0(authentication_name, "") == 0)) { - gtk_list_store_set(credentialStore, &iter, - COLUMN_CREDENTIAL_REALM, realm, - COLUMN_CREDENTIAL_USERNAME, gtk_entry_get_text(GTK_ENTRY(entryUsername)), - COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), - COLUMN_CREDENTIAL_DATA, account, - -1); - } else { - gtk_list_store_set(credentialStore, &iter, - COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(account->properties, ACCOUNT_REALM), - COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME), - // COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), - COLUMN_CREDENTIAL_PASSWORD, PW_HIDDEN, - COLUMN_CREDENTIAL_DATA, account, - -1); - g_signal_handlers_disconnect_by_func (G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL); - } - - if(account->credential_information == NULL) { - DEBUG("No credential defined"); - return; - } - - unsigned int i; - for(i = 0; i < account->credential_information->len; i++) - { - GHashTable * element = g_ptr_array_index(account->credential_information, i); - gtk_list_store_append (credentialStore, &iter); - gtk_list_store_set(credentialStore, &iter, - COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(element, ACCOUNT_REALM), - COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup(element, ACCOUNT_USERNAME), - COLUMN_CREDENTIAL_PASSWORD, g_hash_table_lookup(element, ACCOUNT_PASSWORD), - COLUMN_CREDENTIAL_DATA, element, // Pointer - -1); - } + GtkTreeIter iter; + gtk_list_store_clear(credentialStore); + gtk_list_store_append (credentialStore, &iter); + + /* This is the default, undeletable credential */ + gchar * authentication_name = g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME); + gchar * realm = g_hash_table_lookup(account->properties, ACCOUNT_REALM); + if (realm == NULL || (g_strcmp0(realm, "") == 0)) { + realm = g_strdup("*"); + } + + if((authentication_name == NULL) || (g_strcmp0(authentication_name, "") == 0)) { + gtk_list_store_set(credentialStore, &iter, + COLUMN_CREDENTIAL_REALM, realm, + COLUMN_CREDENTIAL_USERNAME, gtk_entry_get_text(GTK_ENTRY(entryUsername)), + COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), + COLUMN_CREDENTIAL_DATA, account, + -1); + } else { + gtk_list_store_set(credentialStore, &iter, + COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(account->properties, ACCOUNT_REALM), + COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME), + // COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)), + COLUMN_CREDENTIAL_PASSWORD, PW_HIDDEN, + COLUMN_CREDENTIAL_DATA, account, + -1); + g_signal_handlers_disconnect_by_func (G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL); + } + + if(account->credential_information == NULL) { + DEBUG("No credential defined"); + return; + } + + unsigned int i; + for(i = 0; i < account->credential_information->len; i++) + { + GHashTable * element = g_ptr_array_index(account->credential_information, i); + gtk_list_store_append (credentialStore, &iter); + gtk_list_store_set(credentialStore, &iter, + COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(element, ACCOUNT_REALM), + COLUMN_CREDENTIAL_USERNAME, g_hash_table_lookup(element, ACCOUNT_USERNAME), + COLUMN_CREDENTIAL_PASSWORD, g_hash_table_lookup(element, ACCOUNT_PASSWORD), + COLUMN_CREDENTIAL_DATA, element, // Pointer + -1); + } } static select_credential_cb(GtkTreeSelection *selection, GtkTreeModel *model) { - GtkTreeIter iter; - GtkTreePath *path; - if(gtk_tree_selection_get_selected (selection, NULL, &iter)) { - path = gtk_tree_model_get_path (model, &iter); - if(gtk_tree_path_get_indices (path)[0] == 0) { - gtk_widget_set_sensitive(GTK_WIDGET(deleteCredButton), FALSE); - } else { - gtk_widget_set_sensitive(GTK_WIDGET(deleteCredButton), TRUE); - } - } + GtkTreeIter iter; + GtkTreePath *path; + if(gtk_tree_selection_get_selected (selection, NULL, &iter)) { + path = gtk_tree_model_get_path (model, &iter); + if(gtk_tree_path_get_indices (path)[0] == 0) { + gtk_widget_set_sensitive(GTK_WIDGET(deleteCredButton), FALSE); + } else { + gtk_widget_set_sensitive(GTK_WIDGET(deleteCredButton), TRUE); + } + } } static void add_credential_cb (GtkWidget *button, gpointer data) { - GtkTreeIter iter; - GtkTreeModel *model = (GtkTreeModel *)data; - - gtk_list_store_append (GTK_LIST_STORE (model), &iter); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - COLUMN_CREDENTIAL_REALM, "*", - COLUMN_CREDENTIAL_USERNAME, _("Authentication"), - COLUMN_CREDENTIAL_PASSWORD, _("Secret"), - -1); + GtkTreeIter iter; + GtkTreeModel *model = (GtkTreeModel *)data; + + gtk_list_store_append (GTK_LIST_STORE (model), &iter); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COLUMN_CREDENTIAL_REALM, "*", + COLUMN_CREDENTIAL_USERNAME, _("Authentication"), + COLUMN_CREDENTIAL_PASSWORD, _("Secret"), + -1); } static void delete_credential_cb(GtkWidget *button, gpointer data) { - GtkTreeIter iter; - GtkTreeView *treeview = (GtkTreeView *)data; - GtkTreeModel *model = gtk_tree_view_get_model (treeview); - GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); - - if (gtk_tree_selection_get_selected (selection, NULL, &iter)) - { - GtkTreePath *path; - path = gtk_tree_model_get_path (model, &iter); - gtk_list_store_remove (GTK_LIST_STORE (model), &iter); - - gtk_tree_path_free (path); - } + GtkTreeIter iter; + GtkTreeView *treeview = (GtkTreeView *)data; + GtkTreeModel *model = gtk_tree_view_get_model (treeview); + GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); + + if (gtk_tree_selection_get_selected (selection, NULL, &iter)) + { + GtkTreePath *path; + path = gtk_tree_model_get_path (model, &iter); + gtk_list_store_remove (GTK_LIST_STORE (model), &iter); + + gtk_tree_path_free (path); + } } static void cell_edited_cb(GtkCellRendererText *renderer, gchar *path_desc, gchar *text, gpointer data) { - GtkTreeModel *model = (GtkTreeModel *)data; - GtkTreePath *path = gtk_tree_path_new_from_string (path_desc); - GtkTreeIter iter; - + GtkTreeModel *model = (GtkTreeModel *)data; + GtkTreePath *path = gtk_tree_path_new_from_string (path_desc); + GtkTreeIter iter; - gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (renderer), "column")); + gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (renderer), "column")); DEBUG("path desc in cell_edited_cb: %s\n", text); - - if(g_strcasecmp(path_desc, "0") == 0) { - if(g_strcasecmp(text, gtk_entry_get_text (GTK_ENTRY(entryUsername))) != 0) { - g_signal_handlers_disconnect_by_func (G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL); - } - if (column == COLUMN_CREDENTIAL_PASSWORD) { // && g_strcasecmp (text, gtk_entry_get_text (GTK_ENTRY (entryPassword))) == 0) { + if(g_strcasecmp(path_desc, "0") == 0) { + if(g_strcasecmp(text, gtk_entry_get_text (GTK_ENTRY(entryUsername))) != 0) { + g_signal_handlers_disconnect_by_func (G_OBJECT(entryUsername), G_CALLBACK(update_credential_cb), NULL); + } + + if (column == COLUMN_CREDENTIAL_PASSWORD) { gtk_entry_set_text (GTK_ENTRY (entryPassword), text); text = PW_HIDDEN; } - } - - gtk_tree_model_get_iter (model, &iter, path); - gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, text, -1); - gtk_tree_path_free (path); + } + + gtk_tree_model_get_iter (model, &iter, path); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, text, -1); + gtk_tree_path_free (path); } -static void editing_started_cb (GtkCellRenderer *cell, GtkCellEditable * editable, const gchar * path, gpointer data) -{ - DEBUG("Editing started"); +static void editing_started_cb (GtkCellRenderer *cell, GtkCellEditable * editable, const gchar * path, gpointer data) { + + DEBUG("Editing started"); DEBUG("path desc in editing_started_cb: %s\n", path); // If we are dealing the first row @@ -422,20 +512,32 @@ static void editing_started_cb (GtkCellRenderer *cell, GtkCellEditable * editabl static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data) { - DEBUG("Advanced options for ZRTP"); - show_advanced_zrtp_options((GHashTable *) data); + + DEBUG("Advanced options for SRTP"); + if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "ZRTP") == 0) { + show_advanced_zrtp_options((GHashTable *) data); + } + else { + show_advanced_sdes_options((GHashTable *) data); + } } + static void show_advanced_tls_options_cb(GtkWidget *widget UNUSED, gpointer data) { - DEBUG("Advanced options for TLS"); - show_advanced_tls_options((GHashTable *) data); + DEBUG("Advanced options for TLS"); + show_advanced_tls_options((GHashTable *) data); } static void key_exchange_changed_cb(GtkWidget *widget, gpointer data) { - DEBUG("Key exchange changed"); - if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "ZRTP") == 0) { + + DEBUG("Key exchange changed %s", gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo))); + + int isSdes = g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "SDES"); + int isZrtp = g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "ZRTP"); + + if ((isSdes == 0) || (isZrtp == 0)) { gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), TRUE); } else { gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); @@ -443,501 +545,519 @@ static void key_exchange_changed_cb(GtkWidget *widget, gpointer data) } } + static void use_sip_tls_cb(GtkWidget *widget, gpointer data) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Using sips"); - gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); - // Uncheck stun - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useStunCheckBox), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(useStunCheckBox), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), TRUE); - gtk_widget_hide(stunServerLabel); - gtk_widget_hide(stunServerEntry); - - + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { + DEBUG("Using sips"); + gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); + // Uncheck stun + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useStunCheckBox), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(useStunCheckBox), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), TRUE); + gtk_widget_hide (stunServerLabel); + gtk_widget_hide (stunServerEntry); + + + + if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { + gtk_widget_show(publishedAddressEntry); + gtk_widget_show(publishedPortSpinBox); + gtk_widget_show(publishedAddressLabel); + gtk_widget_show(publishedPortLabel); + } - if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { - gtk_widget_show(publishedAddressEntry); - gtk_widget_show(publishedPortSpinBox); - gtk_widget_show(publishedAddressLabel); - gtk_widget_show(publishedPortLabel); - } + } else { + gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(useStunCheckBox), TRUE); + + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox))) { + gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), FALSE); + gtk_widget_show(stunServerLabel); + gtk_widget_show(stunServerEntry); + gtk_widget_hide(publishedAddressEntry); + gtk_widget_hide(publishedPortSpinBox); + gtk_widget_hide(publishedAddressLabel); + gtk_widget_hide(publishedPortLabel); + } + else { + gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), TRUE); + gtk_widget_hide(stunServerLabel); + gtk_widget_hide(stunServerEntry); + } - } else { - gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(useStunCheckBox), TRUE); - - if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox))) { - gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), FALSE); - gtk_widget_show(stunServerLabel); - gtk_widget_show(stunServerEntry); - gtk_widget_hide(publishedAddressEntry); - gtk_widget_hide(publishedPortSpinBox); - gtk_widget_hide(publishedAddressLabel); - gtk_widget_hide(publishedPortLabel); - } - else { - gtk_widget_set_sensitive(GTK_WIDGET(sameAsLocalRadioButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(publishedAddrRadioButton), TRUE); - gtk_widget_hide(stunServerLabel); - gtk_widget_hide(stunServerEntry); - } - - } + } } -static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) -{ +static local_interface_changed_cb(GtkWidget * widget, gpointer data UNUSED) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { - gchar * local_interface; - gchar * local_address; + gchar *local_iface_name; + gchar *local_iface_addr; + local_iface_addr = g_malloc(36); - local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); - local_address = dbus_get_address_from_interface_name(local_interface); + local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); + // sflphone_get_interface_addr_from_name((char *)local_interface); + sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr); - gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); - - // gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); - // gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); - } + gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); + gtk_entry_set_text (GTK_ENTRY(publishedAddressEntry), local_iface_addr); + + // gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); + // gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); + g_free(local_iface_addr); + } } static set_published_addr_manually_cb(GtkWidget * widget, gpointer data UNUSED) { - DEBUG("set_published_addr_manually_cb"); - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Showing manual options"); - gtk_widget_show(publishedPortLabel); - gtk_widget_show(publishedPortSpinBox); - gtk_widget_show(publishedAddressLabel); - gtk_widget_show(publishedAddressEntry); - } else { - DEBUG("Hiding manual options"); - gtk_widget_hide(publishedPortLabel); - gtk_widget_hide(publishedPortSpinBox); - gtk_widget_hide(publishedAddressLabel); - gtk_widget_hide(publishedAddressEntry); - } + DEBUG("set_published_addr_manually_cb"); + + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { + DEBUG("Showing manual options"); + gtk_widget_show(publishedPortLabel); + gtk_widget_show(publishedPortSpinBox); + gtk_widget_show(publishedAddressLabel); + gtk_widget_show(publishedAddressEntry); + } else { + DEBUG("Hiding manual options"); + gtk_widget_hide(publishedPortLabel); + gtk_widget_hide(publishedPortSpinBox); + gtk_widget_hide(publishedAddressLabel); + gtk_widget_hide(publishedAddressEntry); + } } -static use_stun_cb(GtkWidget * widget, gpointer data UNUSED) +static use_stun_cb(GtkWidget *widget, gpointer data UNUSED) { - gchar * local_interface; - gchar * local_address; - - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Showing stun options, hiding Local/Published info"); - gtk_widget_show(stunServerLabel); - gtk_widget_show(stunServerEntry); - gtk_widget_set_sensitive(sameAsLocalRadioButton, FALSE); - gtk_widget_set_sensitive(publishedAddrRadioButton, FALSE); - DEBUG("Problem occurs here"); - gtk_widget_hide(publishedAddressLabel); - gtk_widget_hide(publishedPortLabel); - gtk_widget_hide(publishedAddressEntry); - gtk_widget_hide(publishedPortSpinBox); - } else { - gtk_widget_hide(stunServerLabel); - gtk_widget_hide(stunServerEntry); - gtk_widget_set_sensitive(sameAsLocalRadioButton, TRUE); - gtk_widget_set_sensitive(publishedAddrRadioButton, TRUE); - if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { - gtk_widget_show(publishedAddressLabel); - gtk_widget_show(publishedPortLabel); - gtk_widget_show(publishedAddressEntry); - gtk_widget_show(publishedPortSpinBox); - - // Since stun callback is called at initialization, we cannot reinit published address - // TODO: find a way so that if stun is unchecked, reinit published address entry - // in case local address changedd - - // local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); - // local_address = dbus_get_address_from_interface_name(local_interface); - // gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); + gchar *local_interface; + gchar *local_address; + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) { + + DEBUG("Showing stun options, hiding Local/Published info"); + gtk_widget_show (stunServerLabel); + gtk_widget_show (stunServerEntry); + gtk_widget_set_sensitive (sameAsLocalRadioButton, FALSE); + gtk_widget_set_sensitive (publishedAddrRadioButton, FALSE); + DEBUG("Problem occurs here"); + gtk_widget_hide (publishedAddressLabel); + gtk_widget_hide (publishedPortLabel); + gtk_widget_hide (publishedAddressEntry); + gtk_widget_hide (publishedPortSpinBox); + + } else { + + gtk_widget_hide (stunServerLabel); + gtk_widget_hide (stunServerEntry); + gtk_widget_set_sensitive (sameAsLocalRadioButton, TRUE); + gtk_widget_set_sensitive (publishedAddrRadioButton, TRUE); + + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton))) { + gtk_widget_show (publishedAddressLabel); + gtk_widget_show (publishedPortLabel); + gtk_widget_show (publishedAddressEntry); + gtk_widget_show (publishedPortSpinBox); + + // Since stun callback is called at initialization, we cannot reinit published address + // TODO: find a way so that if stun is unchecked, reinit published address entry + // in case local address changedd + + // local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); + // local_address = dbus_get_address_from_interface_name(local_interface); + // gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); + } } - } - } static same_as_local_cb(GtkWidget * widget, gpointer data UNUSED) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Same as local"); - gchar * local_interface; - gchar * local_address; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { + DEBUG("Same as local"); + gchar * local_interface; + gchar * local_address; - local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); - local_address = dbus_get_address_from_interface_name(local_interface); + local_interface = (gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); + // sflphone_get_interface_addr_from_name((char *)local_interface); + local_address = dbus_get_address_from_interface_name(local_interface); - gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); - - gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); - } + gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); + + gchar * local_port = (gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(local_port, NULL)); + } } -GtkWidget * create_security_tab(account_t **a) -{ - GtkWidget * frame; - GtkWidget * table; - GtkWidget * label; - GtkWidget * ret; - GtkWidget * hbox; - GtkWidget * editButton; - GtkWidget * addButton; - GtkWidget * clearTextCheckbox; - GtkCellRenderer * renderer; - GtkTreeViewColumn * treeViewColumn; - GtkTreeSelection * treeSelection; - - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - account_t * currentAccount; - currentAccount = *a; - - gchar * curSRTPEnabled = NULL; - gchar * curKeyExchange = NULL; - gchar * curTLSEnabled = NULL; - gchar* published_address; - gchar* published_port; - - // Load from SIP/IAX/Unknown ? - if(currentAccount) { - curKeyExchange = g_hash_table_lookup(currentAccount->properties, ACCOUNT_KEY_EXCHANGE); - if (curKeyExchange == NULL) { - curKeyExchange = "none"; - } - - curSRTPEnabled = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SRTP_ENABLED); - if (curSRTPEnabled == NULL) { - curSRTPEnabled = "false"; - } - - curTLSEnabled = g_hash_table_lookup(currentAccount->properties, TLS_ENABLE); - if (curTLSEnabled == NULL) { - curTLSEnabled = "false"; - } +GtkWidget* create_credential_widget (account_t **a) { - published_address = g_hash_table_lookup(currentAccount->properties, PUBLISHED_ADDRESS); + GtkWidget *frame, *table, *scrolledWindowCredential, *addButton; + GtkCellRenderer * renderer; + GtkTreeViewColumn * treeViewColumn; + GtkTreeSelection * treeSelection; - published_port = g_hash_table_lookup(currentAccount->properties, PUBLISHED_PORT); - - DEBUG("TLS is enabled to %s", curTLSEnabled); - } - - /* Credentials tree view */ - gnome_main_section_new_with_table (_("Credential"), &frame, &table, 1, 1); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings(GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - scrolledWindowCredential = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindowCredential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindowCredential), GTK_SHADOW_IN); - gtk_table_attach_defaults (GTK_TABLE(table), scrolledWindowCredential, 0, 1, 0, 1); - - credentialStore = gtk_list_store_new(COLUMN_CREDENTIAL_COUNT, - G_TYPE_STRING, // Realm - G_TYPE_STRING, // Username - G_TYPE_STRING, // Password - G_TYPE_POINTER // Pointer to the Objectc - ); - - treeViewCredential = gtk_tree_view_new_with_model(GTK_TREE_MODEL(credentialStore)); - treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeViewCredential)); - g_signal_connect(G_OBJECT (treeSelection), "changed", G_CALLBACK (select_credential_cb), credentialStore); - - renderer = gtk_cell_renderer_text_new(); - g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); - g_signal_connect(G_OBJECT (renderer), "edited", G_CALLBACK(cell_edited_cb), credentialStore); - g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_REALM)); - treeViewColumn = gtk_tree_view_column_new_with_attributes ("Realm", - renderer, - "markup", COLUMN_CREDENTIAL_REALM, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); - - renderer = gtk_cell_renderer_text_new(); - g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); - g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); - g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Authentication name"), - renderer, - "markup", COLUMN_CREDENTIAL_USERNAME, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); - - renderer = gtk_cell_renderer_text_new(); - g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); - g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); - g_signal_connect (renderer, "editing-started", G_CALLBACK (editing_started_cb), NULL); - g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Password"), - renderer, - "markup", COLUMN_CREDENTIAL_PASSWORD, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); - - gtk_container_add(GTK_CONTAINER(scrolledWindowCredential), treeViewCredential); - - fill_treeview_with_credential(credentialStore, *a); - - /* Credential Buttons */ - hbox = gtk_hbox_new(FALSE, 10); - gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 3, 1, 2); - - addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); - g_signal_connect (addButton, "clicked", G_CALLBACK (add_credential_cb), credentialStore); - gtk_box_pack_start(GTK_BOX(hbox), addButton, FALSE, FALSE, 0); - - deleteCredButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); - g_signal_connect (deleteCredButton, "clicked", G_CALLBACK (delete_credential_cb), treeViewCredential); - gtk_box_pack_start(GTK_BOX(hbox), deleteCredButton, FALSE, FALSE, 0); + /* Credentials tree view */ + gnome_main_section_new_with_table (_("Credential"), &frame, &table, 1, 1); + gtk_container_set_border_width (GTK_CONTAINER(table), 10); + gtk_table_set_row_spacings(GTK_TABLE(table), 10); + + scrolledWindowCredential = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledWindowCredential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledWindowCredential), GTK_SHADOW_IN); + gtk_table_attach_defaults (GTK_TABLE (table), scrolledWindowCredential, 0, 1, 0, 1); + + credentialStore = gtk_list_store_new(COLUMN_CREDENTIAL_COUNT, + G_TYPE_STRING, // Realm + G_TYPE_STRING, // Username + G_TYPE_STRING, // Password + G_TYPE_POINTER // Pointer to the Objectc + ); + + treeViewCredential = gtk_tree_view_new_with_model(GTK_TREE_MODEL(credentialStore)); + treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeViewCredential)); + g_signal_connect(G_OBJECT (treeSelection), "changed", G_CALLBACK (select_credential_cb), credentialStore); + + renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); + g_signal_connect(G_OBJECT (renderer), "edited", G_CALLBACK(cell_edited_cb), credentialStore); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_REALM)); + treeViewColumn = gtk_tree_view_column_new_with_attributes ("Realm", + renderer, + "markup", COLUMN_CREDENTIAL_REALM, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); + + renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); + g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_USERNAME)); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Authentication name"), + renderer, + "markup", COLUMN_CREDENTIAL_USERNAME, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); + + renderer = gtk_cell_renderer_text_new(); + g_object_set (renderer, "editable", TRUE, "editable-set", TRUE, NULL); + g_signal_connect (G_OBJECT (renderer), "edited", G_CALLBACK (cell_edited_cb), credentialStore); + g_signal_connect (renderer, "editing-started", G_CALLBACK (editing_started_cb), NULL); + g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_CREDENTIAL_PASSWORD)); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Password"), + renderer, + "markup", COLUMN_CREDENTIAL_PASSWORD, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(treeViewCredential), treeViewColumn); + + gtk_container_add(GTK_CONTAINER(scrolledWindowCredential), treeViewCredential); + + fill_treeview_with_credential(credentialStore, *a); + + /* Credential Buttons */ + hbox = gtk_hbox_new(FALSE, 10); + gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 3, 1, 2); + + addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); + g_signal_connect (addButton, "clicked", G_CALLBACK (add_credential_cb), credentialStore); + gtk_box_pack_start(GTK_BOX(hbox), addButton, FALSE, FALSE, 0); + + deleteCredButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); + g_signal_connect (deleteCredButton, "clicked", G_CALLBACK (delete_credential_cb), treeViewCredential); + gtk_box_pack_start(GTK_BOX(hbox), deleteCredButton, FALSE, FALSE, 0); + + /* Dynamically resize the window to fit the scrolled window */ + GtkRequisition requisitionTable; + GtkRequisition requisitionTreeView; + gtk_widget_size_request (GTK_WIDGET(treeViewCredential), &requisitionTreeView); + gtk_widget_size_request (GTK_WIDGET(table), &requisitionTable); + gtk_widget_set_size_request (GTK_WIDGET(scrolledWindowCredential), 400, /*requisitionTable.width,*/ 120); + // same_as_local_cb (sameAsLocalRadioButton, NULL); + // set_published_addr_manually_cb (publishedAddrRadioButton, NULL); - /* Security Section */ - gnome_main_section_new_with_table (_("Security"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings (GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - /* TLS subsection */ - GtkWidget * sipTlsAdvancedButton; - sipTlsAdvancedButton = gtk_button_new_from_stock(GTK_STOCK_EDIT); - gtk_table_attach_defaults(GTK_TABLE(table), sipTlsAdvancedButton, 2, 3, 0, 1); - gtk_widget_set_sensitive(GTK_WIDGET(sipTlsAdvancedButton), FALSE); - g_signal_connect(G_OBJECT(sipTlsAdvancedButton), "clicked", G_CALLBACK(show_advanced_tls_options_cb), currentAccount->properties); - - useSipTlsCheckBox = gtk_check_button_new_with_mnemonic(_("Use TLS transport (sips)")); - g_signal_connect (useSipTlsCheckBox, "toggled", G_CALLBACK(use_sip_tls_cb), sipTlsAdvancedButton); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox), (g_strcmp0(curTLSEnabled, "true") == 0) ? TRUE:FALSE); - gtk_table_attach_defaults(GTK_TABLE(table), useSipTlsCheckBox, 0, 2, 0, 1); - - /* ZRTP subsection */ - label = gtk_label_new_with_mnemonic (_("SRTP key exchange")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - keyExchangeCombo = gtk_combo_box_new_text(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP"); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES"); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled")); - - advancedZrtpButton = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES); - g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb), currentAccount->properties); - - if (g_strcmp0(curSRTPEnabled, "false") == 0) - { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); - } else { - if (strcmp(curKeyExchange, ZRTP) == 0) { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0); - } - else if (strcmp(curKeyExchange, SDES) == 0) { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),1); + + return frame; +} + + +GtkWidget* create_security_widget (account_t **a) { + + GtkWidget *frame, *table, *sipTlsAdvancedButton, *label; + gchar *curSRTPEnabled = NULL, *curKeyExchange = NULL, *curTLSEnabled = NULL; + + // Load from SIP/IAX/Unknown ? + if((*a)) { + curKeyExchange = g_hash_table_lookup ((*a)->properties, ACCOUNT_KEY_EXCHANGE); + if (curKeyExchange == NULL) { + curKeyExchange = "none"; + } + + curSRTPEnabled = g_hash_table_lookup ((*a)->properties, ACCOUNT_SRTP_ENABLED); + if (curSRTPEnabled == NULL) { + curSRTPEnabled = "false"; + } + + curTLSEnabled = g_hash_table_lookup ((*a)->properties, TLS_ENABLE); + if (curTLSEnabled == NULL) { + curTLSEnabled = "false"; + } } - else { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); - } - } - - g_signal_connect (G_OBJECT (GTK_COMBO_BOX(keyExchangeCombo)), "changed", G_CALLBACK (key_exchange_changed_cb), currentAccount); - - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), keyExchangeCombo, 1, 2, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), advancedZrtpButton, 2, 3, 1, 2); - gtk_widget_show_all(table); - - /* Dynamically resize the window to fit the scrolled window */ - GtkRequisition requisitionTable; - GtkRequisition requisitionTreeView; - gtk_widget_size_request(GTK_WIDGET(treeViewCredential), &requisitionTreeView); - gtk_widget_size_request(GTK_WIDGET(table), &requisitionTable); - gtk_widget_set_size_request(GTK_WIDGET(scrolledWindowCredential), requisitionTable.width, 120); - - same_as_local_cb(sameAsLocalRadioButton, NULL); - set_published_addr_manually_cb(publishedAddrRadioButton, NULL); + gnome_main_section_new_with_table (_("Security"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER(table), 10); + gtk_table_set_row_spacings (GTK_TABLE(table), 10); + gtk_table_set_col_spacings (GTK_TABLE(table), 10); + + /* TLS subsection */ + sipTlsAdvancedButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); + gtk_table_attach_defaults (GTK_TABLE (table), sipTlsAdvancedButton, 2, 3, 0, 1); + gtk_widget_set_sensitive (GTK_WIDGET (sipTlsAdvancedButton), FALSE); + g_signal_connect (G_OBJECT (sipTlsAdvancedButton), "clicked", G_CALLBACK (show_advanced_tls_options_cb), (*a)->properties); + + useSipTlsCheckBox = gtk_check_button_new_with_mnemonic(_("Use TLS transport (sips)")); + g_signal_connect (useSipTlsCheckBox, "toggled", G_CALLBACK(use_sip_tls_cb), sipTlsAdvancedButton); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox), (g_strcmp0(curTLSEnabled, "true") == 0) ? TRUE:FALSE); + gtk_table_attach_defaults(GTK_TABLE(table), useSipTlsCheckBox, 0, 2, 0, 1); + + /* ZRTP subsection */ + label = gtk_label_new_with_mnemonic (_("SRTP key exchange")); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + keyExchangeCombo = gtk_combo_box_new_text(); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo); + gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP"); + gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES"); + gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled")); - gtk_widget_show_all(ret); - - return ret; + advancedZrtpButton = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES); + g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb), (*a)->properties); + + if (g_strcmp0(curSRTPEnabled, "false") == 0) + { + gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); + gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); + } else { + if (strcmp(curKeyExchange, ZRTP) == 0) { + gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0); + } + else if (strcmp(curKeyExchange, SDES) == 0) { + gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),1); + } + else { + gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); + gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); + } + } + + g_signal_connect (G_OBJECT (GTK_COMBO_BOX(keyExchangeCombo)), "changed", G_CALLBACK (key_exchange_changed_cb), *a); + + gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); + gtk_table_attach_defaults(GTK_TABLE(table), keyExchangeCombo, 1, 2, 1, 2); + gtk_table_attach_defaults(GTK_TABLE(table), advancedZrtpButton, 2, 3, 1, 2); + + gtk_widget_show_all(table); + + return frame; } -GtkWidget * create_advanced_tab(account_t **a) +GtkWidget * create_security_tab (account_t **a) { GtkWidget * frame; - GtkWidget * table; - GtkWidget * label; GtkWidget * ret; GtkWidget * hbox; - + ret = gtk_vbox_new(FALSE, 10); gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - account_t * currentAccount; - currentAccount = *a; - gchar * resolve_once = NULL; - gchar * account_expire = NULL; - gchar * use_tls; - gchar * published_address; - gchar * published_port; - gchar * local_interface; - gchar * local_address; - gchar * local_port; - gchar * stun_enable; - gchar * stun_server; - gchar * published_sameas_local; - - // Load from SIP/IAX/Unknown ? - if(currentAccount) { + /* + published_address = g_hash_table_lookup(currentAccount->properties, PUBLISHED_ADDRESS); - resolve_once = g_hash_table_lookup(currentAccount->properties, ACCOUNT_RESOLVE_ONCE); - account_expire = g_hash_table_lookup(currentAccount->properties, ACCOUNT_REGISTRATION_EXPIRE); - use_tls = g_hash_table_lookup(currentAccount->properties, TLS_ENABLE); + published_port = g_hash_table_lookup(currentAccount->properties, PUBLISHED_PORT); - published_sameas_local = g_hash_table_lookup(currentAccount->properties, PUBLISHED_SAMEAS_LOCAL); + DEBUG("TLS is enabled to %s", curTLSEnabled); + } */ - local_interface = g_hash_table_lookup(currentAccount->properties, LOCAL_INTERFACE); + // Credentials frame + frame = create_credential_widget (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - local_port = g_hash_table_lookup(currentAccount->properties, LOCAL_PORT); + // Security frame + frame = create_security_widget (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); - if (g_strcasecmp(published_sameas_local,"true") == 0) { + gtk_widget_show_all(ret); - published_address = dbus_get_address_from_interface_name(local_interface); - published_port = g_hash_table_lookup(currentAccount->properties, LOCAL_PORT); + return ret; + } - } - else { +GtkWidget* create_registration_expire (account_t **a) { - published_address = g_hash_table_lookup(currentAccount->properties, PUBLISHED_ADDRESS); - published_port = g_hash_table_lookup(currentAccount->properties, PUBLISHED_PORT); - } + GtkWidget *table, *frame, *label; - stun_enable = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_ENABLED); - stun_server = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SIP_STUN_SERVER); - published_sameas_local = g_hash_table_lookup(currentAccount->properties, PUBLISHED_SAMEAS_LOCAL); + gchar *resolve_once=NULL, *account_expire=NULL; - } + if (*a) { + resolve_once = g_hash_table_lookup ((*a)->properties, ACCOUNT_RESOLVE_ONCE); + account_expire = g_hash_table_lookup ((*a)->properties, ACCOUNT_REGISTRATION_EXPIRE); + } - gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings( GTK_TABLE(table), 5); + gnome_main_section_new_with_table (_("Registration"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER(table), 10); + gtk_table_set_row_spacings (GTK_TABLE (table), 5); + + label = gtk_label_new_with_mnemonic (_("Registration expire")); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + expireSpinBox = gtk_spin_button_new_with_range (1, 65535, 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), expireSpinBox); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (expireSpinBox), g_ascii_strtod (account_expire, NULL)); + gtk_table_attach_defaults (GTK_TABLE (table), expireSpinBox, 1, 2, 0, 1); + - label = gtk_label_new_with_mnemonic (_("Registration expire")); - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - expireSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), expireSpinBox); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(expireSpinBox), g_ascii_strtod(account_expire, NULL)); - gtk_table_attach_defaults(GTK_TABLE(table), expireSpinBox, 1, 2, 0, 1); + entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic (_("_Comply with RFC 3263")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (entryResolveNameOnlyOnce), + g_strcasecmp (resolve_once,"false") == 0 ? TRUE: FALSE); + gtk_table_attach_defaults (GTK_TABLE (table), entryResolveNameOnlyOnce, 0, 2, 1, 2); + gtk_widget_set_sensitive (GTK_WIDGET (entryResolveNameOnlyOnce ) , TRUE ); + return frame; +} - entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic(_("_Comply with RFC 3263")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce), - g_strcasecmp(resolve_once,"false") == 0 ? TRUE: FALSE); - gtk_table_attach_defaults( GTK_TABLE( table ), entryResolveNameOnlyOnce, 0, 2, 1, 2); - gtk_widget_set_sensitive( GTK_WIDGET( entryResolveNameOnlyOnce ) , TRUE ); - - - gnome_main_section_new_with_table (_("Network Interface"), &frame, &table, 2, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings( GTK_TABLE(table), 5); - - /** - * Retreive the list of IP interface from the - * the daemon and build the combo box. - */ - - GtkListStore * ipInterfaceListStore; - GtkTreeIter iter; - - ipInterfaceListStore = gtk_list_store_new( 1, G_TYPE_STRING ); - localAddressLabel = gtk_label_new_with_mnemonic (_("Local address")); - gtk_table_attach ( GTK_TABLE( table ), localAddressLabel, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (localAddressLabel), 0, 0.5); - - GtkTreeIter current_local_address_iter = iter; - gchar ** iface_list = NULL; - // iface_list = (gchar**) dbus_get_all_ip_interface(); - iface_list = (gchar**) dbus_get_all_ip_interface_by_name(); - gchar ** iface = NULL; - - // flag to determine if local_address is found - gboolean iface_found = FALSE; +GtkWidget* create_network (account_t **a) { + + GtkWidget *table, *frame, *label; + gchar *local_interface, *local_port; + + if (*a) { + local_interface = g_hash_table_lookup ((*a)->properties, LOCAL_INTERFACE); + local_port = g_hash_table_lookup ((*a)->properties, LOCAL_PORT); + } + + gnome_main_section_new_with_table (_("Network Interface"), &frame, &table, 2, 3); + gtk_container_set_border_width (GTK_CONTAINER(table), 10); + gtk_table_set_row_spacings( GTK_TABLE(table), 5); + + /** + * Retreive the list of IP interface from the + * the daemon and build the combo box. + */ + + GtkListStore * ipInterfaceListStore; + GtkTreeIter iter; + + ipInterfaceListStore = gtk_list_store_new( 1, G_TYPE_STRING ); + label = gtk_label_new_with_mnemonic (_("Local address")); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); - if (iface_list != NULL) { + GtkTreeIter current_local_iface_iter = iter; + gchar ** iface_list = NULL; + // iface_list = (gchar**) dbus_get_all_ip_interface(); + iface_list = (gchar**) dbus_get_all_ip_interface_by_name(); + gchar ** iface = NULL; - // fill the iterface combo box - for (iface = iface_list; *iface; iface++) { - DEBUG("Interface %s", *iface); - gtk_list_store_append(ipInterfaceListStore, &iter ); - gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); + // flag to determine if local_address is found + gboolean iface_found = FALSE; + + gchar *local_iface_addr; + gchar *local_iface_name; + + local_iface_addr= g_malloc(18); + + if (iface_list != NULL) { + + // fill the iterface combo box + for (iface = iface_list; *iface; iface++) { + DEBUG("Interface %s", *iface); + gtk_list_store_append(ipInterfaceListStore, &iter ); + gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); // set the current local address if (!iface_found && (g_strcmp0(*iface, local_interface) == 0)) { - DEBUG("Setting active local address combo box"); - current_local_address_iter = iter; + DEBUG("Setting active local address combo box"); + current_local_iface_iter = iter; iface_found = TRUE; - } - } - - if(!iface_found) { - DEBUG("Did not find local ip address, take fisrt in the list"); - gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ipInterfaceListStore), ¤t_local_address_iter); } - } + + if(!iface_found) { + DEBUG("Did not find local ip address, take fisrt in the list"); + gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ipInterfaceListStore), ¤t_local_iface_iter); + } + + } + - localAddressCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ipInterfaceListStore)); - gtk_label_set_mnemonic_widget(GTK_LABEL(localAddressLabel), localAddressCombo); - gtk_table_attach ( GTK_TABLE( table ), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - g_object_unref(G_OBJECT(ipInterfaceListStore)); + localAddressCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ipInterfaceListStore)); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), localAddressCombo); + gtk_table_attach ( GTK_TABLE( table ), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + g_object_unref(G_OBJECT(ipInterfaceListStore)); + + + GtkCellRenderer * ipInterfaceCellRenderer; + ipInterfaceCellRenderer = gtk_cell_renderer_text_new(); + + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, TRUE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL); + gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), ¤t_local_iface_iter); + + + // Fill the text entry with the ip address of local interface selected + localAddressEntry = gtk_entry_new(); + local_iface_name = (gchar *) gtk_combo_box_get_active_text (GTK_COMBO_BOX (localAddressCombo)); + sflphone_get_interface_addr_from_name(local_iface_name, &local_iface_addr); + gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); + gtk_widget_set_sensitive(localAddressEntry, FALSE); + gtk_table_attach ( GTK_TABLE( table ), localAddressEntry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + g_free(local_iface_addr); - GtkCellRenderer * ipInterfaceCellRenderer; - ipInterfaceCellRenderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL); - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), ¤t_local_address_iter); + // Local port widget + label = gtk_label_new_with_mnemonic (_("Local port")); + gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); + gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); + localPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), localPortSpinBox); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(localPortSpinBox), g_ascii_strtod(local_port, NULL)); + + gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2); + + return frame; +} + +GtkWidget* create_published_address (account_t **a) { + + GtkWidget *table, *frame, *label; + gchar *use_tls, *published_address, *published_port, *local_address, *stun_enable, *stun_server, *published_sameas_local; + // Get the user configuration + if (*a) { - /** - * Local port - */ - localPortLabel = gtk_label_new_with_mnemonic (_("Local port")); - gtk_table_attach_defaults(GTK_TABLE(table), localPortLabel, 0, 1, 1, 2); - gtk_misc_set_alignment(GTK_MISC (localPortLabel), 0, 0.5); - localPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); - gtk_label_set_mnemonic_widget (GTK_LABEL (localPortLabel), localPortSpinBox); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(localPortSpinBox), g_ascii_strtod(local_port, NULL)); + use_tls = g_hash_table_lookup ((*a)->properties, TLS_ENABLE); + published_sameas_local = g_hash_table_lookup ((*a)->properties, PUBLISHED_SAMEAS_LOCAL); - gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2); + if (g_strcasecmp (published_sameas_local, "true") == 0) { + published_address = dbus_get_address_from_interface_name (g_hash_table_lookup ((*a)->properties, LOCAL_INTERFACE)); + published_port = g_hash_table_lookup ((*a)->properties, LOCAL_PORT); + } + else { + published_address = g_hash_table_lookup ((*a)->properties, PUBLISHED_ADDRESS); + published_port = g_hash_table_lookup ((*a)->properties, PUBLISHED_PORT); + } + stun_enable = g_hash_table_lookup ((*a)->properties, ACCOUNT_SIP_STUN_ENABLED); + stun_server = g_hash_table_lookup ((*a)->properties, ACCOUNT_SIP_STUN_SERVER); + published_sameas_local = g_hash_table_lookup ((*a)->properties, PUBLISHED_SAMEAS_LOCAL); + } - /** - * Published address field - */ gnome_main_section_new_with_table (_("Published address"), &frame, &table, 2, 3); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings( GTK_TABLE(table), 5); - + gtk_table_set_row_spacings (GTK_TABLE (table), 5); useStunCheckBox = gtk_check_button_new_with_mnemonic(_("Using STUN")); gtk_table_attach_defaults(GTK_TABLE(table), useStunCheckBox, 0, 1, 0, 1); @@ -948,9 +1068,9 @@ GtkWidget * create_advanced_tab(account_t **a) stunServerLabel = gtk_label_new_with_mnemonic (_("STUN server URL")); gtk_table_attach_defaults(GTK_TABLE(table), stunServerLabel, 0, 1, 1, 2); - gtk_misc_set_alignment(GTK_MISC(stunServerLabel), 0, 0.5); + gtk_misc_set_alignment(GTK_MISC (stunServerLabel), 0, 0.5); stunServerEntry = gtk_entry_new(); - gtk_label_set_mnemonic_widget(GTK_LABEL(stunServerLabel), stunServerEntry); + gtk_label_set_mnemonic_widget (GTK_LABEL (stunServerLabel), stunServerEntry); gtk_entry_set_text(GTK_ENTRY(stunServerEntry), stun_server); gtk_table_attach_defaults(GTK_TABLE(table), stunServerEntry, 1, 2, 1, 2); @@ -960,14 +1080,12 @@ GtkWidget * create_advanced_tab(account_t **a) publishedAddrRadioButton = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(sameAsLocalRadioButton), _("Set published address and port:")); gtk_table_attach_defaults(GTK_TABLE(table), publishedAddrRadioButton, 0, 2, 4, 5); - if(g_strcasecmp(published_sameas_local, "true") == 0) { - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(sameAsLocalRadioButton), TRUE); + if (g_strcasecmp (published_sameas_local, "true") == 0) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sameAsLocalRadioButton), TRUE); } else { - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(publishedAddrRadioButton), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (publishedAddrRadioButton), TRUE); } - gtk_widget_show_all(ret); - publishedAddressLabel = gtk_label_new_with_mnemonic (_("Published address")); gtk_table_attach_defaults( GTK_TABLE(table), publishedAddressLabel, 0, 1, 5, 6); gtk_misc_set_alignment(GTK_MISC (publishedAddressLabel), 0, 0.5); @@ -976,16 +1094,16 @@ GtkWidget * create_advanced_tab(account_t **a) gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), published_address); gtk_table_attach_defaults( GTK_TABLE(table), publishedAddressEntry, 1, 2, 5, 6); - + publishedPortLabel = gtk_label_new_with_mnemonic(_("Published port")); gtk_table_attach_defaults(GTK_TABLE(table), publishedPortLabel, 0, 1, 6, 7); - gtk_misc_set_alignment(GTK_MISC(publishedPortLabel), 0, 0.5); + gtk_misc_set_alignment(GTK_MISC (publishedPortLabel), 0, 0.5); publishedPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); gtk_label_set_mnemonic_widget(GTK_LABEL (publishedPortLabel), publishedPortSpinBox); gtk_spin_button_set_value(GTK_SPIN_BUTTON(publishedPortSpinBox), g_ascii_strtod(published_port, NULL)); gtk_table_attach_defaults(GTK_TABLE(table), publishedPortSpinBox, 1, 2, 6, 7); - + use_stun_cb (GTK_WIDGET (useStunCheckBox), NULL); // This will trigger a signal, and the above two @@ -997,68 +1115,82 @@ GtkWidget * create_advanced_tab(account_t **a) g_signal_connect(sameAsLocalRadioButton, "toggled", G_CALLBACK(same_as_local_cb), sameAsLocalRadioButton); g_signal_connect(publishedAddrRadioButton, "toggled", G_CALLBACK(set_published_addr_manually_cb), publishedAddrRadioButton); + return frame; +} + +GtkWidget* create_advanced_tab (account_t **a) { + + // Build the advanced tab, to appear on the account configuration panel + + GtkWidget *ret, *frame; + + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER(ret), 10); + + frame = create_registration_expire (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + frame = create_network (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + frame = create_published_address (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + gtk_widget_show_all (ret); return ret; } -static GPtrArray * getNewCredential(GHashTable * properties) -{ - GtkTreeIter iter; - gboolean valid; - gint row_count = 0; +GtkWidget* create_codecs_configuration (account_t **a) { - valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(credentialStore), &iter); + // Main widget + GtkWidget *ret, *codecs, *dtmf, *box, *frame, *sipinfo, *table; + account_t *currentAccount = *a; + gchar *currentDtmfType = ""; + gboolean dtmf_are_rtp = TRUE; - GPtrArray * credential_array = g_ptr_array_new (); - - gchar *username; - gchar *realm; - gchar *password; - GHashTable * new_table; - - gtk_tree_model_get (GTK_TREE_MODEL(credentialStore), &iter, - COLUMN_CREDENTIAL_REALM, &realm, - COLUMN_CREDENTIAL_USERNAME, &username, - COLUMN_CREDENTIAL_PASSWORD, &password, - -1); - - g_hash_table_insert(properties, g_strdup(ACCOUNT_REALM), realm); - g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username); - // Do not change the password is nothing has been changed by the user - if (g_strcasecmp (password, PW_HIDDEN) != 0) - g_hash_table_insert(properties, g_strdup(ACCOUNT_PASSWORD), password); - - valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); - - while (valid) { - gtk_tree_model_get (GTK_TREE_MODEL(credentialStore), &iter, - COLUMN_CREDENTIAL_REALM, &realm, - COLUMN_CREDENTIAL_USERNAME, &username, - COLUMN_CREDENTIAL_PASSWORD, &password, - -1); + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - DEBUG ("Row %d: %s %s %s", row_count, username, password, realm); + box = codecs_box (a); - new_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - g_hash_table_insert(new_table, g_strdup(ACCOUNT_REALM), realm); - g_hash_table_insert(new_table, g_strdup(ACCOUNT_USERNAME), username); - g_hash_table_insert(new_table, g_strdup(ACCOUNT_PASSWORD), password); + // Box for the codecs + gnome_main_section_new (_("Codecs"), &codecs); + gtk_box_pack_start (GTK_BOX(ret), codecs, FALSE, FALSE, 0); + gtk_widget_set_size_request (GTK_WIDGET (codecs), -1, 200); + gtk_widget_show (codecs); + gtk_container_add (GTK_CONTAINER (codecs) , box); - g_ptr_array_add (credential_array, new_table); + // Box for dtmf + gnome_main_section_new_with_table (_("DTMF"), &dtmf, &table, 1, 2); + gtk_box_pack_start (GTK_BOX(ret), dtmf, FALSE, FALSE, 0); + gtk_widget_show (dtmf); - row_count ++; - valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter); - } + currentDtmfType = g_hash_table_lookup (currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE)); + if (g_strcasecmp(currentDtmfType, OVERRTP) != 0) { + dtmf_are_rtp = FALSE; + } + + overrtp = gtk_radio_button_new_with_label( NULL, _("RTP") ); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(overrtp), dtmf_are_rtp); + gtk_table_attach ( GTK_TABLE( table ), overrtp, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + sipinfo = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(overrtp), _("SIP")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(sipinfo), !dtmf_are_rtp); + g_signal_connect(G_OBJECT(sipinfo), "clicked", G_CALLBACK(select_dtmf_type), NULL); + gtk_table_attach ( GTK_TABLE( table ), sipinfo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + + gtk_widget_show_all(ret); + + return ret; - return credential_array; } - void -show_account_window (account_t * a) -{ +void show_account_window (account_t * a) { GtkWidget * notebook; - GtkWidget * tab; + GtkWidget *tab, *codecs_tab, *ip_tab; gint response; account_t *currentAccount; @@ -1068,14 +1200,15 @@ show_account_window (account_t * a) gchar * published_address; currentAccount = a; - + if (currentAccount == NULL) { currentAccount = g_new0(account_t, 1); currentAccount->properties = dbus_account_details(NULL); currentAccount->accountID = "new"; + sflphone_fill_codec_list_per_account (¤tAccount); DEBUG("Account is NULL. Will fetch default values\n"); } - + dialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Account settings"), GTK_WINDOW(get_main_window()), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, @@ -1093,141 +1226,183 @@ show_account_window (account_t * a) gtk_container_set_border_width(GTK_CONTAINER(notebook), 10); gtk_widget_show(notebook); - /* General Settings */ - tab = create_basic_tab(¤tAccount); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - - /* Advanced */ - advanced_tab = create_advanced_tab(¤tAccount); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), advanced_tab, gtk_label_new(_("Advanced"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), advanced_tab); - - /* Security */ - security_tab = create_security_tab(¤tAccount); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), security_tab, gtk_label_new(_("Security"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook),security_tab); - - gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook) , 0); - - g_signal_emit_by_name(protocolComboBox, "changed", NULL); - + // We do not need the global settings for the IP2IP account + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + /* General Settings */ + tab = create_basic_tab(¤tAccount); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic"))); + gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + g_signal_emit_by_name (protocolComboBox, "changed", NULL); + + } + + /* Codecs */ + codecs_tab = create_codecs_configuration (¤tAccount); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), codecs_tab, gtk_label_new(_("Codecs"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), codecs_tab); + + // We do not need these one either for the IP2IP account + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + /* Advanced */ + advanced_tab = create_advanced_tab(¤tAccount); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), advanced_tab, gtk_label_new(_("Advanced"))); + gtk_notebook_page_num(GTK_NOTEBOOK(notebook), advanced_tab); + + /* Security */ + security_tab = create_security_tab (¤tAccount); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), security_tab, gtk_label_new(_("Security"))); + gtk_notebook_page_num(GTK_NOTEBOOK(notebook),security_tab); + } + + else { + + /* Custom tab for the IP to IP profile */ + ip_tab = create_direct_ip_calls_tab (¤tAccount); + gtk_notebook_prepend_page (GTK_NOTEBOOK (notebook), ip_tab, gtk_label_new(_("Network"))); + gtk_notebook_page_num (GTK_NOTEBOOK (notebook), ip_tab); + } + + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook) , 0); + response = gtk_dialog_run (GTK_DIALOG (dialog)); if(response == GTK_RESPONSE_ACCEPT) { - gchar* proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); - - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_RESOLVE_ONCE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true")); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_ALIAS), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_TYPE), - g_strdup(proto)); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_HOSTNAME), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryHostname)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_USERNAME), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_PASSWORD), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryPassword)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_MAILBOX), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(ACCOUNT_REGISTRATION_EXPIRE), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(expireSpinBox)))); - - - if (strcmp(proto, "SIP") == 0) { - - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox)) ? "true":"false")); - - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), - g_strdup(gtk_entry_get_text(GTK_ENTRY(stunServerEntry)))); + gchar *proto = "SIP"; + + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + proto = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); + + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_RESOLVE_ONCE), + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce)) ? "false": "true")); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_ALIAS), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryAlias)))); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_TYPE), + g_strdup(proto)); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_HOSTNAME), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryHostname)))); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_USERNAME), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryUsername)))); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_PASSWORD), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryPassword)))); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_MAILBOX), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(entryMailbox)))); + g_hash_table_replace(currentAccount->properties, + g_strdup(ACCOUNT_REGISTRATION_EXPIRE), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(expireSpinBox)))); + } + + + if (strcmp (proto, "SIP") == 0) { + + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_USERAGENT), + g_strdup(gtk_entry_get_text (GTK_ENTRY(entryUseragent)))); + + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useStunCheckBox)) ? "true":"false")); + + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), + g_strdup(gtk_entry_get_text(GTK_ENTRY(stunServerEntry)))); + + g_hash_table_replace(currentAccount->properties, g_strdup(PUBLISHED_SAMEAS_LOCAL), g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton)) ? "true":"false")); + + if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) + { + + g_hash_table_replace(currentAccount->properties, + g_strdup(PUBLISHED_PORT), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedPortSpinBox)))); + + g_hash_table_replace(currentAccount->properties, + g_strdup(PUBLISHED_ADDRESS), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedAddressEntry)))); + } + else { + + g_hash_table_replace(currentAccount->properties, + g_strdup(PUBLISHED_PORT), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); + local_interface = g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo))); + + published_address = dbus_get_address_from_interface_name(local_interface); + + g_hash_table_replace(currentAccount->properties, + g_strdup(PUBLISHED_ADDRESS), + published_address); + } + } + + + if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(overrtp))) { + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE), g_strdup(OVERRTP)); + } + else { + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE), g_strdup(SIPINFO)); + } gchar* keyExchange = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)); + if (g_strcasecmp(keyExchange, "ZRTP") == 0) { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(ZRTP)); + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(ZRTP)); } + else if(g_strcasecmp(keyExchange, "SDES") == 0) { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(SDES)); + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(SDES)); } + else { - g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("false")); + g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("false")); } - + g_hash_table_replace(currentAccount->properties, g_strdup(TLS_ENABLE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox)) ? "true":"false")); + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox)) ? "true":"false")); - g_hash_table_replace(currentAccount->properties, g_strdup(PUBLISHED_SAMEAS_LOCAL), g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton)) ? "true":"false")); g_hash_table_replace(currentAccount->properties, - g_strdup(LOCAL_INTERFACE), - g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); + g_strdup(LOCAL_INTERFACE), + g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); g_hash_table_replace(currentAccount->properties, - g_strdup(LOCAL_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); - - if(!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) - { - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedPortSpinBox)))); - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_ADDRESS), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(publishedAddressEntry)))); - } - else { + g_strdup(LOCAL_PORT), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_PORT), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); - local_interface = g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo))); - - published_address = dbus_get_address_from_interface_name(local_interface); - - g_hash_table_replace(currentAccount->properties, - g_strdup(PUBLISHED_ADDRESS), - published_address); - } - } - - /* Set new credentials if any */ - DEBUG("Setting credentials"); - - /* This hack is necessary because of the way the - * configuration file is made (.ini at that time). - * and deleting account per account is too much - * of a trouble. - */ - dbus_delete_all_credential(currentAccount); - - GPtrArray * credential = getNewCredential(currentAccount->properties); - currentAccount->credential_information = credential; - if(currentAccount->credential_information != NULL) { - int i; - for(i = 0; i < currentAccount->credential_information->len; i++) { - dbus_set_credential(currentAccount, i); - } - dbus_set_number_of_credential(currentAccount, currentAccount->credential_information->len); + if (g_strcasecmp (currentAccount->accountID, IP2IP) != 0) { + + /* This hack is necessary because of the way the + * configuration file is made (.ini at that time). + * and deleting account per account is too much + * of a trouble. + */ + dbus_delete_all_credential(currentAccount); + + GPtrArray * credential = getNewCredential(currentAccount->properties); + currentAccount->credential_information = credential; + if(currentAccount->credential_information != NULL) { + int i; + for(i = 0; i < currentAccount->credential_information->len; i++) { + dbus_set_credential(currentAccount, i); + } + dbus_set_number_of_credential(currentAccount, currentAccount->credential_information->len); + } } - /** @todo Verify if it's the best condition to check */ if (g_strcasecmp(currentAccount->accountID, "new") == 0) { dbus_add_account(currentAccount); @@ -1235,10 +1410,47 @@ show_account_window (account_t * a) else { dbus_set_account_details(currentAccount); } - - } - + // Perpetuate changes to the deamon + codec_list_update_to_daemon (currentAccount); + } + else { + g_print ("IP to IP call\n"); + // Direct IP calls config + // dbus_set_ip2ip_details (directIpCallsProperties); + } + gtk_widget_destroy (GTK_WIDGET(dialog)); +} + +GtkWidget* create_direct_ip_calls_tab (account_t **a) { + + GtkWidget *ret, *frame, *label; + gchar *description; + + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + description = g_markup_printf_escaped(_("This profile is used when you want to reach a remote peer simply by typing a sip URI such as <b>sip:remotepeer</b>. The settings you define here will also be used if no account can be matched to an incoming or outgoing call.")); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), description); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_box_pack_start (GTK_BOX (ret), label, FALSE, FALSE, 0); + + GtkRequisition requisition; + gtk_widget_size_request (GTK_WIDGET (ret), &requisition); + gtk_widget_set_size_request (GTK_WIDGET (label), 350, -1); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); + + frame = create_network (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + frame = create_security_widget (a); + gtk_box_pack_start (GTK_BOX (ret), frame, FALSE, FALSE, 0); + + gtk_widget_show_all (ret); + return ret; + } + diff --git a/sflphone-client-gnome/src/config/accountconfigdialog.h b/sflphone-client-gnome/src/config/accountconfigdialog.h index 5e6d9132c50ee240aa51122114ace4ea76bda300..7ac27c3f6b66bfefcc82678aadbddea605d4512a 100644 --- a/sflphone-client-gnome/src/config/accountconfigdialog.h +++ b/sflphone-client-gnome/src/config/accountconfigdialog.h @@ -26,11 +26,17 @@ #include "utils.h" #include "preferencesdialog.h" +#include "accountlist.h" /** * Display the main account widget * @param a The account you want to edit or null for a new account */ -void show_account_window ( account_t * a ); +void show_account_window (account_t *a); + +GtkWidget* create_registration_expire (account_t **a); + +GtkWidget* create_direct_ip_calls_tab (account_t **a); + #endif diff --git a/sflphone-client-gnome/src/config/accountlistconfigdialog.c b/sflphone-client-gnome/src/config/accountlistconfigdialog.c index 13ccf28619f703b238b42678778bff4a19d1b4e1..38d0769301453e846b5f32a07a9099d339f9c6e6 100644 --- a/sflphone-client-gnome/src/config/accountlistconfigdialog.c +++ b/sflphone-client-gnome/src/config/accountlistconfigdialog.c @@ -21,6 +21,7 @@ #include <accountlistconfigdialog.h> #include <dbus/dbus.h> +#include <accountconfigdialog.h> #include <actions.h> #include <utils.h> #include <string.h> @@ -38,482 +39,548 @@ GtkListStore * accountStore; GtkDialog * accountListDialog = NULL; - account_t * selectedAccount = NULL; // Account properties enum { - COLUMN_ACCOUNT_ALIAS, - COLUMN_ACCOUNT_TYPE, - COLUMN_ACCOUNT_STATUS, - COLUMN_ACCOUNT_ACTIVE, - COLUMN_ACCOUNT_DATA, - COLUMN_ACCOUNT_COUNT + COLUMN_ACCOUNT_ALIAS, + COLUMN_ACCOUNT_TYPE, + COLUMN_ACCOUNT_STATUS, + COLUMN_ACCOUNT_ACTIVE, + COLUMN_ACCOUNT_DATA, + COLUMN_ACCOUNT_COUNT }; /** * Fills the treelist with accounts */ - void -account_list_config_dialog_fill() -{ - - if (accountListDialog == NULL) { - DEBUG("Dialog is not opened"); - return; - } - - GtkTreeIter iter; - - gtk_list_store_clear(accountStore); - - unsigned int i; - for(i = 0; i < account_list_get_size(); i++) { - account_t * a = account_list_get_nth (i); - - if (a) { - gtk_list_store_append (accountStore, &iter); - - DEBUG("Filling accounts: Account is enabled :%s", g_hash_table_lookup(a->properties, ACCOUNT_ENABLED)); - - gtk_list_store_set(accountStore, &iter, - COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name - COLUMN_ACCOUNT_TYPE, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol - COLUMN_ACCOUNT_STATUS, account_state_name(a->state), // Status - COLUMN_ACCOUNT_ACTIVE, (g_strcasecmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0)? TRUE:FALSE, // Enable/Disable - COLUMN_ACCOUNT_DATA, a, // Pointer - -1); - } - } - -} +void account_list_config_dialog_fill() { -/** - * Delete an account - */ - static void -delete_account_cb(GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - if(selectedAccount != NULL) { - dbus_remove_account(selectedAccount->accountID); - } -} + if (accountListDialog == NULL) { + DEBUG("Dialog is not opened"); + return; + } + GtkTreeIter iter; -/** - * Edit an account - */ - static void -edit_account_cb(GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - if(selectedAccount != NULL) - { - show_account_window(selectedAccount); - } -} + gtk_list_store_clear(accountStore); + + unsigned int i; + for(i = 0; i < account_list_get_size(); i++) { + account_t * a = account_list_get_nth (i); + + if (a) { + gtk_list_store_append (accountStore, &iter); + + DEBUG("Filling accounts: Account is enabled :%s", g_hash_table_lookup(a->properties, ACCOUNT_ENABLED)); + + gtk_list_store_set(accountStore, &iter, + COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name + COLUMN_ACCOUNT_TYPE, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol + COLUMN_ACCOUNT_STATUS, account_state_name(a->state), // Status + COLUMN_ACCOUNT_ACTIVE, (g_strcasecmp(g_hash_table_lookup(a->properties, ACCOUNT_ENABLED),"true") == 0)? TRUE:FALSE, // Enable/Disable + COLUMN_ACCOUNT_DATA, a, // Pointer + -1); + } + } -/** - * Add an account - */ -static void -add_account_cb(GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - show_account_window(NULL); } + + /** * Call back when the user click on an account in the list */ - static void + static void select_account_cb(GtkTreeSelection *selection, GtkTreeModel *model) { - GtkTreeIter iter; - GValue val; + GtkTreeIter iter; + GValue val; gchar *state; - memset (&val, 0, sizeof(val)); - if (!gtk_tree_selection_get_selected(selection, &model, &iter)) - { - selectedAccount = NULL; - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(editButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); - return; - } - - // The Gvalue will be initialized in the following function - gtk_tree_model_get_value(model, &iter, COLUMN_ACCOUNT_DATA, &val); - - selectedAccount = (account_t*)g_value_get_pointer(&val); - g_value_unset(&val); - - if(selectedAccount != NULL) - { - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(editButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), TRUE); - - /* Update status bar about current registration state */ - gtk_statusbar_pop (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION); - - if (selectedAccount->protocol_state_description != NULL - && selectedAccount->protocol_state_code != 0) { - - gchar * response = g_strdup_printf( - _("Server returned \"%s\" (%d)"), - selectedAccount->protocol_state_description, - selectedAccount->protocol_state_code); - gchar * message = g_strconcat( - account_state_name(selectedAccount->state), - ". ", - response, - NULL); - - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); - - g_free(response); - g_free(message); - - } else { - state = (gchar*) account_state_name (selectedAccount->state); - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, state); - } - - } - - DEBUG("Selecting account in account window"); + memset (&val, 0, sizeof(val)); + if (!gtk_tree_selection_get_selected(selection, &model, &iter)) + { + selectedAccount = NULL; + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(editButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); + return; + } + + // The Gvalue will be initialized in the following function + gtk_tree_model_get_value(model, &iter, COLUMN_ACCOUNT_DATA, &val); + + selectedAccount = (account_t*)g_value_get_pointer(&val); + g_value_unset(&val); + + if(selectedAccount != NULL) { + gtk_widget_set_sensitive(GTK_WIDGET(editButton), TRUE); + if (g_strcasecmp (selectedAccount->accountID, IP2IP) != 0) { + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), TRUE); + + /* Update status bar about current registration state */ + gtk_statusbar_pop (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION); + + if (selectedAccount->protocol_state_description != NULL + && selectedAccount->protocol_state_code != 0) { + + gchar * response = g_strdup_printf( + _("Server returned \"%s\" (%d)"), + selectedAccount->protocol_state_description, + selectedAccount->protocol_state_code); + gchar * message = g_strconcat( + account_state_name(selectedAccount->state), + ". ", + response, + NULL); + + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); + + g_free(response); + g_free(message); + + } else { + state = (gchar*) account_state_name (selectedAccount->state); + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, state); + } + } + else { + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); + } + } + + DEBUG("Selecting account in account window"); } - static void -enable_account_cb(GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data ) -{ - GtkTreeIter iter; - GtkTreePath *treePath; - GtkTreeModel *model; - gboolean enable; - account_t* acc ; - - // Get pointer on object - treePath = gtk_tree_path_new_from_string(path); - model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); - gtk_tree_model_get_iter(model, &iter, treePath); - gtk_tree_model_get(model, &iter, - COLUMN_ACCOUNT_ACTIVE, &enable, - COLUMN_ACCOUNT_DATA, &acc, - -1); - enable = !enable; - - DEBUG("Account is %d enabled", enable); - // Store value - gtk_list_store_set(GTK_LIST_STORE(model), &iter, - COLUMN_ACCOUNT_ACTIVE, enable, - -1); - - // Modify account state - gchar * registrationState; - if (enable == TRUE) { - registrationState = g_strdup("true"); - } else { - registrationState = g_strdup("false"); - } - DEBUG("Replacing with %s", registrationState); - g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED), registrationState); - - dbus_send_register(acc->accountID, enable); +static void enable_account_cb (GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data ) { + + GtkTreeIter iter; + GtkTreePath *treePath; + GtkTreeModel *model; + gboolean enable; + account_t* acc ; + + // The IP2IP profile can't be disabled + if (g_strcasecmp (path, "0") == 0) + return; + + // Get pointer on object + treePath = gtk_tree_path_new_from_string(path); + model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); + gtk_tree_model_get_iter(model, &iter, treePath); + gtk_tree_model_get(model, &iter, + COLUMN_ACCOUNT_ACTIVE, &enable, + COLUMN_ACCOUNT_DATA, &acc, + -1); + + enable = !enable; + + DEBUG("Account is %d enabled", enable); + // Store value + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COLUMN_ACCOUNT_ACTIVE, enable, + -1); + + // Modify account state + gchar * registrationState; + if (enable == TRUE) { + registrationState = g_strdup("true"); + } else { + registrationState = g_strdup("false"); + } + DEBUG("Replacing with %s", registrationState); + g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED), registrationState); + + dbus_send_register(acc->accountID, enable); } /** * Move account in list depending on direction and selected account */ - static void -account_move(gboolean moveUp, gpointer data) -{ - GtkTreeIter iter; - GtkTreeIter *iter2; - GtkTreeView *treeView; - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkTreePath *treePath; - gchar *path; - - // Get view, model and selection of codec store - treeView = GTK_TREE_VIEW(data); - model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeView)); - selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeView)); - - // Find selected iteration and create a copy - gtk_tree_selection_get_selected(GTK_TREE_SELECTION(selection), &model, &iter); - iter2 = gtk_tree_iter_copy(&iter); - - // Find path of iteration - path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); - treePath = gtk_tree_path_new_from_string(path); - gint *indices = gtk_tree_path_get_indices(treePath); - gint indice = indices[0]; - - // Depending on button direction get new path - if(moveUp) - gtk_tree_path_prev(treePath); - else - gtk_tree_path_next(treePath); - gtk_tree_model_get_iter(model, &iter, treePath); - - // Swap iterations if valid - if(gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter)) - gtk_list_store_swap(GTK_LIST_STORE(model), &iter, iter2); - - // Scroll to new position - gtk_tree_view_scroll_to_cell(treeView, treePath, NULL, FALSE, 0, 0); - - // Free resources - gtk_tree_path_free(treePath); - gtk_tree_iter_free(iter2); - g_free(path); - - // Perpetuate changes in account queue - if(moveUp) - account_list_move_up(indice); - else - account_list_move_down(indice); - - - // Set the order in the configuration file - dbus_set_accounts_order (account_list_get_ordered_list ()); +static void account_move (gboolean moveUp, gpointer data) { + + GtkTreeIter iter; + GtkTreeIter *iter2; + GtkTreeView *treeView; + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreePath *treePath; + gchar *path; + + // Get view, model and selection of codec store + treeView = GTK_TREE_VIEW (data); + model = gtk_tree_view_get_model (GTK_TREE_VIEW(treeView)); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(treeView)); + + // Find selected iteration and create a copy + gtk_tree_selection_get_selected (GTK_TREE_SELECTION(selection), &model, &iter); + iter2 = gtk_tree_iter_copy (&iter); + + // Find path of iteration + path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); + + // The first real account in the list can't move up because of the IP2IP account + // It can still move down though + if (g_strcasecmp (path, "1") == 0 && moveUp) + return; + + treePath = gtk_tree_path_new_from_string(path); + gint *indices = gtk_tree_path_get_indices(treePath); + gint indice = indices[0]; + + // Depending on button direction get new path + if(moveUp) + gtk_tree_path_prev(treePath); + else + gtk_tree_path_next(treePath); + gtk_tree_model_get_iter(model, &iter, treePath); + + // Swap iterations if valid + if(gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter)) + gtk_list_store_swap(GTK_LIST_STORE(model), &iter, iter2); + + // Scroll to new position + gtk_tree_view_scroll_to_cell (treeView, treePath, NULL, FALSE, 0, 0); + + // Free resources + gtk_tree_path_free(treePath); + gtk_tree_iter_free(iter2); + g_free(path); + + // Perpetuate changes in account queue + if(moveUp) + account_list_move_up(indice); + else + account_list_move_down(indice); + + + // Set the order in the configuration file + dbus_set_accounts_order (account_list_get_ordered_list ()); } /** * Called from move up account button signal */ - static void + static void account_move_up_cb(GtkButton *button UNUSED, gpointer data) { - // Change tree view ordering and get indice changed - account_move(TRUE, data); + // Change tree view ordering and get indice changed + account_move(TRUE, data); } /** * Called from move down account button signal */ - static void + static void account_move_down_cb(GtkButton *button UNUSED, gpointer data) { - // Change tree view ordering and get indice changed - account_move(FALSE, data); + // Change tree view ordering and get indice changed + account_move(FALSE, data); } -static void + static void help_contents_cb (GtkWidget * widget, - gpointer data UNUSED) + gpointer data UNUSED) { - GError *error = NULL; - - //gboolean success = gtk_show_uri (NULL, "ghelp: sflphone.xml", GDK_CURRENT_TIME, &error); + GError *error = NULL; + + //gboolean success = gtk_show_uri (NULL, "ghelp: sflphone.xml", GDK_CURRENT_TIME, &error); gnome_help_display ("sflphone.xml", "accounts", &error); - if (error != NULL) - { - g_warning ("%s", error->message); + if (error != NULL) + { + g_warning ("%s", error->message); - g_error_free (error); - } + g_error_free (error); + } } -static void + static void close_dialog_cb (GtkWidget * widget, - gpointer data UNUSED) + gpointer data UNUSED) { - gtk_dialog_response(GTK_DIALOG(accountListDialog), GTK_RESPONSE_ACCEPT); + gtk_dialog_response(GTK_DIALOG(accountListDialog), GTK_RESPONSE_ACCEPT); + +} + +void highlight_ip_profile (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { + + GValue val; + account_t *current; + + memset (&val, 0, sizeof(val)); + gtk_tree_model_get_value(tree_model, iter, COLUMN_ACCOUNT_DATA, &val); + current = (account_t*) g_value_get_pointer(&val); + + g_value_unset (&val); + + if (current != NULL) { + + // Make the first line appear differently + (g_strcasecmp (current->accountID, IP2IP) == 0) ? g_object_set (G_OBJECT (rend), "weight", PANGO_WEIGHT_THIN, + "style", PANGO_STYLE_ITALIC, + "stretch", PANGO_STRETCH_ULTRA_EXPANDED, + "scale", 0.95, + NULL) : + g_object_set (G_OBJECT (rend), "weight", PANGO_WEIGHT_MEDIUM, + "style", PANGO_STYLE_NORMAL, + "stretch", PANGO_STRETCH_NORMAL, + "scale", 1.0, + NULL) ; + } +} + +void highlight_registration (GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { + + GValue val; + account_t *current; + GdkColor green = {0, 255, 0, 0}; + + memset (&val, 0, sizeof(val)); + gtk_tree_model_get_value(tree_model, iter, COLUMN_ACCOUNT_DATA, &val); + current = (account_t*) g_value_get_pointer(&val); + + g_value_unset (&val); + + if (current != NULL) { + if (g_strcasecmp (current->accountID, IP2IP) != 0) { + // Color the account state: green -> registered, otherwise red + (current->state == ACCOUNT_STATE_REGISTERED) ? g_object_set (G_OBJECT (rend), "foreground", "Dark Green", NULL) : + g_object_set (G_OBJECT (rend), "foreground", "Dark Red", NULL); + } + else + g_object_set (G_OBJECT (rend), "foreground", "Black", NULL); + } } /** * Account settings tab */ - GtkWidget * -create_account_list(GtkDialog * dialog) -{ - GtkWidget *table; - GtkWidget *scrolledWindow; - GtkWidget *buttonBox; - GtkCellRenderer *renderer; - GtkTreeView * treeView; - GtkTreeViewColumn *treeViewColumn; - GtkTreeSelection *treeSelection; - GtkRequisition requisition; - - selectedAccount = NULL; - - table = gtk_table_new (1, 2, FALSE/* homogeneous */); - gtk_table_set_col_spacings(GTK_TABLE(table), 10); - gtk_container_set_border_width (GTK_CONTAINER (table), 10); - - scrolledWindow = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN); - gtk_table_attach (GTK_TABLE(table), scrolledWindow, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - accountStore = gtk_list_store_new(COLUMN_ACCOUNT_COUNT, - G_TYPE_STRING, // Name - G_TYPE_STRING, // Protocol - G_TYPE_STRING, // Status - G_TYPE_BOOLEAN, // Enabled / Disabled - G_TYPE_POINTER // Pointer to the Object - ); - - account_list_config_dialog_fill(); - - treeView = GTK_TREE_VIEW (gtk_tree_view_new_with_model (GTK_TREE_MODEL(accountStore))); - treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeView)); - g_signal_connect(G_OBJECT (treeSelection), "changed", - G_CALLBACK (select_account_cb), - accountStore); - - renderer = gtk_cell_renderer_toggle_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes("Enabled", renderer, "active", COLUMN_ACCOUNT_ACTIVE , NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(treeView), treeViewColumn); - g_signal_connect( G_OBJECT(renderer) , "toggled" , G_CALLBACK(enable_account_cb), (gpointer)treeView ); - - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes ("Alias", - renderer, - "markup", COLUMN_ACCOUNT_ALIAS, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - - // A double click on the account line opens the window to edit the account - g_signal_connect( G_OBJECT( treeView ) , "row-activated" , G_CALLBACK( edit_account_cb ) , NULL ); - - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Protocol"), - renderer, - "markup", COLUMN_ACCOUNT_TYPE, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Status"), - renderer, - "markup", COLUMN_ACCOUNT_STATUS, - NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); - - g_object_unref(G_OBJECT(accountStore)); - - gtk_container_add (GTK_CONTAINER(scrolledWindow), GTK_WIDGET (treeView)); - - /* The buttons to press! */ - buttonBox = gtk_vbutton_box_new(); - gtk_box_set_spacing(GTK_BOX(buttonBox), 10); - gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_START); - gtk_table_attach (GTK_TABLE(table), buttonBox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - accountMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), accountMoveUpButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(accountMoveUpButton), "clicked", G_CALLBACK(account_move_up_cb), treeView); - - accountMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); - gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), accountMoveDownButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(accountMoveDownButton), "clicked", G_CALLBACK(account_move_down_cb), treeView); - - addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); - g_signal_connect_swapped(G_OBJECT(addButton), "clicked", - G_CALLBACK(add_account_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), addButton, FALSE, FALSE, 0); - - editButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); - gtk_widget_set_sensitive(GTK_WIDGET(editButton), FALSE); - g_signal_connect_swapped(G_OBJECT(editButton), "clicked", - G_CALLBACK(edit_account_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), editButton, FALSE, FALSE, 0); - - deleteButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); - gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); - g_signal_connect_swapped(G_OBJECT(deleteButton), "clicked", - G_CALLBACK(delete_account_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonBox), deleteButton, FALSE, FALSE, 0); - - /* help and close buttons */ - GtkWidget * buttonHbox = gtk_hbutton_box_new(); - gtk_table_attach(GTK_TABLE(table), buttonHbox, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); - - GtkWidget * helpButton = gtk_button_new_from_stock (GTK_STOCK_HELP); - g_signal_connect_swapped(G_OBJECT(helpButton), "clicked", - G_CALLBACK(help_contents_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonHbox), helpButton, FALSE, FALSE, 0); - - GtkWidget * closeButton = gtk_button_new_from_stock (GTK_STOCK_CLOSE); - g_signal_connect_swapped(G_OBJECT(closeButton), "clicked", G_CALLBACK(close_dialog_cb), NULL); - gtk_box_pack_start(GTK_BOX(buttonHbox), closeButton, FALSE, FALSE, 0); - - gtk_widget_show_all(table); - // account_list_config_dialog_fill(); - - /* Resize the scrolledWindow for a better view */ - gtk_widget_size_request(GTK_WIDGET(treeView), &requisition); - gtk_widget_set_size_request(GTK_WIDGET(scrolledWindow), requisition.width + 20, requisition.height); - GtkRequisition requisitionButton; - gtk_widget_size_request(GTK_WIDGET(deleteButton), &requisitionButton); - gtk_widget_set_size_request(GTK_WIDGET(closeButton), requisitionButton.width, -1); - gtk_widget_set_size_request(GTK_WIDGET(helpButton), requisitionButton.width, -1); - - gtk_widget_show_all(table); - - return table; +GtkWidget* create_account_list(GtkDialog * dialog) { + + GtkWidget *table, *scrolledWindow, *buttonBox; + GtkCellRenderer *renderer; + GtkTreeView * treeView; + GtkTreeViewColumn *treeViewColumn; + GtkTreeSelection *treeSelection; + GtkRequisition requisition; + + selectedAccount = NULL; + + table = gtk_table_new (1, 2, FALSE/* homogeneous */); + gtk_table_set_col_spacings(GTK_TABLE(table), 10); + gtk_container_set_border_width (GTK_CONTAINER (table), 10); + + scrolledWindow = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN); + gtk_table_attach (GTK_TABLE(table), scrolledWindow, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + accountStore = gtk_list_store_new(COLUMN_ACCOUNT_COUNT, + G_TYPE_STRING, // Name + G_TYPE_STRING, // Protocol + G_TYPE_STRING, // Status + G_TYPE_BOOLEAN, // Enabled / Disabled + G_TYPE_POINTER // Pointer to the Object + ); + + account_list_config_dialog_fill(); + + treeView = GTK_TREE_VIEW (gtk_tree_view_new_with_model (GTK_TREE_MODEL(accountStore))); + treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW (treeView)); + g_signal_connect(G_OBJECT (treeSelection), "changed", + G_CALLBACK (select_account_cb), + accountStore); + + renderer = gtk_cell_renderer_toggle_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes("Enabled", renderer, "active", COLUMN_ACCOUNT_ACTIVE , NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(treeView), treeViewColumn); + g_signal_connect (G_OBJECT(renderer) , "toggled" , G_CALLBACK (enable_account_cb), (gpointer)treeView ); + + // gtk_cell_renderer_toggle_set_activatable (renderer, FALSE); + + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes ("Alias", + renderer, + "markup", COLUMN_ACCOUNT_ALIAS, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); + + // A double click on the account line opens the window to edit the account + g_signal_connect( G_OBJECT( treeView ) , "row-activated" , G_CALLBACK( edit_account_cb ) , NULL ); + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); + + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Protocol"), + renderer, + "markup", COLUMN_ACCOUNT_TYPE, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); + + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes (_("Status"), + renderer, + "markup", COLUMN_ACCOUNT_STATUS, + NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW(treeView), treeViewColumn); + // Highlight IP profile + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_ip_profile, NULL, NULL); + // Highlight account registration state + gtk_tree_view_column_set_cell_data_func (treeViewColumn, renderer, highlight_registration, NULL, NULL); + + g_object_unref(G_OBJECT(accountStore)); + + gtk_container_add (GTK_CONTAINER(scrolledWindow), GTK_WIDGET (treeView)); + + /* The buttons to press! */ + buttonBox = gtk_vbutton_box_new(); + gtk_box_set_spacing(GTK_BOX(buttonBox), 10); + gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_START); + gtk_table_attach (GTK_TABLE(table), buttonBox, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + accountMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE); + gtk_box_pack_start(GTK_BOX(buttonBox), accountMoveUpButton, FALSE, FALSE, 0); + g_signal_connect(G_OBJECT(accountMoveUpButton), "clicked", G_CALLBACK(account_move_up_cb), treeView); + + accountMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); + gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE); + gtk_box_pack_start(GTK_BOX(buttonBox), accountMoveDownButton, FALSE, FALSE, 0); + g_signal_connect(G_OBJECT(accountMoveDownButton), "clicked", G_CALLBACK(account_move_down_cb), treeView); + + addButton = gtk_button_new_from_stock (GTK_STOCK_ADD); + g_signal_connect_swapped(G_OBJECT(addButton), "clicked", + G_CALLBACK(add_account_cb), NULL); + gtk_box_pack_start(GTK_BOX(buttonBox), addButton, FALSE, FALSE, 0); + + editButton = gtk_button_new_from_stock (GTK_STOCK_EDIT); + gtk_widget_set_sensitive(GTK_WIDGET(editButton), FALSE); + g_signal_connect_swapped(G_OBJECT(editButton), "clicked", + G_CALLBACK(edit_account_cb), NULL); + gtk_box_pack_start(GTK_BOX(buttonBox), editButton, FALSE, FALSE, 0); + + deleteButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE); + gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE); + g_signal_connect_swapped(G_OBJECT(deleteButton), "clicked", + G_CALLBACK(delete_account_cb), NULL); + gtk_box_pack_start(GTK_BOX(buttonBox), deleteButton, FALSE, FALSE, 0); + + /* help and close buttons */ + GtkWidget * buttonHbox = gtk_hbutton_box_new(); + gtk_table_attach(GTK_TABLE(table), buttonHbox, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 10); + + GtkWidget * helpButton = gtk_button_new_from_stock (GTK_STOCK_HELP); + g_signal_connect_swapped(G_OBJECT(helpButton), "clicked", + G_CALLBACK(help_contents_cb), NULL); + gtk_box_pack_start(GTK_BOX(buttonHbox), helpButton, FALSE, FALSE, 0); + + GtkWidget * closeButton = gtk_button_new_from_stock (GTK_STOCK_CLOSE); + g_signal_connect_swapped(G_OBJECT(closeButton), "clicked", G_CALLBACK(close_dialog_cb), NULL); + gtk_box_pack_start(GTK_BOX(buttonHbox), closeButton, FALSE, FALSE, 0); + + gtk_widget_show_all(table); + // account_list_config_dialog_fill(); + + /* Resize the scrolledWindow for a better view */ + gtk_widget_size_request(GTK_WIDGET(treeView), &requisition); + gtk_widget_set_size_request(GTK_WIDGET(scrolledWindow), requisition.width + 20, requisition.height); + GtkRequisition requisitionButton; + gtk_widget_size_request(GTK_WIDGET(deleteButton), &requisitionButton); + gtk_widget_set_size_request(GTK_WIDGET(closeButton), requisitionButton.width, -1); + gtk_widget_set_size_request(GTK_WIDGET(helpButton), requisitionButton.width, -1); + + gtk_widget_show_all(table); + + return table; } - void + void show_account_list_config_dialog(void) { - GtkWidget * accountFrame; - GtkWidget * tab; - - accountListDialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Accounts"), - GTK_WINDOW(get_main_window()), - GTK_DIALOG_DESTROY_WITH_PARENT, - NULL)); - - /* Set window properties */ - gtk_dialog_set_has_separator(accountListDialog, FALSE); - gtk_container_set_border_width(GTK_CONTAINER(accountListDialog), 0); - gtk_window_set_resizable(GTK_WINDOW(accountListDialog), FALSE); - - gnome_main_section_new (_("Configured Accounts"), &accountFrame); - gtk_box_pack_start( GTK_BOX(accountListDialog->vbox ), accountFrame , TRUE, TRUE, 0); - gtk_widget_show(accountFrame); - - /* Accounts tab */ - tab = create_account_list(accountListDialog); - gtk_widget_show(tab); - gtk_container_add(GTK_CONTAINER(accountFrame), tab); - - /* Status bar for the account list */ - status_bar = gtk_statusbar_new(); - gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE); - gtk_widget_show(status_bar); - gtk_box_pack_start(GTK_BOX(accountListDialog->vbox ), status_bar, TRUE, TRUE, 0); - - int number_accounts = account_list_get_size(); - if (number_accounts) { - gchar * message = g_strdup_printf(n_("There is %d active account", - "There are %d active accounts", number_accounts), - number_accounts); - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); - g_free(message); - } else { - gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, _("You have no active account")); - } - - gtk_dialog_run(accountListDialog); - - status_bar_display_account (); - - gtk_widget_destroy(GTK_WIDGET(accountListDialog)); - - accountListDialog = NULL; - - update_actions (); + GtkWidget * accountFrame; + GtkWidget * tab; + + accountListDialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Accounts"), + GTK_WINDOW(get_main_window()), + GTK_DIALOG_DESTROY_WITH_PARENT, + NULL)); + + /* Set window properties */ + gtk_dialog_set_has_separator(accountListDialog, FALSE); + gtk_container_set_border_width(GTK_CONTAINER(accountListDialog), 0); + gtk_window_set_resizable(GTK_WINDOW(accountListDialog), FALSE); + + gnome_main_section_new (_("Configured Accounts"), &accountFrame); + gtk_box_pack_start( GTK_BOX(accountListDialog->vbox ), accountFrame , TRUE, TRUE, 0); + gtk_widget_show(accountFrame); + + /* Accounts tab */ + tab = create_account_list(accountListDialog); + gtk_widget_show(tab); + gtk_container_add(GTK_CONTAINER(accountFrame), tab); + + /* Status bar for the account list */ + status_bar = gtk_statusbar_new(); + gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (status_bar), FALSE); + gtk_widget_show(status_bar); + gtk_box_pack_start(GTK_BOX(accountListDialog->vbox ), status_bar, TRUE, TRUE, 0); + + int number_accounts = account_list_get_registered_accounts (); + if (number_accounts) { + gchar * message = g_strdup_printf(n_("There is %d active account", + "There are %d active accounts", number_accounts), + number_accounts); + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, message); + g_free(message); + } else { + gtk_statusbar_push (GTK_STATUSBAR (status_bar), CONTEXT_ID_REGISTRATION, _("You have no active account")); + } + + gtk_dialog_run(accountListDialog); + + status_bar_display_account (); + + gtk_widget_destroy(GTK_WIDGET(accountListDialog)); + + accountListDialog = NULL; + + update_actions (); +} + + +/** + * Delete an account + */ +static void delete_account_cb (void) { + + if(selectedAccount != NULL) { + dbus_remove_account(selectedAccount->accountID); + } +} + + +/** + * Edit an account + */ +static void edit_account_cb (void) { + + if(selectedAccount != NULL) { + show_account_window (selectedAccount); + } +} + +/** + * Add an account + */ +static void add_account_cb (void) { + + show_account_window (NULL); } diff --git a/sflphone-client-gnome/src/config/accountlistconfigdialog.h b/sflphone-client-gnome/src/config/accountlistconfigdialog.h index 43e1ab228b634299b4534517b2443f61c32b85e5..0990ef93d48381c91c4cc3887049dd1a968dff07 100644 --- a/sflphone-client-gnome/src/config/accountlistconfigdialog.h +++ b/sflphone-client-gnome/src/config/accountlistconfigdialog.h @@ -21,7 +21,15 @@ #ifndef __SFL_ACCOUNTLISTDIALOG_H__ #define __SFL_ACCOUNTLISTDIALOG_H__ +#include <sflphone_const.h> + void show_account_list_config_dialog(void); void account_list_config_dialog_fill(void); + +static void delete_account_cb (void); + +static void add_account_cb (void); + +static void edit_account_cb (void); #endif diff --git a/sflphone-client-gnome/src/config/audioconf.c b/sflphone-client-gnome/src/config/audioconf.c index 308131207f5c401c8753ec6701c0915edf651c7a..322801a904eaed40f999fb8ce4a3e5882bc144bf 100644 --- a/sflphone-client-gnome/src/config/audioconf.c +++ b/sflphone-client-gnome/src/config/audioconf.c @@ -35,880 +35,891 @@ GtkWidget *pulse; GtkWidget *alsabox; GtkWidget *alsa_conf; GtkWidget *noise_conf; - + // Codec properties ID enum { - COLUMN_CODEC_ACTIVE, - COLUMN_CODEC_NAME, - COLUMN_CODEC_FREQUENCY, - COLUMN_CODEC_BITRATE, - COLUMN_CODEC_BANDWIDTH, - CODEC_COLUMN_COUNT + COLUMN_CODEC_ACTIVE, + COLUMN_CODEC_NAME, + COLUMN_CODEC_FREQUENCY, + COLUMN_CODEC_BITRATE, + COLUMN_CODEC_BANDWIDTH, + CODEC_COLUMN_COUNT }; /** * Fills the tree list with supported codecs */ - void -preferences_dialog_fill_codec_list() -{ - GtkListStore *codecStore; - GtkTreeIter iter; - - // Get model of view and clear it - codecStore = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(codecTreeView))); - gtk_list_store_clear(codecStore); - - // Insert codecs - unsigned int i; - for(i = 0; i < codec_list_get_size(); i++) - { - codec_t *c = codec_list_get_nth(i); - DEBUG("%s", c->name); - if(c) - { - gtk_list_store_append(codecStore, &iter); - gtk_list_store_set(codecStore, &iter, - COLUMN_CODEC_ACTIVE, c->is_active, // Active - COLUMN_CODEC_NAME, c->name, // Name - COLUMN_CODEC_FREQUENCY, g_strdup_printf("%d kHz", c->sample_rate/1000), // Frequency (kHz) - COLUMN_CODEC_BITRATE, g_strdup_printf("%.1f kbps", c->_bitrate), // Bitrate (kbps) - COLUMN_CODEC_BANDWIDTH, g_strdup_printf("%.1f kbps", c->_bandwidth), // Bandwidth (kpbs) - -1); - } - } +void preferences_dialog_fill_codec_list (account_t **a) { + + GtkListStore *codecStore; + GtkTreeIter iter; + GQueue *current; + + // Get model of view and clear it + codecStore = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView))); + gtk_list_store_clear (codecStore); + + if ((*a) != NULL) { + current = (*a)->codecs; + } + else { + // Failover + current = get_system_codec_list (); + } + + + // Insert codecs + unsigned int i; + for(i = 0; i < current->length; i++) + { + codec_t *c = codec_list_get_nth (i, current); + if (c) + { + DEBUG ("%s", c->name); + gtk_list_store_append (codecStore, &iter); + gtk_list_store_set (codecStore, &iter, + COLUMN_CODEC_ACTIVE, c->is_active, // Active + COLUMN_CODEC_NAME, c->name, // Name + COLUMN_CODEC_FREQUENCY, g_strdup_printf("%d kHz", c->sample_rate/1000), // Frequency (kHz) + COLUMN_CODEC_BITRATE, g_strdup_printf("%.1f kbps", c->_bitrate), // Bitrate (kbps) + COLUMN_CODEC_BANDWIDTH, g_strdup_printf("%.1f kbps", c->_bandwidth), // Bandwidth (kpbs) + -1); + } + } } /** * Fill store with output audio plugins */ - void + void preferences_dialog_fill_output_audio_plugin_list() { - GtkTreeIter iter; - gchar** list; - gchar* managerName; - - gtk_list_store_clear(pluginlist); - - // Call dbus to retreive list - list = dbus_get_output_audio_plugin_list(); - // For each API name included in list - int c = 0; - - if (list != NULL){ - for(managerName = list[c]; managerName != NULL; managerName = list[c]) - { - c++; - gtk_list_store_append(pluginlist, &iter); - gtk_list_store_set(pluginlist, &iter, 0 , managerName, -1); - } - } - list = NULL; + GtkTreeIter iter; + gchar** list; + gchar* managerName; + + gtk_list_store_clear(pluginlist); + + // Call dbus to retreive list + list = dbus_get_output_audio_plugin_list(); + // For each API name included in list + int c = 0; + + if (list != NULL){ + for(managerName = list[c]; managerName != NULL; managerName = list[c]) + { + c++; + gtk_list_store_append(pluginlist, &iter); + gtk_list_store_set(pluginlist, &iter, 0 , managerName, -1); + } + } + list = NULL; } /** * Fill output audio device store */ - void + void preferences_dialog_fill_output_audio_device_list() { - GtkTreeIter iter; - gchar** list; - gchar** audioDevice; - int index; - - gtk_list_store_clear(outputlist); - - // Call dbus to retreive list - list = dbus_get_audio_output_device_list(); - - // For each device name included in list - int c = 0; - for(audioDevice = list; *list ; list++) - { - index = dbus_get_audio_device_index( *list ); - gtk_list_store_append(outputlist, &iter); - gtk_list_store_set(outputlist, &iter, 0, *list, 1, index, -1); - c++; - } + GtkTreeIter iter; + gchar** list; + gchar** audioDevice; + int index; + + gtk_list_store_clear(outputlist); + + // Call dbus to retreive list + list = dbus_get_audio_output_device_list(); + + // For each device name included in list + int c = 0; + for(audioDevice = list; *list ; list++) + { + index = dbus_get_audio_device_index( *list ); + gtk_list_store_append(outputlist, &iter); + gtk_list_store_set(outputlist, &iter, 0, *list, 1, index, -1); + c++; + } } /** * Select active output audio device */ - void + void select_active_output_audio_device() { - if( SHOW_ALSA_CONF ) - { - - GtkTreeModel* model; - GtkTreeIter iter; - gchar** devices; - int currentDeviceIndex; - int deviceIndex; - - // Select active output device on server - devices = dbus_get_current_audio_devices_index(); - currentDeviceIndex = atoi(devices[0]); - DEBUG("audio device index for output = %d", currentDeviceIndex); - model = gtk_combo_box_get_model(GTK_COMBO_BOX(output)); - - // Find the currently set output device - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - if(deviceIndex == currentDeviceIndex) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(output), &iter); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active output device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(output), 0); - } + if( SHOW_ALSA_CONF ) + { + + GtkTreeModel* model; + GtkTreeIter iter; + gchar** devices; + int currentDeviceIndex; + int deviceIndex; + + // Select active output device on server + devices = dbus_get_current_audio_devices_index(); + currentDeviceIndex = atoi(devices[0]); + DEBUG("audio device index for output = %d", currentDeviceIndex); + model = gtk_combo_box_get_model(GTK_COMBO_BOX(output)); + + // Find the currently set output device + gtk_tree_model_get_iter_first(model, &iter); + do { + gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + if(deviceIndex == currentDeviceIndex) + { + // Set current iteration the active one + gtk_combo_box_set_active_iter(GTK_COMBO_BOX(output), &iter); + return; + } + } while(gtk_tree_model_iter_next(model, &iter)); + + // No index was found, select first one + WARN("Warning : No active output device found"); + gtk_combo_box_set_active(GTK_COMBO_BOX(output), 0); + } } /** * Fill input audio device store */ - void + void preferences_dialog_fill_input_audio_device_list() { - GtkTreeIter iter; - gchar** list; - gchar** audioDevice; - int index ; - gtk_list_store_clear(inputlist); - - // Call dbus to retreive list - list = dbus_get_audio_input_device_list(); - - // For each device name included in list - //int c = 0; - for(audioDevice = list; *list; list++) - { - index = dbus_get_audio_device_index( *list ); - gtk_list_store_append(inputlist, &iter); - gtk_list_store_set(inputlist, &iter, 0, *list, 1, index, -1); - //c++; - } + GtkTreeIter iter; + gchar** list; + gchar** audioDevice; + int index ; + gtk_list_store_clear(inputlist); + + // Call dbus to retreive list + list = dbus_get_audio_input_device_list(); + + // For each device name included in list + //int c = 0; + for(audioDevice = list; *list; list++) + { + index = dbus_get_audio_device_index( *list ); + gtk_list_store_append(inputlist, &iter); + gtk_list_store_set(inputlist, &iter, 0, *list, 1, index, -1); + //c++; + } } /** * Select active input audio device */ - void + void select_active_input_audio_device() { - if( SHOW_ALSA_CONF) - { - - GtkTreeModel* model; - GtkTreeIter iter; - gchar** devices; - int currentDeviceIndex; - int deviceIndex; - - // Select active input device on server - devices = dbus_get_current_audio_devices_index(); - currentDeviceIndex = atoi(devices[1]); - model = gtk_combo_box_get_model(GTK_COMBO_BOX(input)); - - // Find the currently set input device - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - if(deviceIndex == currentDeviceIndex) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(input), &iter); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active input device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(input), 0); - } + if( SHOW_ALSA_CONF) + { + + GtkTreeModel* model; + GtkTreeIter iter; + gchar** devices; + int currentDeviceIndex; + int deviceIndex; + + // Select active input device on server + devices = dbus_get_current_audio_devices_index(); + currentDeviceIndex = atoi(devices[1]); + model = gtk_combo_box_get_model(GTK_COMBO_BOX(input)); + + // Find the currently set input device + gtk_tree_model_get_iter_first(model, &iter); + do { + gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + if(deviceIndex == currentDeviceIndex) + { + // Set current iteration the active one + gtk_combo_box_set_active_iter(GTK_COMBO_BOX(input), &iter); + return; + } + } while(gtk_tree_model_iter_next(model, &iter)); + + // No index was found, select first one + WARN("Warning : No active input device found"); + gtk_combo_box_set_active(GTK_COMBO_BOX(input), 0); + } } /** * Select the output audio plugin by calling the server */ - static void + static void select_output_audio_plugin(GtkComboBox* widget, gpointer data UNUSED) { - GtkTreeModel* model; - GtkTreeIter iter; - int comboBoxIndex; - gchar* pluginName; - - comboBoxIndex = gtk_combo_box_get_active(widget); - - if(comboBoxIndex >= 0) - { - model = gtk_combo_box_get_model(widget); - gtk_combo_box_get_active_iter(widget, &iter); - gtk_tree_model_get(model, &iter, 0, &pluginName, -1); - dbus_set_output_audio_plugin(pluginName); - //update_combo_box( pluginName); - } + GtkTreeModel* model; + GtkTreeIter iter; + int comboBoxIndex; + gchar* pluginName; + + comboBoxIndex = gtk_combo_box_get_active(widget); + + if(comboBoxIndex >= 0) + { + model = gtk_combo_box_get_model(widget); + gtk_combo_box_get_active_iter(widget, &iter); + gtk_tree_model_get(model, &iter, 0, &pluginName, -1); + dbus_set_output_audio_plugin(pluginName); + //update_combo_box( pluginName); + } } /** * Select active output audio plugin */ - void + void select_active_output_audio_plugin() { - GtkTreeModel* model; - GtkTreeIter iter; - gchar* pluginname; - gchar* tmp; - - // Select active output device on server - pluginname = dbus_get_current_audio_output_plugin(); - tmp = pluginname; - model = gtk_combo_box_get_model(GTK_COMBO_BOX(plugin)); - - // Find the currently alsa plugin - gtk_tree_model_get_iter_first(model, &iter); - do { - gtk_tree_model_get(model, &iter, 0, &pluginname , -1); - if( g_strcasecmp( tmp , pluginname ) == 0 ) - { - // Set current iteration the active one - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(plugin), &iter); - //update_combo_box( plugin ); - return; - } - } while(gtk_tree_model_iter_next(model, &iter)); - - // No index was found, select first one - WARN("Warning : No active output device found"); - gtk_combo_box_set_active(GTK_COMBO_BOX(plugin), 0); + GtkTreeModel* model; + GtkTreeIter iter; + gchar* pluginname; + gchar* tmp; + + // Select active output device on server + pluginname = dbus_get_current_audio_output_plugin(); + tmp = pluginname; + model = gtk_combo_box_get_model(GTK_COMBO_BOX(plugin)); + + // Find the currently alsa plugin + gtk_tree_model_get_iter_first(model, &iter); + do { + gtk_tree_model_get(model, &iter, 0, &pluginname , -1); + if( g_strcasecmp( tmp , pluginname ) == 0 ) + { + // Set current iteration the active one + gtk_combo_box_set_active_iter(GTK_COMBO_BOX(plugin), &iter); + //update_combo_box( plugin ); + return; + } + } while(gtk_tree_model_iter_next(model, &iter)); + + // No index was found, select first one + WARN("Warning : No active output device found"); + gtk_combo_box_set_active(GTK_COMBO_BOX(plugin), 0); } /** * Set the audio output device on the server with its index */ - static void + static void select_audio_output_device(GtkComboBox* comboBox, gpointer data UNUSED) { - GtkTreeModel* model; - GtkTreeIter iter; - int comboBoxIndex; - int deviceIndex; + GtkTreeModel* model; + GtkTreeIter iter; + int comboBoxIndex; + int deviceIndex; - comboBoxIndex = gtk_combo_box_get_active(comboBox); + comboBoxIndex = gtk_combo_box_get_active(comboBox); - if(comboBoxIndex >= 0) - { - model = gtk_combo_box_get_model(comboBox); - gtk_combo_box_get_active_iter(comboBox, &iter); - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + if(comboBoxIndex >= 0) + { + model = gtk_combo_box_get_model(comboBox); + gtk_combo_box_get_active_iter(comboBox, &iter); + gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - dbus_set_audio_output_device(deviceIndex); - } + dbus_set_audio_output_device(deviceIndex); + } } /** * Set the audio input device on the server with its index */ - static void + static void select_audio_input_device(GtkComboBox* comboBox, gpointer data UNUSED) { - GtkTreeModel* model; - GtkTreeIter iter; - int comboBoxIndex; - int deviceIndex; + GtkTreeModel* model; + GtkTreeIter iter; + int comboBoxIndex; + int deviceIndex; - comboBoxIndex = gtk_combo_box_get_active(comboBox); + comboBoxIndex = gtk_combo_box_get_active(comboBox); - if(comboBoxIndex >= 0) - { - model = gtk_combo_box_get_model(comboBox); - gtk_combo_box_get_active_iter(comboBox, &iter); - gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); + if(comboBoxIndex >= 0) + { + model = gtk_combo_box_get_model(comboBox); + gtk_combo_box_get_active_iter(comboBox, &iter); + gtk_tree_model_get(model, &iter, 1, &deviceIndex, -1); - dbus_set_audio_input_device(deviceIndex); - } + dbus_set_audio_input_device(deviceIndex); + } } /** * Toggle move buttons on if a codec is selected, off elsewise */ - static void + static void select_codec(GtkTreeSelection *selection, GtkTreeModel *model) { - GtkTreeIter iter; - - if(!gtk_tree_selection_get_selected(selection, &model, &iter)) - { - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE); - } - else - { - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), TRUE); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), TRUE); - } + GtkTreeIter iter; + + if(!gtk_tree_selection_get_selected(selection, &model, &iter)) + { + gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE); + } + else + { + gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), TRUE); + } } /** * Toggle active value of codec on click and update changes to the deamon * and in configuration files */ - static void -codec_active_toggled(GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data ) + static void +codec_active_toggled (GtkCellRendererToggle *renderer UNUSED, gchar *path, gpointer data ) { - GtkTreeIter iter; - GtkTreePath *treePath; - GtkTreeModel *model; - gboolean active; - char* name; - char* srate; - codec_t* codec; - - // Get path of clicked codec active toggle box - treePath = gtk_tree_path_new_from_string(path); - model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); - gtk_tree_model_get_iter(model, &iter, treePath); - - // Get active value and name at iteration - gtk_tree_model_get(model, &iter, - COLUMN_CODEC_ACTIVE, &active, - COLUMN_CODEC_NAME, &name, - COLUMN_CODEC_FREQUENCY, &srate, - -1); - - // printf("%s, %s\n", name, srate); - - // codec_list_get_by_name(name); - if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"8 kHz")==0)) - codec = codec_list_get_by_payload((gconstpointer) 110); - else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"16 kHz")==0)) - codec = codec_list_get_by_payload((gconstpointer) 111); - else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"32 kHz")==0)) - codec = codec_list_get_by_payload((gconstpointer) 112); - else - codec = codec_list_get_by_name(name); - - // Toggle active value - active = !active; - - // Store value - gtk_list_store_set(GTK_LIST_STORE(model), &iter, - COLUMN_CODEC_ACTIVE, active, - -1); - - gtk_tree_path_free(treePath); - - // Modify codec queue to represent change - if(active) - codec_set_active(codec); - else - codec_set_inactive(codec); - - // Perpetuate changes to the deamon - codec_list_update_to_daemon(); + GtkTreeIter iter; + GtkTreePath *treePath; + GtkTreeModel *model; + gboolean active; + char* name; + char* srate; + codec_t* codec; + account_t *acc; + + // Get path of clicked codec active toggle box + treePath = gtk_tree_path_new_from_string(path); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (codecTreeView)); + gtk_tree_model_get_iter(model, &iter, treePath); + + // Retrieve userdata + acc = (account_t*) data; + + if (!acc) + ERROR ("Aie, no account selected"); + + // Get active value and name at iteration + gtk_tree_model_get(model, &iter, + COLUMN_CODEC_ACTIVE, &active, + COLUMN_CODEC_NAME, &name, + COLUMN_CODEC_FREQUENCY, &srate, + -1); + + printf("%s, %s\n", name, srate); + printf("%i\n", g_queue_get_length (acc->codecs)); + + // codec_list_get_by_name(name); + if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"8 kHz")==0)) + codec = codec_list_get_by_payload((gconstpointer) 110, acc->codecs); + else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"16 kHz")==0)) + codec = codec_list_get_by_payload((gconstpointer) 111, acc->codecs); + else if ((g_strcasecmp(name,"speex")==0) && (g_strcasecmp(srate,"32 kHz")==0)) + codec = codec_list_get_by_payload((gconstpointer) 112, acc->codecs); + else + codec = codec_list_get_by_name ((gconstpointer) name, acc->codecs); + + // Toggle active value + active = !active; + + // Store value + gtk_list_store_set(GTK_LIST_STORE(model), &iter, + COLUMN_CODEC_ACTIVE, active, + -1); + + gtk_tree_path_free(treePath); + + // Modify codec queue to represent change + if (active) + codec_set_active (&codec); + else + codec_set_inactive (&codec); + + // Perpetuate changes to the deamon + // codec_list_update_to_daemon (acc); } /** * Move codec in list depending on direction and selected codec and * update changes in the daemon list and the configuration files */ - static void -codec_move(gboolean moveUp, gpointer data) -{ - GtkTreeIter iter; - GtkTreeIter *iter2; - GtkTreeView *treeView; - GtkTreeModel *model; - GtkTreeSelection *selection; - GtkTreePath *treePath; - gchar *path; - - // Get view, model and selection of codec store - treeView = GTK_TREE_VIEW(data); - model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeView)); - selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeView)); - - // Find selected iteration and create a copy - gtk_tree_selection_get_selected(GTK_TREE_SELECTION(selection), &model, &iter); - iter2 = gtk_tree_iter_copy(&iter); - - // Find path of iteration - path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); - treePath = gtk_tree_path_new_from_string(path); - gint *indices = gtk_tree_path_get_indices(treePath); - gint indice = indices[0]; - - // Depending on button direction get new path - if(moveUp) - gtk_tree_path_prev(treePath); - else - gtk_tree_path_next(treePath); - gtk_tree_model_get_iter(model, &iter, treePath); - - // Swap iterations if valid - if(gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter)) - gtk_list_store_swap(GTK_LIST_STORE(model), &iter, iter2); - - // Scroll to new position - gtk_tree_view_scroll_to_cell(treeView, treePath, NULL, FALSE, 0, 0); - - // Free resources - gtk_tree_path_free(treePath); - gtk_tree_iter_free(iter2); - g_free(path); - - // Perpetuate changes in codec queue - if(moveUp) - codec_list_move_codec_up(indice); - else - codec_list_move_codec_down(indice); - - // Perpetuate changes to the deamon - codec_list_update_to_daemon(); +static void codec_move (gboolean moveUp, gpointer data) { + + GtkTreeIter iter; + GtkTreeIter *iter2; + GtkTreeView *treeView; + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreePath *treePath; + gchar *path; + account_t *acc; + GQueue *acc_q; + + // Get view, model and selection of codec store + model = gtk_tree_view_get_model(GTK_TREE_VIEW(codecTreeView)); + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(codecTreeView)); + + // Retrieve the user data + acc = (account_t*) data; + if (acc) + acc_q = acc->codecs; + + // Find selected iteration and create a copy + gtk_tree_selection_get_selected(GTK_TREE_SELECTION(selection), &model, &iter); + iter2 = gtk_tree_iter_copy(&iter); + + // Find path of iteration + path = gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(model), &iter); + treePath = gtk_tree_path_new_from_string(path); + gint *indices = gtk_tree_path_get_indices(treePath); + gint indice = indices[0]; + + // Depending on button direction get new path + if(moveUp) + gtk_tree_path_prev(treePath); + else + gtk_tree_path_next(treePath); + gtk_tree_model_get_iter(model, &iter, treePath); + + // Swap iterations if valid + if(gtk_list_store_iter_is_valid(GTK_LIST_STORE(model), &iter)) + gtk_list_store_swap(GTK_LIST_STORE(model), &iter, iter2); + + // Scroll to new position + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (codecTreeView), treePath, NULL, FALSE, 0, 0); + + // Free resources + gtk_tree_path_free(treePath); + gtk_tree_iter_free(iter2); + g_free(path); + + // Perpetuate changes in codec queue + if(moveUp) + codec_list_move_codec_up (indice, &acc_q); + else + codec_list_move_codec_down (indice, &acc_q); + } /** * Called from move up codec button signal */ - static void -codec_move_up(GtkButton *button UNUSED, gpointer data) -{ - // Change tree view ordering and get indice changed - codec_move(TRUE, data); +static void codec_move_up (GtkButton *button UNUSED, gpointer data) { + + // Change tree view ordering and get indice changed + codec_move (TRUE, data); } /** * Called from move down codec button signal */ - static void -codec_move_down(GtkButton *button UNUSED, gpointer data) -{ - // Change tree view ordering and get indice changed - codec_move(FALSE, data); +static void codec_move_down(GtkButton *button UNUSED, gpointer data) { + + // Change tree view ordering and get indice changed + codec_move (FALSE, data); } - int + int is_ringtone_enabled( void ) { - return dbus_is_ringtone_enabled(); + return dbus_is_ringtone_enabled(); } - void + void ringtone_enabled( void ) { - dbus_ringtone_enabled(); + dbus_ringtone_enabled(); } - void + void ringtone_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) { - gchar* tone = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( chooser )); - dbus_set_ringtone_choice( tone ); + gchar* tone = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( chooser )); + dbus_set_ringtone_choice( tone ); } - gchar* + gchar* get_ringtone_choice( void ) { - return dbus_get_ringtone_choice(); + return dbus_get_ringtone_choice(); } -GtkWidget* codecs_box() +GtkWidget* codecs_box (account_t **a) { - GtkWidget *ret; - GtkWidget *scrolledWindow; - GtkWidget *buttonBox; - - GtkListStore *codecStore; - GtkCellRenderer *renderer; - GtkTreeSelection *treeSelection; - GtkTreeViewColumn *treeViewColumn; - - ret = gtk_hbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - scrolledWindow = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN); - - gtk_box_pack_start(GTK_BOX(ret), scrolledWindow, TRUE, TRUE, 0); - codecStore = gtk_list_store_new(CODEC_COLUMN_COUNT, - G_TYPE_BOOLEAN, // Active - G_TYPE_STRING, // Name - G_TYPE_STRING, // Frequency - G_TYPE_STRING, // Bit rate - G_TYPE_STRING // Bandwith - ); - - // Create codec tree view with list store - codecTreeView = gtk_tree_view_new_with_model(GTK_TREE_MODEL(codecStore)); - - // Get tree selection manager - treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW(codecTreeView)); - g_signal_connect(G_OBJECT(treeSelection), "changed", - G_CALLBACK (select_codec), - codecStore); - - // Active column - renderer = gtk_cell_renderer_toggle_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes("", renderer, "active", COLUMN_CODEC_ACTIVE, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Toggle codec active property on clicked - g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK(codec_active_toggled), (gpointer)codecTreeView); - - // Name column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Name"), renderer, "markup", COLUMN_CODEC_NAME, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Bit rate column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Frequency"), renderer, "text", COLUMN_CODEC_FREQUENCY, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Bandwith column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Bitrate"), renderer, "text", COLUMN_CODEC_BITRATE, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - // Frequency column - renderer = gtk_cell_renderer_text_new(); - treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Bandwidth"), renderer, "text", COLUMN_CODEC_BANDWIDTH, NULL); - gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); - - g_object_unref(G_OBJECT(codecStore)); - gtk_container_add(GTK_CONTAINER(scrolledWindow), codecTreeView); - - // Create button box - buttonBox = gtk_vbox_new(FALSE, 0); - gtk_container_set_border_width(GTK_CONTAINER(buttonBox), 10); - gtk_box_pack_start(GTK_BOX(ret), buttonBox, FALSE, FALSE, 0); - - codecMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveUpButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(codecMoveUpButton), "clicked", G_CALLBACK(codec_move_up), codecTreeView); - - codecMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); - gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE); - gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveDownButton, FALSE, FALSE, 0); - g_signal_connect(G_OBJECT(codecMoveDownButton), "clicked", G_CALLBACK(codec_move_down), codecTreeView); - - preferences_dialog_fill_codec_list(); - - return ret; + GtkWidget *ret; + GtkWidget *scrolledWindow; + GtkWidget *buttonBox; + + GtkListStore *codecStore; + GtkCellRenderer *renderer; + GtkTreeSelection *treeSelection; + GtkTreeViewColumn *treeViewColumn; + + ret = gtk_hbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + scrolledWindow = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_SHADOW_IN); + + gtk_box_pack_start(GTK_BOX(ret), scrolledWindow, TRUE, TRUE, 0); + codecStore = gtk_list_store_new(CODEC_COLUMN_COUNT, + G_TYPE_BOOLEAN, // Active + G_TYPE_STRING, // Name + G_TYPE_STRING, // Frequency + G_TYPE_STRING, // Bit rate + G_TYPE_STRING // Bandwith + ); + + // Create codec tree view with list store + codecTreeView = gtk_tree_view_new_with_model(GTK_TREE_MODEL(codecStore)); + + // Get tree selection manager + treeSelection = gtk_tree_view_get_selection(GTK_TREE_VIEW(codecTreeView)); + g_signal_connect(G_OBJECT(treeSelection), "changed", + G_CALLBACK (select_codec), + codecStore); + + // Active column + renderer = gtk_cell_renderer_toggle_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes("", renderer, "active", COLUMN_CODEC_ACTIVE, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); + + // Toggle codec active property on clicked + g_signal_connect(G_OBJECT(renderer), "toggled", G_CALLBACK (codec_active_toggled), (gpointer) *a); + + // Name column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Name"), renderer, "markup", COLUMN_CODEC_NAME, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); + + // Bit rate column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Frequency"), renderer, "text", COLUMN_CODEC_FREQUENCY, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); + + // Bandwith column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Bitrate"), renderer, "text", COLUMN_CODEC_BITRATE, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); + + // Frequency column + renderer = gtk_cell_renderer_text_new(); + treeViewColumn = gtk_tree_view_column_new_with_attributes(_("Bandwidth"), renderer, "text", COLUMN_CODEC_BANDWIDTH, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(codecTreeView), treeViewColumn); + + g_object_unref(G_OBJECT(codecStore)); + gtk_container_add(GTK_CONTAINER(scrolledWindow), codecTreeView); + + // Create button box + buttonBox = gtk_vbox_new(FALSE, 0); + gtk_container_set_border_width(GTK_CONTAINER(buttonBox), 10); + gtk_box_pack_start(GTK_BOX(ret), buttonBox, FALSE, FALSE, 0); + + codecMoveUpButton = gtk_button_new_from_stock(GTK_STOCK_GO_UP); + gtk_widget_set_sensitive(GTK_WIDGET(codecMoveUpButton), FALSE); + gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveUpButton, FALSE, FALSE, 0); + g_signal_connect(G_OBJECT(codecMoveUpButton), "clicked", G_CALLBACK(codec_move_up), *a); + + codecMoveDownButton = gtk_button_new_from_stock(GTK_STOCK_GO_DOWN); + gtk_widget_set_sensitive(GTK_WIDGET(codecMoveDownButton), FALSE); + gtk_box_pack_start(GTK_BOX(buttonBox), codecMoveDownButton, FALSE, FALSE, 0); + g_signal_connect(G_OBJECT(codecMoveDownButton), "clicked", G_CALLBACK(codec_move_down), *a); + + preferences_dialog_fill_codec_list (a); + + return ret; } - void + void select_audio_manager( void ) { - DEBUG("audio manager selected\n"); + DEBUG("audio manager selected\n"); - if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) ) - { - dbus_set_audio_manager( ALSA ); - DEBUG(" display alsa conf panel"); - alsabox = alsa_box(); - gtk_container_add( GTK_CONTAINER(alsa_conf ) , alsabox); - gtk_widget_show( alsa_conf ); - gtk_widget_set_sensitive(GTK_WIDGET(alsa_conf), TRUE); + if( !SHOW_ALSA_CONF && !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) ) ) + { + dbus_set_audio_manager( ALSA ); + DEBUG(" display alsa conf panel"); + alsabox = alsa_box(); + gtk_container_add( GTK_CONTAINER(alsa_conf ) , alsabox); + gtk_widget_show( alsa_conf ); + gtk_widget_set_sensitive(GTK_WIDGET(alsa_conf), TRUE); gtk_action_set_sensitive (GTK_ACTION (volumeToggle), TRUE); - } - else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )) - { - dbus_set_audio_manager( PULSEAUDIO ); - DEBUG(" remove alsa conf panel"); - gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox ); - gtk_widget_hide( alsa_conf ); + } + else if( SHOW_ALSA_CONF && gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(pulse) )) + { + dbus_set_audio_manager( PULSEAUDIO ); + DEBUG(" remove alsa conf panel"); + gtk_container_remove( GTK_CONTAINER(alsa_conf) , alsabox ); + gtk_widget_hide( alsa_conf ); if (gtk_toggle_action_get_active ( GTK_TOGGLE_ACTION (volumeToggle))) { - main_window_volume_controls(FALSE); - dbus_set_volume_controls (FALSE); - gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (volumeToggle), FALSE); + main_window_volume_controls(FALSE); + dbus_set_volume_controls (FALSE); + gtk_toggle_action_set_active ( GTK_TOGGLE_ACTION (volumeToggle), FALSE); } gtk_action_set_sensitive (GTK_ACTION (volumeToggle), FALSE); - } else { - DEBUG("alsa conf panel...nothing"); - } + } else { + DEBUG("alsa conf panel...nothing"); + } } GtkWidget* alsa_box() { - GtkWidget *ret; - GtkWidget *table; - GtkWidget *item; - GtkCellRenderer *renderer; - - ret = gtk_hbox_new(FALSE, 10); - gtk_widget_show( ret ); - - table = gtk_table_new(4, 3, FALSE); - gtk_table_set_col_spacing(GTK_TABLE(table), 0, 40); - gtk_box_pack_start( GTK_BOX(ret) , table , TRUE , TRUE , 1); - gtk_widget_show(table); - - DEBUG("plugin"); - item = gtk_label_new(_("ALSA plugin")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show( item ); - // Set choices of audio managers - pluginlist = gtk_list_store_new(1, G_TYPE_STRING); - preferences_dialog_fill_output_audio_plugin_list(); - plugin = gtk_combo_box_new_with_model(GTK_TREE_MODEL(pluginlist)); - select_active_output_audio_plugin(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), plugin); - g_signal_connect(G_OBJECT(plugin), "changed", G_CALLBACK(select_output_audio_plugin), plugin); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(plugin), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(plugin), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), plugin, 2, 3, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(plugin); - - // Device : Output device - // Create title label - DEBUG("output"); - item = gtk_label_new(_("Output")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(item); - // Set choices of output devices - outputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); - preferences_dialog_fill_output_audio_device_list(); - output = gtk_combo_box_new_with_model(GTK_TREE_MODEL(outputlist)); - select_active_output_audio_device(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), output); - g_signal_connect(G_OBJECT(output), "changed", G_CALLBACK(select_audio_output_device), output); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(output), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(output), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), output, 2, 3, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(output); - - // Device : Input device - // Create title label - DEBUG("input"); - item = gtk_label_new(_("Input")); - gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(item); - - // Set choices of output devices - inputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); - preferences_dialog_fill_input_audio_device_list(); - input = gtk_combo_box_new_with_model(GTK_TREE_MODEL(inputlist)); - select_active_input_audio_device(); - gtk_label_set_mnemonic_widget(GTK_LABEL(item), input); - g_signal_connect(G_OBJECT(input), "changed", G_CALLBACK(select_audio_input_device), input); - - // Set rendering - renderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(input), renderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(input), renderer, "text", 0, NULL); - gtk_table_attach(GTK_TABLE(table), input, 2, 3, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); - gtk_widget_show(input); - - gtk_widget_show_all(ret); - - DEBUG("done"); - return ret; + GtkWidget *ret; + GtkWidget *table; + GtkWidget *item; + GtkCellRenderer *renderer; + + ret = gtk_hbox_new(FALSE, 10); + gtk_widget_show( ret ); + + table = gtk_table_new(4, 3, FALSE); + gtk_table_set_col_spacing(GTK_TABLE(table), 0, 40); + gtk_box_pack_start( GTK_BOX(ret) , table , TRUE , TRUE , 1); + gtk_widget_show(table); + + DEBUG("plugin"); + item = gtk_label_new(_("ALSA plugin")); + gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); + gtk_table_attach(GTK_TABLE(table), item, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show( item ); + // Set choices of audio managers + pluginlist = gtk_list_store_new(1, G_TYPE_STRING); + preferences_dialog_fill_output_audio_plugin_list(); + plugin = gtk_combo_box_new_with_model(GTK_TREE_MODEL(pluginlist)); + select_active_output_audio_plugin(); + gtk_label_set_mnemonic_widget(GTK_LABEL(item), plugin); + g_signal_connect(G_OBJECT(plugin), "changed", G_CALLBACK(select_output_audio_plugin), plugin); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(plugin), renderer, TRUE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(plugin), renderer, "text", 0, NULL); + gtk_table_attach(GTK_TABLE(table), plugin, 2, 3, 1, 2, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show(plugin); + + // Device : Output device + // Create title label + DEBUG("output"); + item = gtk_label_new(_("Output")); + gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); + gtk_table_attach(GTK_TABLE(table), item, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show(item); + // Set choices of output devices + outputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); + preferences_dialog_fill_output_audio_device_list(); + output = gtk_combo_box_new_with_model(GTK_TREE_MODEL(outputlist)); + select_active_output_audio_device(); + gtk_label_set_mnemonic_widget(GTK_LABEL(item), output); + g_signal_connect(G_OBJECT(output), "changed", G_CALLBACK(select_audio_output_device), output); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(output), renderer, TRUE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(output), renderer, "text", 0, NULL); + gtk_table_attach(GTK_TABLE(table), output, 2, 3, 2, 3, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show(output); + + // Device : Input device + // Create title label + DEBUG("input"); + item = gtk_label_new(_("Input")); + gtk_misc_set_alignment(GTK_MISC(item), 0, 0.5); + gtk_table_attach(GTK_TABLE(table), item, 1, 2, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show(item); + + // Set choices of output devices + inputlist = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); + preferences_dialog_fill_input_audio_device_list(); + input = gtk_combo_box_new_with_model(GTK_TREE_MODEL(inputlist)); + select_active_input_audio_device(); + gtk_label_set_mnemonic_widget(GTK_LABEL(item), input); + g_signal_connect(G_OBJECT(input), "changed", G_CALLBACK(select_audio_input_device), input); + + // Set rendering + renderer = gtk_cell_renderer_text_new(); + gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(input), renderer, TRUE); + gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(input), renderer, "text", 0, NULL); + gtk_table_attach(GTK_TABLE(table), input, 2, 3, 3, 4, GTK_FILL | GTK_EXPAND, GTK_SHRINK, 0, 0); + gtk_widget_show(input); + + gtk_widget_show_all(ret); + + DEBUG("done"); + return ret; } GtkWidget* noise_box() { - GtkWidget *ret; - GtkWidget *enableVoiceActivity; - GtkWidget *enableNoiseReduction; - - // check button to enable ringtones - ret = gtk_hbox_new( TRUE , 1); - - enableVoiceActivity = gtk_check_button_new_with_mnemonic( _("_Voice Activity Detection")); - //TODO Use the value from D-BUS - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableVoiceActivity), FALSE ); - gtk_box_pack_start( GTK_BOX(ret) , enableVoiceActivity , TRUE , TRUE , 1); - //TODO Enable it - //gtk_widget_set_sensitive(GTK_WIDGET(noise_conf), FALSE); - //TODO Add a callback function - //g_signal_connect(G_OBJECT( enableNoiseReduction) , "clicked" , NULL , NULL); - - - enableNoiseReduction = gtk_check_button_new_with_mnemonic( _("_Noise Reduction (Narrow-Band Companding)")); - //TODO Use the value from D-BUS - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableNoiseReduction), FALSE ); - gtk_box_pack_start( GTK_BOX(ret) , enableNoiseReduction , TRUE , TRUE , 1); - //TODO Enable it - // gtk_widget_set_sensitive(GTK_WIDGET(noise_conf), FALSE); - //TODO Add a callback function - //g_signal_connect(G_OBJECT( enableNoiseReduction) , "clicked" , NULL , NULL); - - return ret; + GtkWidget *ret; + GtkWidget *enableVoiceActivity; + GtkWidget *enableNoiseReduction; + + // check button to enable ringtones + ret = gtk_hbox_new( TRUE , 1); + + enableVoiceActivity = gtk_check_button_new_with_mnemonic( _("_Voice Activity Detection")); + //TODO Use the value from D-BUS + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableVoiceActivity), FALSE ); + gtk_box_pack_start( GTK_BOX(ret) , enableVoiceActivity , TRUE , TRUE , 1); + //TODO Enable it + //gtk_widget_set_sensitive(GTK_WIDGET(noise_conf), FALSE); + //TODO Add a callback function + //g_signal_connect(G_OBJECT( enableNoiseReduction) , "clicked" , NULL , NULL); + + + enableNoiseReduction = gtk_check_button_new_with_mnemonic( _("_Noise Reduction (Narrow-Band Companding)")); + //TODO Use the value from D-BUS + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableNoiseReduction), FALSE ); + gtk_box_pack_start( GTK_BOX(ret) , enableNoiseReduction , TRUE , TRUE , 1); + //TODO Enable it + // gtk_widget_set_sensitive(GTK_WIDGET(noise_conf), FALSE); + //TODO Add a callback function + //g_signal_connect(G_OBJECT( enableNoiseReduction) , "clicked" , NULL , NULL); + + return ret; } static void record_path_changed( GtkFileChooser *chooser , GtkLabel *label UNUSED) { - DEBUG("record_path_changed"); - - gchar* path; - // path = gtk_file_chooser_get_uri( GTK_FILE_CHOOSER( chooser )); - // DEBUG("path1 %s", path); - path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER( chooser )); - DEBUG("path2 %s", path); - // path = g_strndup (path + 6, strlen(path) - 6); - dbus_set_record_path( path ); + DEBUG("record_path_changed"); + + gchar* path; + path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER( chooser )); + DEBUG("path2 %s", path); + dbus_set_record_path( path ); } GtkWidget* create_audio_configuration() { - // Main widget - GtkWidget *ret; - // Main frames - GtkWidget *codecs_conf; - // Sub boxes - GtkWidget *box; - GtkWidget *frame; - - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - GtkWidget *alsa; - GtkWidget *table; - - gnome_main_section_new_with_table (_("Sound Manager"), &frame, &table, 1, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - int audio_manager = dbus_get_audio_manager(); - gboolean pulse_audio = FALSE; - if (audio_manager == PULSEAUDIO) { - pulse_audio = TRUE; - } - - pulse = gtk_radio_button_new_with_mnemonic( NULL , _("_Pulseaudio")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(pulse), pulse_audio); - gtk_table_attach ( GTK_TABLE( table ), pulse, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - alsa = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(pulse), _("_ALSA")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(alsa), !pulse_audio); - g_signal_connect(G_OBJECT(alsa), "clicked", G_CALLBACK(select_audio_manager), NULL); - gtk_table_attach ( GTK_TABLE( table ), alsa, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // Box for the ALSA configuration - gnome_main_section_new (_("ALSA settings"), &alsa_conf); - gtk_box_pack_start(GTK_BOX(ret), alsa_conf, FALSE, FALSE, 0); - // gtk_widget_hide( GTK_CONTAINER(alsa_conf) ); - gtk_widget_show( alsa_conf ); - if( SHOW_ALSA_CONF ) - { - // Box for the ALSA configuration - // alsa_conf = gtk_frame_new(_("ALSA configuration")); - // gtk_box_pack_start(GTK_BOX(ret), alsa_conf, FALSE, FALSE, 0); - printf("ALSA Created \n"); - alsabox = alsa_box(); - gtk_container_add( GTK_CONTAINER(alsa_conf) , alsabox ); - gtk_widget_hide( alsa_conf ); - } - - - // Box for the codecs - gnome_main_section_new (_("Codecs"), &codecs_conf); - gtk_box_pack_start(GTK_BOX(ret), codecs_conf, FALSE, FALSE, 0); - gtk_widget_set_size_request(GTK_WIDGET(codecs_conf), -1, 200); - gtk_widget_show( codecs_conf ); - box = codecs_box(); - gtk_container_add( GTK_CONTAINER(codecs_conf) , box ); - - // Box for noise reduction - // removed until the functions are implemented - - /* - noise_conf = gtk_frame_new(_("Audio Processing")); - gnome_main_section_new (_("Noise reduction"), &noise_conf); - gtk_box_pack_start(GTK_BOX(ret), noise_conf, FALSE, FALSE, 0); - gtk_widget_show( noise_conf ); - box = noise_box(); - gtk_container_add( GTK_CONTAINER(noise_conf) , box ); - gtk_widget_set_sensitive(GTK_WIDGET(noise_conf), FALSE); - */ - - // Recorded file saving path - GtkWidget *label; - GtkWidget *folderChooser; - gchar *dftPath; - - /* Get the path where to save audio files */ - dftPath = dbus_get_record_path (); - DEBUG("load recording path %s\n", dftPath); - - gnome_main_section_new_with_table (_("Recordings"), &frame, &table, 1, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - // label - label = gtk_label_new(_("Destination folder")); - gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // folder chooser button - folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser), dftPath); - g_signal_connect( G_OBJECT( folderChooser ) , "selection_changed" , G_CALLBACK( record_path_changed ) , NULL ); - gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // Box for the ringtones - gnome_main_section_new_with_table (_("Ringtones"), &frame, &table, 1, 2); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - GtkWidget *enableTone; - GtkWidget *fileChooser; - - enableTone = gtk_check_button_new_with_mnemonic( _("_Enable ringtones")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableTone), dbus_is_ringtone_enabled() ); - g_signal_connect(G_OBJECT( enableTone) , "clicked" , G_CALLBACK( ringtone_enabled ) , NULL); - gtk_table_attach ( GTK_TABLE( table ), enableTone, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - // file chooser button - fileChooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); - g_signal_connect( G_OBJECT( fileChooser ) , "selection_changed" , G_CALLBACK( ringtone_changed ) , NULL ); - - GtkFileFilter *filter = gtk_file_filter_new(); - gtk_file_filter_set_name( filter , _("Audio Files") ); - gtk_file_filter_add_pattern(filter , "*.wav" ); - gtk_file_filter_add_pattern(filter , "*.ul" ); - gtk_file_filter_add_pattern(filter , "*.au" ); - gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( fileChooser ) , filter); - gtk_table_attach ( GTK_TABLE( table ), fileChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - - gtk_widget_show_all(ret); - - if(!pulse_audio) { - gtk_widget_show(alsa_conf); - } - else{ - gtk_widget_hide(alsa_conf); - } - - return ret; + // Main widget + GtkWidget *ret; + // Sub boxes + GtkWidget *box; + GtkWidget *frame; + + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + GtkWidget *alsa; + GtkWidget *table; + + gnome_main_section_new_with_table (_("Sound Manager"), &frame, &table, 1, 2); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + + int audio_manager = dbus_get_audio_manager(); + gboolean pulse_audio = FALSE; + if (audio_manager == PULSEAUDIO) { + pulse_audio = TRUE; + } + + pulse = gtk_radio_button_new_with_mnemonic( NULL , _("_Pulseaudio")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(pulse), pulse_audio); + gtk_table_attach ( GTK_TABLE( table ), pulse, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + alsa = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(pulse), _("_ALSA")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(alsa), !pulse_audio); + g_signal_connect(G_OBJECT(alsa), "clicked", G_CALLBACK(select_audio_manager), NULL); + gtk_table_attach ( GTK_TABLE( table ), alsa, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // Box for the ALSA configuration + gnome_main_section_new (_("ALSA settings"), &alsa_conf); + gtk_box_pack_start(GTK_BOX(ret), alsa_conf, FALSE, FALSE, 0); + gtk_widget_show( alsa_conf ); + if( SHOW_ALSA_CONF ) + { + // Box for the ALSA configuration + printf("ALSA Created \n"); + alsabox = alsa_box(); + gtk_container_add( GTK_CONTAINER(alsa_conf) , alsabox ); + gtk_widget_hide( alsa_conf ); + } + + // Recorded file saving path + GtkWidget *label; + GtkWidget *folderChooser; + gchar *dftPath; + + /* Get the path where to save audio files */ + dftPath = dbus_get_record_path (); + DEBUG("load recording path %s\n", dftPath); + + gnome_main_section_new_with_table (_("Recordings"), &frame, &table, 1, 2); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + + // label + label = gtk_label_new(_("Destination folder")); + gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // folder chooser button + folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser), dftPath); + g_signal_connect( G_OBJECT( folderChooser ) , "selection_changed" , G_CALLBACK( record_path_changed ) , NULL ); + gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // Box for the ringtones + gnome_main_section_new_with_table (_("Ringtones"), &frame, &table, 1, 2); + gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); + + GtkWidget *enableTone; + GtkWidget *fileChooser; + + enableTone = gtk_check_button_new_with_mnemonic( _("_Enable ringtones")); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableTone), dbus_is_ringtone_enabled() ); + g_signal_connect(G_OBJECT( enableTone) , "clicked" , G_CALLBACK( ringtone_enabled ) , NULL); + gtk_table_attach ( GTK_TABLE( table ), enableTone, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + // file chooser button + fileChooser = gtk_file_chooser_button_new(_("Choose a ringtone"), GTK_FILE_CHOOSER_ACTION_OPEN); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( fileChooser) , g_get_home_dir()); + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER( fileChooser) , get_ringtone_choice()); + g_signal_connect( G_OBJECT( fileChooser ) , "selection_changed" , G_CALLBACK( ringtone_changed ) , NULL ); + + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter , _("Audio Files") ); + gtk_file_filter_add_pattern(filter , "*.wav" ); + gtk_file_filter_add_pattern(filter , "*.ul" ); + gtk_file_filter_add_pattern(filter , "*.au" ); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER( fileChooser ) , filter); + gtk_table_attach ( GTK_TABLE( table ), fileChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + gtk_widget_show_all(ret); + + if(!pulse_audio) { + gtk_widget_show(alsa_conf); + } + else{ + gtk_widget_hide(alsa_conf); + } + + return ret; +} +/* +GtkWidget* create_codecs_configuration (account_t **a) { + + // Main widget + GtkWidget *ret, *codecs, *box, *frame; + + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + // Box for the codecs + gnome_main_section_new (_("Codecs"), &codecs); + gtk_box_pack_start (GTK_BOX(ret), codecs, FALSE, FALSE, 0); + gtk_widget_set_size_request (GTK_WIDGET (codecs), -1, 200); + gtk_widget_show (codecs); + box = codecs_box (a); + gtk_container_add (GTK_CONTAINER (codecs) , box); + + gtk_widget_show_all(ret); + + return ret; + } +*/ diff --git a/sflphone-client-gnome/src/config/audioconf.h b/sflphone-client-gnome/src/config/audioconf.h index 26e28aa7715a51a16292b4138cf171539afc583a..18a1232ff25b3c600ce2b359f0355791b5084331 100644 --- a/sflphone-client-gnome/src/config/audioconf.h +++ b/sflphone-client-gnome/src/config/audioconf.h @@ -22,7 +22,8 @@ #include <actions.h> -GtkWidget* create_audio_configuration(); +GtkWidget* create_audio_configuration (void); +GtkWidget* create_codecs_configuration (account_t **a); GtkWidget* api_box(); GtkWidget* alsa_box(); diff --git a/sflphone-client-gnome/src/config/preferencesdialog.c b/sflphone-client-gnome/src/config/preferencesdialog.c index 4b7d9af6f23db9bd6c520a073e37c0fd204f0c0b..82570beb2f503b5db1e6b38b22188ca530983377 100644 --- a/sflphone-client-gnome/src/config/preferencesdialog.c +++ b/sflphone-client-gnome/src/config/preferencesdialog.c @@ -30,6 +30,7 @@ #include <mainwindow.h> #include <audioconf.h> #include <addressbook-config.h> +#include <shortcuts-config.h> #include <hooks-config.h> #include <utils.h> @@ -51,541 +52,278 @@ GtkWidget * history_value; GtkWidget * status; +GtkWidget *showstatusicon; +GtkWidget *starthidden; +GtkWidget *popupwindow; +GtkWidget *neverpopupwindow; + static int history_limit; static gboolean history_enabled = TRUE; - -GHashTable * directIpCallsProperties = NULL; - - - static void -set_md5_hash_cb(GtkWidget *widget UNUSED, gpointer data UNUSED) -{ - gboolean enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); - dbus_set_md5_credential_hashing(enabled); -} - - static void -start_hidden( void ) -{ - dbus_start_hidden(); -} - -static void set_popup_mode (GtkWidget *widget, gpointer *userdata) -{ - if (dbus_popup_mode () || gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) - dbus_switch_popup_mode (); -} - - - void -set_notif_level( ) -{ - dbus_set_notify(); -} - -static void history_limit_cb (GtkSpinButton *button, void *ptr) -{ - history_limit = gtk_spin_button_get_value_as_int((GtkSpinButton *)(ptr)); -} - -static void history_enabled_cb (GtkWidget *widget) +static void +set_md5_hash_cb (GtkWidget *widget UNUSED, gpointer data UNUSED) { - history_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - gtk_widget_set_sensitive (GTK_WIDGET (history_value), history_enabled); - // Toggle it through D-Bus - dbus_set_history_enabled (); + gboolean enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget)); + dbus_set_md5_credential_hashing (enabled); } - void -clean_history( void ) +static void +start_hidden (void) { - calllist_clean_history(); + dbus_start_hidden (); } -static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data) +static void +set_popup_mode (GtkWidget *widget, gpointer *userdata) { - DEBUG("Advanced options for ZRTP"); - show_advanced_zrtp_options((GHashTable *) data); + if (dbus_popup_mode () || gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON (widget))) + dbus_switch_popup_mode (); } -static void show_advanced_tls_options_cb(GtkWidget *widget UNUSED, gpointer data) +void +set_notif_level () { - DEBUG("Advanced options for TLS"); - show_advanced_tls_options((GHashTable *) data); + dbus_set_notify (); } -static void key_exchange_changed_cb(GtkWidget *widget, gpointer data) +static void +history_limit_cb (GtkSpinButton *button, void *ptr) { - DEBUG("Key exchange changed"); - if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)), (gchar *) "ZRTP") == 0) { - gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); - g_hash_table_replace(directIpCallsProperties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); - g_hash_table_replace(directIpCallsProperties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(ZRTP)); - } - else if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)), (gchar *) "SDES") == 0) { - gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); - g_hash_table_replace(directIpCallsProperties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); - g_hash_table_replace(directIpCallsProperties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(SDES)); - } - else { - gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); - DEBUG("Setting key exchange %s to %s\n", ACCOUNT_KEY_EXCHANGE, KEY_EXCHANGE_NONE); - g_hash_table_replace(directIpCallsProperties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("false")); - g_hash_table_replace(directIpCallsProperties, g_strdup(ACCOUNT_KEY_EXCHANGE), g_strdup(KEY_EXCHANGE_NONE)); - } + history_limit = gtk_spin_button_get_value_as_int ((GtkSpinButton *) (ptr)); } -static void use_sip_tls_cb(GtkWidget *widget, gpointer data) +static void +history_enabled_cb (GtkWidget *widget) { - if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { - DEBUG("Using sips"); - gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE); - g_hash_table_replace(directIpCallsProperties, - g_strdup(TLS_ENABLE), g_strdup("true")); - } else { - gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); - g_hash_table_replace(directIpCallsProperties, - g_strdup(TLS_ENABLE), g_strdup("false")); - } -} + history_enabled = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + gtk_widget_set_sensitive (GTK_WIDGET (history_value), history_enabled); - -static void ip2ip_local_address_changed_cb(GtkWidget *widget, gpointer data) -{ - DEBUG("ip2ip_local_address_changed_cb\n"); - g_hash_table_replace(directIpCallsProperties, g_strdup(LOCAL_INTERFACE), g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)))); + // Toggle it through D-Bus + dbus_set_history_enabled (); } -static void ip2ip_local_port_changed_cb(GtkWidget *widget, gpointer data) +void +clean_history (void) { - DEBUG("ip2ip_local_port_changed_cb\n"); - gint new_port = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widget)); - DEBUG("new_port %i", new_port); - g_hash_table_replace(directIpCallsProperties, - g_strdup(LOCAL_PORT), g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(GTK_SPIN_BUTTON(widget))))); + calllist_clean_history (); } +void showstatusicon_cb (GtkWidget *widget, gpointer data) { -GtkWidget* create_direct_ip_calls_tab() -{ - GtkWidget * frame; - GtkWidget * table; - GtkWidget * label; - GtkWidget * explanationLabel; - - GtkWidget * localPortLabel; - // GtkWidget * localPortSpinBox; - GtkWidget * localAddressLabel; - // GtkWidget * localAddressCombo; - - GtkWidget * keyExchangeCombo; - GtkWidget * advancedZrtpButton; - GtkWidget * useSipTlsCheckBox; - - gchar * curSRTPEnabled = "false"; - gchar * curTlsEnabled = "false"; - gchar * curKeyExchange = "0"; - gchar * description; - - gchar * local_interface; - gchar * local_address; - gchar * local_port; - - //directIpCallsProperties = sflphone_get_ip2ip_properties(); - sflphone_get_ip2ip_properties(&directIpCallsProperties); - - if(directIpCallsProperties != NULL) { - DEBUG("got a directIpCallsProperties"); - local_interface = g_hash_table_lookup(directIpCallsProperties, LOCAL_INTERFACE); - local_port = g_hash_table_lookup(directIpCallsProperties, LOCAL_PORT); - DEBUG(" local interface = %s", local_interface); - DEBUG(" local port = %s", local_port); - curSRTPEnabled = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_SRTP_ENABLED); - DEBUG(" curSRTPEnabled = %s", curSRTPEnabled); - curKeyExchange = g_hash_table_lookup(directIpCallsProperties, ACCOUNT_KEY_EXCHANGE); - curTlsEnabled = g_hash_table_lookup(directIpCallsProperties, TLS_ENABLE); - } - - - - GtkWidget * vbox = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); - - description = g_markup_printf_escaped(_("This profile is used when you want to reach a remote peer simply by typing a sip URI such as <b>sip:remotepeer</b>. The settings you define here will also be used if no account can be matched to an incoming or outgoing call.")); - explanationLabel = gtk_label_new(NULL); - gtk_label_set_markup(GTK_LABEL(explanationLabel), description); - gtk_misc_set_alignment(GTK_MISC(explanationLabel), 0, 0.5); - gtk_box_pack_start(GTK_BOX(vbox), explanationLabel, FALSE, FALSE, 0); - - /** - * Network Interface Section - */ - gnome_main_section_new_with_table (_("Network Interface"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings (GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0); - - /** - * Retreive the list of IP interface from the - * the daemon and build the combo box. - */ - - GtkListStore * ipInterfaceListStore; - GtkTreeIter iter; - - ipInterfaceListStore = gtk_list_store_new( 1, G_TYPE_STRING ); - localAddressLabel = gtk_label_new_with_mnemonic (_("Local address")); - gtk_table_attach ( GTK_TABLE( table ), localAddressLabel, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC (localAddressLabel), 0, 0.5); - - GtkTreeIter current_local_address_iter = iter; - gchar ** iface_list = NULL; - // iface_list = (gchar**) dbus_get_all_ip_interface(); - iface_list = (gchar**) dbus_get_all_ip_interface_by_name(); - gchar ** iface; - - gboolean iface_found = FALSE; - - if (iface_list != NULL) { - - for (iface = iface_list; *iface; iface++) { - gtk_list_store_append(ipInterfaceListStore, &iter ); - gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1 ); - - if (!iface_found && (g_strcmp0(*iface, local_interface) == 0)) { - DEBUG("Setting active local address combo box"); - current_local_address_iter = iter; - iface_found = TRUE; - } - } - - if(!iface_found) { - DEBUG("Did not find local ip address, take fisrt in the list"); - gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ipInterfaceListStore), ¤t_local_address_iter); - } - } - - - - - localAddressCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ipInterfaceListStore)); - gtk_label_set_mnemonic_widget(GTK_LABEL(localAddressLabel), localAddressCombo); - gtk_table_attach ( GTK_TABLE( table ), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - g_object_unref(G_OBJECT(ipInterfaceListStore)); - - GtkCellRenderer * ipInterfaceCellRenderer; - ipInterfaceCellRenderer = gtk_cell_renderer_text_new(); - gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, TRUE); - gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL); - gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), ¤t_local_address_iter); - g_signal_connect (G_OBJECT(GTK_COMBO_BOX(localAddressCombo)), "changed", G_CALLBACK (ip2ip_local_address_changed_cb), localAddressCombo); - - g_hash_table_replace(directIpCallsProperties, g_strdup(LOCAL_INTERFACE), g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)))); - - - /** - * Local port - */ - /** SIP port information */ - localPortLabel = gtk_label_new_with_mnemonic (_("Local port")); - gtk_table_attach_defaults(GTK_TABLE(table), localPortLabel, 0, 1, 1, 2); - - gtk_misc_set_alignment(GTK_MISC (localPortLabel), 0, 0.5); - localPortSpinBox = gtk_spin_button_new_with_range(1, 65535, 1); - gtk_label_set_mnemonic_widget (GTK_LABEL (localPortLabel), localPortSpinBox); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(localPortSpinBox), g_ascii_strtod(local_port, NULL)); - - gtk_table_attach_defaults(GTK_TABLE(table), localPortSpinBox, 1, 2, 1, 2); - g_signal_connect (G_OBJECT(localPortSpinBox), "changed", G_CALLBACK (ip2ip_local_port_changed_cb), localPortSpinBox); - - - GtkWidget *applyModificationButton = gtk_button_new_from_stock(GTK_STOCK_APPLY); - // g_signal_connect( G_OBJECT(applyModificationButton) , "clicked" , G_CALLBACK( update_ip_address_port_cb ), localPortSpinBox); - gtk_table_attach( GTK_TABLE(table), applyModificationButton, 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - - /** - * Security Section - */ - gnome_main_section_new_with_table (_("Security"), &frame, &table, 2, 3); - gtk_container_set_border_width (GTK_CONTAINER(table), 10); - gtk_table_set_row_spacings (GTK_TABLE(table), 10); - gtk_table_set_col_spacings( GTK_TABLE(table), 10); - gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0); - - GtkWidget * sipTlsAdvancedButton; - sipTlsAdvancedButton = gtk_button_new_from_stock(GTK_STOCK_EDIT); - gtk_table_attach_defaults(GTK_TABLE(table), sipTlsAdvancedButton, 2, 3, 0, 1); - gtk_widget_set_sensitive(GTK_WIDGET(sipTlsAdvancedButton), FALSE); - g_signal_connect(G_OBJECT(sipTlsAdvancedButton), "clicked", G_CALLBACK(show_advanced_tls_options_cb), directIpCallsProperties); - - useSipTlsCheckBox = gtk_check_button_new_with_mnemonic(_("Use TLS transport (sips)")); - g_signal_connect (useSipTlsCheckBox, "toggled", G_CALLBACK(use_sip_tls_cb), sipTlsAdvancedButton); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(useSipTlsCheckBox), (g_strcmp0(curTlsEnabled, "false") == 0) ? FALSE:TRUE); - gtk_table_attach_defaults(GTK_TABLE(table), useSipTlsCheckBox, 0, 2, 0, 1); - - label = gtk_label_new_with_mnemonic (_("SRTP key exchange")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - keyExchangeCombo = gtk_combo_box_new_text(); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP"); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES"); - gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled")); - - advancedZrtpButton = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES); - g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb), directIpCallsProperties); - - if (g_strcasecmp(curKeyExchange, ZRTP) == 0) { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0); - } - else if(g_strcasecmp(curKeyExchange, SDES) == 0) { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),1); - } - else { - gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); - gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE); - } - - g_signal_connect (G_OBJECT (GTK_COMBO_BOX(keyExchangeCombo)), "changed", G_CALLBACK (key_exchange_changed_cb), advancedZrtpButton); + gboolean currentstatus = FALSE; - gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), keyExchangeCombo, 1, 2, 1, 2); - gtk_table_attach_defaults(GTK_TABLE(table), advancedZrtpButton, 2, 3, 1, 2); + // data contains the previous value of dbus_is_status_icon_enabled () - ie before the click. + currentstatus = (gboolean) gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - gtk_widget_show_all(table); - - GtkRequisition requisition; - gtk_widget_size_request(GTK_WIDGET(table), &requisition); - gtk_widget_set_size_request(GTK_WIDGET(explanationLabel), requisition.width * 1.5, -1); - gtk_label_set_line_wrap(GTK_LABEL(explanationLabel), TRUE); + // Update the widget states + gtk_widget_set_sensitive (GTK_WIDGET (popupwindow), currentstatus); + gtk_widget_set_sensitive (GTK_WIDGET (neverpopupwindow), currentstatus); + gtk_widget_set_sensitive (GTK_WIDGET (starthidden), currentstatus); - gtk_widget_show_all(vbox); + currentstatus ? show_status_icon () : hide_status_icon (); - return vbox; + // Update through D-Bus + dbus_enable_status_icon (currentstatus ? "true" : "false"); } -/* - GtkWidget* create_network_tab() - { - GtkWidget * frame; - GtkWidget * table; - GtkWidget * label; - GtkWidget * ret; - gchar * description; - - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - -// SIP port information -int curPort = dbus_get_sip_port(); -if(curPort <= 0 || curPort > 65535) { -curPort = 5060; -} - -int account_number = account_list_get_sip_account_number(); -DEBUG("sip account number = %i", account_number); - -gnome_main_section_new_with_table (_("SIP Port"), &frame, &table, 1, 3); -gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); -gtk_widget_set_sensitive(GTK_WIDGET(frame),(account_number == 0) ? FALSE:TRUE); -GtkWidget *applySipPortButton = gtk_button_new_from_stock(GTK_STOCK_APPLY); -GtkWidget *entryPort; -label = gtk_label_new(_("UDP Transport")); -gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); -entryPort = gtk_spin_button_new_with_range(1, 65535, 1); -gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryPort); -gtk_spin_button_set_value(GTK_SPIN_BUTTON(entryPort), curPort); -g_signal_connect( G_OBJECT( applySipPortButton) , "clicked" , G_CALLBACK( update_port_cb ) , entryPort); - -gtk_table_attach( GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); -gtk_table_attach( GTK_TABLE(table), entryPort, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); -gtk_table_attach( GTK_TABLE(table), applySipPortButton, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - -gtk_widget_show_all(ret); - -return ret; -} - */ - - GtkWidget* +GtkWidget* create_general_settings () { - GtkWidget *ret; - - GtkWidget *notifAll; - - GtkWidget *trayItem; - GtkWidget *frame; - GtkWidget *checkBoxWidget; - GtkWidget *label; - GtkWidget *table; - - // Load history configuration - history_load_configuration (); - - // Main widget - ret = gtk_vbox_new(FALSE, 10); - gtk_container_set_border_width(GTK_CONTAINER(ret), 10); - - // Notifications Frame - gnome_main_section_new_with_table (_("Desktop Notifications"), &frame, &table, 2, 1); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - // Notification All - notifAll = gtk_check_button_new_with_mnemonic( _("_Enable notifications")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(notifAll), dbus_get_notify() ); - g_signal_connect(G_OBJECT( notifAll ) , "clicked" , G_CALLBACK( set_notif_level ) , NULL ); - gtk_table_attach( GTK_TABLE(table), notifAll, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // System Tray option frame - gnome_main_section_new_with_table (_("System Tray Icon"), &frame, &table, 3, 1); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - GtkWidget* trayItem1 = gtk_radio_button_new_with_mnemonic(NULL, _("_Popup main window on incoming call")); - g_signal_connect(G_OBJECT (trayItem1), "toggled", G_CALLBACK (set_popup_mode), NULL); - gtk_table_attach( GTK_TABLE(table), trayItem1, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - trayItem = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON(trayItem1), _("Ne_ver popup main window")); - gtk_table_attach( GTK_TABLE(table), trayItem, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // Toggle according to the user configuration - dbus_popup_mode () ? gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (trayItem1), TRUE) : gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (trayItem), TRUE); - - trayItem = gtk_check_button_new_with_mnemonic(_("Hide SFLphone window on _startup")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(trayItem), dbus_is_start_hidden() ); - g_signal_connect(G_OBJECT( trayItem ) , "clicked" , G_CALLBACK( start_hidden ) , NULL); - gtk_table_attach( GTK_TABLE(table), trayItem, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // HISTORY CONFIGURATION - gnome_main_section_new_with_table (_("Calls History"), &frame, &table, 3, 1); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - - checkBoxWidget = gtk_check_button_new_with_mnemonic(_("_Keep my history for at least")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkBoxWidget), history_enabled); - g_signal_connect (G_OBJECT (checkBoxWidget) , "clicked" , G_CALLBACK (history_enabled_cb) , NULL); - gtk_table_attach( GTK_TABLE(table), checkBoxWidget, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - history_value = gtk_spin_button_new_with_range(1, 99, 1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON(history_value), history_limit); - g_signal_connect( G_OBJECT (history_value) , "value-changed" , G_CALLBACK (history_limit_cb) , history_value); - gtk_widget_set_sensitive (GTK_WIDGET (history_value), gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkBoxWidget))); - gtk_table_attach( GTK_TABLE(table), history_value, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - label = gtk_label_new(_("days")); - gtk_table_attach( GTK_TABLE(table), label, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - - // Configuration File - // Commented out because not functional yet - /* - gnome_main_section_new_with_table (_("Configuration File"), &frame, &table, 1, 1); - gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); - checkBoxWidget = gtk_check_button_new_with_mnemonic(_("Store SIP credentials as MD5 hash")); - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(checkBoxWidget), dbus_is_md5_credential_hashing() ); - g_signal_connect(G_OBJECT( checkBoxWidget ) , "clicked" , G_CALLBACK(set_md5_hash_cb) , NULL); - gtk_table_attach( GTK_TABLE(table), checkBoxWidget, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); - */ - - gtk_widget_show_all(ret); - - return ret; + GtkWidget *ret, *notifAll, *trayItem, *frame, *checkBoxWidget, *label, *table; + gboolean statusicon = FALSE; + + // Load history configuration + history_load_configuration (); + + // Main widget + ret = gtk_vbox_new (FALSE, 10); + gtk_container_set_border_width (GTK_CONTAINER(ret), 10); + + // Notifications Frame + gnome_main_section_new_with_table (_("Desktop Notifications"), &frame, + &table, 2, 1); + gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); + + // Notification All + notifAll = gtk_check_button_new_with_mnemonic (_("_Enable notifications")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(notifAll), dbus_get_notify ()); + g_signal_connect(G_OBJECT( notifAll ) , "clicked" , G_CALLBACK( set_notif_level ) , NULL ); + gtk_table_attach (GTK_TABLE(table), notifAll, 0, 1, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // System Tray option frame + gnome_main_section_new_with_table (_("System Tray Icon"), &frame, &table, 4, + 1); + gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); + + if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) + statusicon = TRUE; + else + statusicon = FALSE; + + showstatusicon = gtk_check_button_new_with_mnemonic ( + _("Show SFLphone in the system tray")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(showstatusicon), statusicon); + g_signal_connect (G_OBJECT (showstatusicon) , "clicked" , G_CALLBACK (showstatusicon_cb), NULL); + gtk_table_attach (GTK_TABLE (table), showstatusicon, 0, 1, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + popupwindow = gtk_radio_button_new_with_mnemonic (NULL, + _("_Popup main window on incoming call")); + g_signal_connect(G_OBJECT (popupwindow), "toggled", G_CALLBACK (set_popup_mode), NULL); + gtk_table_attach (GTK_TABLE(table), popupwindow, 0, 1, 1, 2, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + neverpopupwindow = gtk_radio_button_new_with_mnemonic_from_widget ( + GTK_RADIO_BUTTON (popupwindow), _("Ne_ver popup main window")); + gtk_table_attach (GTK_TABLE(table), neverpopupwindow, 0, 1, 2, 3, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // Toggle according to the user configuration + dbus_popup_mode () ? gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (popupwindow), TRUE) : gtk_toggle_button_set_active ( + GTK_TOGGLE_BUTTON (neverpopupwindow), TRUE); + + starthidden = gtk_check_button_new_with_mnemonic ( + _("Hide SFLphone window on _startup")); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(starthidden), + dbus_is_start_hidden ()); + g_signal_connect(G_OBJECT (starthidden) , "clicked" , G_CALLBACK( start_hidden ) , NULL); + gtk_table_attach (GTK_TABLE(table), starthidden, 0, 1, 3, 4, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + // Update the widget states + gtk_widget_set_sensitive (GTK_WIDGET (popupwindow),statusicon); + gtk_widget_set_sensitive (GTK_WIDGET (neverpopupwindow),statusicon); + gtk_widget_set_sensitive (GTK_WIDGET (starthidden),statusicon); + + // HISTORY CONFIGURATION + gnome_main_section_new_with_table (_("Calls History"), &frame, &table, 3, 1); + gtk_box_pack_start (GTK_BOX(ret), frame, FALSE, FALSE, 0); + + checkBoxWidget = gtk_check_button_new_with_mnemonic ( + _("_Keep my history for at least")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkBoxWidget), + history_enabled); + g_signal_connect (G_OBJECT (checkBoxWidget) , "clicked" , G_CALLBACK (history_enabled_cb) , NULL); + gtk_table_attach (GTK_TABLE(table), checkBoxWidget, 0, 1, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + history_value = gtk_spin_button_new_with_range (1, 99, 1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON(history_value), history_limit); + g_signal_connect( G_OBJECT (history_value) , "value-changed" , G_CALLBACK (history_limit_cb) , history_value); + gtk_widget_set_sensitive (GTK_WIDGET (history_value), + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkBoxWidget))); + gtk_table_attach (GTK_TABLE(table), history_value, 1, 2, 0, 1, GTK_EXPAND + | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); + + label = gtk_label_new (_("days")); + gtk_table_attach (GTK_TABLE(table), label, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, + GTK_EXPAND | GTK_FILL, 0, 5); + + gtk_widget_show_all (ret); + + return ret; } -void save_configuration_parameters (void) { +void +save_configuration_parameters (void) +{ - // Address book config - addressbook_config_save_parameters (); - hooks_save_parameters (); + // Address book config + addressbook_config_save_parameters (); + hooks_save_parameters (); - // History config - dbus_set_history_limit (history_limit); + // History config + dbus_set_history_limit (history_limit); - // Direct IP calls config - dbus_set_ip2ip_details(directIpCallsProperties); + // Direct IP calls config + // dbus_set_ip2ip_details (directIpCallsProperties); } -void history_load_configuration () +void +history_load_configuration () { - history_limit = dbus_get_history_limit (); - history_enabled = TRUE; - if (g_strcasecmp (dbus_get_history_enabled (), "false") == 0) - history_enabled = FALSE; + history_limit = dbus_get_history_limit (); + history_enabled = TRUE; + if (g_strcasecmp (dbus_get_history_enabled (), "false") == 0) + history_enabled = FALSE; } /** * Show configuration window with tabs */ - void +void show_preferences_dialog () { - GtkDialog * dialog; - GtkWidget * notebook; - GtkWidget * tab; - guint result; - - dialogOpen = TRUE; - - dialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Preferences"), - GTK_WINDOW(get_main_window()), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CLOSE, - GTK_RESPONSE_ACCEPT, - NULL)); - - // Set window properties - gtk_dialog_set_has_separator(dialog, FALSE); - gtk_window_set_default_size(GTK_WINDOW(dialog), 600, 400); - gtk_container_set_border_width(GTK_CONTAINER(dialog), 0); - - // Create tabs container - notebook = gtk_notebook_new(); - gtk_box_pack_start(GTK_BOX (dialog->vbox), notebook, TRUE, TRUE, 0); - gtk_container_set_border_width(GTK_CONTAINER(notebook), 10); - gtk_widget_show(notebook); - - // General settings tab - tab = create_general_settings(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("General"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - - // Audio tab - tab = create_audio_configuration(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Audio"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - - // Addressbook tab - tab = create_addressbook_settings(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Address Book"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - - // HookS tab - tab = create_hooks_settings(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Hooks"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - /* - // Network tab - tab = create_network_tab(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Network"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - */ - // Direct IP calls tab - tab = create_direct_ip_calls_tab(); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Direct IP calls"))); - gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); - - gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook) , 0); - - result = gtk_dialog_run(dialog); - - save_configuration_parameters (); - update_actions(); - - dialogOpen = FALSE; - - gtk_widget_destroy(GTK_WIDGET(dialog)); + GtkDialog * dialog; + GtkWidget * notebook; + GtkWidget * tab; + guint result; + + dialogOpen = TRUE; + + dialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Preferences"), + GTK_WINDOW(get_main_window()), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, + GTK_RESPONSE_ACCEPT, + NULL)); + + // Set window properties + gtk_dialog_set_has_separator (dialog, FALSE); + gtk_window_set_default_size (GTK_WINDOW(dialog), 600, 400); + gtk_container_set_border_width (GTK_CONTAINER(dialog), 0); + + // Create tabs container + notebook = gtk_notebook_new (); + gtk_box_pack_start (GTK_BOX (dialog->vbox), notebook, TRUE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER(notebook), 10); + gtk_widget_show (notebook); + + // General settings tab + tab = create_general_settings (); + gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( + _("General"))); + gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); + + // Audio tab + tab = create_audio_configuration (); + gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( + _("Audio"))); + gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); + + // Addressbook tab + tab = create_addressbook_settings (); + gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( + _("Address Book"))); + gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); + + // Hooks tab + tab = create_hooks_settings (); + gtk_notebook_append_page (GTK_NOTEBOOK(notebook), tab, gtk_label_new ( + _("Hooks"))); + gtk_notebook_page_num (GTK_NOTEBOOK(notebook), tab); + + // Shortcuts tab + tab = create_shortcuts_settings(); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Shortcuts"))); + gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + + gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); + + result = gtk_dialog_run (dialog); + + save_configuration_parameters (); + update_actions (); + + dialogOpen = FALSE; + + gtk_widget_destroy (GTK_WIDGET(dialog)); } diff --git a/sflphone-client-gnome/src/config/shortcuts-config.c b/sflphone-client-gnome/src/config/shortcuts-config.c new file mode 100644 index 0000000000000000000000000000000000000000..06eb1839a94c5be5c41531a2a0f921ae092a8fe3 --- /dev/null +++ b/sflphone-client-gnome/src/config/shortcuts-config.c @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2010 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "shortcuts-config.h" +#include "shortcuts.h" + +#include <gdk/gdkx.h> + +GtkWidget* +create_shortcuts_settings() +{ + GtkWidget *vbox, *result_frame, *window, *treeview, *scrolled_window, *label; + + GtkTreeIter iter; + guint i = 0; + + vbox = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(vbox), 10); + + gnome_main_section_new(_("General"), &result_frame); + + label = gtk_label_new(_("Be careful: these shortcuts might override system-wide shortcuts.")); + + treeview = gtk_tree_view_new(); + setup_tree_view(treeview); + + GtkListStore *store = gtk_list_store_new(COLUMNS, G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT); + + Accelerator* list = shortcuts_get_list(); + + while (list[i].action != NULL) + { + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, ACTION, _(list[i].action), MASK, + (gint) list[i].mask, VALUE, XKeycodeToKeysym(GDK_DISPLAY(), + list[i].value, 0), -1); + i++; + } + + gtk_tree_view_set_model(GTK_TREE_VIEW (treeview), GTK_TREE_MODEL (store)); + g_object_unref(store); + + gtk_container_add(GTK_CONTAINER (result_frame), treeview); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), result_frame, FALSE, FALSE, 0); + + gtk_widget_show_all(vbox); + + return vbox; +} + +/* + * Create a tree view with two columns. The first is an action and the + * second is a keyboard accelerator. + */ +static void +setup_tree_view(GtkWidget *treeview) +{ + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + renderer = gtk_cell_renderer_text_new(); + column = gtk_tree_view_column_new_with_attributes("Action", renderer, "text", + ACTION, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW (treeview), column); + + renderer = gtk_cell_renderer_accel_new(); + g_object_set(renderer, "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_GTK, + "editable", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes("Shortcut", renderer, + "accel-mods", MASK, "accel-key", VALUE, NULL); + + gtk_tree_view_append_column(GTK_TREE_VIEW (treeview), column); + g_signal_connect (G_OBJECT (renderer), "accel_edited", G_CALLBACK (accel_edited), (gpointer) treeview); + g_signal_connect (G_OBJECT (renderer), "accel_cleared", G_CALLBACK (accel_cleared), (gpointer) treeview); +} + +static void +accel_edited(GtkCellRendererAccel *renderer, gchar *path, guint accel_key, + GdkModifierType mask, guint hardware_keycode, GtkTreeView *treeview) +{ + DEBUG("Accel edited"); + + GtkTreeModel *model; + GtkTreeIter iter; + + Accelerator* list = shortcuts_get_list(); + model = gtk_tree_view_get_model(treeview); + gint code = XKeysymToKeycode(GDK_DISPLAY(), accel_key); + + // Disable existing binding if key already used + int i = 0; + gtk_tree_model_get_iter_first(model, &iter); + while (list[i].action != NULL) + { + if(list[i].value == code) + { + gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1); + WARN("This key was already affected"); + } + gtk_tree_model_iter_next(model, &iter); + i++; + } + + // Update treeview + if (gtk_tree_model_get_iter_from_string(model, &iter, path)) + gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, (gint) mask, VALUE, + accel_key, -1); + + // Update GDK bindings + shortcuts_update_bindings(atoi(path), code); +} + +static void +accel_cleared(GtkCellRendererAccel *renderer, gchar *path, GtkTreeView *treeview) +{ + DEBUG("Accel cleared"); + + GtkTreeModel *model; + GtkTreeIter iter; + + // Update treeview + model = gtk_tree_view_get_model(treeview); + if (gtk_tree_model_get_iter_from_string(model, &iter, path)) + gtk_list_store_set(GTK_LIST_STORE (model), &iter, MASK, 0, VALUE, 0, -1); + + // Update GDK bindings + shortcuts_update_bindings(atoi(path), 0); +} diff --git a/sflphone-client-gnome/src/config/shortcuts-config.h b/sflphone-client-gnome/src/config/shortcuts-config.h new file mode 100644 index 0000000000000000000000000000000000000000..b7edf5c5499eb2caffc6821495bafa06a3b7edbf --- /dev/null +++ b/sflphone-client-gnome/src/config/shortcuts-config.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _SHORTCUTS_CONFIG +#define _SHORTCUTS_CONFIG + +#include <gtk/gtk.h> +#include <glib/gtypes.h> + +#include "actions.h" +#include <utils.h> + +G_BEGIN_DECLS + +enum +{ + ACTION = 0, MASK, VALUE, COLUMNS +}; + +GtkWidget* +create_shortcuts_settings (); + +static void +setup_tree_view (GtkWidget *treeview); + +static void +accel_edited (GtkCellRendererAccel *renderer, gchar *path, guint accel_key, + GdkModifierType mask, guint hardware_keycode, GtkTreeView *treeview); + +static void +accel_cleared (GtkCellRendererAccel *renderer, gchar *path, + GtkTreeView *treeview); + +G_END_DECLS + +#endif // _SHORTCUTS_CONFIG diff --git a/sflphone-client-gnome/src/config/tlsadvanceddialog.c b/sflphone-client-gnome/src/config/tlsadvanceddialog.c index 493053f0ee93b715706ce03a0bec1e4c5869bac6..2b1c03e004f5548b47549a174fa4efe027a67198 100644 --- a/sflphone-client-gnome/src/config/tlsadvanceddialog.c +++ b/sflphone-client-gnome/src/config/tlsadvanceddialog.c @@ -69,6 +69,8 @@ void show_advanced_tls_options(GHashTable * properties) gtk_label_set_markup(GTK_LABEL(label), description); gtk_table_attach(GTK_TABLE(table), label, 0, 3, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gchar * account_id; + gchar * tls_listener_port; gchar * tls_ca_list_file; gchar * tls_certificate_file; gchar * tls_private_key_file; @@ -81,42 +83,56 @@ void show_advanced_tls_options(GHashTable * properties) gchar * require_client_certificate; gchar * negotiation_timeout_sec; gchar * negotiation_timeout_msec; - + if (properties != NULL) { - tls_ca_list_file = g_hash_table_lookup(properties, TLS_CA_LIST_FILE); - tls_certificate_file = g_hash_table_lookup(properties, TLS_CERTIFICATE_FILE); - tls_private_key_file = g_hash_table_lookup(properties, TLS_PRIVATE_KEY_FILE); - tls_password = g_hash_table_lookup(properties, TLS_PASSWORD); - tls_method = g_hash_table_lookup(properties, TLS_METHOD); - tls_ciphers = g_hash_table_lookup(properties, TLS_CIPHERS); - tls_server_name = g_hash_table_lookup(properties, TLS_SERVER_NAME); - verify_server = g_hash_table_lookup(properties, TLS_VERIFY_SERVER); - verify_client = g_hash_table_lookup(properties, TLS_VERIFY_CLIENT); - require_client_certificate = g_hash_table_lookup(properties, TLS_REQUIRE_CLIENT_CERTIFICATE); - negotiation_timeout_sec = g_hash_table_lookup(properties, TLS_NEGOTIATION_TIMEOUT_SEC); - negotiation_timeout_msec = g_hash_table_lookup(properties, TLS_NEGOTIATION_TIMEOUT_MSEC); - - DEBUG("ca_list_file %s", tls_ca_list_file); - DEBUG("certificate_file %s", tls_certificate_file); + + account_id = g_hash_table_lookup(properties, ACCOUNT_ID); + tls_listener_port = g_hash_table_lookup(properties, TLS_LISTENER_PORT); + tls_ca_list_file = g_hash_table_lookup(properties, TLS_CA_LIST_FILE); + tls_certificate_file = g_hash_table_lookup(properties, TLS_CERTIFICATE_FILE); + tls_private_key_file = g_hash_table_lookup(properties, TLS_PRIVATE_KEY_FILE); + tls_password = g_hash_table_lookup(properties, TLS_PASSWORD); + tls_method = g_hash_table_lookup(properties, TLS_METHOD); + tls_ciphers = g_hash_table_lookup(properties, TLS_CIPHERS); + tls_server_name = g_hash_table_lookup(properties, TLS_SERVER_NAME); + verify_server = g_hash_table_lookup(properties, TLS_VERIFY_SERVER); + verify_client = g_hash_table_lookup(properties, TLS_VERIFY_CLIENT); + require_client_certificate = g_hash_table_lookup(properties, TLS_REQUIRE_CLIENT_CERTIFICATE); + negotiation_timeout_sec = g_hash_table_lookup(properties, TLS_NEGOTIATION_TIMEOUT_SEC); + negotiation_timeout_msec = g_hash_table_lookup(properties, TLS_NEGOTIATION_TIMEOUT_MSEC); + + } + + + label = gtk_label_new(_("Global TLS listener (all accounts)")); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GtkWidget * tlsListenerPort; + GtkWidget * hbox = gtk_hbox_new(FALSE, 10); + gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + tlsListenerPort = gtk_spin_button_new_with_range(0, 65535, 1); + gtk_label_set_mnemonic_widget(GTK_LABEL (label), tlsListenerPort); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(tlsListenerPort), g_ascii_strtod(tls_listener_port, NULL)); + gtk_box_pack_start_defaults(GTK_BOX(hbox), tlsListenerPort); + + if(g_strcmp0(account_id, IP2IP_PROFILE) != 0) { + gtk_widget_set_sensitive(tlsListenerPort, FALSE); } label = gtk_label_new( _("Certificate of Authority list")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * caListFileChooser; caListFileChooser = gtk_file_chooser_button_new(_("Choose a CA list file (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_table_attach (GTK_TABLE(table), caListFileChooser, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), caListFileChooser, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); if (tls_ca_list_file == NULL) { - // gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(caListFileChooser), g_get_home_dir()); - gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); + gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); } else { - DEBUG("**********************************************************%s\n", tls_ca_list_file); - - if(g_strcmp0(tls_ca_list_file, "") == 0) { + if(g_strcmp0(tls_ca_list_file, "") == 0) { gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); } @@ -129,17 +145,16 @@ void show_advanced_tls_options(GHashTable * properties) } label = gtk_label_new( _("Public endpoint certificate file")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * certificateFileChooser; certificateFileChooser = gtk_file_chooser_button_new(_("Choose a public endpoint certificate (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_table_attach (GTK_TABLE(table), certificateFileChooser, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), certificateFileChooser, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); if (tls_certificate_file == NULL) { // gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(caListFileChooser), g_get_home_dir()); gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); } else { - DEBUG("**********************************************************%s\n", tls_certificate_file); if(g_strcmp0(tls_certificate_file, "") == 0){ gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(certificateFileChooser)); @@ -154,16 +169,15 @@ void show_advanced_tls_options(GHashTable * properties) label = gtk_label_new(("Private key file")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * privateKeyFileChooser; privateKeyFileChooser = gtk_file_chooser_button_new(_("Choose a private key file (optional)"), GTK_FILE_CHOOSER_ACTION_OPEN); - gtk_table_attach (GTK_TABLE(table), privateKeyFileChooser, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), privateKeyFileChooser, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); if (tls_private_key_file == NULL) { gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(caListFileChooser)); - // gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(privateKeyFileChooser), g_get_home_dir()); } else { - DEBUG("**********************************************************%s\n", tls_private_key_file); + if(g_strcmp0(tls_private_key_file, "") == 0) { gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(privateKeyFileChooser)); @@ -180,7 +194,7 @@ void show_advanced_tls_options(GHashTable * properties) label = gtk_label_new_with_mnemonic (_("Password for the private key")); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * privateKeyPasswordEntry; #if GTK_CHECK_VERSION(2,16,0) privateKeyPasswordEntry = gtk_entry_new(); @@ -193,7 +207,7 @@ void show_advanced_tls_options(GHashTable * properties) gtk_entry_set_visibility(GTK_ENTRY(privateKeyPasswordEntry), FALSE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), privateKeyPasswordEntry); gtk_entry_set_text(GTK_ENTRY(privateKeyPasswordEntry), tls_password); - gtk_table_attach (GTK_TABLE(table), privateKeyPasswordEntry, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), privateKeyPasswordEntry, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); /* TLS protocol methods */ GtkListStore * tlsProtocolMethodListStore; @@ -202,7 +216,7 @@ void show_advanced_tls_options(GHashTable * properties) tlsProtocolMethodListStore = gtk_list_store_new( 1, G_TYPE_STRING ); label = gtk_label_new_with_mnemonic (_("TLS protocol method")); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5); gchar** supported_tls_method = NULL; @@ -223,8 +237,8 @@ void show_advanced_tls_options(GHashTable * properties) } tlsProtocolMethodCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(tlsProtocolMethodListStore)); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), tlsProtocolMethodCombo); - gtk_table_attach(GTK_TABLE(table), tlsProtocolMethodCombo, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), tlsProtocolMethodCombo); + gtk_table_attach(GTK_TABLE(table), tlsProtocolMethodCombo, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); g_object_unref(G_OBJECT(tlsProtocolMethodListStore)); GtkCellRenderer *tlsProtocolMethodCellRenderer; @@ -233,31 +247,31 @@ void show_advanced_tls_options(GHashTable * properties) gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(tlsProtocolMethodCombo), tlsProtocolMethodCellRenderer, "text", 0, NULL); gtk_combo_box_set_active_iter(GTK_COMBO_BOX(tlsProtocolMethodCombo), &supported_tls_method_iter); - /* Cipher list */ + /* Cipher list */ GtkWidget * cipherListEntry; - label = gtk_label_new_with_mnemonic (_("TLS cipher list")); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - cipherListEntry = gtk_entry_new(); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), cipherListEntry); - gtk_entry_set_text(GTK_ENTRY(cipherListEntry), tls_ciphers); - gtk_table_attach (GTK_TABLE(table), cipherListEntry, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new_with_mnemonic (_("TLS cipher list")); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + cipherListEntry = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), cipherListEntry); + gtk_entry_set_text(GTK_ENTRY(cipherListEntry), tls_ciphers); + gtk_table_attach (GTK_TABLE(table), cipherListEntry, 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * serverNameInstance; - label = gtk_label_new_with_mnemonic (_("Server name instance for outgoing TLS connection")); - gtk_table_attach (GTK_TABLE(table), label, 0, 1, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - serverNameInstance = gtk_entry_new(); - gtk_label_set_mnemonic_widget(GTK_LABEL(label), serverNameInstance); - gtk_entry_set_text(GTK_ENTRY(serverNameInstance), tls_server_name); - gtk_table_attach (GTK_TABLE(table), serverNameInstance, 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + label = gtk_label_new_with_mnemonic (_("Server name instance for outgoing TLS connection")); + gtk_table_attach (GTK_TABLE(table), label, 0, 1, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + serverNameInstance = gtk_entry_new(); + gtk_label_set_mnemonic_widget(GTK_LABEL(label), serverNameInstance); + gtk_entry_set_text(GTK_ENTRY(serverNameInstance), tls_server_name); + gtk_table_attach (GTK_TABLE(table), serverNameInstance, 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); label = gtk_label_new(_("Negotiation timeout (sec:msec)")); - gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - GtkWidget * tlsTimeOutSec; - GtkWidget * hbox = gtk_hbox_new(FALSE, 10); - gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); + gtk_table_attach(GTK_TABLE(table), label, 0, 1, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + GtkWidget * tlsTimeOutSec; + hbox = gtk_hbox_new(FALSE, 10); + gtk_table_attach(GTK_TABLE(table), hbox, 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); tlsTimeOutSec = gtk_spin_button_new_with_range(0, pow(2,sizeof(long)), 1); gtk_label_set_mnemonic_widget(GTK_LABEL (label), tlsTimeOutSec); gtk_spin_button_set_value(GTK_SPIN_BUTTON(tlsTimeOutSec), g_ascii_strtod(negotiation_timeout_sec, NULL)); @@ -269,70 +283,74 @@ void show_advanced_tls_options(GHashTable * properties) gtk_box_pack_start_defaults(GTK_BOX(hbox), tlsTimeOutMSec); GtkWidget * verifyCertificateServer; - verifyCertificateServer = gtk_check_button_new_with_mnemonic(_("Verify incoming certificates, as a server")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateServer), - g_strcasecmp(verify_server,"true") == 0 ? TRUE: FALSE); - gtk_table_attach (GTK_TABLE(table), verifyCertificateServer, 0, 1, 10, 11, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + verifyCertificateServer = gtk_check_button_new_with_mnemonic(_("Verify incoming certificates, as a server")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateServer), + g_strcasecmp(verify_server,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE(table), verifyCertificateServer, 0, 1, 11, 12, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * verifyCertificateClient; - verifyCertificateClient = gtk_check_button_new_with_mnemonic(_("Verify certificates from answer, as a client")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateClient), - g_strcasecmp(verify_client,"true") == 0 ? TRUE: FALSE); - gtk_table_attach (GTK_TABLE(table), verifyCertificateClient, 0, 1, 11, 12, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + verifyCertificateClient = gtk_check_button_new_with_mnemonic(_("Verify certificates from answer, as a client")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(verifyCertificateClient), + g_strcasecmp(verify_client,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE(table), verifyCertificateClient, 0, 1, 12, 13, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); GtkWidget * requireCertificate; - requireCertificate = gtk_check_button_new_with_mnemonic(_("Require certificate for incoming tls connections")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(requireCertificate), - g_strcasecmp(require_client_certificate,"true") == 0 ? TRUE: FALSE); - gtk_table_attach (GTK_TABLE(table), requireCertificate, 0, 1, 12, 13, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + requireCertificate = gtk_check_button_new_with_mnemonic(_("Require certificate for incoming tls connections")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(requireCertificate), + g_strcasecmp(require_client_certificate,"true") == 0 ? TRUE: FALSE); + gtk_table_attach (GTK_TABLE(table), requireCertificate, 0, 1, 13, 14, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show_all(ret); - if(gtk_dialog_run(GTK_DIALOG(tlsDialog)) == GTK_RESPONSE_ACCEPT) { + if(gtk_dialog_run(GTK_DIALOG(tlsDialog)) == GTK_RESPONSE_ACCEPT) { + g_hash_table_replace(properties, - g_strdup(TLS_CA_LIST_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(caListFileChooser)))); + g_strdup(TLS_LISTENER_PORT), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsListenerPort)))); + g_hash_table_replace(properties, + g_strdup(TLS_CA_LIST_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(caListFileChooser)))); g_hash_table_replace(properties, - g_strdup(TLS_CERTIFICATE_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(certificateFileChooser)))); - + g_strdup(TLS_CERTIFICATE_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(certificateFileChooser)))); + g_hash_table_replace(properties, - g_strdup(TLS_PRIVATE_KEY_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(privateKeyFileChooser)))); + g_strdup(TLS_PRIVATE_KEY_FILE), g_strdup(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(privateKeyFileChooser)))); - g_hash_table_replace(properties, - g_strdup(TLS_PASSWORD), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(privateKeyPasswordEntry)))); + g_hash_table_replace(properties, + g_strdup(TLS_PASSWORD), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(privateKeyPasswordEntry)))); - g_hash_table_replace(properties, - g_strdup(TLS_METHOD), - g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(tlsProtocolMethodCombo)))); + g_hash_table_replace(properties, + g_strdup(TLS_METHOD), + g_strdup((gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(tlsProtocolMethodCombo)))); - g_hash_table_replace(properties, - g_strdup(TLS_CIPHERS), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(cipherListEntry)))); + g_hash_table_replace(properties, + g_strdup(TLS_CIPHERS), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(cipherListEntry)))); - g_hash_table_replace(properties, - g_strdup(TLS_SERVER_NAME), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(serverNameInstance)))); + g_hash_table_replace(properties, + g_strdup(TLS_SERVER_NAME), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(serverNameInstance)))); - g_hash_table_replace(properties, - g_strdup(TLS_VERIFY_SERVER), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(verifyCertificateServer)) ? "true": "false")); + g_hash_table_replace(properties, + g_strdup(TLS_VERIFY_SERVER), + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(verifyCertificateServer)) ? "true": "false")); - g_hash_table_replace(properties, - g_strdup(TLS_VERIFY_CLIENT), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(verifyCertificateClient)) ? "true": "false")); + g_hash_table_replace(properties, + g_strdup(TLS_VERIFY_CLIENT), + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(verifyCertificateClient)) ? "true": "false")); - g_hash_table_replace(properties, - g_strdup(TLS_REQUIRE_CLIENT_CERTIFICATE), - g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(requireCertificate)) ? "true": "false")); + g_hash_table_replace(properties, + g_strdup(TLS_REQUIRE_CLIENT_CERTIFICATE), + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(requireCertificate)) ? "true": "false")); - g_hash_table_replace(properties, - g_strdup(TLS_NEGOTIATION_TIMEOUT_SEC), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsTimeOutSec)))); + g_hash_table_replace(properties, + g_strdup(TLS_NEGOTIATION_TIMEOUT_SEC), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsTimeOutSec)))); - g_hash_table_replace(properties, - g_strdup(TLS_NEGOTIATION_TIMEOUT_MSEC), - g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsTimeOutMSec)))); + g_hash_table_replace(properties, + g_strdup(TLS_NEGOTIATION_TIMEOUT_MSEC), + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(tlsTimeOutMSec)))); } gtk_widget_destroy (GTK_WIDGET(tlsDialog)); diff --git a/sflphone-client-gnome/src/config/zrtpadvanceddialog.c b/sflphone-client-gnome/src/config/zrtpadvanceddialog.c index 02b634d55915e91c8752448bfdbee95013e3400a..3689dc16d00fbd3d232c7f233d39aa78b801505f 100644 --- a/sflphone-client-gnome/src/config/zrtpadvanceddialog.c +++ b/sflphone-client-gnome/src/config/zrtpadvanceddialog.c @@ -114,3 +114,61 @@ void show_advanced_zrtp_options(GHashTable * properties) gtk_widget_destroy (GTK_WIDGET(securityDialog)); } + + +void show_advanced_sdes_options(GHashTable * properties) { + + GtkDialog * securityDialog; + + GtkWidget * sdesTable; + GtkWidget * enableRtpFallback; + gchar * rtpFallback = "false"; + + if(properties != NULL) { + rtpFallback = g_hash_table_lookup(properties, ACCOUNT_SRTP_RTP_FALLBACK); + } + + securityDialog = GTK_DIALOG (gtk_dialog_new_with_buttons ( _("SDES Options"), + + GTK_WINDOW (get_main_window()), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + + GTK_STOCK_CANCEL, + + GTK_RESPONSE_CANCEL, + + GTK_STOCK_SAVE, + + GTK_RESPONSE_ACCEPT, + + NULL)); + + gtk_window_set_policy( GTK_WINDOW(securityDialog), FALSE, FALSE, FALSE ); + gtk_dialog_set_has_separator(securityDialog, TRUE); + gtk_container_set_border_width (GTK_CONTAINER(securityDialog), 0); + + sdesTable = gtk_table_new (1, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings( GTK_TABLE(sdesTable), 10); + gtk_table_set_col_spacings( GTK_TABLE(sdesTable), 10); + gtk_box_pack_start(GTK_BOX(securityDialog->vbox), sdesTable, FALSE, FALSE, 0); + gtk_widget_show(sdesTable); + + enableRtpFallback = gtk_check_button_new_with_mnemonic(_("Fallback on RTP on SDES failure")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(enableRtpFallback), + g_strcasecmp(rtpFallback,"true") == 0 ? TRUE: FALSE); + gtk_table_attach ( GTK_TABLE(sdesTable), enableRtpFallback, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_set_sensitive( GTK_WIDGET( enableRtpFallback ) , TRUE ); + + + gtk_widget_show_all(sdesTable); + + gtk_container_set_border_width (GTK_CONTAINER(sdesTable), 10); + + if(gtk_dialog_run(GTK_DIALOG(securityDialog)) == GTK_RESPONSE_ACCEPT) { + g_hash_table_replace(properties, + g_strdup(ACCOUNT_SRTP_RTP_FALLBACK), + g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(enableRtpFallback)) ? "true": "false")); + } + + gtk_widget_destroy (GTK_WIDGET(securityDialog)); +} diff --git a/sflphone-client-gnome/src/config/zrtpadvanceddialog.h b/sflphone-client-gnome/src/config/zrtpadvanceddialog.h index df92bfb09b5586627b02fb61600388bb0d6cbd1e..23bfdbb8bcb246a9a42165e78ff899caa827e3df 100644 --- a/sflphone-client-gnome/src/config/zrtpadvanceddialog.h +++ b/sflphone-client-gnome/src/config/zrtpadvanceddialog.h @@ -31,4 +31,6 @@ void show_advanced_zrtp_options(GHashTable * properties); +void show_advanced_sdes_options(GHashTable * properties); + #endif diff --git a/sflphone-client-gnome/src/contacts/calltree.c b/sflphone-client-gnome/src/contacts/calltree.c index 0838bacd8e50d2c25eb2b671ab9bb3ed4b857235..af03022d30f010783c64cec949bec1e79033a54e 100644 --- a/sflphone-client-gnome/src/contacts/calltree.c +++ b/sflphone-client-gnome/src/contacts/calltree.c @@ -80,78 +80,77 @@ popup_menu (GtkWidget *widget, call_selected_cb(GtkTreeSelection *sel, void* data UNUSED ) { - DEBUG("Selection Callback"); + DEBUG("Selection Callback"); - GtkTreeIter iter; - GValue val; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; + GtkTreeIter iter; + GValue val; + GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; + + GtkTreePath* path; + gchar* string_path; - GtkTreePath* path; - gchar* string_path; + if (! gtk_tree_selection_get_selected (sel, &model, &iter)) + return; - if (! gtk_tree_selection_get_selected (sel, &model, &iter)) - return; + // store info for dragndrop + path = gtk_tree_model_get_path(model, &iter); + string_path = gtk_tree_path_to_string(path); + selected_path_depth = gtk_tree_path_get_depth(path); - // store info for dragndrop - path = gtk_tree_model_get_path(model, &iter); - string_path = gtk_tree_path_to_string(path); - selected_path_depth = gtk_tree_path_get_depth(path); + if(gtk_tree_model_iter_has_child(GTK_TREE_MODEL(model), &iter)) { - if(gtk_tree_model_iter_has_child(GTK_TREE_MODEL(model), &iter)) - { - DEBUG("SELECTED A CONFERENCE"); - selected_type = A_CONFERENCE; + DEBUG("SELECTED A CONFERENCE"); + selected_type = A_CONFERENCE; - val.g_type = 0; - gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - - calltab_select_conf((conference_obj_t*) g_value_get_pointer(&val)); + val.g_type = 0; + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - selected_conf = (conference_obj_t*)g_value_get_pointer(&val); + calltab_select_conf((conference_obj_t*) g_value_get_pointer(&val)); - if(selected_conf) - { + selected_conf = (conference_obj_t*)g_value_get_pointer(&val); - selected_call_id = selected_conf->_confID; - selected_path = string_path; - selected_call = NULL; - - } + if(selected_conf) { - DEBUG(" selected_path %s, selected_call_id %s, selected_path_depth %i\n", selected_path, selected_call_id, selected_path_depth); + selected_call_id = selected_conf->_confID; + selected_path = string_path; + selected_call = NULL; } - else - { - DEBUG("SELECTED A CALL"); - selected_type = A_CALL; - // gtk_tree_model_iter_parent(GTK_TREE_MODEL(model), parent_conference, &iter); - - val.g_type = 0; - gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - calltab_select_call(active_calltree, (callable_obj_t*) g_value_get_pointer(&val)); + DEBUG(" selected_path %s, selected_call_id %s, selected_path_depth %i\n", selected_path, selected_call_id, selected_path_depth); - selected_call = (callable_obj_t*)g_value_get_pointer(&val); + } + else { + + DEBUG("SELECTED A CALL"); + selected_type = A_CALL; + // gtk_tree_model_iter_parent(GTK_TREE_MODEL(model), parent_conference, &iter); - if(selected_call) { + val.g_type = 0; + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); + + calltab_select_call(active_calltree, (callable_obj_t*) g_value_get_pointer(&val)); + + selected_call = (callable_obj_t*)g_value_get_pointer(&val); - selected_call_id = selected_call->_callID; - selected_path = string_path; - selected_conf = NULL; - } + if(selected_call) { - DEBUG(" selected_path %s, selected_call_id %s, selected_path_depth %i\n", selected_path, selected_call_id, selected_path_depth); + selected_call_id = selected_call->_callID; + selected_path = string_path; + selected_conf = NULL; } + DEBUG(" selected_path %s, selected_call_id %s, selected_path_depth %i\n", selected_path, selected_call_id, selected_path_depth); + } + - // conferencelist_reset (); - // sflphone_fill_conference_list(); + // conferencelist_reset (); + // sflphone_fill_conference_list(); - g_value_unset(&val); - update_actions(); + g_value_unset(&val); + update_actions(); } @@ -160,97 +159,90 @@ call_selected_cb(GtkTreeSelection *sel, void* data UNUSED ) row_activated(GtkTreeView *tree_view UNUSED, GtkTreePath *path UNUSED, GtkTreeViewColumn *column UNUSED, - void * data UNUSED) -{ - callable_obj_t* selectedCall = NULL; - callable_obj_t* new_call; - conference_obj_t* selectedConf = NULL; - gchar *account_id; - - DEBUG("double click action"); - - if(calltab_get_selected_type(active_calltree) == A_CALL) { - - DEBUG("Selected a call\n"); - selectedCall = calltab_get_selected_call(active_calltree); + void * data UNUSED) { + callable_obj_t* selectedCall = NULL; + callable_obj_t* new_call; + conference_obj_t* selectedConf = NULL; + gchar *account_id; + + DEBUG("double click action"); + + if(calltab_get_selected_type(active_calltree) == A_CALL) { + + DEBUG("Selected a call\n"); + selectedCall = calltab_get_selected_call(active_calltree); - if (selectedCall) - { - DEBUG("there is a selected call\n"); + if (selectedCall) { + DEBUG("there is a selected call\n"); - // Get the right event from the right calltree - if( active_calltree == current_calls ) - { + // Get the right event from the right calltree + if( active_calltree == current_calls ) { - DEBUG("active tree is current calls"); - - switch(selectedCall->_state) { - case CALL_STATE_INCOMING: - dbus_accept(selectedCall); - stop_notification(); - break; - case CALL_STATE_HOLD: - dbus_unhold(selectedCall); - break; - case CALL_STATE_RINGING: - case CALL_STATE_CURRENT: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - break; - case CALL_STATE_DIALING: - sflphone_place_call (selectedCall); - break; - default: - WARN("Row activated - Should not happen!"); - break; - } - } + DEBUG("active tree is current calls"); + + switch(selectedCall->_state) { + case CALL_STATE_INCOMING: + dbus_accept(selectedCall); + stop_notification(); + break; + case CALL_STATE_HOLD: + dbus_unhold(selectedCall); + break; + case CALL_STATE_RINGING: + case CALL_STATE_CURRENT: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + break; + case CALL_STATE_DIALING: + sflphone_place_call (selectedCall); + break; + default: + WARN("Row activated - Should not happen!"); + break; + } + } - // If history or contact: double click action places a new call - else - { - DEBUG("active tree is history or contact"); + // If history or contact: double click action places a new call + else { - account_id = g_strdup (selectedCall->_accountID); + DEBUG("active tree is history or contact"); + + account_id = g_strdup (selectedCall->_accountID); - // Create a new call - create_new_call (CALL, CALL_STATE_DIALING, "", account_id, selectedCall->_peer_name, selectedCall->_peer_number, &new_call); + // Create a new call + create_new_call (CALL, CALL_STATE_DIALING, "", account_id, selectedCall->_peer_name, selectedCall->_peer_number, &new_call); - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); - calltree_display(current_calls); - } + calllist_add(current_calls, new_call); + calltree_add_call(current_calls, new_call, NULL); + sflphone_place_call(new_call); + calltree_display(current_calls); } } - else if(calltab_get_selected_type(current_calls) == A_CONFERENCE) - { - DEBUG("Selected a conference\n"); + } + else if(calltab_get_selected_type(current_calls) == A_CONFERENCE) { - if( active_calltree == current_calls ) - { + DEBUG("Selected a conference\n"); + + if( active_calltree == current_calls ) { - selectedConf = calltab_get_selected_conf(current_calls); + selectedConf = calltab_get_selected_conf(current_calls); - if(selectedConf) - { - switch(selectedConf->_state) - { - case CONFERENCE_STATE_ACTIVE_ATACHED: - // sflphone_add_main_participant(selectedConf); - break; - case CONFERENCE_STATE_ACTIVE_DETACHED: - sflphone_add_main_participant(selectedConf); - break; - case CONFERENCE_STATE_HOLD: - sflphone_conference_off_hold(selectedConf); - break; - } - } + if(selectedConf) { + + switch(selectedConf->_state) { + case CONFERENCE_STATE_ACTIVE_ATACHED: + // sflphone_add_main_participant(selectedConf); + break; + case CONFERENCE_STATE_ACTIVE_DETACHED: + sflphone_add_main_participant(selectedConf); + break; + case CONFERENCE_STATE_HOLD: + sflphone_conference_off_hold(selectedConf); + break; } + } } - - + } } @@ -258,83 +250,80 @@ row_activated(GtkTreeView *tree_view UNUSED, void row_single_click(GtkTreeView *tree_view UNUSED, void * data UNUSED) { - DEBUG("single click action"); - callable_obj_t * selectedCall=NULL; - account_t * account_details=NULL; - gchar * displaySasOnce=""; + DEBUG("single click action"); + callable_obj_t * selectedCall=NULL; + account_t * account_details=NULL; + gchar * displaySasOnce=""; - selectedCall = calltab_get_selected_call( active_calltree ); + selectedCall = calltab_get_selected_call( active_calltree ); - if (selectedCall != NULL) - { - account_details = account_list_get_by_id(selectedCall->_accountID); - DEBUG("AccountID %s", selectedCall->_accountID); + if (selectedCall != NULL) { - if(account_details != NULL) { - displaySasOnce = g_hash_table_lookup(account_details->properties, ACCOUNT_DISPLAY_SAS_ONCE); - DEBUG("Display SAS once %s", displaySasOnce); - } else { - GHashTable * properties = NULL; - sflphone_get_ip2ip_properties (&properties); - if(properties != NULL) - { displaySasOnce = g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE); DEBUG("IP2IP displaysasonce %s", displaySasOnce); } - } + account_details = account_list_get_by_id(selectedCall->_accountID); + DEBUG("AccountID %s", selectedCall->_accountID); - /* Make sure that we are not in the history tab since - * nothing is defined for it yet - */ - if( active_calltree == current_calls ) - { + if(account_details != NULL) { + displaySasOnce = g_hash_table_lookup(account_details->properties, ACCOUNT_DISPLAY_SAS_ONCE); + DEBUG("Display SAS once %s", displaySasOnce); + } + else { + GHashTable * properties = NULL; + sflphone_get_ip2ip_properties (&properties); + if(properties != NULL) + { displaySasOnce = g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE); DEBUG("IP2IP displaysasonce %s", displaySasOnce); } + } - // sflphone_selected_call_codec(selectedCall); + /* Make sure that we are not in the history tab since + * nothing is defined for it yet + */ + if( active_calltree == current_calls ) { - // DEBUG("single click action: %s", dbus_get_current_codec_name(selectedCall)); - // sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); + // sflphone_selected_call_codec(selectedCall); - switch(selectedCall->_srtp_state) - { - case SRTP_STATE_SAS_UNCONFIRMED: - selectedCall->_srtp_state = SRTP_STATE_SAS_CONFIRMED; - if(g_strcasecmp(displaySasOnce,"true") == 0) { - selectedCall->_zrtp_confirmed = TRUE; - } - dbus_confirm_sas(selectedCall); - calltree_update_call(current_calls, selectedCall, NULL); - break; - case SRTP_STATE_SAS_CONFIRMED: - selectedCall->_srtp_state = SRTP_STATE_SAS_UNCONFIRMED; - dbus_reset_sas(selectedCall); - calltree_update_call(current_calls, selectedCall, NULL); - break; - default: - DEBUG("Single click but no action"); - break; - } - } + // DEBUG("single click action: %s", dbus_get_current_codec_name(selectedCall)); + // sflphone_display_selected_codec(dbus_get_current_codec_name(selectedCall)); + + switch(selectedCall->_srtp_state) { + + case SRTP_STATE_ZRTP_SAS_UNCONFIRMED: + selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_CONFIRMED; + if(g_strcasecmp(displaySasOnce,"true") == 0) { + selectedCall->_zrtp_confirmed = TRUE; + } + dbus_confirm_sas(selectedCall); + calltree_update_call(current_calls, selectedCall, NULL); + break; + case SRTP_STATE_ZRTP_SAS_CONFIRMED: + selectedCall->_srtp_state = SRTP_STATE_ZRTP_SAS_UNCONFIRMED; + dbus_reset_sas(selectedCall); + calltree_update_call(current_calls, selectedCall, NULL); + break; + default: + DEBUG("Single click but no action"); + break; + } } + } } static gboolean button_pressed(GtkWidget* widget, GdkEventButton *event, gpointer user_data UNUSED) { - if (event->button == 3 && event->type == GDK_BUTTON_PRESS) - { - if( active_calltree == current_calls ) - { - show_popup_menu(widget, event); - return TRUE; - } - else if (active_calltree == history) - { - show_popup_menu_history (widget, event); - return TRUE; - } - else{ - show_popup_menu_contacts (widget, event); - return TRUE; - } + if (event->button == 3 && event->type == GDK_BUTTON_PRESS){ + if( active_calltree == current_calls ) { + show_popup_menu(widget, event); + return TRUE; + } + else if (active_calltree == history) { + show_popup_menu_history (widget, event); + return TRUE; + } + else { + show_popup_menu_contacts (widget, event); + return TRUE; } - return FALSE; + } + return FALSE; } @@ -387,33 +376,26 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch if(g_strcmp0("", c->_peer_name) == 0) { description = g_markup_printf_escaped("<b>%s</b><i>%s</i>", - display_number, - c->_peer_name); + display_number, c->_peer_name); } else { description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - c->_peer_name, - display_number); + c->_peer_name, display_number); } } else { if(g_strcmp0("", c->_peer_name) == 0) { description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>%s (%d)</i>", - display_number, - c->_peer_name, - c->_state_code_description, - c->_state_code); + display_number, c->_peer_name, + c->_state_code_description, c->_state_code); } else { description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i>", - c->_peer_name, - display_number, - c->_state_code_description, - c->_state_code); + c->_peer_name, display_number, + c->_state_code_description, c->_state_code); } } - break; @@ -423,17 +405,12 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch if(g_strcmp0("",c->_peer_name) == 0){ description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>Transfert to:%s</i> ", - display_number, - c->_peer_name, - c->_trsft_to); + display_number, c->_peer_name, c->_trsft_to); } else { description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Transfert to:%s</i> ", - c->_peer_name, - display_number, - c->_trsft_to); - } - + c->_peer_name, display_number, c->_trsft_to); + } break; @@ -446,31 +423,23 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch if (c->_state_code) { description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>%s (%d)</i> <i>%s</i>", - display_number, - c->_peer_name, - c->_state_code_description, - c->_state_code, + display_number, c->_peer_name, + c->_state_code_description, c->_state_code, audio_codec); } else { description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>%s</i>", - display_number, - c->_peer_name, - audio_codec); + display_number, c->_peer_name, audio_codec); } } else { if (c->_state_code) { description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s (%d)</i> <i>%s</i>", - c->_peer_name, - display_number, - c->_state_code_description, - c->_state_code, + c->_peer_name, display_number, + c->_state_code_description, c->_state_code, audio_codec); } else { description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>%s</i>", - c->_peer_name, - display_number, - audio_codec); + c->_peer_name, display_number, audio_codec); } } break; @@ -479,35 +448,27 @@ calltree_display_call_info(callable_obj_t * c, CallDisplayType display_type, gch DEBUG("display a call with sas"); - if(g_strcmp0("",c->_peer_name) == 0){ + if(g_strcmp0("", c->_peer_name) == 0){ description = g_markup_printf_escaped("<b>%s</b><i>%s</i>\n<i>Confirm SAS <b>%s</b> ?</i> ", - display_number, - c->_peer_name, - c->_sas); + display_number, c->_peer_name, c->_sas); } else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>\n<i>Confirm SAS <b>%s</b> ?</i> ", - c->_peer_name, - display_number, - c->_sas); + c->_peer_name, display_number, c->_sas); } + break; case DISPLAY_TYPE_HISTORY : DEBUG("display history entry"); if(g_strcmp0("", c->_peer_name) == 0) { - description = g_markup_printf_escaped("<b>%s</b><i>%s</i>", - display_number, - c->_peer_name); + display_number, c->_peer_name); } else { - description = g_markup_printf_escaped("<b>%s</b> <i>%s</i>", - c->_peer_name, - display_number); + c->_peer_name, display_number); } break; @@ -601,7 +562,7 @@ calltree_create (calltab_t* tab, gboolean searchbar_type) G_CALLBACK (focus_on_calltree_out), NULL); - if(tab != history || tab!=contacts) { + if(tab != history && tab!=contacts) { DEBUG("SET TREE VIEW REORDABLE"); // Make calltree reordable for drag n drop @@ -718,6 +679,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) gchar* srtp_enabled = ""; gboolean display_sas = TRUE; + gboolean sdes_success = TRUE; account_t* account_details=NULL; gchar *audio_codec = ""; @@ -734,6 +696,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) GHashTable * properties = NULL; sflphone_get_ip2ip_properties (&properties); if(properties != NULL) { + srtp_enabled = g_hash_table_lookup(properties, ACCOUNT_SRTP_ENABLED); if(g_strcasecmp(g_hash_table_lookup(properties, ACCOUNT_ZRTP_DISPLAY_SAS),"false") == 0) { display_sas = FALSE; } } @@ -772,12 +735,9 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) } else { - if((c->_sas != NULL) && (display_sas == TRUE) && (c->_srtp_state == SRTP_STATE_SAS_UNCONFIRMED) && (c->_zrtp_confirmed == FALSE)) { - + if((c->_sas != NULL) && (display_sas == TRUE) && (c->_srtp_state == SRTP_STATE_ZRTP_SAS_UNCONFIRMED) && (c->_zrtp_confirmed == FALSE)) { calltree_display_call_info(c, DISPLAY_TYPE_SAS, NULL, &description); - } else { - calltree_display_call_info(c, DISPLAY_TYPE_STATE_CODE, audio_codec, &description); } } @@ -797,7 +757,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/current.svg", NULL); break; case CALL_STATE_DIALING: - pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); + pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/dial.svg", NULL); break; case CALL_STATE_FAILURE: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/fail.svg", NULL); @@ -816,16 +776,20 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) } switch(c->_srtp_state) { - case SRTP_STATE_SAS_UNCONFIRMED: + case SRTP_STATE_SDES_SUCCESS: + DEBUG("SDES negotiation succes"); + pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL); + break; + case SRTP_STATE_ZRTP_SAS_UNCONFIRMED: DEBUG("Secure is ON"); pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_unconfirmed.svg", NULL); if(c->_sas != NULL) { DEBUG("SAS is ready with value %s", c->_sas); } break; - case SRTP_STATE_SAS_CONFIRMED: + case SRTP_STATE_ZRTP_SAS_CONFIRMED: DEBUG("SAS is confirmed"); pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL); break; - case SRTP_STATE_SAS_SIGNED: + case SRTP_STATE_ZRTP_SAS_SIGNED: DEBUG("Secure is ON with SAS signed and verified"); pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_certified.svg", NULL); break; @@ -844,9 +808,7 @@ calltree_update_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) } } - - if(tab == history) { - + else if(tab == history) { switch(c->_history_state) { case INCOMING: pixbuf = gdk_pixbuf_new_from_file(ICONS_DIR "/incoming.svg", NULL); @@ -922,6 +884,8 @@ void calltree_add_call (calltab_t* tab, callable_obj_t * c, GtkTreeIter *parent) } } + DEBUG("Added call key exchange is %s", key_exchange) + if( tab == current_calls ) { switch(c->_state) @@ -1304,136 +1268,130 @@ void calltree_update_conference (calltab_t* tab, const gchar* confID) void calltree_remove_conference (calltab_t* tab, const conference_obj_t* conf, GtkTreeIter *parent) { - DEBUG("calltree_remove_conference %s\n", conf->_confID); - - GtkTreeIter iter_parent; - GtkTreeIter iter_child; - GValue confval; - GValue callval; - conference_obj_t * tempconf; - callable_obj_t * call; - GtkTreeStore* store = tab->store; - - int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); - - int nbParticipant; - - int i, j; - for( i = 0; i < nbChild; i++) - { + DEBUG("calltree_remove_conference %s\n", conf->_confID); + + GtkTreeIter iter_parent; + GtkTreeIter iter_child; + GValue confval; + GValue callval; + conference_obj_t * tempconf; + callable_obj_t * call; + GtkTreeStore* store = tab->store; - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter_parent, parent, i)) - { + int nbChild = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), parent); - if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter_parent)) - { + int nbParticipant; - calltree_remove_conference (tab, conf, &iter_parent); + int i, j; + for( i = 0; i < nbChild; i++) { - confval.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter_parent, COLUMN_ACCOUNT_PTR, &confval); + if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter_parent, parent, i)) { - tempconf = (conference_obj_t*) g_value_get_pointer(&confval); - g_value_unset(&confval); + if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(store), &iter_parent)) { - if(tempconf == conf) - { - nbParticipant = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), &iter_parent); - DEBUG("nbParticipant: %i\n", nbParticipant); - for( j = 0; j < nbParticipant; j++) - { - call = NULL; - if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter_child, &iter_parent, j)) - { + calltree_remove_conference (tab, conf, &iter_parent); - callval.g_type = 0; - gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter_child, COLUMN_ACCOUNT_PTR, &callval); + confval.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter_parent, COLUMN_ACCOUNT_PTR, &confval); - call = (callable_obj_t*)g_value_get_pointer(&callval); - g_value_unset(&callval); + tempconf = (conference_obj_t*) g_value_get_pointer(&confval); + g_value_unset(&confval); - if(call) - { - calltree_add_call (tab, call, NULL); - } - } + if(tempconf == conf) { + + nbParticipant = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(store), &iter_parent); + DEBUG("nbParticipant: %i\n", nbParticipant); + for( j = 0; j < nbParticipant; j++) { + call = NULL; + if(gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter_child, &iter_parent, j)){ - } + callval.g_type = 0; + gtk_tree_model_get_value (GTK_TREE_MODEL(store), &iter_child, COLUMN_ACCOUNT_PTR, &callval); - gtk_tree_store_remove(store, &iter_parent); - } + call = (callable_obj_t*)g_value_get_pointer(&callval); + g_value_unset(&callval); + + if(call) { + calltree_add_call (tab, call, NULL); + } } + + } + + gtk_tree_store_remove(store, &iter_parent); } + } } + } - // callable_obj_t * selectedCall = calltab_get_selected_call(tab); - // if(selectedCall == c) - // calltab_select_call(tab, NULL); - - update_actions(); + // callable_obj_t * selectedCall = calltab_get_selected_call(tab); + // if(selectedCall == c) + // calltab_select_call(tab, NULL); + update_actions(); + } void calltree_display (calltab_t *tab) { + + GtkTreeSelection *sel; - GtkTreeSelection *sel; - - /* If we already are displaying the specified calltree */ - if (active_calltree == tab) - return; - - /* case 1: we want to display the main calltree */ - if (tab==current_calls) { + /* If we already are displaying the specified calltree */ + if (active_calltree == tab) + return; - DEBUG ("display main tab"); + /* case 1: we want to display the main calltree */ + if (tab==current_calls) { + DEBUG ("display main tab"); - if (active_calltree==contacts) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); - } else { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); - } - // gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)currentCallsButton, TRUE); + if (active_calltree==contacts) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); + } else { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); } + // gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)currentCallsButton, TRUE); - /* case 2: we want to display the history */ - else if (tab==history) { + } - DEBUG ("display history tab"); + /* case 2: we want to display the history */ + else if (tab==history) { - if (active_calltree==contacts) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); - } + DEBUG ("display history tab"); - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, TRUE); + if (active_calltree==contacts) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, FALSE); } - else if (tab==contacts) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, TRUE); + } - DEBUG ("display contact tab"); + else if (tab==contacts) { - if (active_calltree==history) { - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); - } + DEBUG ("display contact tab"); - gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, TRUE); + if (active_calltree==history) { + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)historyButton, FALSE); } - else - ERROR ("calltree.c line %d . This is probably a bug in the application", __LINE__); - + gtk_toggle_tool_button_set_active ((GtkToggleToolButton*)contactButton, TRUE); + } - gtk_widget_hide (active_calltree->tree); - active_calltree = tab; - gtk_widget_show (active_calltree->tree); + else + ERROR ("calltree.c line %d . This is probably a bug in the application", __LINE__); + - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); - DEBUG("Emit signal changed from calltree_display"); - g_signal_emit_by_name(sel, "changed"); - update_actions(); + gtk_widget_hide (active_calltree->tree); + active_calltree = tab; + gtk_widget_show (active_calltree->tree); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view)); + DEBUG("Emit signal changed from calltree_display"); + g_signal_emit_by_name(sel, "changed"); + update_actions(); } @@ -1442,266 +1400,266 @@ void calltree_display (calltab_t *tab) { static void drag_begin_cb(GtkWidget *widget, GdkDragContext *dc, gpointer data) { - GtkTargetList* target_list; + GtkTargetList* target_list; - // DEBUG("drag_begin_cb %s\n", dragged_path); - if((target_list = gtk_drag_source_get_target_list(widget)) != NULL); + // DEBUG("drag_begin_cb %s\n", dragged_path); + if((target_list = gtk_drag_source_get_target_list(widget)) != NULL); } static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer data) { - DEBUG("drag_end_cb\n"); - DEBUG(" selected_path %s, selected_call_id %s, selected_path_depth %i\n", selected_path, selected_call_id, selected_path_depth); - DEBUG(" dragged path %s, dragged_call_id %s, dragged_path_depth %i\n", selected_path, selected_call_id, dragged_path_depth); - - GtkTreeModel *model = (GtkTreeModel*)current_calls->store; - GtkTreePath *path = gtk_tree_path_new_from_string(dragged_path); - GtkTreePath *dpath = gtk_tree_path_new_from_string(dragged_path); - GtkTreePath *spath = gtk_tree_path_new_from_string(selected_path); - - GtkTreeIter iter; - GtkTreeIter iter_parent; - GtkTreeIter iter_children; - GtkTreeIter parent_conference; // conference for which this call is attached - - GValue val; + DEBUG("drag_end_cb\n"); + DEBUG(" selected_path %s, selected_call_id %s, selected_path_depth %i\n", selected_path, selected_call_id, selected_path_depth); + DEBUG(" dragged path %s, dragged_call_id %s, dragged_path_depth %i\n", selected_path, selected_call_id, dragged_path_depth); + + GtkTreeModel *model = (GtkTreeModel*)current_calls->store; + GtkTreePath *path = gtk_tree_path_new_from_string(dragged_path); + GtkTreePath *dpath = gtk_tree_path_new_from_string(dragged_path); + GtkTreePath *spath = gtk_tree_path_new_from_string(selected_path); + + GtkTreeIter iter; + GtkTreeIter iter_parent; + GtkTreeIter iter_children; + GtkTreeIter parent_conference; // conference for which this call is attached - callable_obj_t* call; - conference_obj_t* conf; + GValue val; + + callable_obj_t* call; + conference_obj_t* conf; - // Make sure that drag n drop does not imply a dialing call - if(selected_type == A_CALL && selected_call->_state == CALL_STATE_DIALING) { + // Make sure that drag n drop does not imply a dialing call + if(selected_type == A_CALL && selected_call->_state == CALL_STATE_DIALING) { - DEBUG("Dragged a call on a dialing call"); + DEBUG("Dragged a call on a dialing call"); - calltree_remove_call(current_calls, selected_call, NULL); - calltree_add_call(current_calls, selected_call, NULL); - return; - } + calltree_remove_call(current_calls, selected_call, NULL); + calltree_add_call(current_calls, selected_call, NULL); + return; + } - else if(selected_type == A_CALL) { - - // user may have dragged it outside the conference - if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) { + else if(selected_type == A_CALL) { - calltree_remove_call(current_calls, dragged_call, NULL); + // user may have dragged it outside the conference + if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) { - DEBUG("Dragged a call on a dialing call"); + calltree_remove_call(current_calls, dragged_call, NULL); - // test if call participate to a conference - if(selected_call->_confID) { + DEBUG("Dragged a call on a dialing call"); + + // test if call participate to a conference + if(selected_call->_confID) { - gtk_tree_path_up(spath); - gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, path); + gtk_tree_path_up(spath); + gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, path); - calltree_add_call(current_calls, selected_call, &parent_conference); - } - else { - calltree_add_call(current_calls, selected_call, NULL); - } - - calltree_add_call(current_calls, dragged_call, NULL); - return; + calltree_add_call(current_calls, selected_call, &parent_conference); + } + else { + calltree_add_call(current_calls, selected_call, NULL); + } - } + calltree_add_call(current_calls, dragged_call, NULL); + return; + + } - } - else if(selected_type == A_CONFERENCE) { + } + else if(selected_type == A_CONFERENCE) { - DEBUG("Dragged a conference on a dialing call"); + DEBUG("Dragged a conference on a dialing call"); - if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) { + if(dragged_call && dragged_call->_state == CALL_STATE_DIALING) { - conf = selected_conf; + conf = selected_conf; - calltree_remove_conference(current_calls, conf, NULL); - calltree_add_conference(current_calls, conf); - return; - } - } + calltree_remove_conference(current_calls, conf, NULL); + calltree_add_conference(current_calls, conf); + return; + } + } - if(selected_path_depth == 1) { + if(selected_path_depth == 1) { - if(dragged_path_depth == 1) { + if(dragged_path_depth == 1) { - if (selected_type == A_CALL && dragged_type == A_CALL) { + if (selected_type == A_CALL && dragged_type == A_CALL) { - if(gtk_tree_path_compare (dpath, spath) == 0) { - // draged a call on itself - } - else { - // dragged a single call on a single call - if(selected_call != NULL && dragged_call != NULL) - sflphone_join_participant(selected_call->_callID, dragged_call->_callID); - } - } - else if(selected_type == A_CALL && dragged_type == A_CONFERENCE) { + if(gtk_tree_path_compare (dpath, spath) == 0) { + // draged a call on itself + } + else { + // dragged a single call on a single call + if(selected_call != NULL && dragged_call != NULL) + sflphone_join_participant(selected_call->_callID, dragged_call->_callID); + } + } + else if(selected_type == A_CALL && dragged_type == A_CONFERENCE) { - // dragged a single call on a conference - if(!selected_call) { - DEBUG("Error: call dragged on a conference is null"); - return; - } + // dragged a single call on a conference + if(!selected_call) { + DEBUG("Error: call dragged on a conference is null"); + return; + } - selected_call->_confID = g_strdup(dragged_call_id); - sflphone_add_participant(selected_call_id, dragged_call_id); - } - else if(selected_type == A_CONFERENCE && dragged_type == A_CALL) { + selected_call->_confID = g_strdup(dragged_call_id); + sflphone_add_participant(selected_call_id, dragged_call_id); + } + else if(selected_type == A_CONFERENCE && dragged_type == A_CALL) { - // dragged a conference on a single call - conf = selected_conf; + // dragged a conference on a single call + conf = selected_conf; - calltree_remove_conference(current_calls, conf, NULL); - calltree_add_conference(current_calls, conf); + calltree_remove_conference(current_calls, conf, NULL); + calltree_add_conference(current_calls, conf); - } - else if(selected_type == A_CONFERENCE && dragged_type == A_CONFERENCE){ - - // dragged a conference on a conference - if(gtk_tree_path_compare (dpath, spath) == 0) { - - if(!current_calls) { - DEBUG("Error while joining the same conference\n"); - return; - } - - DEBUG("Joined the same conference!\n"); - gtk_tree_view_expand_row(GTK_TREE_VIEW(current_calls->view), path, FALSE); - } - else { + } + else if(selected_type == A_CONFERENCE && dragged_type == A_CONFERENCE){ - if(!selected_conf) { - DEBUG("Error: selected conference is null while joining 2 conference"); - } + // dragged a conference on a conference + if(gtk_tree_path_compare (dpath, spath) == 0) { - if(!dragged_conf) { - DEBUG("Error: dragged conference is null while joining 2 conference"); - } - - DEBUG("Joined two conference %s, %s!\n", dragged_path, selected_path); - sflphone_join_conference(selected_conf->_confID, dragged_conf->_confID); - } - } + if(!current_calls) { + DEBUG("Error while joining the same conference\n"); + return; + } - // TODO: dragged a single call on a NULL element (should do nothing) - // TODO: dragged a conference on a NULL element (should do nothing) + DEBUG("Joined the same conference!\n"); + gtk_tree_view_expand_row(GTK_TREE_VIEW(current_calls->view), path, FALSE); + } + else { - } - else { - - // dragged_path_depth == 2 - if (selected_type == A_CALL && dragged_type == A_CALL) { + if(!selected_conf) { + DEBUG("Error: selected conference is null while joining 2 conference"); + } - // TODO: dragged a call on a conference call - calltree_remove_call(current_calls, selected_call, NULL); - calltree_add_call(current_calls, selected_call, NULL); - } + if(!dragged_conf) { + DEBUG("Error: dragged conference is null while joining 2 conference"); + } - else if(selected_type == A_CONFERENCE && dragged_type == A_CALL) { + DEBUG("Joined two conference %s, %s!\n", dragged_path, selected_path); + sflphone_join_conference(selected_conf->_confID, dragged_conf->_confID); + } + } - // TODO: dragged a conference on a conference call - calltree_remove_conference(current_calls, selected_conf, NULL); - calltree_add_conference(current_calls, selected_conf); - } + // TODO: dragged a single call on a NULL element (should do nothing) + // TODO: dragged a conference on a NULL element (should do nothing) - // TODO: dragged a single call on a NULL element - // TODO: dragged a conference on a NULL element - } } else { + + // dragged_path_depth == 2 + if (selected_type == A_CALL && dragged_type == A_CALL) { - // selected_path_depth == 2 + // TODO: dragged a call on a conference call + calltree_remove_call(current_calls, selected_call, NULL); + calltree_add_call(current_calls, selected_call, NULL); + } - if(dragged_path_depth == 1) { + else if(selected_type == A_CONFERENCE && dragged_type == A_CALL) { - if(selected_type == A_CALL && dragged_type == A_CALL) { + // TODO: dragged a conference on a conference call + calltree_remove_conference(current_calls, selected_conf, NULL); + calltree_add_conference(current_calls, selected_conf); + } - // dragged a conference call on a call - sflphone_detach_participant(selected_call_id); + // TODO: dragged a single call on a NULL element + // TODO: dragged a conference on a NULL element + } + } + else { - if(selected_call != NULL && dragged_call != NULL) - sflphone_join_participant(selected_call->_callID, dragged_call->_callID); + // selected_path_depth == 2 + + if(dragged_path_depth == 1) { - } - else if(selected_type == A_CALL && dragged_type == A_CONFERENCE) { + if(selected_type == A_CALL && dragged_type == A_CALL) { - // dragged a conference call on a conference - sflphone_detach_participant(selected_call_id); + // dragged a conference call on a call + sflphone_detach_participant(selected_call_id); + + if(selected_call != NULL && dragged_call != NULL) + sflphone_join_participant(selected_call->_callID, dragged_call->_callID); - if(selected_call != NULL && dragged_conf != NULL) { + } + else if(selected_type == A_CALL && dragged_type == A_CONFERENCE) { - DEBUG("Adding a participant, since dragged call on a conference"); + // dragged a conference call on a conference + sflphone_detach_participant(selected_call_id); + + if(selected_call != NULL && dragged_conf != NULL) { - sflphone_add_participant(selected_call_id, dragged_call_id); - } - } - else { + DEBUG("Adding a participant, since dragged call on a conference"); - // dragged a conference call on a NULL element - sflphone_detach_participant(selected_call_id); + sflphone_add_participant(selected_call_id, dragged_call_id); } - } else { - // dragged_path_depth == 2 - // dragged a conference call on another conference call (same conference) - // TODO: dragged a conference call on another conference call (different conference) - - gtk_tree_path_up(path); - - gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, path); - - gtk_tree_path_up(dpath); - gtk_tree_path_up(spath); + // dragged a conference call on a NULL element + sflphone_detach_participant(selected_call_id); + } + + } + else { - if(gtk_tree_path_compare (dpath, spath) == 0) { + // dragged_path_depth == 2 + // dragged a conference call on another conference call (same conference) + // TODO: dragged a conference call on another conference call (different conference) + + gtk_tree_path_up(path); - DEBUG("Dragged a call in the same conference"); - calltree_remove_call (current_calls, selected_call, NULL); - calltree_add_call (current_calls, selected_call, &parent_conference); - } - else { + gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &parent_conference, path); + gtk_tree_path_up(dpath); + gtk_tree_path_up(spath); + + if(gtk_tree_path_compare (dpath, spath) == 0) { - DEBUG("Dragged a conference call onto another conference call %s, %s", gtk_tree_path_to_string(dpath), gtk_tree_path_to_string(spath)); + DEBUG("Dragged a call in the same conference"); + calltree_remove_call (current_calls, selected_call, NULL); + calltree_add_call (current_calls, selected_call, &parent_conference); + } + else { - conf = NULL; - val.g_type = 0; - if(gtk_tree_model_get_iter (model, &iter, dpath)) { - - DEBUG("we got an iter!"); - gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); - - conf = (conference_obj_t*)g_value_get_pointer(&val); - } - g_value_unset(&val); + DEBUG("Dragged a conference call onto another conference call %s, %s", gtk_tree_path_to_string(dpath), gtk_tree_path_to_string(spath)); - sflphone_detach_participant(selected_call_id); + conf = NULL; + + val.g_type = 0; + if(gtk_tree_model_get_iter (model, &iter, dpath)) { + + DEBUG("we got an iter!"); + gtk_tree_model_get_value (model, &iter, COLUMN_ACCOUNT_PTR, &val); + + conf = (conference_obj_t*)g_value_get_pointer(&val); + } + g_value_unset(&val); - if(conf) { + sflphone_detach_participant(selected_call_id); - DEBUG("we got a conf!"); - sflphone_add_participant(selected_call_id, conf->_confID); - } - else { + if(conf) { - DEBUG("didn't find a conf!"); - } + DEBUG("we got a conf!"); + sflphone_add_participant(selected_call_id, conf->_confID); } + else { - // TODO: dragged a conference call on another conference call (different conference) - // TODO: dragged a conference call on a NULL element (same conference) - // TODO: dragged a conference call on a NULL element (different conference) + DEBUG("didn't find a conf!"); + } } - - } + + // TODO: dragged a conference call on another conference call (different conference) + // TODO: dragged a conference call on a NULL element (same conference) + // TODO: dragged a conference call on a NULL element (different conference) + } + + } } @@ -1709,88 +1667,87 @@ static void drag_end_cb(GtkWidget * widget, GdkDragContext * context, gpointer d void drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint t, gpointer data) { - // DEBUG("drag_data_received_cb\n"); - GtkTreeView *tree_view = GTK_TREE_VIEW(widget); - GtkTreePath *drop_path; - GtkTreeViewDropPosition position; - GValue val; + // DEBUG("drag_data_received_cb\n"); + GtkTreeView *tree_view = GTK_TREE_VIEW(widget); + GtkTreePath *drop_path; + GtkTreeViewDropPosition position; + GValue val; - GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; - GtkTreeModel* tree_model = gtk_tree_view_get_model(tree_view); + GtkTreeModel *model = (GtkTreeModel*)active_calltree->store; + GtkTreeModel* tree_model = gtk_tree_view_get_model(tree_view); - GtkTreeIter iter; - gchar value; + GtkTreeIter iter; + gchar value; - val.g_type = 0; - gtk_tree_view_get_drag_dest_row(tree_view, &drop_path, &position); + val.g_type = 0; + gtk_tree_view_get_drag_dest_row(tree_view, &drop_path, &position); - if(drop_path) - { + if(drop_path) { - gtk_tree_model_get_iter(tree_model, &iter, drop_path); - gtk_tree_model_get_value(tree_model, &iter, COLUMN_ACCOUNT_PTR, &val); + gtk_tree_model_get_iter(tree_model, &iter, drop_path); + gtk_tree_model_get_value(tree_model, &iter, COLUMN_ACCOUNT_PTR, &val); - if(gtk_tree_model_iter_has_child(tree_model, &iter)) { - - DEBUG("DRAGGING ON A CONFERENCE"); - dragged_type = A_CONFERENCE; - } - else { - - DEBUG("DRAGGING ON A CALL"); - dragged_type = A_CALL; - } + if(gtk_tree_model_iter_has_child(tree_model, &iter)) { - switch (position) { - - case GTK_TREE_VIEW_DROP_AFTER: - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - dragged_call_id = "NULL"; - dragged_call = NULL; - dragged_conf = NULL; - break; + DEBUG("DRAGGING ON A CONFERENCE"); + dragged_type = A_CONFERENCE; + } + else { - case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - if (dragged_type == A_CALL) { - - dragged_call_id = ((callable_obj_t*)g_value_get_pointer(&val))->_callID; - dragged_call = (callable_obj_t*)g_value_get_pointer(&val); - } - else { + DEBUG("DRAGGING ON A CALL"); + dragged_type = A_CALL; + } - dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID; - dragged_conf = (conference_obj_t*)g_value_get_pointer(&val); - } - break; + switch (position) { - case GTK_TREE_VIEW_DROP_BEFORE: - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - dragged_call_id = "NULL"; - dragged_call = NULL; - dragged_conf = NULL; - break; + case GTK_TREE_VIEW_DROP_AFTER: + dragged_path = gtk_tree_path_to_string(drop_path); + dragged_path_depth = gtk_tree_path_get_depth(drop_path); + dragged_call_id = "NULL"; + dragged_call = NULL; + dragged_conf = NULL; + break; - case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - dragged_path = gtk_tree_path_to_string(drop_path); - dragged_path_depth = gtk_tree_path_get_depth(drop_path); - if (dragged_type == A_CALL) { - dragged_call_id = ((callable_obj_t*)g_value_get_pointer(&val))->_callID; - dragged_call = (callable_obj_t*)g_value_get_pointer(&val); - } - else { - dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID; - dragged_conf = (conference_obj_t*)g_value_get_pointer(&val); - } - break; + case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: + dragged_path = gtk_tree_path_to_string(drop_path); + dragged_path_depth = gtk_tree_path_get_depth(drop_path); + if (dragged_type == A_CALL) { + + dragged_call_id = ((callable_obj_t*)g_value_get_pointer(&val))->_callID; + dragged_call = (callable_obj_t*)g_value_get_pointer(&val); + } + else { - default: - return; + dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID; + dragged_conf = (conference_obj_t*)g_value_get_pointer(&val); + } + break; + + case GTK_TREE_VIEW_DROP_BEFORE: + dragged_path = gtk_tree_path_to_string(drop_path); + dragged_path_depth = gtk_tree_path_get_depth(drop_path); + dragged_call_id = "NULL"; + dragged_call = NULL; + dragged_conf = NULL; + break; + + case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: + dragged_path = gtk_tree_path_to_string(drop_path); + dragged_path_depth = gtk_tree_path_get_depth(drop_path); + if (dragged_type == A_CALL) { + dragged_call_id = ((callable_obj_t*)g_value_get_pointer(&val))->_callID; + dragged_call = (callable_obj_t*)g_value_get_pointer(&val); } + else { + dragged_call_id = ((conference_obj_t*)g_value_get_pointer(&val))->_confID; + dragged_conf = (conference_obj_t*)g_value_get_pointer(&val); + } + break; + + default: + return; } + } } diff --git a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml index ba4e42577b4b546a1cb001049cbe63622e491dda..3d1720ac18676692e6e84ea7db212c83d6f2be12 100644 --- a/sflphone-client-gnome/src/dbus/callmanager-introspec.xml +++ b/sflphone-client-gnome/src/dbus/callmanager-introspec.xml @@ -202,13 +202,21 @@ <method name="requestGoClear"> <arg type="s" name="callID" direction="in"/> </method> - - <signal name="secureOn"> + + <signal name="secureSdesOn"> + <arg type="s" name="callID" direction="out" /> + </signal> + + <signal name="secureSdesOff"> + <arg type="s" name="callID" direction="out" /> + </signal> + + <signal name="secureZrtpOn"> <arg type="s" name="callID" direction="out" /> <arg type="s" name="cipher" direction="out" /> </signal> - <signal name="secureOff"> + <signal name="secureZrtpOff"> <arg type="s" name="callID" direction="out" /> </signal> diff --git a/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml b/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml index 018917eaa4db5f890284d00d99d93be1b6871747..0b66386689b19c9612c175bb562cce576fad7319 100644 --- a/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml +++ b/sflphone-client-gnome/src/dbus/configurationmanager-introspec.xml @@ -4,12 +4,78 @@ <!-- Accounts-related methods --> <method name="getAccountDetails"> + <!--* Method that returns a hashtable containing the current + account configuration setting. + + CONFIG_ACCOUNT_ENABLE + CONFIG_ACCOUNT_RESOLVE_ONCE + CONFIG_ACCOUNT_TYPE + HOSTNAME + USERNAME + PASSWORD + REALM + AUTHENTICATION_USERNAME + CONFIG_ACCOUNT_MAILBOX + CONFIG_ACCOUNT_REGISTRATION_EXPIRE + LOCAL_INTERFACE + PUBLISHED_SAMEAS_LOCAL + PUBLISHED_ADDRESS + LOCAL_PORT + PUBLISHED_PORT + DISPLAY_NAME + STUN_ENABLE + STUN_SERVER + + REGISTRATION_STATUS + REGISTRATION_STATE_CODE + REGISTRATION_STATE_DESCRIPTION + SRTP_KEY_EXCHANGE + SRTP_ENABLE + + SRTP_RTP_FALLBACK + ZRTP_DISPLAY_SAS + ZRTP_DISPLAY_SAS_ONCE + ZRTP_HELLO_HASH + ZRTP_NOT_SUPP_WARNING + + TLS_LISTENER_PORT + TLS_ENABLE + TLS_CA_LIST_FILE + TLS_CERTIFICATE_FILE + TLS_PRIVATE_KEY_FILE + + TLS_METHOD + TLS_CIPHERS + TLS_SERVER_NAME + TLS_VERIFY_SERVER + TLS_VERIFY_CLIENT + TLS_REQUIRE_CLIENT_CERTIFICATE + TLS_NEGOTIATION_TIMEOUT_SEC + TLS_NEGOTIATION_TIMEOUT_MSEC + + + @param[in] input accountID + @param[out] output details + --> <arg type="s" name="accountID" direction="in"/> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> <arg type="a{ss}" name="details" direction="out"/> </method> <method name="setAccountDetails"> + <!--* Modify the current accout parameter settings given an + accountID and a hash table containing the parameters to + update. The hash table is not required to be complete, + only the parameter to change may be specified. Only the + running parameters are updated dynamically, configuration + settings are stored in the configuration file when + SFLphone-daemon quit. + + For a complete list of account settings refer to getAccountDetails + + @param[in] input accountID + @param[in] input details + --> <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> <arg type="s" name="accountID" direction="in"/> <arg type="a{ss}" name="details" direction="in"/> @@ -26,15 +92,59 @@ <arg type="i" name="number" direction="in"/> </method> - <method name="deleteAllCredential"> - <arg type="s" name="accountID" direction="in"/> + <method name="deleteAllCredential"> + <arg type="s" name="accountID" direction="in"/> </method> <method name="getIp2IpDetails"> + <!--* Specific call to get configuration settings of the + IP2IP_PROFILE. Which are sligthly different since no VoIP + Account parameters are envolved. + + ACCOUNT_ID + SRTP_KEY_EXCHANGE + SRTP_ENABLE + SRTP_RTP_FALLBACK + ZRTP_DISPLAY_SAS + ZRTP_HELLO_HASH + ZRTP_NOT_SUPP_WARNING + ZRTP_DISPLAY_SAS_ONCE + LOCAL_INTERFACE + LOCAL_PORT + + TLS_LISTENER_PORT + TLS_CA_LIST_FILE + TLS_CERTIFICATE_FILE + TLS_PRIVATE_KEY_FILE + TLS_PASSWORD + TLS_METHOD + TLS_CIPHERS + TLS_SERVER_NAME + TLS_VERIFY_SERVER + TLS_VERIFY_CLIENT + TLS_REQUIRE_CLIENT_CERTIFICATE + TLS_NEGOTIATION_TIMEOUT_SEC + TLS_NEGOTIATION_TIMEOUT_MSEC + + @param[in] input accountID + @param[out] output details + --> <arg type="a{ss}" name="details" direction="out"/> </method> <method name="setIp2IpDetails"> + <!--* Modify the IP2IP_PROFILE parameter settings a hash table + containing the parameters to update. The hash table is not required to be complete, + only the parameters to be modified may be specified. Also, + only the running configuration is updated dynamically, + settings are stored in the configuration file when + SFLphone-daemon quit. + + For a complete list of account settings refer to getAccountDetails + + @param[in] input accountID + @param[in] input details + --> <arg type="a{ss}" name="details" direction="in"/> </method> @@ -50,25 +160,52 @@ </method> <method name="addAccount"> + <!--* Add a new account to the SFLphone-daemon list. If no + details are specified, default parameters are used. + A REGISTER is automatically sent and configuration is + saved if account created successfully. + + @param[in] input details + @param[out] output accountID + --> <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> <arg type="a{ss}" name="details" direction="in"/> <arg type="s" name="createdAccountId" direction="out"/> </method> <method name="setAccountsOrder"> + <!--* Update the account list given a new list of accountID. If no account is specified + for a call, the first one in the list will be used. + + @param[in] input order + --> <arg type="s" name="order" direction="in"/> </method> <method name="removeAccount"> + <!--* Delete an account from SFLphone-daemon list and erase + account parameters from configuration file. + + @param[in] input accountID + --> <arg type="s" name="accoundID" direction="in"/> </method> <method name="getAccountList"> + <!--* Get teh accountlist as stored in SFLphone-daemon. + + @param[in] input accountID + --> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> <arg type="as" name="list" direction="out"/> </method> <method name="sendRegister"> + <!--* Send accout registration request to PBX server. Register + the account if expire=1, unregister if expire=0. + + @param[in] input accountID + --> <arg type="s" name="accountID" direction="in"/> <arg type="i" name="expire" direction="in"/> </method> @@ -149,12 +286,14 @@ <method name="getActiveCodecList"> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="s" name="accountID" direction="in"/> <arg type="as" name="list" direction="out"/> </method> <method name="setActiveCodecList"> <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> <arg type="as" name="list" direction="in"/> + <arg type="s" name="accountID" direction="in"/> </method> @@ -290,7 +429,47 @@ <method name="switchPopupMode"> </method> + <method name="getWindowWidth"> + <arg type="i" name="width" direction="out"/> + </method> + + <method name="getWindowHeight"> + <arg type="i" name="height" direction="out"/> + </method> + + <method name="setWindowWidth"> + <arg type="i" name="width" direction="in"/> + </method> + <method name="setWindowHeight"> + <arg type="i" name="height" direction="in"/> + </method> + + <method name="getWindowPositionX"> + <arg type="i" name="posX" direction="out"/> + </method> + + <method name="setWindowPositionX"> + <arg type="i" name="posX" direction="in"/> + </method> + + <method name="getWindowPositionY"> + <arg type="i" name="posY" direction="out"/> + </method> + + <method name="setWindowPositionY"> + <arg type="i" name="posY" direction="in"/> + </method> + + <method name="enableStatusIcon"> + <arg type="s" name="value" direction="in"/> + </method> + + <method name="isStatusIconEnabled"> + <arg type="s" name="value" direction="out"/> + </method> + + <!-- Addressbook configuration --> <method name="getAddressbookSettings"> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> @@ -378,5 +557,12 @@ <arg type="as" name="list" direction="out"/> </method> + <method name="getShortcuts"> + <arg type="a{si}" name="shortcutsMap" direction="out"/> + </method> + + <method name="setShortcuts"> + <arg type="a{si}" name="shortcutsMap" direction="in"/> + </method> </interface> </node> diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index 7d4fb6f4e767ef415441d039c2eefe4ffd16b5bb..48f047c0929ac7515dd142a25e9f6ad61e95026d 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -43,1668 +43,1621 @@ DBusGProxy * callManagerProxy; DBusGProxy * configurationManagerProxy; DBusGProxy * instanceProxy; - static void -incoming_call_cb (DBusGProxy *proxy UNUSED, - const gchar* accountID, - const gchar* callID, - const gchar* from, - void * foo UNUSED ) +static void +incoming_call_cb(DBusGProxy *proxy UNUSED, const gchar* accountID, + const gchar* callID, const gchar* from, void * foo UNUSED ) { - DEBUG("Incoming call (%s) from %s", callID, from); + DEBUG("Incoming call (%s) from %s", callID, from); - callable_obj_t * c; - gchar *peer_name, *peer_number; - // We receive the from field under a formatted way. We want to extract the number and the name of the caller - peer_name = call_get_peer_name (from); - peer_number = call_get_peer_number (from); + callable_obj_t * c; + gchar *peer_name, *peer_number; + // We receive the from field under a formatted way. We want to extract the number and the name of the caller + peer_name = call_get_peer_name(from); + peer_number = call_get_peer_number(from); - DEBUG(" peer name: %s", peer_name); - DEBUG(" peer number: %s", peer_number); + DEBUG(" peer name: %s", peer_name); + DEBUG(" peer number: %s", peer_number); - create_new_call (CALL, CALL_STATE_INCOMING, g_strdup(callID), g_strdup(accountID), peer_name, peer_number, &c); + create_new_call(CALL, CALL_STATE_INCOMING, g_strdup(callID), g_strdup( + accountID), peer_name, peer_number, &c); #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink (TRUE); - popup_main_window (); + status_tray_icon_blink(TRUE); + popup_main_window(); #endif - set_timestamp (&c->_time_start); - notify_incoming_call (c); - sflphone_incoming_call (c); + set_timestamp(&c->_time_start); + notify_incoming_call(c); + sflphone_incoming_call(c); } - static void -zrtp_negotiation_failed_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* reason, - const gchar* severity, - void * foo UNUSED ) +static void +zrtp_negotiation_failed_cb(DBusGProxy *proxy UNUSED, const gchar* callID, + const gchar* reason, const gchar* severity, void * foo UNUSED ) { - DEBUG ("Zrtp negotiation failed."); - main_window_zrtp_negotiation_failed(callID, reason, severity); - callable_obj_t * c = NULL; - c = calllist_get(current_calls, callID); - if(c) { - notify_zrtp_negotiation_failed(c); + DEBUG ("Zrtp negotiation failed."); + main_window_zrtp_negotiation_failed(callID, reason, severity); + callable_obj_t * c = NULL; + c = calllist_get(current_calls, callID); + if (c) + { + notify_zrtp_negotiation_failed(c); } } - static void -curent_selected_codec (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* codecName, - void * foo UNUSED ) +static void +curent_selected_codec(DBusGProxy *proxy UNUSED, const gchar* callID, + const gchar* codecName, void * foo UNUSED ) { - // DEBUG ("%s codec decided for call %s",codecName,callID); - // sflphone_display_selected_codec (codecName); + // DEBUG ("%s codec decided for call %s",codecName,callID); + // sflphone_display_selected_codec (codecName); } - static void -volume_changed_cb (DBusGProxy *proxy UNUSED, - const gchar* device, - const gdouble value, - void * foo UNUSED ) +static void +volume_changed_cb(DBusGProxy *proxy UNUSED, const gchar* device, const gdouble value, + void * foo UNUSED ) { - DEBUG ("Volume of %s changed to %f.",device, value); - set_slider(device, value); + DEBUG ("Volume of %s changed to %f.",device, value); + set_slider(device, value); } - static void -voice_mail_cb (DBusGProxy *proxy UNUSED, - const gchar* accountID, - const guint nb, - void * foo UNUSED ) +static void +voice_mail_cb(DBusGProxy *proxy UNUSED, const gchar* accountID, const guint nb, + void * foo UNUSED ) { - DEBUG ("%d Voice mail waiting!",nb); - sflphone_notify_voice_mail (accountID , nb); + DEBUG ("%d Voice mail waiting!",nb); + sflphone_notify_voice_mail(accountID, nb); } - static void -incoming_message_cb (DBusGProxy *proxy UNUSED, - const gchar* accountID UNUSED, - const gchar* msg, - void * foo UNUSED ) +static void +incoming_message_cb(DBusGProxy *proxy UNUSED, const gchar* accountID UNUSED, + const gchar* msg, void * foo UNUSED ) { - DEBUG ("Message %s!",msg); + DEBUG ("Message %s!",msg); } - static void -call_state_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* state, - void * foo UNUSED ) +static void +call_state_cb(DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* state, + void * foo UNUSED ) { - DEBUG ("Call %s state %s",callID, state); - callable_obj_t * c = calllist_get(current_calls, callID); - if(c) + DEBUG ("Call %s state %s",callID, state); + callable_obj_t * c = calllist_get(current_calls, callID); + if (c) { - if ( strcmp(state, "HUNGUP") == 0 ) + if (strcmp(state, "HUNGUP") == 0) { - if(c->_state==CALL_STATE_CURRENT) + if (c->_state == CALL_STATE_CURRENT) { - // peer hung up, the conversation was established, so _stop has been initialized with the current time value - DEBUG("call state current"); - set_timestamp (&c->_time_stop); - calltree_update_call( history, c, NULL); + // peer hung up, the conversation was established, so _stop has been initialized with the current time value + DEBUG("call state current"); + set_timestamp(&c->_time_stop); + calltree_update_call(history, c, NULL); } - stop_notification(); - sflphone_hung_up (c); - calltree_update_call( history, c, NULL ); - status_bar_display_account(); + stop_notification(); + sflphone_hung_up(c); + calltree_update_call(history, c, NULL ); + status_bar_display_account(); } - else if ( strcmp(state, "UNHOLD_CURRENT") == 0 ) + else if (strcmp(state, "UNHOLD_CURRENT") == 0) { - sflphone_current (c); + sflphone_current(c); } - else if ( strcmp(state, "UNHOLD_RECORD") == 0 ) + else if (strcmp(state, "UNHOLD_RECORD") == 0) { - sflphone_record (c); + sflphone_record(c); } - else if ( strcmp(state, "HOLD") == 0 ) + else if (strcmp(state, "HOLD") == 0) { - sflphone_hold (c); + sflphone_hold(c); } - else if ( strcmp(state, "RINGING") == 0 ) + else if (strcmp(state, "RINGING") == 0) { - sflphone_ringing (c); + sflphone_ringing(c); } - else if ( strcmp(state, "CURRENT") == 0 ) + else if (strcmp(state, "CURRENT") == 0) { - sflphone_current (c); + sflphone_current(c); } - else if ( strcmp(state, "FAILURE") == 0 ) + else if (strcmp(state, "FAILURE") == 0) { - sflphone_fail (c); + sflphone_fail(c); } - else if ( strcmp(state, "BUSY") == 0 ) + else if (strcmp(state, "BUSY") == 0) { - sflphone_busy (c); + sflphone_busy(c); } } - else + else { - // The callID is unknow, threat it like a new call - // If it were an incoming call, we won't be here - // It means that a new call has been initiated with an other client (cli for instance) - if ( strcmp(state, "RINGING") == 0 || strcmp(state, "CURRENT") == 0) + // The callID is unknow, threat it like a new call + // If it were an incoming call, we won't be here + // It means that a new call has been initiated with an other client (cli for instance) + if (strcmp(state, "RINGING") == 0 || strcmp(state, "CURRENT") == 0) { - callable_obj_t *new_call; - GHashTable *call_details; - gchar *type; + callable_obj_t *new_call; + GHashTable *call_details; + gchar *type; - DEBUG ("New ringing call! accountID: %s", callID); + DEBUG ("New ringing call! accountID: %s", callID); - // We fetch the details associated to the specified call - call_details = dbus_get_call_details (callID); - create_new_call_from_details (callID, call_details, &new_call); + // We fetch the details associated to the specified call + call_details = dbus_get_call_details(callID); + create_new_call_from_details(callID, call_details, &new_call); - // Restore the callID to be synchronous with the daemon - new_call->_callID = g_strdup(callID); - type = g_hash_table_lookup (call_details, "CALL_TYPE"); + // Restore the callID to be synchronous with the daemon + new_call->_callID = g_strdup(callID); + type = g_hash_table_lookup(call_details, "CALL_TYPE"); - if (g_strcasecmp (type, "0") == 0) + if (g_strcasecmp(type, "0") == 0) { - // DEBUG("incoming\n"); - new_call->_history_state = INCOMING; + // DEBUG("incoming\n"); + new_call->_history_state = INCOMING; } - else + else { - // DEBUG("outgoing\n"); - new_call->_history_state = OUTGOING; + // DEBUG("outgoing\n"); + new_call->_history_state = OUTGOING; } - calllist_add (current_calls, new_call); - calllist_add (history, new_call); - calltree_add_call (current_calls, new_call, NULL); - update_actions (); - calltree_display (current_calls); + calllist_add(current_calls, new_call); + calllist_add(history, new_call); + calltree_add_call(current_calls, new_call, NULL); + update_actions(); + calltree_display(current_calls); - //sflphone_incoming_call (new_call); + //sflphone_incoming_call (new_call); } } } static void -conference_changed_cb (DBusGProxy *proxy UNUSED, - const gchar* confID, - const gchar* state, - void * foo UNUSED ) +conference_changed_cb(DBusGProxy *proxy UNUSED, const gchar* confID, + const gchar* state, void * foo UNUSED ) { - - // sflphone_display_transfer_status("Transfer successfull"); - conference_obj_t* changed_conf = conferencelist_get(confID); - gchar** participants; - gchar** part; - DEBUG("conference new state %s\n", state); + // sflphone_display_transfer_status("Transfer successfull"); + conference_obj_t* changed_conf = conferencelist_get(confID); + gchar** participants; + gchar** part; - if(changed_conf) + DEBUG("conference new state %s\n", state); + + if (changed_conf) { - // remove old conference from calltree - calltree_remove_conference (current_calls, changed_conf, NULL); + // remove old conference from calltree + calltree_remove_conference(current_calls, changed_conf, NULL); + + // update conference state + if (strcmp(state, "ACTIVE_ATACHED") == 0) + { + changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + } + else if (strcmp(state, "ACTIVE_DETACHED") == 0) + { + changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED; + } + else if (strcmp(state, "HOLD") == 0) + { + changed_conf->_state = CONFERENCE_STATE_HOLD; + } + else + { + DEBUG("Error: conference state not recognized"); + } - // update conference state - if ( strcmp(state, "ACTIVE_ATACHED") == 0 ) { - changed_conf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - } - else if ( strcmp(state, "ACTIVE_DETACHED") == 0 ) { - changed_conf->_state = CONFERENCE_STATE_ACTIVE_DETACHED; - } - else if ( strcmp(state, "HOLD") == 0 ) { - changed_conf->_state = CONFERENCE_STATE_HOLD; - } - else { - DEBUG("Error: conference state not recognized"); - } - + participants = (gchar**) dbus_get_participant_list(changed_conf->_confID); - participants = (gchar**)dbus_get_participant_list(changed_conf->_confID); + // update conferece participants + conference_participant_list_update(participants, changed_conf); - // update conferece participants - conference_participant_list_update(participants, changed_conf); - - // add new conference to calltree - calltree_add_conference (current_calls, changed_conf); + // add new conference to calltree + calltree_add_conference(current_calls, changed_conf); } } - static void -conference_created_cb (DBusGProxy *proxy UNUSED, - const gchar* confID, - void * foo UNUSED ) +conference_created_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED ) { - DEBUG ("Conference added %s\n", confID); + DEBUG ("Conference added %s\n", confID); - conference_obj_t* new_conf; - callable_obj_t* call; - gchar* call_id; - gchar** participants; - gchar** part; + conference_obj_t* new_conf; + callable_obj_t* call; + gchar* call_id; + gchar** participants; + gchar** part; - create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, confID, &new_conf); - // new_conf->_confID = g_strdup(confID); + create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, confID, &new_conf); + // new_conf->_confID = g_strdup(confID); - participants = (gchar**)dbus_get_participant_list(new_conf->_confID); + participants = (gchar**) dbus_get_participant_list(new_conf->_confID); - conference_participant_list_update(participants, new_conf); + conference_participant_list_update(participants, new_conf); - // participant = new_conf->participant; - for (part = participants; *part; part++) - { - call_id = (gchar*)(*part); - call = calllist_get (current_calls, call_id); - call->_confID = g_strdup(confID); + // participant = new_conf->participant; + for (part = participants; *part; part++) + { + call_id = (gchar*) (*part); + call = calllist_get(current_calls, call_id); + call->_confID = g_strdup(confID); } - conferencelist_add(new_conf); - calltree_add_conference (current_calls, new_conf); + conferencelist_add(new_conf); + calltree_add_conference(current_calls, new_conf); } - static void -conference_removed_cb (DBusGProxy *proxy UNUSED, - const gchar* confID, - void * foo UNUSED ) +conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED ) { - DEBUG ("Conference removed %s\n", confID); + DEBUG ("Conference removed %s\n", confID); - conference_obj_t * c = conferencelist_get(confID); - calltree_remove_conference (current_calls, c, NULL); - conferencelist_remove(c->_confID); + conference_obj_t * c = conferencelist_get(confID); + calltree_remove_conference(current_calls, c, NULL); + conferencelist_remove(c->_confID); } - - static void -accounts_changed_cb (DBusGProxy *proxy UNUSED, - void * foo UNUSED ) +static void +accounts_changed_cb(DBusGProxy *proxy UNUSED, void * foo UNUSED ) { - DEBUG ("Accounts changed"); - sflphone_fill_account_list (); - sflphone_fill_ip2ip_profile(); - account_list_config_dialog_fill(); - - // Update the status bar in case something happened - // Should fix ticket #1215 - status_bar_display_account(); -} + DEBUG ("Accounts changed"); + sflphone_fill_account_list(); + sflphone_fill_ip2ip_profile(); + account_list_config_dialog_fill(); + // Update the status bar in case something happened + // Should fix ticket #1215 + status_bar_display_account(); - static void -transfer_succeded_cb (DBusGProxy *proxy UNUSED, - void * foo UNUSED ) -{ - DEBUG ("Transfer succeded\n"); - sflphone_display_transfer_status("Transfer successfull"); + // Update the tooltip on the status icon + statusicon_set_tooltip (); } - - static void -transfer_failed_cb (DBusGProxy *proxy UNUSED, - void * foo UNUSED ) +static void +transfer_succeded_cb(DBusGProxy *proxy UNUSED, void * foo UNUSED ) { - DEBUG ("Transfer failed\n"); - sflphone_display_transfer_status("Transfer failed"); + DEBUG ("Transfer succeded\n"); + sflphone_display_transfer_status("Transfer successfull"); } - static void -secure_on_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* cipher, - void * foo UNUSED ) +static void +transfer_failed_cb(DBusGProxy *proxy UNUSED, void * foo UNUSED ) { - DEBUG ("SRTP is ON secure_on_cb"); - callable_obj_t * c = calllist_get(current_calls, callID); - if(c) { - c->_srtp_cipher = g_strdup(cipher); - sflphone_srtp_on (c); - notify_secure_on(c); - } + DEBUG ("Transfer failed\n"); + sflphone_display_transfer_status("Transfer failed"); } - static void -secure_off_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - void * foo UNUSED ) +static void +secure_sdes_on_cb(DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED) { - DEBUG ("SRTP is OFF"); - callable_obj_t * c = calllist_get(current_calls, callID); - if(c) { - sflphone_srtp_off (c); - notify_secure_off (c); + DEBUG("SRTP using SDES is on"); + callable_obj_t *c = calllist_get(current_calls, callID); + if (c) + { + sflphone_srtp_sdes_on(c); + notify_secure_on(c); } + } - static void -show_sas_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* sas, - const gboolean verified, - void * foo UNUSED ) +static void +secure_sdes_off_cb(DBusGProxy *proxy UNUSED, const gchar *callID, void *foo UNUSED) { - DEBUG ("Showing SAS"); - callable_obj_t * c = calllist_get(current_calls, callID); - if(c) { - sflphone_srtp_show_sas (c, sas, verified); + DEBUG("SRTP using SDES is off"); + callable_obj_t *c = calllist_get(current_calls, callID); + if (c) + { + sflphone_srtp_sdes_off(c); + notify_secure_off(c); } } - static void -confirm_go_clear_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - void * foo UNUSED ) +static void +secure_zrtp_on_cb(DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* cipher, + void * foo UNUSED ) { - DEBUG ("Confirm Go Clear request"); - callable_obj_t * c = calllist_get(current_calls, callID); - if(c) { - sflphone_confirm_go_clear (c); + DEBUG ("SRTP using ZRTP is ON secure_on_cb"); + callable_obj_t * c = calllist_get(current_calls, callID); + if (c) + { + c->_srtp_cipher = g_strdup(cipher); + + sflphone_srtp_zrtp_on(c); + notify_secure_on(c); } } - static void -zrtp_not_supported_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - void * foo UNUSED ) +static void +secure_zrtp_off_cb(DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED ) { - DEBUG ("ZRTP not supported on the other end"); - callable_obj_t * c = calllist_get(current_calls, callID); - if(c) { - sflphone_zrtp_not_supported (c); - notify_zrtp_not_supported(c); + DEBUG ("SRTP using ZRTP is OFF"); + callable_obj_t * c = calllist_get(current_calls, callID); + if (c) + { + sflphone_srtp_zrtp_off(c); + notify_secure_off(c); } } - static void -sip_call_state_cb (DBusGProxy *proxy UNUSED, - const gchar* callID, - const gchar* description, - const guint code, - void * foo UNUSED ) +static void +show_zrtp_sas_cb(DBusGProxy *proxy UNUSED, const gchar* callID, const gchar* sas, + const gboolean verified, void * foo UNUSED ) { - callable_obj_t * c = NULL; - c = calllist_get(current_calls, callID); - - if(c != NULL) { - DEBUG("sip_call_state_cb received code %d", code); - sflphone_call_state_changed(c, description, code); + DEBUG ("Showing SAS"); + callable_obj_t * c = calllist_get(current_calls, callID); + if (c) + { + sflphone_srtp_zrtp_show_sas(c, sas, verified); } } - static void -error_alert(DBusGProxy *proxy UNUSED, - int errCode, - void * foo UNUSED ) +static void +confirm_go_clear_cb(DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED ) { - ERROR ("Error notifying : (%i)", errCode); - sflphone_throw_exception( errCode ); + DEBUG ("Confirm Go Clear request"); + callable_obj_t * c = calllist_get(current_calls, callID); + if (c) + { + sflphone_confirm_go_clear(c); + } } - gboolean -dbus_connect () +static void +zrtp_not_supported_cb(DBusGProxy *proxy UNUSED, const gchar* callID, void * foo UNUSED ) { - - GError *error = NULL; - connection = NULL; - instanceProxy = NULL; - - g_type_init (); - - connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - - if (error) + DEBUG ("ZRTP not supported on the other end"); + callable_obj_t * c = calllist_get(current_calls, callID); + if (c) { - ERROR ("Failed to open connection to bus: %s", - error->message); - g_error_free (error); - return FALSE; + sflphone_srtp_zrtp_not_supported(c); + notify_zrtp_not_supported(c); } +} - /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ - - - instanceProxy = dbus_g_proxy_new_for_name (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/Instance", - "org.sflphone.SFLphone.Instance"); - /* - instanceProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/Instance", - "org.sflphone.SFLphone.Instance", - &error); - */ +static void +sip_call_state_cb(DBusGProxy *proxy UNUSED, const gchar* callID, + const gchar* description, const guint code, void * foo UNUSED ) +{ + callable_obj_t * c = NULL; + c = calllist_get(current_calls, callID); - if (instanceProxy==NULL) + if (c != NULL) { - ERROR ("Failed to get proxy to Instance"); - return FALSE; + DEBUG("sip_call_state_cb received code %d", code); + sflphone_call_state_changed(c, description, code); } +} +static void +error_alert(DBusGProxy *proxy UNUSED, int errCode, void * foo UNUSED ) +{ + ERROR ("Error notifying : (%i)", errCode); + sflphone_throw_exception(errCode); +} - DEBUG ("DBus connected to Instance"); - - - callManagerProxy = dbus_g_proxy_new_for_name (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager"); +gboolean +dbus_connect() +{ - /* - callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/CallManager", - "org.sflphone.SFLphone.CallManager", - &error); - */ - if (callManagerProxy==NULL) - { - ERROR ("Failed to get proxy to CallManagers"); - return FALSE; - } - - DEBUG ("DBus connected to CallManager"); - /* STRING STRING STRING Marshaller */ - /* Incoming call */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "incomingCall", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "incomingCall", G_CALLBACK(incoming_call_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "zrtpNegotiationFailed", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "zrtpNegotiationFailed", G_CALLBACK(zrtp_negotiation_failed_cb), NULL, NULL); - - /* Current codec */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "currentSelectedCodec", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "currentSelectedCodec", G_CALLBACK(curent_selected_codec), NULL, NULL); - - /* Register a marshaller for STRING,STRING */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "callStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "callStateChanged", G_CALLBACK(call_state_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "voiceMailNotify", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "voiceMailNotify", G_CALLBACK(voice_mail_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "incomingMessage", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "incomingMessage", G_CALLBACK(incoming_message_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_DOUBLE, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "volumeChanged", G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "volumeChanged", G_CALLBACK(volume_changed_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "transferSucceded", G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "transferSucceded", G_CALLBACK(transfer_succeded_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "transferFailed", G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "transferFailed", G_CALLBACK(transfer_failed_cb), NULL, NULL); - - /* Conference related callback */ - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "conferenceChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "conferenceChanged", G_CALLBACK(conference_changed_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "conferenceCreated", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "conferenceCreated", G_CALLBACK(conference_created_cb), NULL, NULL); - - dbus_g_proxy_add_signal (callManagerProxy, - "conferenceRemoved", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "conferenceRemoved", G_CALLBACK(conference_removed_cb), NULL, NULL); - - /* Security related callbacks */ - - /* Register a marshaller for STRING,STRING,BOOL */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_BOOL, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "showSAS", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "showSAS", G_CALLBACK(show_sas_cb), NULL, NULL); - - - dbus_g_proxy_add_signal (callManagerProxy, - "secureOn", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "secureOn", G_CALLBACK(secure_on_cb), NULL, NULL); - - /* Register a marshaller for STRING*/ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_add_signal (callManagerProxy, - "secureOff", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "secureOff", G_CALLBACK(secure_off_cb), NULL, NULL); - dbus_g_proxy_add_signal (callManagerProxy, - "zrtpNotSuppOther", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "zrtpNotSuppOther", G_CALLBACK(zrtp_not_supported_cb), NULL, NULL); - dbus_g_proxy_add_signal (callManagerProxy, - "confirmGoClear", G_TYPE_STRING, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "confirmGoClear", G_CALLBACK(confirm_go_clear_cb), NULL, NULL); - - /* VOID STRING STRING INT */ - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_INT, - G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - - - dbus_g_proxy_add_signal (callManagerProxy, - "sipCallStateChanged", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (callManagerProxy, - "sipCallStateChanged", G_CALLBACK(sip_call_state_cb), NULL, NULL); - - configurationManagerProxy = dbus_g_proxy_new_for_name (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager"); - - - /* - configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, - "org.sflphone.SFLphone", - "/org/sflphone/SFLphone/ConfigurationManager", - "org.sflphone.SFLphone.ConfigurationManager", - &error); - */ - if (!configurationManagerProxy) - { - ERROR ("Failed to get proxy to ConfigurationManager"); - return FALSE; - } - DEBUG ("DBus connected to ConfigurationManager"); - dbus_g_proxy_add_signal (configurationManagerProxy, - "accountsChanged", G_TYPE_INVALID); - dbus_g_proxy_connect_signal (configurationManagerProxy, - "accountsChanged", G_CALLBACK(accounts_changed_cb), NULL, NULL); - - dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, - G_TYPE_NONE, G_TYPE_INT , G_TYPE_INVALID); - dbus_g_proxy_add_signal (configurationManagerProxy, - "errorAlert", G_TYPE_INT , G_TYPE_INVALID); - dbus_g_proxy_connect_signal (configurationManagerProxy, - "errorAlert", G_CALLBACK(error_alert), NULL, NULL); - - /* Defines a default timeout for the proxies */ + GError *error = NULL; + connection = NULL; + instanceProxy = NULL; + + g_type_init(); + + connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + + if (error) + { + ERROR ("Failed to open connection to bus: %s", + error->message); + g_error_free(error); + return FALSE; + } + + /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */ + + instanceProxy = dbus_g_proxy_new_for_name(connection, + "org.sflphone.SFLphone", "/org/sflphone/SFLphone/Instance", + "org.sflphone.SFLphone.Instance"); + /* + instanceProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/Instance", + "org.sflphone.SFLphone.Instance", + &error); + */ + + if (instanceProxy == NULL) + { + ERROR ("Failed to get proxy to Instance"); + return FALSE; + } + + DEBUG ("DBus connected to Instance"); + + callManagerProxy = dbus_g_proxy_new_for_name(connection, + "org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager"); + + /* + callManagerProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + "org.sflphone.SFLphone.CallManager", + &error); + */ + if (callManagerProxy == NULL) + { + ERROR ("Failed to get proxy to CallManagers"); + return FALSE; + } + + DEBUG ("DBus connected to CallManager"); + /* STRING STRING STRING Marshaller */ + /* Incoming call */ + dbus_g_object_register_marshaller( + g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "incomingCall", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "incomingCall", + G_CALLBACK(incoming_call_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "zrtpNegotiationFailed", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "zrtpNegotiationFailed", + G_CALLBACK(zrtp_negotiation_failed_cb), NULL, NULL); + + /* Current codec */ + dbus_g_object_register_marshaller( + g_cclosure_user_marshal_VOID__STRING_STRING_STRING, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "currentSelectedCodec", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "currentSelectedCodec", + G_CALLBACK(curent_selected_codec), NULL, NULL); + + /* Register a marshaller for STRING,STRING */ + dbus_g_object_register_marshaller( + g_cclosure_user_marshal_VOID__STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "callStateChanged", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "callStateChanged", + G_CALLBACK(call_state_cb), NULL, NULL); + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_INT, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "voiceMailNotify", G_TYPE_STRING, + G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "voiceMailNotify", + G_CALLBACK(voice_mail_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "incomingMessage", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "incomingMessage", + G_CALLBACK(incoming_message_cb), NULL, NULL); + + dbus_g_object_register_marshaller( + g_cclosure_user_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, G_TYPE_STRING, + G_TYPE_DOUBLE, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "volumeChanged", G_TYPE_STRING, + G_TYPE_DOUBLE, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "volumeChanged", + G_CALLBACK(volume_changed_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "transferSucceded", G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "transferSucceded", + G_CALLBACK(transfer_succeded_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "transferFailed", G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "transferFailed", + G_CALLBACK(transfer_failed_cb), NULL, NULL); + + /* Conference related callback */ + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "conferenceChanged", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "conferenceChanged", + G_CALLBACK(conference_changed_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "conferenceCreated", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "conferenceCreated", + G_CALLBACK(conference_created_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "conferenceRemoved", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "conferenceRemoved", + G_CALLBACK(conference_removed_cb), NULL, NULL); + + /* Security related callbacks */ + + dbus_g_proxy_add_signal(callManagerProxy, "secureSdesOn", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "secureSdesOn", + G_CALLBACK(secure_sdes_on_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "secureSdesOff", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "secureSdesOff", + G_CALLBACK(secure_sdes_off_cb), NULL, NULL); + + /* Register a marshaller for STRING,STRING,BOOL */ + dbus_g_object_register_marshaller( + g_cclosure_user_marshal_VOID__STRING_STRING_BOOL, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "showSAS", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "showSAS", + G_CALLBACK(show_zrtp_sas_cb), NULL, NULL); + + dbus_g_proxy_add_signal(callManagerProxy, "secureZrtpOn", G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "secureZrtpOn", + G_CALLBACK(secure_zrtp_on_cb), NULL, NULL); + + /* Register a marshaller for STRING*/ + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING, + G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INVALID); + dbus_g_proxy_add_signal(callManagerProxy, "secureZrtpOff", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "secureZrtpOff", + G_CALLBACK(secure_zrtp_off_cb), NULL, NULL); + dbus_g_proxy_add_signal(callManagerProxy, "zrtpNotSuppOther", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "zrtpNotSuppOther", + G_CALLBACK(zrtp_not_supported_cb), NULL, NULL); + dbus_g_proxy_add_signal(callManagerProxy, "confirmGoClear", G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "confirmGoClear", + G_CALLBACK(confirm_go_clear_cb), NULL, NULL); + + /* VOID STRING STRING INT */ + dbus_g_object_register_marshaller( + g_cclosure_user_marshal_VOID__STRING_STRING_INT, G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + + dbus_g_proxy_add_signal(callManagerProxy, "sipCallStateChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_connect_signal(callManagerProxy, "sipCallStateChanged", + G_CALLBACK(sip_call_state_cb), NULL, NULL); + + configurationManagerProxy = dbus_g_proxy_new_for_name(connection, + "org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", + "org.sflphone.SFLphone.ConfigurationManager"); + + /* + configurationManagerProxy = dbus_g_proxy_new_for_name_owner (connection, + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/ConfigurationManager", + "org.sflphone.SFLphone.ConfigurationManager", + &error); + */ + if (!configurationManagerProxy) + { + ERROR ("Failed to get proxy to ConfigurationManager"); + return FALSE; + } + DEBUG ("DBus connected to ConfigurationManager"); + dbus_g_proxy_add_signal(configurationManagerProxy, "accountsChanged", + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(configurationManagerProxy, "accountsChanged", + G_CALLBACK(accounts_changed_cb), NULL, NULL); + + dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__INT, + G_TYPE_NONE, G_TYPE_INT, G_TYPE_INVALID); + dbus_g_proxy_add_signal(configurationManagerProxy, "errorAlert", G_TYPE_INT, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal(configurationManagerProxy, "errorAlert", + G_CALLBACK(error_alert), NULL, NULL); + + /* Defines a default timeout for the proxies */ #if HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT - dbus_g_proxy_set_default_timeout(callManagerProxy, DEFAULT_DBUS_TIMEOUT); - dbus_g_proxy_set_default_timeout(instanceProxy, DEFAULT_DBUS_TIMEOUT); - dbus_g_proxy_set_default_timeout(configurationManagerProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(callManagerProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(instanceProxy, DEFAULT_DBUS_TIMEOUT); + dbus_g_proxy_set_default_timeout(configurationManagerProxy, DEFAULT_DBUS_TIMEOUT); #endif - - return TRUE; + + return TRUE; } - void -dbus_clean () +void +dbus_clean() { - g_object_unref (callManagerProxy); - g_object_unref (configurationManagerProxy); - g_object_unref (instanceProxy); + g_object_unref(callManagerProxy); + g_object_unref(configurationManagerProxy); + g_object_unref(instanceProxy); } - - void -dbus_hold (const callable_obj_t * c) +void +dbus_hold(const callable_obj_t * c) { - DEBUG("dbus_hold %s\n", c->_callID); + DEBUG("dbus_hold %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold ( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hold(callManagerProxy, c->_callID, &error); + if (error) { - ERROR ("Failed to call hold() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call hold() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_unhold (const callable_obj_t * c) +void +dbus_unhold(const callable_obj_t * c) { - DEBUG("dbus_unhold %s\n", c->_callID); + DEBUG("dbus_unhold %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold ( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_unhold(callManagerProxy, c->_callID, &error); + if (error) { - ERROR ("Failed to call unhold() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call unhold() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_hold_conference (const conference_obj_t * c) +void +dbus_hold_conference(const conference_obj_t * c) { - DEBUG("dbus_hold_conference %s\n", c->_confID); + DEBUG("dbus_hold_conference %s\n", c->_confID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hold_conference ( callManagerProxy, c->_confID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hold_conference(callManagerProxy, + c->_confID, &error); + if (error) { - ERROR ("Failed to call hold() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call hold() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_unhold_conference (const conference_obj_t * c) +void +dbus_unhold_conference(const conference_obj_t * c) { - DEBUG("dbus_unhold_conference %s\n", c->_confID); + DEBUG("dbus_unhold_conference %s\n", c->_confID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_unhold_conference ( callManagerProxy, c->_confID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_unhold_conference(callManagerProxy, + c->_confID, &error); + if (error) { - ERROR ("Failed to call unhold() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call unhold() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_hang_up (const callable_obj_t * c) +void +dbus_hang_up(const callable_obj_t * c) { - DEBUG("dbus_hang_up %s\n", c->_callID); - - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up ( callManagerProxy, c->_callID, &error); - if (error) + DEBUG("dbus_hang_up %s\n", c->_callID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hang_up(callManagerProxy, c->_callID, + &error); + if (error) { - ERROR ("Failed to call hang_up() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call hang_up() on CallManager: %s", + error->message); + g_error_free(error); } } - - void -dbus_hang_up_conference (const conference_obj_t * c) +void +dbus_hang_up_conference(const conference_obj_t * c) { - DEBUG("dbus_hang_up_conference %s\n", c->_confID); - - GError *error = NULL; - org_sflphone_SFLphone_CallManager_hang_up_conference ( callManagerProxy, c->_confID, &error); - if (error) + DEBUG("dbus_hang_up_conference %s\n", c->_confID); + + GError *error = NULL; + org_sflphone_SFLphone_CallManager_hang_up_conference(callManagerProxy, + c->_confID, &error); + if (error) { - ERROR ("Failed to call hang_up() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call hang_up() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_transfert (const callable_obj_t * c) +void +dbus_transfert(const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_transfert ( callManagerProxy, c->_callID, c->_trsft_to, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_transfert(callManagerProxy, c->_callID, + c->_trsft_to, &error); + if (error) { - ERROR ("Failed to call transfert() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call transfert() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_accept (const callable_obj_t * c) +void +dbus_accept(const callable_obj_t * c) { #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink( FALSE ); + status_tray_icon_blink(FALSE); #endif - DEBUG("dbus_accept %s\n", c->_callID); + DEBUG("dbus_accept %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_accept ( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_accept(callManagerProxy, c->_callID, &error); + if (error) { - ERROR ("Failed to call accept(%s) on CallManager: %s", c->_callID, - (error->message == NULL ? g_quark_to_string(error->domain): error->message)); - g_error_free (error); + ERROR ("Failed to call accept(%s) on CallManager: %s", c->_callID, + (error->message == NULL ? g_quark_to_string(error->domain): error->message)); + g_error_free(error); } } - void -dbus_refuse (const callable_obj_t * c) +void +dbus_refuse(const callable_obj_t * c) { #if GTK_CHECK_VERSION(2,10,0) - status_tray_icon_blink( FALSE ); + status_tray_icon_blink(FALSE); #endif - DEBUG("dbus_refuse %s\n", c->_callID); + DEBUG("dbus_refuse %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_refuse ( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_refuse(callManagerProxy, c->_callID, &error); + if (error) { - ERROR ("Failed to call refuse() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call refuse() on CallManager: %s", + error->message); + g_error_free(error); } } - - void -dbus_place_call (const callable_obj_t * c) +void +dbus_place_call(const callable_obj_t * c) { - DEBUG("dbus_place_call %s\n", c->_callID); + DEBUG("dbus_place_call %s\n", c->_callID); - GError *error = NULL; - org_sflphone_SFLphone_CallManager_place_call ( callManagerProxy, c->_accountID, c->_callID, c->_peer_number, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_place_call(callManagerProxy, c->_accountID, + c->_callID, c->_peer_number, &error); + if (error) { - ERROR ("Failed to call placeCall() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call placeCall() on CallManager: %s", + error->message); + g_error_free(error); } } -gchar** dbus_account_list() +gchar** +dbus_account_list() { - GError *error = NULL; - char ** array; + GError *error = NULL; + char ** array; - if(!org_sflphone_SFLphone_ConfigurationManager_get_account_list ( configurationManagerProxy, &array, &error)) + if (!org_sflphone_SFLphone_ConfigurationManager_get_account_list( + configurationManagerProxy, &array, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_account_list) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_account_list: %s", error->message); + ERROR("Error while calling get_account_list: %s", error->message); } - g_error_free (error); - return NULL; + g_error_free(error); + return NULL; } - else{ - DEBUG ("DBus called get_account_list() on ConfigurationManager"); - return array; + else + { + DEBUG ("DBus called get_account_list() on ConfigurationManager"); + return array; } } - -GHashTable* dbus_account_details(gchar * accountID) +GHashTable* +dbus_account_details(gchar * accountID) { - GError *error = NULL; - GHashTable * details; + GError *error = NULL; + GHashTable * details; - if(!org_sflphone_SFLphone_ConfigurationManager_get_account_details( configurationManagerProxy, accountID, &details, &error)) + if (!org_sflphone_SFLphone_ConfigurationManager_get_account_details( + configurationManagerProxy, accountID, &details, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_account_details: %s", error->message); + ERROR("Error while calling get_account_details: %s", error->message); } - g_error_free (error); - return NULL; + g_error_free(error); + return NULL; } - else{ - return details; + else + { + return details; } } - void +void dbus_set_credential(account_t *a, int index) { - DEBUG("Sending credential %d to server", index); - GError *error = NULL; - GHashTable * credential = g_ptr_array_index(a->credential_information, index); - - if(credential == NULL) { - DEBUG("Credential %d was deleted", index); - } else { - org_sflphone_SFLphone_ConfigurationManager_set_credential ( - configurationManagerProxy, - a->accountID, - index, - credential, - &error); - } - - if (error) { - ERROR ("Failed to call set_credential() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } -} - void -dbus_set_number_of_credential(account_t *a, int number) -{ - DEBUG("Sending number of credential %d to server", number); - GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_set_number_of_credential( configurationManagerProxy, a->accountID, number, &error); - - if (error) { - ERROR ("Failed to call set_number_of_credential() on ConfigurationManager: %s", - error->message); - g_error_free (error); - } -} - void + DEBUG("Sending credential %d to server", index); + GError *error = NULL; + GHashTable * credential = g_ptr_array_index(a->credential_information, index); + + if (credential == NULL) + { + DEBUG("Credential %d was deleted", index); + } + else + { + org_sflphone_SFLphone_ConfigurationManager_set_credential( + configurationManagerProxy, a->accountID, index, credential, &error); + } + + if (error) + { + ERROR ("Failed to call set_credential() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } +} +void +dbus_set_number_of_credential(account_t *a, int number) +{ + DEBUG("Sending number of credential %d to server", number); + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_number_of_credential( + configurationManagerProxy, a->accountID, number, &error); + + if (error) + { + ERROR ("Failed to call set_number_of_credential() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } +} +void dbus_delete_all_credential(account_t *a) { - DEBUG("Deleting all credentials\n"); - GError *error = NULL; - - org_sflphone_SFLphone_ConfigurationManager_delete_all_credential(configurationManagerProxy, a->accountID, &error); - - if (error) { - ERROR ("Failed to call deleteAllCredential on ConfigurationManager: %s", - error->message); - g_error_free (error); - } + DEBUG("Deleting all credentials\n"); + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_delete_all_credential( + configurationManagerProxy, a->accountID, &error); + + if (error) + { + ERROR ("Failed to call deleteAllCredential on ConfigurationManager: %s", + error->message); + g_error_free(error); + } } - int +int dbus_get_number_of_credential(gchar * accountID) { - GError *error = NULL; - int number = 0; + GError *error = NULL; + int number = 0; + + DEBUG("Getting number of credential for account %s", accountID); - DEBUG("Getting number of credential for account %s", accountID); - - if(!org_sflphone_SFLphone_ConfigurationManager_get_number_of_credential( configurationManagerProxy, accountID, &number, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); + if (!org_sflphone_SFLphone_ConfigurationManager_get_number_of_credential( + configurationManagerProxy, accountID, &number, &error)) + { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) + { + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else { - ERROR("Error while calling get_account_details: %s", error->message); + else + { + ERROR("Error while calling get_account_details: %s", error->message); } - g_error_free (error); - return 0; - } else { - DEBUG("%d credential(s) found for account %s", number, accountID); - return number; + g_error_free(error); + return 0; + } + else + { + DEBUG("%d credential(s) found for account %s", number, accountID); + return number; } } -GHashTable* dbus_get_credential(gchar * accountID, int index) +GHashTable* +dbus_get_credential(gchar * accountID, int index) { - GError *error = NULL; - GHashTable * details; + GError *error = NULL; + GHashTable * details; - if(!org_sflphone_SFLphone_ConfigurationManager_get_credential( configurationManagerProxy, accountID, index, &details, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); - } else { - ERROR("Error while calling get_account_details: %s", error->message); + if (!org_sflphone_SFLphone_ConfigurationManager_get_credential( + configurationManagerProxy, accountID, index, &details, &error)) + { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) + { + ERROR ("Caught remote method (get_account_details) exception %s: %s", dbus_g_error_get_name(error), error->message); } - g_error_free (error); - return NULL; - } else { - return details; + else + { + ERROR("Error while calling get_account_details: %s", error->message); + } + g_error_free(error); + return NULL; + } + else + { + return details; } } -GHashTable* dbus_get_ip2_ip_details(void) +GHashTable* +dbus_get_ip2_ip_details(void) { - GError *error = NULL; - GHashTable * details; - if(!org_sflphone_SFLphone_ConfigurationManager_get_ip2_ip_details( configurationManagerProxy, &details, &error)) + GError *error = NULL; + GHashTable * details; + if (!org_sflphone_SFLphone_ConfigurationManager_get_ip2_ip_details( + configurationManagerProxy, &details, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_ip2_ip_details) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_ip2_ip_details) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_ip2_ip_details: %s", error->message); + ERROR("Error while calling get_ip2_ip_details: %s", error->message); } - g_error_free (error); - return NULL; + g_error_free(error); + return NULL; } - else{ - return details; + else + { + return details; } } - void +void dbus_set_ip2ip_details(GHashTable * properties) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_ip2_ip_details ( - configurationManagerProxy, - properties, - &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_ip2_ip_details( + configurationManagerProxy, properties, &error); + if (error) { - ERROR ("Failed to call set_ip_2ip_details() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call set_ip_2ip_details() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } - void -dbus_send_register ( gchar* accountID , const guint enable) +void +dbus_send_register(gchar* accountID, const guint enable) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_send_register(configurationManagerProxy, accountID, enable ,&error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_send_register( + configurationManagerProxy, accountID, enable, &error); + if (error) { - ERROR ("Failed to call send_register() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call send_register() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } - void +void dbus_remove_account(gchar * accountID) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_remove_account ( - configurationManagerProxy, - accountID, - &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_remove_account( + configurationManagerProxy, accountID, &error); + if (error) { - ERROR ("Failed to call remove_account() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call remove_account() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } - void +void dbus_set_account_details(account_t *a) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_account_details ( - configurationManagerProxy, - a->accountID, - a->properties, - &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_account_details( + configurationManagerProxy, a->accountID, a->properties, &error); + if (error) { - ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call set_account_details() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } - gchar* +gchar* dbus_add_account(account_t *a) { - gchar* accountId; - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_add_account ( - configurationManagerProxy, - a->properties, - &accountId, - &error); - if (error) + gchar* accountId; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_add_account( + configurationManagerProxy, a->properties, &accountId, &error); + if (error) { - ERROR ("Failed to call add_account() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call add_account() on ConfigurationManager: %s", + error->message); + g_error_free(error); } - return accountId; + return accountId; } - void +void dbus_set_volume(const gchar * device, gdouble value) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_volume( - callManagerProxy, - device, - value, - &error); + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_volume(callManagerProxy, device, value, + &error); - if (error) + if (error) { - ERROR ("Failed to call set_volume() on callManagerProxy: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call set_volume() on callManagerProxy: %s", + error->message); + g_error_free(error); } } - - gdouble +gdouble dbus_get_volume(const gchar * device) { - gdouble value; - GError *error = NULL; + gdouble value; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_get_volume( - callManagerProxy, - device, - &value, - &error); + org_sflphone_SFLphone_CallManager_get_volume(callManagerProxy, device, + &value, &error); - if (error) + if (error) { - ERROR ("Failed to call get_volume() on callManagerProxy: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call get_volume() on callManagerProxy: %s", + error->message); + g_error_free(error); } - return value; + return value; } - - void +void dbus_play_dtmf(const gchar * key) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_play_dt_mf( - callManagerProxy, - key, - &error); + org_sflphone_SFLphone_CallManager_play_dt_mf(callManagerProxy, key, &error); - if (error) + if (error) { - ERROR ("Failed to call playDTMF() on callManagerProxy: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call playDTMF() on callManagerProxy: %s", + error->message); + g_error_free(error); } } - void -dbus_start_tone(const int start , const guint type ) +void +dbus_start_tone(const int start, const guint type) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_CallManager_start_tone( - callManagerProxy, - start, - type, - &error); + org_sflphone_SFLphone_CallManager_start_tone(callManagerProxy, start, type, + &error); - if (error) + if (error) { - ERROR ("Failed to call startTone() on callManagerProxy: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call startTone() on callManagerProxy: %s", + error->message); + g_error_free(error); } } - void +void dbus_register(int pid, gchar * name) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_Instance_register( - instanceProxy, - pid, - name, - &error); + org_sflphone_SFLphone_Instance_register(instanceProxy, pid, name, &error); - if (error) + if (error) { - ERROR ("Failed to call register() on instanceProxy: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call register() on instanceProxy: %s", + error->message); + g_error_free(error); } } - void +void dbus_unregister(int pid) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_Instance_unregister( - instanceProxy, - pid, - &error); + org_sflphone_SFLphone_Instance_unregister(instanceProxy, pid, &error); - if (error) + if (error) { - ERROR ("Failed to call unregister() on instanceProxy: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call unregister() on instanceProxy: %s", + error->message); + g_error_free(error); } } - gchar** +gchar** dbus_codec_list() { - GError *error = NULL; - gchar** array = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_codec_list ( - configurationManagerProxy, - &array, - &error); + GError *error = NULL; + gchar** array = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_codec_list( + configurationManagerProxy, &array, &error); - if (error) + if (error) { - ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call get_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free(error); } - return array; + return array; } - gchar** -dbus_codec_details( int payload ) +gchar** +dbus_codec_details(int payload) { - GError *error = NULL; - gchar ** array; - org_sflphone_SFLphone_ConfigurationManager_get_codec_details ( - configurationManagerProxy, - payload, - &array, - &error); + GError *error = NULL; + gchar ** array; + org_sflphone_SFLphone_ConfigurationManager_get_codec_details( + configurationManagerProxy, payload, &array, &error); - if (error) + if (error) { - ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call get_codec_details() on ConfigurationManager: %s", + error->message); + g_error_free(error); } - return array; + return array; } -gchar* dbus_get_current_codec_name (const callable_obj_t * c) +gchar* +dbus_get_current_codec_name(const callable_obj_t * c) { - gchar* codecName= ""; - GError* error = NULL; + gchar* codecName = ""; + GError* error = NULL; - org_sflphone_SFLphone_CallManager_get_current_codec_name ( - callManagerProxy, - c->_callID, - &codecName, - &error); - if(error) + org_sflphone_SFLphone_CallManager_get_current_codec_name(callManagerProxy, + c->_callID, &codecName, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - DEBUG("dbus_get_current_codec_name : codecName : %s", codecName); + DEBUG("dbus_get_current_codec_name : codecName : %s", codecName); - return codecName; + return codecName; } - - - gchar** -dbus_get_active_codec_list() +gchar** +dbus_get_active_codec_list(gchar *accountID) { - gchar ** array; - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list ( - configurationManagerProxy, - &array, - &error); + gchar ** array; + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_active_codec_list( + configurationManagerProxy, accountID, &array, &error); - if (error) + if (error) { - ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call get_active_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free(error); } - return array; + return array; } - void -dbus_set_active_codec_list(const gchar** list) +void +dbus_set_active_codec_list(const gchar** list, const gchar *accountID) { - GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list ( - configurationManagerProxy, - list, - &error); + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_active_codec_list( + configurationManagerProxy, list, accountID, &error); - if (error) + if (error) { - ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call set_active_codec_list() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } /** * Get a list of input supported audio plugins */ - gchar** +gchar** dbus_get_input_audio_plugin_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_input_audio_plugin_list( - configurationManagerProxy, - &array, - &error); - if(error) + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_input_audio_plugin_list( + configurationManagerProxy, &array, &error); + if (error) { - ERROR("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call get_input_audio_plugin_list() on ConfigurationManager: %s", error->message); + g_error_free(error); } - return array; + return array; } /** * Get a list of output supported audio plugins */ - gchar** +gchar** dbus_get_output_audio_plugin_list() { - gchar** array; - GError* error = NULL; + gchar** array; + GError* error = NULL; - if(!org_sflphone_SFLphone_ConfigurationManager_get_output_audio_plugin_list( configurationManagerProxy, &array, &error)) + if (!org_sflphone_SFLphone_ConfigurationManager_get_output_audio_plugin_list( + configurationManagerProxy, &array, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_output_audio_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_output_audio_plugin_list) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_out_audio_plugin_list: %s", error->message); + ERROR("Error while calling get_out_audio_plugin_list: %s", error->message); } - g_error_free (error); - return NULL; + g_error_free(error); + return NULL; } - else{ - return array; + else + { + return array; } } - void +void dbus_set_input_audio_plugin(gchar* audioPlugin) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin( - configurationManagerProxy, - audioPlugin, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_input_audio_plugin( + configurationManagerProxy, audioPlugin, &error); + if (error) { - ERROR("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call set_input_audio_plugin() on ConfigurationManager: %s", error->message); + g_error_free(error); } } - void +void dbus_set_output_audio_plugin(gchar* audioPlugin) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin( - configurationManagerProxy, - audioPlugin, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_output_audio_plugin( + configurationManagerProxy, audioPlugin, &error); + if (error) { - ERROR("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call set_output_audio_plugin() on ConfigurationManager: %s", error->message); + g_error_free(error); } } /** * Get all output devices index supported by current audio manager */ -gchar** dbus_get_audio_output_device_list() +gchar** +dbus_get_audio_output_device_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list( - configurationManagerProxy, - &array, - &error); - if(error) + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_output_device_list( + configurationManagerProxy, &array, &error); + if (error) { - ERROR("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call get_audio_output_device_list() on ConfigurationManager: %s", error->message); + g_error_free(error); } - return array; + return array; } /** * Set audio output device from its index */ - void +void dbus_set_audio_output_device(const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device( - configurationManagerProxy, - index, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_output_device( + configurationManagerProxy, index, &error); + if (error) { - ERROR("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call set_audio_output_device() on ConfigurationManager: %s", error->message); + g_error_free(error); } } /** * Get all input devices index supported by current audio manager */ - gchar** +gchar** dbus_get_audio_input_device_list() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list( - configurationManagerProxy, - &array, - &error); - if(error) + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_input_device_list( + configurationManagerProxy, &array, &error); + if (error) { - ERROR("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call get_audio_input_device_list() on ConfigurationManager: %s", error->message); + g_error_free(error); } - return array; + return array; } /** * Set audio input device from its index */ - void +void dbus_set_audio_input_device(const int index) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device( - configurationManagerProxy, - index, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_input_device( + configurationManagerProxy, index, &error); + if (error) { - ERROR("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call set_audio_input_device() on ConfigurationManager: %s", error->message); + g_error_free(error); } } /** * Get output device index and input device index */ - gchar** +gchar** dbus_get_current_audio_devices_index() { - gchar** array; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index( - configurationManagerProxy, - &array, - &error); - if(error) + gchar** array; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_devices_index( + configurationManagerProxy, &array, &error); + if (error) { - ERROR("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call get_current_audio_devices_index() on ConfigurationManager: %s", error->message); + g_error_free(error); } - return array; + return array; } /** * Get index */ - int +int dbus_get_audio_device_index(const gchar *name) { - int index; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index( - configurationManagerProxy, - name, - &index, - &error); - if(error) + int index; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_device_index( + configurationManagerProxy, name, &index, &error); + if (error) { - ERROR("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call get_audio_device_index() on ConfigurationManager: %s", error->message); + g_error_free(error); } - return index; + return index; } /** * Get audio plugin */ - gchar* +gchar* dbus_get_current_audio_output_plugin() { - gchar* plugin=""; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin( - configurationManagerProxy, - &plugin, - &error); - if(error) + gchar* plugin = ""; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin( + configurationManagerProxy, &plugin, &error); + if (error) { - ERROR("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); - g_error_free(error); + ERROR("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); + g_error_free(error); } - return plugin; + return plugin; } - - gchar* +gchar* dbus_get_ringtone_choice() { - gchar* tone; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice( - configurationManagerProxy, - &tone, - &error); - if(error) + gchar* tone; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_ringtone_choice( + configurationManagerProxy, &tone, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return tone; + return tone; } - void -dbus_set_ringtone_choice( const gchar* tone ) +void +dbus_set_ringtone_choice(const gchar* tone) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice( - configurationManagerProxy, - tone, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_ringtone_choice( + configurationManagerProxy, tone, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - int +int dbus_is_ringtone_enabled() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_ringtone_enabled( - configurationManagerProxy, - &res, - &error); - if(error) + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_ringtone_enabled( + configurationManagerProxy, &res, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return res; + return res; } - void +void dbus_ringtone_enabled() { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled( - configurationManagerProxy, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_ringtone_enabled( + configurationManagerProxy, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - gboolean +gboolean dbus_is_md5_credential_hashing() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_md5_credential_hashing( - configurationManagerProxy, - &res, - &error); - if(error) + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_md5_credential_hashing( + configurationManagerProxy, &res, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return res; + return res; } - void +void dbus_set_md5_credential_hashing(gboolean enabled) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_md5_credential_hashing( - configurationManagerProxy, - enabled, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_md5_credential_hashing( + configurationManagerProxy, enabled, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - int +int dbus_is_iax2_enabled() { - int res; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled( - configurationManagerProxy, - &res, - &error); - if(error) + int res; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_is_iax2_enabled( + configurationManagerProxy, &res, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return res; + return res; } - int +int dbus_get_dialpad() { - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_dialpad( - configurationManagerProxy, - &state, - &error); - if(error) + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_dialpad( + configurationManagerProxy, &state, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return state; + return state; } -void dbus_set_dialpad (gboolean display) +void +dbus_set_dialpad(gboolean display) { - - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_dialpad( - configurationManagerProxy, - display, - &error); - if(error) + + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_dialpad( + configurationManagerProxy, display, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - int +int dbus_get_searchbar() { - int state; - GError* error = NULL; - if(!org_sflphone_SFLphone_ConfigurationManager_get_searchbar( configurationManagerProxy, &state, &error)) + int state; + GError* error = NULL; + if (!org_sflphone_SFLphone_ConfigurationManager_get_searchbar( + configurationManagerProxy, &state, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_searchbar) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_searchbar) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_searchbar: %s", error->message); + ERROR("Error while calling get_searchbar: %s", error->message); } - g_error_free (error); - return -1; + g_error_free(error); + return -1; } - else + else { - return state; + return state; } } - void -dbus_set_searchbar( ) +void +dbus_set_searchbar() { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_searchbar( - configurationManagerProxy, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_searchbar( + configurationManagerProxy, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - int +int dbus_get_volume_controls() { - int state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_volume_controls( - configurationManagerProxy, - &state, - &error); - if(error) + int state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_volume_controls( + configurationManagerProxy, &state, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return state; + return state; } - void -dbus_set_volume_controls (gboolean display) +void +dbus_set_volume_controls(gboolean display) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_volume_controls( - configurationManagerProxy, - display, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_volume_controls( + configurationManagerProxy, display, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } @@ -1712,719 +1665,955 @@ void dbus_join_participant(const gchar* sel_callID, const gchar* drag_callID) { - DEBUG("dbus_join_participant %s and %s\n", sel_callID, drag_callID); + DEBUG("dbus_join_participant %s and %s\n", sel_callID, drag_callID); + + GError* error = NULL; - GError* error = NULL; - - org_sflphone_SFLphone_CallManager_join_participant ( - callManagerProxy, - sel_callID, - drag_callID, - &error); - if(error) + org_sflphone_SFLphone_CallManager_join_participant(callManagerProxy, + sel_callID, drag_callID, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - + } void dbus_add_participant(const gchar* callID, const gchar* confID) { - DEBUG("dbus_add_participant %s and %s\n", callID, confID); + DEBUG("dbus_add_participant %s and %s\n", callID, confID); + + GError* error = NULL; - GError* error = NULL; - - org_sflphone_SFLphone_CallManager_add_participant ( - callManagerProxy, - callID, - confID, - &error); - if(error) + org_sflphone_SFLphone_CallManager_add_participant(callManagerProxy, callID, + confID, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - + } void dbus_add_main_participant(const gchar* confID) { - DEBUG("dbus_add_participant %s\n", confID); + DEBUG("dbus_add_participant %s\n", confID); - GError* error = NULL; + GError* error = NULL; - org_sflphone_SFLphone_CallManager_add_main_participant ( - callManagerProxy, - confID, - &error); - if(error) + org_sflphone_SFLphone_CallManager_add_main_participant(callManagerProxy, + confID, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - - void +void dbus_detach_participant(const gchar* callID) { - DEBUG("dbus_detach_participant %s\n", callID); + DEBUG("dbus_detach_participant %s\n", callID); - GError* error = NULL; - org_sflphone_SFLphone_CallManager_detach_participant( - callManagerProxy, - callID, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_CallManager_detach_participant(callManagerProxy, + callID, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - -} +} dbus_join_conference(const gchar* sel_confID, const gchar* drag_confID) { - DEBUG("dbus_join_conference %s and %s\n", sel_confID, drag_confID); + DEBUG("dbus_join_conference %s and %s\n", sel_confID, drag_confID); - GError* error = NULL; - - org_sflphone_SFLphone_CallManager_join_conference ( - callManagerProxy, - sel_confID, - drag_confID, - &error); - if(error) + GError* error = NULL; + + org_sflphone_SFLphone_CallManager_join_conference(callManagerProxy, + sel_confID, drag_confID, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - -} - +} - void +void dbus_set_record(const gchar* id) { - DEBUG("dbus_set_record %s\n", id); + DEBUG("dbus_set_record %s\n", id); - GError* error = NULL; - org_sflphone_SFLphone_CallManager_set_recording ( - callManagerProxy, - id, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_CallManager_set_recording(callManagerProxy, id, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - - gboolean +gboolean dbus_get_is_recording(const callable_obj_t * c) { - DEBUG("dbus_get_is_recording %s\n", c->_callID); - GError* error = NULL; - gboolean isRecording; - org_sflphone_SFLphone_CallManager_get_is_recording ( - callManagerProxy, - c->_callID, - &isRecording, - &error); - if(error) + DEBUG("dbus_get_is_recording %s\n", c->_callID); + GError* error = NULL; + gboolean isRecording; + org_sflphone_SFLphone_CallManager_get_is_recording(callManagerProxy, + c->_callID, &isRecording, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - //DEBUG("RECORDING: %i",isRecording); - return isRecording; + //DEBUG("RECORDING: %i",isRecording); + return isRecording; } - void +void dbus_set_record_path(const gchar* path) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_record_path ( - configurationManagerProxy, - path, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_record_path( + configurationManagerProxy, path, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - gchar* +gchar* dbus_get_record_path(void) { - GError* error = NULL; - gchar *path; - org_sflphone_SFLphone_ConfigurationManager_get_record_path ( - configurationManagerProxy, - &path, - &error); - if(error) + GError* error = NULL; + gchar *path; + org_sflphone_SFLphone_ConfigurationManager_get_record_path( + configurationManagerProxy, &path, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return path; + return path; } -void dbus_set_history_limit (const guint days) +void +dbus_set_history_limit(const guint days) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_history_limit( - configurationManagerProxy, - days, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_history_limit( + configurationManagerProxy, days, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } -void dbus_set_history_enabled () +void +dbus_set_history_enabled() { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_history_enabled( - configurationManagerProxy, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_history_enabled( + configurationManagerProxy, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } -gchar* dbus_get_history_enabled () +gchar* +dbus_get_history_enabled() { - gchar* state; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_history_enabled( - configurationManagerProxy, - &state, - &error); - if(error) + gchar* state; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_history_enabled( + configurationManagerProxy, &state, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return state; + return state; } - - -guint dbus_get_history_limit (void) +guint +dbus_get_history_limit(void) { - GError* error = NULL; - gint days=30; - org_sflphone_SFLphone_ConfigurationManager_get_history_limit( - configurationManagerProxy, - &days, - &error); - if(error) + GError* error = NULL; + gint days = 30; + org_sflphone_SFLphone_ConfigurationManager_get_history_limit( + configurationManagerProxy, &days, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return (guint)days; + return (guint) days; } - void -dbus_start_hidden( void ) +void +dbus_start_hidden(void) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_start_hidden( - configurationManagerProxy, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_start_hidden( + configurationManagerProxy, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - - int -dbus_is_start_hidden( void ) +int +dbus_is_start_hidden(void) { - GError* error = NULL; - int state; - org_sflphone_SFLphone_ConfigurationManager_is_start_hidden( - configurationManagerProxy, - &state, - &error); - if(error) + GError* error = NULL; + int state; + org_sflphone_SFLphone_ConfigurationManager_is_start_hidden( + configurationManagerProxy, &state, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return state; + return state; } - int -dbus_popup_mode( void ) +int +dbus_popup_mode(void) { - GError* error = NULL; - int state; - org_sflphone_SFLphone_ConfigurationManager_popup_mode( - configurationManagerProxy, - &state, - &error); - if(error) + GError* error = NULL; + int state; + org_sflphone_SFLphone_ConfigurationManager_popup_mode( + configurationManagerProxy, &state, &error); + if (error) { - g_error_free(error); + g_error_free(error); } - return state; + return state; } - void -dbus_switch_popup_mode( void ) +void +dbus_switch_popup_mode(void) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_switch_popup_mode( - configurationManagerProxy, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_switch_popup_mode( + configurationManagerProxy, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - void -dbus_set_notify( void ) +void +dbus_set_notify(void) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_notify( - configurationManagerProxy, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_notify( + configurationManagerProxy, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - guint -dbus_get_notify( void ) +guint +dbus_get_notify(void) { - gint level; - GError* error = NULL; - if( !org_sflphone_SFLphone_ConfigurationManager_get_notify( configurationManagerProxy,&level, &error) ) + gint level; + GError* error = NULL; + if (!org_sflphone_SFLphone_ConfigurationManager_get_notify( + configurationManagerProxy, &level, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_notify) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_notify) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR ("Error while calling get_notify: %s", error->message); + ERROR ("Error while calling get_notify: %s", error->message); } - g_error_free (error); - return 0; + g_error_free(error); + return 0; } - else{ - return (guint)level; + else + { + return (guint) level; } } - void -dbus_set_audio_manager( int api ) +void +dbus_set_audio_manager(int api) { - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_audio_manager( - configurationManagerProxy, - api, - &error); - if(error) + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_audio_manager( + configurationManagerProxy, api, &error); + if (error) { - g_error_free(error); + g_error_free(error); } } - int -dbus_get_audio_manager( void ) +int +dbus_get_audio_manager(void) { - int api; - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_audio_manager( - configurationManagerProxy, - &api, - &error); - if(error) + int api; + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_audio_manager( + configurationManagerProxy, &api, &error); + if (error) { - ERROR("Error calling dbus_get_audio_manager"); - g_error_free(error); + ERROR("Error calling dbus_get_audio_manager"); + g_error_free(error); } - return api; + return api; } /* - void -dbus_set_sip_address( const gchar* address ) -{ - GError* error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_sip_address( - configurationManagerProxy, - address, - &error); - if(error) - { - g_error_free(error); - } -} -*/ + void + dbus_set_sip_address( const gchar* address ) + { + GError* error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_sip_address( + configurationManagerProxy, + address, + &error); + if(error) + { + g_error_free(error); + } + } + */ - /* +/* - gint -dbus_get_sip_address( void ) -{ - GError* error = NULL; - gint address; - org_sflphone_SFLphone_ConfigurationManager_get_sip_address( - configurationManagerProxy, - &address, - &error); - if(error) - { - g_error_free(error); - } - return address; -} + gint + dbus_get_sip_address( void ) + { + GError* error = NULL; + gint address; + org_sflphone_SFLphone_ConfigurationManager_get_sip_address( + configurationManagerProxy, + &address, + &error); + if(error) + { + g_error_free(error); + } + return address; + } */ -GHashTable* dbus_get_addressbook_settings (void) { +GHashTable* +dbus_get_addressbook_settings(void) +{ - GError *error = NULL; - GHashTable *results = NULL; + GError *error = NULL; + GHashTable *results = NULL; - //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); - org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings (configurationManagerProxy, &results, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings( + configurationManagerProxy, &results, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + g_error_free(error); } - return results; + return results; } -void dbus_set_addressbook_settings (GHashTable * settings){ +void +dbus_set_addressbook_settings(GHashTable * settings) +{ - GError *error = NULL; + GError *error = NULL; - DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); + DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); - org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings (configurationManagerProxy, settings, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings( + configurationManagerProxy, settings, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings"); + g_error_free(error); } } -gchar** dbus_get_addressbook_list (void) { +gchar** +dbus_get_addressbook_list(void) +{ - GError *error = NULL; - gchar** array; + GError *error = NULL; + gchar** array; - org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list (configurationManagerProxy, &array, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list( + configurationManagerProxy, &array, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_list"); + g_error_free(error); } - return array; + return array; } -void dbus_set_addressbook_list (const gchar** list){ +void +dbus_set_addressbook_list(const gchar** list) +{ - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list(configurationManagerProxy, list, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list( + configurationManagerProxy, list, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_addressbook_list"); + g_error_free(error); } } -GHashTable* dbus_get_hook_settings (void) { +GHashTable* +dbus_get_hook_settings(void) +{ - GError *error = NULL; - GHashTable *results = NULL; + GError *error = NULL; + GHashTable *results = NULL; - //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); + //DEBUG ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings"); - org_sflphone_SFLphone_ConfigurationManager_get_hook_settings (configurationManagerProxy, &results, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_get_hook_settings( + configurationManagerProxy, &results, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings"); + g_error_free(error); } - return results; + return results; } -void dbus_set_hook_settings (GHashTable * settings){ +void +dbus_set_hook_settings(GHashTable * settings) +{ - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_hook_settings (configurationManagerProxy, settings, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_set_hook_settings( + configurationManagerProxy, settings, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings"); + g_error_free(error); } } -GHashTable* dbus_get_call_details (const gchar *callID) +GHashTable* +dbus_get_call_details(const gchar *callID) { - GError *error = NULL; - GHashTable *details = NULL; + GError *error = NULL; + GHashTable *details = NULL; - org_sflphone_SFLphone_CallManager_get_call_details (callManagerProxy, callID, &details, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_details"); - g_error_free (error); + org_sflphone_SFLphone_CallManager_get_call_details(callManagerProxy, callID, + &details, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_details"); + g_error_free(error); } - return details; + return details; } -gchar** dbus_get_call_list (void) +gchar** +dbus_get_call_list(void) { - GError *error = NULL; - gchar **list = NULL; + GError *error = NULL; + gchar **list = NULL; - org_sflphone_SFLphone_CallManager_get_call_list (callManagerProxy, &list, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_list"); - g_error_free (error); + org_sflphone_SFLphone_CallManager_get_call_list(callManagerProxy, &list, + &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_call_list"); + g_error_free(error); } - return list; + return list; } -gchar** dbus_get_conference_list (void) +gchar** +dbus_get_conference_list(void) { - GError *error = NULL; - gchar **list = NULL; + GError *error = NULL; + gchar **list = NULL; - org_sflphone_SFLphone_CallManager_get_conference_list (callManagerProxy, &list, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_list"); - g_error_free (error); + org_sflphone_SFLphone_CallManager_get_conference_list(callManagerProxy, + &list, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_list"); + g_error_free(error); } - return list; + return list; } - -gchar** dbus_get_participant_list (const char * confID) +gchar** +dbus_get_participant_list(const char * confID) { - GError *error = NULL; - gchar **list = NULL; + GError *error = NULL; + gchar **list = NULL; - DEBUG("get participant list") + DEBUG("get participant list") - org_sflphone_SFLphone_CallManager_get_participant_list (callManagerProxy, confID, &list, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_participant_list"); - g_error_free (error); + org_sflphone_SFLphone_CallManager_get_participant_list(callManagerProxy, + confID, &list, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_participant_list"); + g_error_free(error); } - return list; + return list; } - -GHashTable* dbus_get_conference_details (const gchar *confID) +GHashTable* +dbus_get_conference_details(const gchar *confID) { - GError *error = NULL; - GHashTable *details = NULL; + GError *error = NULL; + GHashTable *details = NULL; - org_sflphone_SFLphone_CallManager_get_conference_details (callManagerProxy, confID, &details, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_details"); - g_error_free (error); + org_sflphone_SFLphone_CallManager_get_conference_details(callManagerProxy, + confID, &details, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_conference_details"); + g_error_free(error); } - return details; + return details; } -void dbus_set_accounts_order (const gchar* order) { +void +dbus_set_accounts_order(const gchar* order) +{ - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_accounts_order (configurationManagerProxy, order, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_accounts_order"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_set_accounts_order( + configurationManagerProxy, order, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_accounts_order"); + g_error_free(error); } } -GHashTable* dbus_get_history (void) +GHashTable* +dbus_get_history(void) { - GError *error = NULL; - GHashTable *entries = NULL; + GError *error = NULL; + GHashTable *entries = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_history (configurationManagerProxy, &entries, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_history"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_get_history( + configurationManagerProxy, &entries, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_get_history"); + g_error_free(error); } - return entries; + return entries; } -void dbus_set_history (GHashTable* entries) +void +dbus_set_history(GHashTable* entries) { - GError *error = NULL; + GError *error = NULL; - org_sflphone_SFLphone_ConfigurationManager_set_history (configurationManagerProxy, entries, &error); - if (error){ - ERROR ("Error calling org_sflphone_SFLphone_CallManager_set_history"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_set_history( + configurationManagerProxy, entries, &error); + if (error) + { + ERROR ("Error calling org_sflphone_SFLphone_CallManager_set_history"); + g_error_free(error); } } - void -dbus_confirm_sas (const callable_obj_t * c) +void +dbus_confirm_sas(const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_sa_sverified ( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_sa_sverified(callManagerProxy, + c->_callID, &error); + if (error) { - ERROR ("Failed to call setSASVerified() on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call setSASVerified() on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_reset_sas (const callable_obj_t * c) +void +dbus_reset_sas(const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_reset_sa_sverified ( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_reset_sa_sverified(callManagerProxy, + c->_callID, &error); + if (error) { - ERROR ("Failed to call resetSASVerified on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call resetSASVerified on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_set_confirm_go_clear (const callable_obj_t * c) +void +dbus_set_confirm_go_clear(const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_set_confirm_go_clear( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_set_confirm_go_clear(callManagerProxy, + c->_callID, &error); + if (error) { - ERROR ("Failed to call set_confirm_go_clear on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call set_confirm_go_clear on CallManager: %s", + error->message); + g_error_free(error); } } - void -dbus_request_go_clear (const callable_obj_t * c) +void +dbus_request_go_clear(const callable_obj_t * c) { - GError *error = NULL; - org_sflphone_SFLphone_CallManager_request_go_clear( callManagerProxy, c->_callID, &error); - if (error) + GError *error = NULL; + org_sflphone_SFLphone_CallManager_request_go_clear(callManagerProxy, + c->_callID, &error); + if (error) { - ERROR ("Failed to call request_go_clear on CallManager: %s", - error->message); - g_error_free (error); + ERROR ("Failed to call request_go_clear on CallManager: %s", + error->message); + g_error_free(error); } } - gchar** +gchar** dbus_get_supported_tls_method() { - GError *error = NULL; - gchar** array = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_supported_tls_method (configurationManagerProxy, &array, &error); + GError *error = NULL; + gchar** array = NULL; + org_sflphone_SFLphone_ConfigurationManager_get_supported_tls_method( + configurationManagerProxy, &array, &error); - if (error != NULL) { - ERROR ("Failed to call get_supported_tls_method() on ConfigurationManager: %s", - error->message); - g_error_free (error); + if (error != NULL) + { + ERROR ("Failed to call get_supported_tls_method() on ConfigurationManager: %s", + error->message); + g_error_free(error); } - return array; + return array; } -GHashTable* dbus_get_tls_settings_default(void) +GHashTable* +dbus_get_tls_settings_default(void) { - GError *error = NULL; - GHashTable *results = NULL; + GError *error = NULL; + GHashTable *results = NULL; - org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default(configurationManagerProxy, &results, &error); - if (error != NULL){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default( + configurationManagerProxy, &results, &error); + if (error != NULL) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_tls_settings_default"); + g_error_free(error); } - return results; + return results; } - -gchar * dbus_get_address_from_interface_name(gchar* interface) +gchar * +dbus_get_address_from_interface_name(gchar* interface) { - GError *error = NULL; - gchar * address; + GError *error = NULL; + gchar * address; - org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name ( configurationManagerProxy, interface, &address, &error); - if (error != NULL){ - ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name\n"); - g_error_free (error); + org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name( + configurationManagerProxy, interface, &address, &error); + if (error != NULL) + { + ERROR ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_addr_from_interface_name\n"); + g_error_free(error); } - return address; + return address; } +gchar ** +dbus_get_all_ip_interface(void) +{ + GError *error = NULL; + gchar ** array; -gchar ** dbus_get_all_ip_interface(void) + if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface( + configurationManagerProxy, &array, &error)) + { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) + { + ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); + } + else + { + ERROR("Error while calling get_all_ip_interface: %s", error->message); + } + g_error_free(error); + return NULL; + } + else + { + DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); + return array; + } +} + +gchar ** +dbus_get_all_ip_interface_by_name(void) { - GError *error = NULL; - gchar ** array; + GError *error = NULL; + gchar ** array; - if(!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface ( configurationManagerProxy, &array, &error)) + if (!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface_by_name( + configurationManagerProxy, &array, &error)) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_all_ip_interface: %s", error->message); + ERROR("Error while calling get_all_ip_interface: %s", error->message); } - g_error_free (error); - return NULL; + g_error_free(error); + return NULL; + } + else + { + DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); + return array; + } +} + +guint +dbus_get_window_width(void) +{ + + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_width( + configurationManagerProxy, &value, &error); + + if (error != NULL) + { + ERROR ("Failed to call get_window_width() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } + return value; +} + +guint +dbus_get_window_height(void) +{ + + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_height( + configurationManagerProxy, &value, &error); + + if (error != NULL) + { + ERROR ("Failed to call get_window_height() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } + return value; +} + +void +dbus_set_window_width(const guint width) +{ + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_window_width( + configurationManagerProxy, width, &error); + + if (error != NULL) + { + ERROR ("Failed to call set_window_width() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } +} + +void +dbus_set_window_height(const guint height) +{ + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_window_height( + configurationManagerProxy, height, &error); + + if (error != NULL) + { + ERROR ("Failed to call set_window_height() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } +} + +guint +dbus_get_window_position_x(void) +{ + + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_position_x( + configurationManagerProxy, &value, &error); + + if (error != NULL) + { + ERROR ("Failed to call get_window_position_x() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } + return value; +} + +guint +dbus_get_window_position_y(void) +{ + + GError *error = NULL; + guint value; + + org_sflphone_SFLphone_ConfigurationManager_get_window_position_y( + configurationManagerProxy, &value, &error); + + if (error != NULL) + { + ERROR ("Failed to call get_window_position_y() on ConfigurationManager: %s", + error->message); + g_error_free(error); } - else{ - DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); - return array; + return value; +} + +void +dbus_set_window_position_x(const guint posx) +{ + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_window_position_x( + configurationManagerProxy, posx, &error); + + if (error != NULL) + { + ERROR ("Failed to call set_window_position_x() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } -gchar ** dbus_get_all_ip_interface_by_name(void) +void +dbus_set_window_position_y(const guint posy) { - GError *error = NULL; - gchar ** array; - if(!org_sflphone_SFLphone_ConfigurationManager_get_all_ip_interface_by_name ( configurationManagerProxy, &array, &error)) + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_window_position_y( + configurationManagerProxy, posy, &error); + + if (error != NULL) { - if(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) + ERROR ("Failed to call set_window_position_y() on ConfigurationManager: %s", + error->message); + g_error_free(error); + } +} + +GHashTable* +dbus_get_shortcuts(void) +{ + GError *error = NULL; + GHashTable * shortcuts; + if (!org_sflphone_SFLphone_ConfigurationManager_get_shortcuts( + configurationManagerProxy, &shortcuts, &error)) + { + if (error->domain == DBUS_GERROR && error->code + == DBUS_GERROR_REMOTE_EXCEPTION) { - ERROR ("Caught remote method (get_all_ip_interface) exception %s: %s", dbus_g_error_get_name(error), error->message); + ERROR ("Caught remote method (get_shortcuts) exception %s: %s", dbus_g_error_get_name(error), error->message); } - else + else { - ERROR("Error while calling get_all_ip_interface: %s", error->message); + ERROR("Error while calling get_shortcuts: %s", error->message); } - g_error_free (error); - return NULL; + g_error_free(error); + return NULL; + } + else + { + return shortcuts; } - else{ - DEBUG ("DBus called get_all_ip_interface() on ConfigurationManager"); - return array; +} + +void +dbus_set_shortcuts(GHashTable * shortcuts) +{ + GError *error = NULL; + org_sflphone_SFLphone_ConfigurationManager_set_shortcuts( + configurationManagerProxy, shortcuts, &error); + if (error) + { + ERROR ("Failed to call set_shortcuts() on ConfigurationManager: %s", + error->message); + g_error_free(error); } } + +void dbus_enable_status_icon (const gchar *value) { + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_enable_status_icon (configurationManagerProxy, value, &error); + + if (error != NULL) { + ERROR ("Failed to call enable_status_icon on ConfigurationManager: %s", + error->message); + g_error_free (error); + } +} + +gchar* dbus_is_status_icon_enabled (void) { + + GError *error = NULL; + gchar* value = TRUE; + + org_sflphone_SFLphone_ConfigurationManager_is_status_icon_enabled (configurationManagerProxy, &value, &error); + + if (error != NULL) { + ERROR ("Failed to call is_status_icon_enabled on ConfigurationManager: %s", + error->message); + g_error_free (error); + } + return value; +} + diff --git a/sflphone-client-gnome/src/dbus/dbus.h b/sflphone-client-gnome/src/dbus/dbus.h index fb9662231fe2dc10f5706e2bf7ddcaa74d3ea115..394b1505695bf84b6c5cfa6e3e44cc5cd14461b8 100644 --- a/sflphone-client-gnome/src/dbus/dbus.h +++ b/sflphone-client-gnome/src/dbus/dbus.h @@ -227,13 +227,13 @@ gchar** dbus_default_codec_list(); * ConfigurationManager - Get the list of the codecs used for media negociation * @return gchar** The list of codecs */ -gchar** dbus_get_active_codec_list( void ); +gchar** dbus_get_active_codec_list (gchar *accountID); /** * ConfigurationManager - Set the list of codecs used for media negociation * @param list The list of codecs */ -void dbus_set_active_codec_list( const gchar** list ); +void dbus_set_active_codec_list (const gchar** list, const gchar*); /** * CallManager - return the codec name @@ -597,5 +597,19 @@ gchar** dbus_get_supported_tls_method(); gchar** dbus_get_participant_list (const char * confID); +guint dbus_get_window_width (void); +guint dbus_get_window_height (void); +void dbus_set_window_height (const guint height); +void dbus_set_window_width (const guint width); +guint dbus_get_window_position_x (void); +guint dbus_get_window_position_y (void); +void dbus_set_window_position_x (const guint posx); +void dbus_set_window_position_y (const guint posy); + +GHashTable* dbus_get_shortcuts(void); +void dbus_set_shortcuts(GHashTable * shortcuts); + +void dbus_enable_status_icon (const gchar*); +gchar* dbus_is_status_icon_enabled (void); #endif diff --git a/sflphone-client-gnome/src/dbus/shortcutsmanager-introspec.xml b/sflphone-client-gnome/src/dbus/shortcutsmanager-introspec.xml new file mode 100644 index 0000000000000000000000000000000000000000..89d39efb192ecd3fe0604f080a95ff58129368d1 --- /dev/null +++ b/sflphone-client-gnome/src/dbus/shortcutsmanager-introspec.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.ContactManager"> + + <!-- Contacts related methods --> + + <!-- Called by the client to get all saved contacts --> + <method name="getContacts"> + <arg type="s" name="accountID" direction="in"/> + <arg type="a{ss}" name="details" direction="out"/> + </method> + + <!-- Called by the client to save all local contacts --> + <method name="setContacts"> + <arg type="s" name="accountID" direction="in"/> + <arg type="a{ss}" name="details" direction="in"/> + </method> + + <!-- /////////////////////// --> + + <!-- Presence related methods --> + + <!-- Called by the client to set its new presence status --> + <method name="setPresence"> + <arg type="s" name="accountID" direction="in"/> + <arg type="s" name="presence" direction="in"/> + <arg type="s" name="additionalInfo" direction="in"/> + </method> + + <!-- Called by the daemon when a contact presence changes --> + <method name="setContactPresence"> + <arg type="s" name="accountID" direction="in"/> + <arg type="s" name="presence" direction="in"/> + <arg type="s" name="additionalInfo" direction="in"/> + </method> + + </interface> +</node> diff --git a/sflphone-client-gnome/src/main.c b/sflphone-client-gnome/src/main.c index fffd9a831b849f5b91b4c97625bd9ff1f2d7f156..1d656b8f85f75128bdab778290f77ad46200ec39 100644 --- a/sflphone-client-gnome/src/main.c +++ b/sflphone-client-gnome/src/main.c @@ -29,13 +29,15 @@ #include <gtk/gtk.h> #include <stdlib.h> +#include "shortcuts.h" + /** * Stop logging engine */ static void -shutdown_logging() +shutdown_logging () { - if (log4c_fini()) + if (log4c_fini ()) { ERROR("log4c_fini() failed"); } @@ -45,87 +47,92 @@ shutdown_logging() * Start loggin engine */ static void -startup_logging() +startup_logging () { - log4c_init(); - if (log4c_load(DATA_DIR "/log4crc") == -1) - g_warning("Cannot load log4j configuration file : %s",DATA_DIR "/log4crc"); + log4c_init (); + if (log4c_load (DATA_DIR "/log4crc") == -1) + g_warning ("Cannot load log4j configuration file : %s", DATA_DIR "/log4crc"); - log4c_sfl_gtk_category = log4c_category_get("org.sflphone.gtk"); + log4c_sfl_gtk_category = log4c_category_get ("org.sflphone.gtk"); } int -main(int argc, char *argv[]) +main (int argc, char *argv[]) { // Handle logging int i; + gboolean statusicon = FALSE; // Startup logging - startup_logging(); + startup_logging (); // Check arguments if debug mode is activated for (i = 0; i < argc; i++) - if (g_strcmp0(argv[i], "--debug") == 0) - log4c_category_set_priority(log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG); + if (g_strcmp0 (argv[i], "--debug") == 0) + log4c_category_set_priority (log4c_sfl_gtk_category, LOG4C_PRIORITY_DEBUG); // Start GTK application - gtk_init(&argc, &argv); + gtk_init (&argc, &argv); - g_print("%s %s\n", PACKAGE, VERSION); - g_print("Copyright (c) 2005 2006 2007 2008 2009 Savoir-faire Linux Inc.\n"); - g_print( + g_print ("%s %s\n", PACKAGE, VERSION); + g_print ("Copyright (c) 2005 2006 2007 2008 2009 Savoir-faire Linux Inc.\n"); + g_print ( "This is free software. You may redistribute copies of it under the terms of\n\ the GNU General Public License Version 3 <http://www.gnu.org/licenses/gpl.html>.\n\ There is NO WARRANTY, to the extent permitted by law.\n\n"); DEBUG("Logging Started"); - srand(time(NULL)); + srand (time (NULL)); // Internationalization - bindtextdomain("sflphone-client-gnome", LOCALEDIR); - textdomain("sflphone-client-gnome"); + bindtextdomain ("sflphone-client-gnome", LOCALEDIR); + textdomain ("sflphone-client-gnome"); // Initialises the GNOME libraries - gnome_program_init ( "sflphone", VERSION, - LIBGNOMEUI_MODULE, argc, argv, - GNOME_PROGRAM_STANDARD_PROPERTIES, - NULL); + gnome_program_init ("sflphone", VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PROGRAM_STANDARD_PROPERTIES, + NULL) ; - if (sflphone_init()) + if (sflphone_init ()) { -#if GTK_CHECK_VERSION(2,10,0) - show_status_icon(); -#endif - create_main_window(); -#if GTK_CHECK_VERSION(2,10,0) - if (dbus_is_start_hidden()) + if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) + statusicon = TRUE; + + if (statusicon) show_status_icon (); + create_main_window (); + + if (statusicon && dbus_is_start_hidden ()) { - gtk_widget_hide(GTK_WIDGET( get_main_window() )); - set_minimized(TRUE); + gtk_widget_hide (GTK_WIDGET( get_main_window() )); + set_minimized (TRUE); } -#endif - status_bar_display_account(); - // Load the history - sflphone_fill_history (); + status_bar_display_account (); + + // Load the history + sflphone_fill_history (); - // Get the active calls and conferences at startup - sflphone_fill_call_list (); - sflphone_fill_conference_list(); + // Get the active calls and conferences at startup + sflphone_fill_call_list (); + sflphone_fill_conference_list (); - // Update the GUI - update_actions (); - - /* start the main loop */ - gtk_main(); + // Update the GUI + update_actions (); + + shortcuts_initialize_bindings(); + + /* start the main loop */ + gtk_main (); } // Cleanly stop logging - shutdown_logging(); + shutdown_logging (); + + shortcuts_destroy_bindings(); return 0; } diff --git a/sflphone-client-gnome/src/mainwindow.c b/sflphone-client-gnome/src/mainwindow.c index 8218938509eddeb310adac4d2670abdd0eaa3b67..0f34b5df9b82e507dd12d20461ac46be9faeb446 100644 --- a/sflphone-client-gnome/src/mainwindow.c +++ b/sflphone-client-gnome/src/mainwindow.c @@ -37,400 +37,475 @@ /** Local variables */ GtkUIManager *ui_manager = NULL; GtkAccelGroup * accelGroup = NULL; -GtkWidget * window = NULL; -GtkWidget * subvbox = NULL; -GtkWidget * vbox = NULL; -GtkWidget * dialpad = NULL; +GtkWidget * window = NULL; +GtkWidget * subvbox = NULL; +GtkWidget * vbox = NULL; +GtkWidget * dialpad = NULL; GtkWidget * speaker_control = NULL; GtkWidget * mic_control = NULL; GtkWidget * statusBar = NULL; GtkWidget * filterEntry = NULL; PidginScrollBook *embedded_error_notebook; +static gboolean +window_configure_cb (GtkWidget *win, GdkEventConfigure *event) +{ + + int pos_x, pos_y; + + dbus_set_window_width ((guint) event->width); + dbus_set_window_height ((guint) event->height); + + gtk_window_get_position (GTK_WINDOW (window), &pos_x, &pos_y); + dbus_set_window_position_x ((guint) pos_x); + dbus_set_window_position_y ((guint) pos_y); + + return FALSE; +} + /** * Minimize the main window. */ - static gboolean +static gboolean on_delete (GtkWidget * widget UNUSED, gpointer data UNUSED) { -#if GTK_CHECK_VERSION(2,10,0) - gtk_widget_hide(GTK_WIDGET( get_main_window() )); - set_minimized( TRUE ); -#endif - return TRUE; + + if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) { + gtk_widget_hide (GTK_WIDGET( get_main_window() )); + set_minimized (TRUE); + } + else { + sflphone_quit (); + } + return TRUE; } /** Ask the user if he wants to hangup current calls */ gboolean -main_window_ask_quit(){ - guint count = calllist_get_size(current_calls); - GtkWidget * dialog; - gint response; - gchar * question; - - if(count == 1) - { - question = _("There is one call in progress."); - } - else - { - question = _("There are calls in progress."); - } - - dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window) , - GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_YES_NO, - "%s\n%s", - question, - _("Do you still want to quit?") ); - - - response = gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_destroy (dialog); - if(response == GTK_RESPONSE_YES) - { - return TRUE; - } - else if(response == GTK_RESPONSE_NO) - { - return FALSE; - } - return TRUE; -} +main_window_ask_quit () +{ + guint count = calllist_get_size (current_calls); + GtkWidget * dialog; + gint response; + gchar * question; + + if (count == 1) + { + question = _("There is one call in progress."); + } + else + { + question = _("There are calls in progress."); + } + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), + GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, "%s\n%s", + question, _("Do you still want to quit?") ); + response = gtk_dialog_run (GTK_DIALOG (dialog)); + + gtk_widget_destroy (dialog); + if (response == GTK_RESPONSE_YES) + { + return TRUE; + } + else if (response == GTK_RESPONSE_NO) + { + return FALSE; + } + return TRUE; +} - static gboolean +static gboolean on_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data UNUSED) { - DEBUG("On key released from Main Window : %s", gtk_widget_get_name(widget)); - - if (focus_is_on_searchbar == FALSE) { - // If a modifier key is pressed, it's a shortcut, pass along - if(event->state & GDK_CONTROL_MASK || - event->state & GDK_MOD1_MASK || - event->keyval == 60 || // < - event->keyval == 62 || // > - event->keyval == 34 || // " - event->keyval == 65289 || // tab - event->keyval == 65361 || // left arrow - event->keyval == 65363 || // right arrow - event->keyval >= 65470 || // F-keys - event->keyval == 32 // space - ) - return FALSE; - else - sflphone_keypad(event->keyval, event->string); - } - - return TRUE; + DEBUG("On key released from Main Window : %s", gtk_widget_get_name(widget)); + + if (focus_is_on_searchbar == FALSE) + { + // If a modifier key is pressed, it's a shortcut, pass along + if (event->state & GDK_CONTROL_MASK || event->state & GDK_MOD1_MASK + || event->keyval == 60 || // < + event->keyval == 62 || // > + event->keyval == 34 || // " + event->keyval == 65289 || // tab + event->keyval == 65361 || // left arrow + event->keyval == 65363 || // right arrow + event->keyval >= 65470 || // F-keys + event->keyval == 32 // space + ) + return FALSE; + else + sflphone_keypad (event->keyval, event->string); + } + + return TRUE; } void -focus_on_mainwindow_out(){ - // gtk_widget_grab_focus(GTK_WIDGET(window)); +focus_on_mainwindow_out () +{ + // gtk_widget_grab_focus(GTK_WIDGET(window)); } void -focus_on_mainwindow_in(){ - // gtk_widget_grab_focus(GTK_WIDGET(window)); +focus_on_mainwindow_in () +{ + // gtk_widget_grab_focus(GTK_WIDGET(window)); } - - void +void create_main_window () { - GtkWidget *widget; - gchar *path; - GError *error = NULL; - gboolean ret; - const char *window_title = "SFLphone VoIP Client"; - - focus_is_on_calltree = FALSE; - focus_is_on_searchbar = FALSE; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - gtk_window_set_title (GTK_WINDOW (window), window_title); - gtk_window_set_default_size (GTK_WINDOW (window), MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT); - gtk_window_set_default_icon_from_file (LOGO, - NULL); - gtk_window_set_position( GTK_WINDOW( window ) , GTK_WIN_POS_MOUSE); + GtkWidget *widget; + gchar *path; + GError *error = NULL; + gboolean ret; + const char *window_title = "SFLphone VoIP Client"; + int width, height, position_x, position_y; + + focus_is_on_calltree = FALSE; + focus_is_on_searchbar = FALSE; + + // Get configuration stored + width = dbus_get_window_width (); + height = dbus_get_window_height (); + position_x = dbus_get_window_position_x (); + position_y = dbus_get_window_position_y (); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_container_set_border_width (GTK_CONTAINER (window), 0); + gtk_window_set_title (GTK_WINDOW (window), window_title); + gtk_window_set_default_size (GTK_WINDOW (window), width, height); + gtk_window_set_default_icon_from_file (LOGO, NULL); + gtk_window_set_position (GTK_WINDOW( window ), GTK_WIN_POS_MOUSE); + + /* Connect the destroy event of the window with our on_destroy function + * When the window is about to be destroyed we get a notificaiton and + * stop the main GTK loop + */ + g_signal_connect (G_OBJECT (window), "delete-event", + G_CALLBACK (on_delete), NULL); + + g_signal_connect (G_OBJECT (window), "key-release-event", + G_CALLBACK (on_key_released), NULL); + + g_signal_connect_after (G_OBJECT (window), "focus-in-event", + G_CALLBACK (focus_on_mainwindow_in), NULL); + + g_signal_connect_after (G_OBJECT (window), "focus-out-event", + G_CALLBACK (focus_on_mainwindow_out), NULL); + + g_signal_connect_object (G_OBJECT (window), "configure-event", + G_CALLBACK (window_configure_cb), NULL, 0); + + gtk_widget_set_name (window, "mainwindow"); + + ret = uimanager_new (&ui_manager); + if (!ret) + { + ERROR ("Could not load xml GUI\n"); + g_error_free (error); + exit (1); + } - // GTK_WIDGET_SET_FLAGS (GTK_WIDGET(window),GTK_CAN_FOCUS); - // gtk_widget_grab_focus (GTK_WIDGET(window)); + /* Create an accel group for window's shortcuts */ + gtk_window_add_accel_group (GTK_WINDOW(window), + gtk_ui_manager_get_accel_group (ui_manager)); - /* Connect the destroy event of the window with our on_destroy function - * When the window is about to be destroyed we get a notificaiton and - * stop the main GTK loop - */ - g_signal_connect (G_OBJECT (window), "delete-event", - G_CALLBACK (on_delete), NULL); + vbox = gtk_vbox_new (FALSE /*homogeneous*/, 0 /*spacing*/); + subvbox = gtk_vbox_new (FALSE /*homogeneous*/, 5 /*spacing*/); - g_signal_connect (G_OBJECT (window), "key-release-event", - G_CALLBACK (on_key_released), NULL); + create_menus (ui_manager, &widget); + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, + 0 /*padding*/); - g_signal_connect_after (G_OBJECT (window), "focus-in-event", - G_CALLBACK (focus_on_mainwindow_in), NULL); + create_toolbar_actions (ui_manager, &widget); + // Do not override GNOME user settings + gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, + 0 /*padding*/); - g_signal_connect_after (G_OBJECT (window), "focus-out-event", - G_CALLBACK (focus_on_mainwindow_out), NULL); + gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, + FALSE /*fill*/, 0 /*padding*/); - gtk_widget_set_name (window, "mainwindow"); + embedded_error_notebook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new()); + gtk_box_pack_start (GTK_BOX(subvbox), GTK_WIDGET(embedded_error_notebook), + FALSE, FALSE, 0); - ret = uimanager_new (&ui_manager); - if (!ret) + if (SHOW_VOLUME) { - ERROR ("Could not load xml GUI\n"); - g_error_free (error); - exit (1); + speaker_control = create_slider ("speaker"); + gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (speaker_control); + mic_control = create_slider ("mic"); + gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (mic_control); } - /* Create an accel group for window's shortcuts */ - gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group (ui_manager)); - - vbox = gtk_vbox_new ( FALSE /*homogeneous*/, 0 /*spacing*/); - subvbox = gtk_vbox_new ( FALSE /*homogeneous*/, 5 /*spacing*/); - - create_menus (ui_manager, &widget); - gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - - create_toolbar_actions (ui_manager, &widget); - // Do not override GNOME user settings - gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - - gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_box_pack_start (GTK_BOX (vbox), contacts->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - - gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/); - - embedded_error_notebook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new()); - gtk_box_pack_start(GTK_BOX(subvbox), - GTK_WIDGET(embedded_error_notebook), FALSE, FALSE, 0); - - if(SHOW_VOLUME){ - speaker_control = create_slider("speaker"); - gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (speaker_control); - mic_control = create_slider("mic"); - gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (mic_control); - } - - if(SHOW_DIALPAD){ - dialpad = create_dialpad(); - gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (dialpad); - } + if (SHOW_DIALPAD) + { + dialpad = create_dialpad (); + gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (dialpad); + } - /* Status bar */ - statusBar = gtk_statusbar_new(); - gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_container_add (GTK_CONTAINER (window), vbox); + /* Status bar */ + statusBar = gtk_statusbar_new (); + gtk_box_pack_start (GTK_BOX (vbox), statusBar, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_container_add (GTK_CONTAINER (window), vbox); - /* make sure that everything, window and label, are visible */ - gtk_widget_show_all (window); + /* make sure that everything, window and label, are visible */ + gtk_widget_show_all (window); - /* dont't show the history */ - gtk_widget_hide(history->tree); + /* dont't show the history */ + gtk_widget_hide (history->tree); - /* dont't show the contact list */ - gtk_widget_hide(contacts->tree); + /* dont't show the contact list */ + gtk_widget_hide (contacts->tree); - searchbar_init(history); - searchbar_init(contacts); + searchbar_init (history); + searchbar_init (contacts); - /* don't show waiting layer */ - gtk_widget_hide(waitingLayer); + /* don't show waiting layer */ + gtk_widget_hide (waitingLayer); - // Configuration wizard - if (account_list_get_size() == 0) - { + // Configuration wizard + if (account_list_get_size () == 0) + { #if GTK_CHECK_VERSION(2,10,0) - build_wizard(); + build_wizard (); #else - GtkWidget * dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_INFO, - GTK_BUTTONS_YES_NO, - "<b><big>Welcome to SFLphone!</big></b>\n\nThere are no VoIP accounts configured, would you like to edit the preferences now?"); + GtkWidget * dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_YES_NO, + "<b><big>Welcome to SFLphone!</big></b>\n\nThere are no VoIP accounts configured, would you like to edit the preferences now?"); - int response = gtk_dialog_run (GTK_DIALOG(dialog)); + int response = gtk_dialog_run (GTK_DIALOG(dialog)); - gtk_widget_destroy (GTK_WIDGET(dialog)); + gtk_widget_destroy (GTK_WIDGET(dialog)); - if (response == GTK_RESPONSE_YES) - { - show_preferences_dialog(); - } + if (response == GTK_RESPONSE_YES) + { + show_preferences_dialog(); + } #endif - } + } + + // Move the main window + gtk_window_move (GTK_WINDOW (window), position_x, position_y); } - GtkAccelGroup * -get_accel_group() +GtkAccelGroup * +get_accel_group () { - return accelGroup; + return accelGroup; } - GtkWidget * -get_main_window() +GtkWidget * +get_main_window () { - return window; + return window; } void -main_window_message(GtkMessageType type, gchar * markup){ +main_window_message (GtkMessageType type, gchar * markup) +{ - GtkWidget * dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW(get_main_window()), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - type, - GTK_BUTTONS_CLOSE, - NULL); + GtkWidget * dialog = gtk_message_dialog_new_with_markup ( + GTK_WINDOW(get_main_window()), GTK_DIALOG_MODAL + | GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_CLOSE, NULL); - gtk_window_set_title(GTK_WINDOW(dialog), _("SFLphone Error")); - gtk_message_dialog_set_markup(GTK_MESSAGE_DIALOG(dialog), markup); + gtk_window_set_title (GTK_WINDOW(dialog), _("SFLphone Error")); + gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG(dialog), markup); - gtk_dialog_run (GTK_DIALOG(dialog)); - gtk_widget_destroy (GTK_WIDGET(dialog)); + gtk_dialog_run (GTK_DIALOG(dialog)); + gtk_widget_destroy (GTK_WIDGET(dialog)); } void -main_window_error_message(gchar * markup){ - main_window_message(GTK_MESSAGE_ERROR, markup); +main_window_error_message (gchar * markup) +{ + main_window_message (GTK_MESSAGE_ERROR, markup); } void -main_window_warning_message(gchar * markup){ - main_window_message(GTK_MESSAGE_WARNING, markup); +main_window_warning_message (gchar * markup) +{ + main_window_message (GTK_MESSAGE_WARNING, markup); } void -main_window_info_message(gchar * markup){ - main_window_message(GTK_MESSAGE_INFO, markup); +main_window_info_message (gchar * markup) +{ + main_window_message (GTK_MESSAGE_INFO, markup); } -void main_window_dialpad (gboolean state){ +void +main_window_dialpad (gboolean state) +{ - g_print ("main_window_dialpad\n"); + g_print ("main_window_dialpad\n"); - if(state) { - dialpad = create_dialpad(); - gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (dialpad); - } else { - gtk_container_remove(GTK_CONTAINER (subvbox), dialpad); - } + if (state) + { + dialpad = create_dialpad (); + gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (dialpad); + } + else + { + gtk_container_remove (GTK_CONTAINER (subvbox), dialpad); + } } void -main_window_volume_controls( gboolean state ){ - if(state){ - speaker_control = create_slider("speaker"); - gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (speaker_control); - mic_control = create_slider("mic"); - gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); - gtk_widget_show_all (mic_control); - } else { - gtk_container_remove( GTK_CONTAINER(subvbox) , speaker_control ); - gtk_container_remove( GTK_CONTAINER(subvbox) , mic_control ); - } -} - - void -statusbar_push_message(const gchar * message, guint id) +main_window_volume_controls (gboolean state) { - gtk_statusbar_push(GTK_STATUSBAR(statusBar), id, message); + if (state) + { + speaker_control = create_slider ("speaker"); + gtk_box_pack_end (GTK_BOX (subvbox), speaker_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (speaker_control); + mic_control = create_slider ("mic"); + gtk_box_pack_end (GTK_BOX (subvbox), mic_control, FALSE /*expand*/, + TRUE /*fill*/, 0 /*padding*/); + gtk_widget_show_all (mic_control); + } + else + { + gtk_container_remove (GTK_CONTAINER(subvbox), speaker_control); + gtk_container_remove (GTK_CONTAINER(subvbox), mic_control); + } } - void -statusbar_pop_message(guint id) +void +statusbar_push_message (const gchar * message, guint id) { - gtk_statusbar_pop(GTK_STATUSBAR(statusBar), id); + gtk_statusbar_push (GTK_STATUSBAR(statusBar), id, message); } - static void -add_error_dialog(GtkWidget *dialog, callable_obj_t * call) +void +statusbar_pop_message (guint id) { - gtk_container_add(GTK_CONTAINER(embedded_error_notebook), dialog); - call_add_error(call, dialog); + gtk_statusbar_pop (GTK_STATUSBAR(statusBar), id); } - static void -destroy_error_dialog_cb(GtkObject *dialog, callable_obj_t * call) +static void +add_error_dialog (GtkWidget *dialog, callable_obj_t * call) { - call_remove_error(call, dialog); + gtk_container_add (GTK_CONTAINER(embedded_error_notebook), dialog); + call_add_error (call, dialog); } - void -main_window_zrtp_not_supported(callable_obj_t * c) +static void +destroy_error_dialog_cb (GtkObject *dialog, callable_obj_t * call) { - account_t* account_details=NULL; - gchar* warning_enabled=""; - - account_details = account_list_get_by_id(c->_accountID); - if(account_details != NULL) { - warning_enabled = g_hash_table_lookup(account_details->properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING); - DEBUG("Warning Enabled %s", warning_enabled); - } else { - DEBUG("Account is null callID %s", c->_callID); - GHashTable * properties = NULL; - sflphone_get_ip2ip_properties (&properties); - if(properties != NULL) - { warning_enabled = g_hash_table_lookup(properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING); } - } - - if(g_strcasecmp(warning_enabled,"true") == 0) { - PidginMiniDialog *mini_dialog; - gchar *desc = g_markup_printf_escaped(_("ZRTP is not supported by peer %s\n"), c->_peer_number); - mini_dialog = pidgin_mini_dialog_new(_("Secure Communication Unavailable"), desc, GTK_STOCK_DIALOG_WARNING); - pidgin_mini_dialog_add_button(mini_dialog, _("Continue"), NULL, NULL); - pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL); - - g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); - - add_error_dialog(GTK_WIDGET(mini_dialog), c); - } + call_remove_error (call, dialog); } - void -main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, const gchar* severity) +void +main_window_zrtp_not_supported (callable_obj_t * c) { - gchar* peer_number = "(number unknown)"; - callable_obj_t * c = NULL; - c = calllist_get(current_calls, callID); - if (c != NULL) { - peer_number = c->_peer_number; - } - - PidginMiniDialog *mini_dialog; - gchar *desc = g_markup_printf_escaped(_("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"), severity, peer_number, reason); - mini_dialog = pidgin_mini_dialog_new(_("ZRTP negotiation failed"), desc, GTK_STOCK_DIALOG_WARNING); - pidgin_mini_dialog_add_button(mini_dialog, _("Continue"), NULL, NULL); - pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL); - - g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); - - add_error_dialog(GTK_WIDGET(mini_dialog), c); + account_t* account_details = NULL; + gchar* warning_enabled = ""; + + account_details = account_list_get_by_id (c->_accountID); + if (account_details != NULL) + { + warning_enabled = g_hash_table_lookup (account_details->properties, + ACCOUNT_ZRTP_NOT_SUPP_WARNING); + DEBUG("Warning Enabled %s", warning_enabled); + } + else + { + DEBUG("Account is null callID %s", c->_callID); + GHashTable * properties = NULL; + sflphone_get_ip2ip_properties (&properties); + if (properties != NULL) + { + warning_enabled = g_hash_table_lookup (properties, + ACCOUNT_ZRTP_NOT_SUPP_WARNING); + } + } + + if (g_strcasecmp (warning_enabled, "true") == 0) + { + PidginMiniDialog *mini_dialog; + gchar *desc = g_markup_printf_escaped ( + _("ZRTP is not supported by peer %s\n"), c->_peer_number); + mini_dialog = pidgin_mini_dialog_new ( + _("Secure Communication Unavailable"), desc, + GTK_STOCK_DIALOG_WARNING); + pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL); + pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), + sflphone_hang_up, NULL); + + g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); + + add_error_dialog (GTK_WIDGET(mini_dialog), c); + } } - void -main_window_confirm_go_clear(callable_obj_t * c) +void +main_window_zrtp_negotiation_failed (const gchar* callID, const gchar* reason, + const gchar* severity) { - PidginMiniDialog *mini_dialog; - gchar *desc = g_markup_printf_escaped(_("%s wants to stop using secure communication. Confirm will resume conversation without SRTP.\n"), c->_peer_number); - mini_dialog = pidgin_mini_dialog_new(_("Confirm Go Clear"), desc, GTK_STOCK_STOP); - pidgin_mini_dialog_add_button(mini_dialog, _("Confirm"), (PidginMiniDialogCallback)sflphone_set_confirm_go_clear, NULL); - pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL); + gchar* peer_number = "(number unknown)"; + callable_obj_t * c = NULL; + c = calllist_get (current_calls, callID); + if (c != NULL) + { + peer_number = c->_peer_number; + } - add_error_dialog(GTK_WIDGET(mini_dialog), c); + PidginMiniDialog *mini_dialog; + gchar + *desc = + g_markup_printf_escaped ( + _("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"), + severity, peer_number, reason); + mini_dialog = pidgin_mini_dialog_new (_("ZRTP negotiation failed"), desc, + GTK_STOCK_DIALOG_WARNING); + pidgin_mini_dialog_add_button (mini_dialog, _("Continue"), NULL, NULL); + pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), sflphone_hang_up, + NULL); + + g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c); + + add_error_dialog (GTK_WIDGET(mini_dialog), c); } - +void +main_window_confirm_go_clear (callable_obj_t * c) +{ + PidginMiniDialog *mini_dialog; + gchar + *desc = + g_markup_printf_escaped ( + _("%s wants to stop using secure communication. Confirm will resume conversation without SRTP.\n"), + c->_peer_number); + mini_dialog = pidgin_mini_dialog_new (_("Confirm Go Clear"), desc, + GTK_STOCK_STOP); + pidgin_mini_dialog_add_button (mini_dialog, _("Confirm"), + (PidginMiniDialogCallback) sflphone_set_confirm_go_clear, NULL); + pidgin_mini_dialog_add_button (mini_dialog, _("Stop Call"), sflphone_hang_up, + NULL); + + add_error_dialog (GTK_WIDGET(mini_dialog), c); +} diff --git a/sflphone-client-gnome/src/sflphone_const.h b/sflphone-client-gnome/src/sflphone_const.h index 52e786ade3e73803fe23fcf3943435c3fe7b7851..919bf1d30d4f3d0458cffeca1533de4315ae0f0e 100644 --- a/sflphone-client-gnome/src/sflphone_const.h +++ b/sflphone-client-gnome/src/sflphone_const.h @@ -43,21 +43,26 @@ #define c_(COMMENT,STRING) gettext(STRING) #define n_(SING,PLUR,COUNT) ngettext(SING,PLUR,COUNT) - +#define IP2IP "IP2IP" /** Warnings unused variables **/ #define UNUSED_VAR(var) (void*)var #define UNUSED __attribute__((__unused__)) +#define IP2IP_PROFILE "IP2IP" + +#define ACCOUNT_ID "Account.id" #define ACCOUNT_TYPE "Account.type" #define ACCOUNT_ALIAS "Account.alias" #define ACCOUNT_ENABLED "Account.enable" #define ACCOUNT_MAILBOX "Account.mailbox" +#define ACCOUNT_USERAGENT "useragent" #define ACCOUNT_RESOLVE_ONCE "Account.resolveOnce" #define ACCOUNT_REGISTRATION_EXPIRE "Account.expire" #define ACCOUNT_SIP_STUN_SERVER "STUN.server" #define ACCOUNT_SIP_STUN_ENABLED "STUN.enable" +#define ACCOUNT_DTMF_TYPE "Account.dtmfType" #define ACCOUNT_HOSTNAME "hostname" #define ACCOUNT_USERNAME "username" #define ACCOUNT_PASSWORD "password" @@ -65,6 +70,7 @@ #define ACCOUNT_REALM "realm" #define ACCOUNT_KEY_EXCHANGE "SRTP.keyExchange" #define ACCOUNT_SRTP_ENABLED "SRTP.enable" +#define ACCOUNT_SRTP_RTP_FALLBACK "SRTP.rtpFallback" #define ACCOUNT_ZRTP_DISPLAY_SAS "ZRTP.displaySAS" #define ACCOUNT_ZRTP_NOT_SUPP_WARNING "ZRTP.notSuppWarning" #define ACCOUNT_ZRTP_HELLO_HASH "ZRTP.helloHashEnable" @@ -73,6 +79,7 @@ #define ZRTP "1" #define SDES "2" +#define TLS_LISTENER_PORT "TLS.listenerPort" #define TLS_ENABLE "TLS.enable" #define TLS_PORT "TLS.port" #define TLS_CA_LIST_FILE "TLS.certificateListFile" @@ -129,6 +136,10 @@ log4c_category_t* log4c_sfl_gtk_category; #define ALSA 0 #define PULSEAUDIO 1 + /** DTMF type */ +#define OVERRTP "overrtp" +#define SIPINFO "sipinfo" + /** Notification levels */ #define __NOTIF_LEVEL_MIN 0 #define __NOTIF_LEVEL_MED 1 diff --git a/sflphone-client-gnome/src/shortcuts.c b/sflphone-client-gnome/src/shortcuts.c new file mode 100644 index 0000000000000000000000000000000000000000..7dfd53173b606a561fa5c176a57f9d5cff23bd3b --- /dev/null +++ b/sflphone-client-gnome/src/shortcuts.c @@ -0,0 +1,497 @@ +/* + * Copyright (C) 2010 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <string.h> +#include <stdlib.h> +#include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> +#include <X11/Xlib.h> +#include <X11/XF86keysym.h> +#include <gdk/gdkx.h> +#include <dbus/dbus-glib.h> + +#include "shortcuts.h" +#include "mainwindow.h" +#include "callable_obj.h" +#include "sflphone_const.h" +#include "dbus.h" + +// used to store accelerator config +static Accelerator* accelerators_list; + +// used to store config (for dbus calls) +static GHashTable* shortcutsMap; + +/* + * Callbacks + */ + +static void +toggle_pick_up_hang_up_callback () +{ + callable_obj_t * selectedCall = calltab_get_selected_call (active_calltree); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); + + g_print("toggle_pick_up_hang_up_callback\n"); + + if (selectedCall) + { + switch (selectedCall->_state) + { + case CALL_STATE_INCOMING: + case CALL_STATE_TRANSFERT: + sflphone_pick_up (); + break; + case CALL_STATE_DIALING: + case CALL_STATE_HOLD: + case CALL_STATE_CURRENT: + case CALL_STATE_RECORD: + case CALL_STATE_RINGING: + sflphone_hang_up (); + break; + } + } + else if (selectedConf) + { + dbus_hang_up_conference (selectedConf); + } + else + sflphone_pick_up (); +} + +static void +pick_up_callback () +{ + sflphone_pick_up (); +} + +static void +hang_up_callback () +{ + sflphone_hang_up (); +} + +static void +toggle_hold_callback () +{ + callable_obj_t * selectedCall = calltab_get_selected_call (current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf (active_calltree); + + if (selectedCall) + { + switch (selectedCall->_state) + { + case CALL_STATE_CURRENT: + case CALL_STATE_RECORD: + g_print("on hold\n"); + sflphone_on_hold(); + break; + case CALL_STATE_HOLD: + g_print("off hold\n"); + sflphone_off_hold(); + break; + } + } + else if (selectedConf) + dbus_hold_conference (selectedConf); + else + ERROR("Should not happen"); +} + +static void +popup_window_callback () +{ + gtk_widget_hide (GTK_WIDGET(get_main_window())); + gtk_widget_show (GTK_WIDGET(get_main_window())); + gtk_window_move (GTK_WINDOW (get_main_window ()), + dbus_get_window_position_x (), dbus_get_window_position_y ()); +} + +static void +default_callback () +{ + ERROR("Missing shortcut callback"); +} + +/* + * return callback corresponding to a specific action + */ +static void* +get_action_callback (const gchar* action) +{ + if (strcmp (action, "pick_up") == 0) + return pick_up_callback; + + if (strcmp (action, "hang_up") == 0) + return hang_up_callback; + + if (strcmp (action, "popup_window") == 0) + return popup_window_callback; + + if (strcmp (action, "toggle_pick_up_hang_up") == 0) + return toggle_pick_up_hang_up_callback; + + if (strcmp (action, "toggle_hold") == 0) + return toggle_hold_callback; + + return default_callback; +} + +/* + * Handle bindings + */ + +/* + * Remove all existing bindings + */ +static void +remove_bindings () +{ + GdkDisplay *display; + GdkScreen *screen; + GdkWindow *root; + + display = gdk_display_get_default (); + + int i = 0; + int j = 0; + while (accelerators_list[i].action != NULL) + { + if (accelerators_list[i].value != 0) + { + for (j = 0; j < gdk_display_get_n_screens (display); j++) + { + screen = gdk_display_get_screen (display, j); + + if (screen != NULL) + { + root = gdk_screen_get_root_window (screen); + ungrab_key (accelerators_list[i].value, root); + gdk_window_remove_filter (root, filter_keys, NULL); + } + } + } + + i++; + } +} + +/* + * Create all bindings, using stored configuration + */ +static void +create_bindings () +{ + GdkDisplay *display; + GdkScreen *screen; + GdkWindow *root; + + display = gdk_display_get_default (); + + int i = 0; + int j = 0; + while (accelerators_list[i].action != NULL) + { + if (accelerators_list[i].value != 0) + { + // updated GDK bindings + for (j = 0; j < gdk_display_get_n_screens (display); j++) + { + screen = gdk_display_get_screen (display, j); + + if (screen != NULL) + { + root = gdk_screen_get_root_window (screen); + grab_key (accelerators_list[i].value, root); + gdk_window_add_filter (root, filter_keys, NULL); + } + } + } + + i++; + } +} + +/* + * Initialize a specific binding + */ +static void +initialize_binding (const gchar* action, const guint code) +{ + //initialize_shortcuts_keys(); + int index = 0; + while (accelerators_list[index].action != NULL) + { + if (strcmp (action, accelerators_list[index].action) == 0) + { + break; + } + index++; + } + + if (accelerators_list[index].action == NULL) + { + ERROR("Should not happen: cannot find corresponding action"); + return; + } + + // update config value + accelerators_list[index].value = code; + + // update bindings + create_bindings (); +} + +/* + * Prepare accelerators list + */ +static void +initialize_accelerators_list () +{ + GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap); + + accelerators_list = (Accelerator*) malloc ( + (g_list_length (shortcutsKeys) + 1) * sizeof(Accelerator)); + + GList* shortcutsKeysElement; + int index = 0; + for (shortcutsKeysElement = shortcutsKeys; shortcutsKeysElement; shortcutsKeysElement + = shortcutsKeysElement->next) + { + gchar* action = shortcutsKeysElement->data; + + accelerators_list[index].action = g_strdup (action); + accelerators_list[index].callback = get_action_callback (action); + accelerators_list[index].mask = 0; + accelerators_list[index].value = 0; + + index++; + } + + // last element must be null + accelerators_list[index].action = 0; + accelerators_list[index].callback = 0; + accelerators_list[index].mask = 0; + accelerators_list[index].value = 0; +} + +static void +update_bindings_data (const guint index, const guint code) +{ + // we need to be sure this code is not already affected + // to another action + int i = 0; + while (accelerators_list[i].action != NULL) + { + if (accelerators_list[i].value == code) + { + // disable old binding + accelerators_list[i].value = 0; + + // update config table + g_hash_table_replace (shortcutsMap, g_strdup ( + accelerators_list[i].action), GINT_TO_POINTER (0)); + } + i++; + } + + // store new value + accelerators_list[index].value = code; + + // update value in hashtable (used for dbus calls) + g_hash_table_replace (shortcutsMap, + g_strdup (accelerators_list[index].action), GINT_TO_POINTER ( + accelerators_list[index].value)); +} + +/* + * "Public" functions + */ + +/* + * Update current bindings with a new value + */ +void +shortcuts_update_bindings (const guint index, const guint code) +{ + // first remove all existing bindings + remove_bindings (); + + // update data + update_bindings_data (index, code); + + // recreate all bindings + create_bindings (); + + // update configuration + dbus_set_shortcuts (shortcutsMap); +} + +/* + * Initialize bindings with configuration retrieved from dbus + */ +void +shortcuts_initialize_bindings () +{ + // get shortcuts stored in config through dbus + shortcutsMap = dbus_get_shortcuts (); + + // initialize list of keys + initialize_accelerators_list (); + + // iterate through keys to initialize bindings + GList* shortcutsKeys = g_hash_table_get_keys (shortcutsMap); + GList* shortcutsKeysElement; + for (shortcutsKeysElement = shortcutsKeys; shortcutsKeysElement; shortcutsKeysElement + = shortcutsKeysElement->next) + { + gchar* key = shortcutsKeysElement->data; + int shortcut = (size_t) g_hash_table_lookup (shortcutsMap, key); + if (shortcut != 0) + initialize_binding (key, shortcut); + } +} + +/* + * Initialize bindings with configuration retrieved from dbus + */ +void +shortcuts_destroy_bindings () +{ + // remove bindings + remove_bindings (); + + // free pointers + int index = 0; + while (accelerators_list[index].action != NULL) + { + g_free (accelerators_list[index].action); + index++; + } + free (accelerators_list); +} + +Accelerator* +shortcuts_get_list () +{ + return accelerators_list; +} + +/* + * XLib functions + */ + +/* + * filter used when an event is catched + */ +static GdkFilterReturn +filter_keys (GdkXEvent *xevent, GdkEvent *event, gpointer data) +{ + XEvent *xev; + XKeyEvent *key; + + xev = (XEvent *) xevent; + if (xev->type != KeyPress) + { + return GDK_FILTER_CONTINUE; + } + + key = (XKeyEvent *) xevent; + + // try to find corresponding action + int i = 0; + while (accelerators_list[i].action != NULL) + { + if (accelerators_list[i].value == key->keycode) + { + DEBUG("catched key for action: %s (%d)", accelerators_list[i].action, + accelerators_list[i].value); + + // call associated callback function + accelerators_list[i].callback (); + + return GDK_FILTER_REMOVE; + } + i++; + } + + DEBUG("Should not be reached :(\n"); + return GDK_FILTER_CONTINUE; +} + +/* + * Remove key "catcher" from GDK layer + */ +static void +ungrab_key (int key_code, GdkWindow *root) +{ + gdk_error_trap_push (); + + XUngrabKey (GDK_DISPLAY(), key_code, 0, GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, + GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask, + GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask, + GDK_WINDOW_XID(root)); + XUngrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask, + GDK_WINDOW_XID(root)); + + gdk_flush (); + if (gdk_error_trap_pop ()) + { + ERROR("Error ungrabbing key"); + } +} + +/* + * Add key "catcher" to GDK layer + */ +static void +grab_key (int key_code, GdkWindow *root) +{ + + gdk_error_trap_push (); + + XGrabKey (GDK_DISPLAY(), key_code, 0, GDK_WINDOW_XID(root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask, GDK_WINDOW_XID(root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod5Mask, GDK_WINDOW_XID(root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, LockMask, GDK_WINDOW_XID(root), True, + GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask, GDK_WINDOW_XID(root), + True, GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | LockMask, GDK_WINDOW_XID(root), + True, GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod5Mask | LockMask, GDK_WINDOW_XID(root), + True, GrabModeAsync, GrabModeAsync); + XGrabKey (GDK_DISPLAY(), key_code, Mod2Mask | Mod5Mask | LockMask, + GDK_WINDOW_XID(root), True, GrabModeAsync, GrabModeAsync); + + gdk_flush (); + if (gdk_error_trap_pop ()) + { + ERROR("Error grabbing key"); + } +} diff --git a/sflphone-client-gnome/src/shortcuts.h b/sflphone-client-gnome/src/shortcuts.h new file mode 100644 index 0000000000000000000000000000000000000000..3bc1a44cdb77c46b7929adf38197c169d588e63f --- /dev/null +++ b/sflphone-client-gnome/src/shortcuts.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2010 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef SHORTCUTS_H_ +#define SHORTCUTS_H_ + +typedef struct +{ + gchar *action; + GdkModifierType mask; + guint value; + void + (*callback) (void); +} Accelerator; + +static void +grab_key (int key_code, GdkWindow *root); + +static void +ungrab_key (int key_code, GdkWindow *root); + +static GdkFilterReturn +filter_keys (GdkXEvent *xevent, GdkEvent *event, gpointer data); + +static void +remove_bindings (); + +static void +create_bindings (); + +static void +pick_up_callback (); + +static void +hang_up_callback (); + +static void +toggle_pick_up_hang_up_callback (); + +static void +toggle_hold_callback (); + +static void +initialize_binding (const gchar* action, const guint code); + +static void +initialize_shortcuts_keys (); + +static void* +get_action_callback (const gchar* action); + +static void +update_bindings_data (const guint index, const guint code); + +/* + * "Public" functions + */ + +void +shortcuts_initialize_bindings (); + +void +shortcuts_update_bindings (const guint index, const guint code); + +void +shortcuts_destroy_bindings (); + +Accelerator* +shortcuts_get_list (); + +#endif /* SHORTCUTS_H_ */ diff --git a/sflphone-client-gnome/src/statusicon.c b/sflphone-client-gnome/src/statusicon.c index 47e9d4a855517764dc2380834bc76d20ff3f1489..7f74f6f066ed8c9d77a52b948658c1d44dae01ae 100644 --- a/sflphone-client-gnome/src/statusicon.c +++ b/sflphone-client-gnome/src/statusicon.c @@ -25,92 +25,133 @@ #include <statusicon.h> #if GTK_CHECK_VERSION(2,10,0) -GtkStatusIcon* status; -GtkWidget * show_menu_item; +GtkStatusIcon *status; +GtkWidget *show_menu_item, *hangup_menu_item; gboolean __minimized = MINIMIZED; +void +popup_main_window(void) +{ + if (__POPUP_WINDOW) + { + gtk_widget_show(get_main_window()); + gtk_window_move(GTK_WINDOW (get_main_window ()), + dbus_get_window_position_x(), dbus_get_window_position_y()); + set_minimized(FALSE); + } +} -void popup_main_window (void) +void +show_status_hangup_icon() { - if (__POPUP_WINDOW) - { - gtk_widget_show (get_main_window ()); - set_minimized (FALSE); - } + if (status) { + DEBUG("Show Hangup in Systray"); + gtk_widget_show(GTK_WIDGET(hangup_menu_item)); + } } -void -status_quit ( void * foo UNUSED) +void +hide_status_hangup_icon() +{ + if (status) { + DEBUG("Hide Hangup in Systray"); + gtk_widget_hide(GTK_WIDGET(hangup_menu_item)); + } +} + +void +status_quit(void * foo UNUSED) { sflphone_quit(); } -void +void +status_hangup() +{ + sflphone_hang_up(); +} + +void status_icon_unminimize() { gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE); } -gboolean main_widget_minimized() +gboolean +main_widget_minimized() { return __minimized; } -void show_hide (void) +void +show_hide(void) { - if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))) - { - gtk_widget_show(GTK_WIDGET(get_main_window())); - set_minimized( !MINIMIZED ); - } - else - { - gtk_widget_hide(GTK_WIDGET(get_main_window())); - set_minimized( MINIMIZED ); - } + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))) + { + gtk_widget_show(GTK_WIDGET(get_main_window())); + gtk_window_move(GTK_WINDOW (get_main_window ()), + dbus_get_window_position_x(), dbus_get_window_position_y()); + set_minimized(!MINIMIZED); + } + else + { + gtk_widget_hide(GTK_WIDGET(get_main_window())); + set_minimized(MINIMIZED); + } } - -void status_click (GtkStatusIcon *status_icon UNUSED, void * foo UNUSED) +void +status_click(GtkStatusIcon *status_icon UNUSED, void * foo UNUSED) { - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), - !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), + !gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))); } -void menu (GtkStatusIcon *status_icon, - guint button, - guint activate_time, - GtkWidget * menu) +void +menu(GtkStatusIcon *status_icon, guint button, guint activate_time, + GtkWidget * menu) { - gtk_menu_popup(GTK_MENU(menu), NULL, NULL, gtk_status_icon_position_menu, - status_icon, button, activate_time); + gtk_menu_popup(GTK_MENU(menu), NULL, NULL, gtk_status_icon_position_menu, + status_icon, button, activate_time); } -GtkWidget* create_menu() +GtkWidget* +create_menu() { GtkWidget * menu; GtkWidget * menu_items; - - menu = gtk_menu_new (); - - show_menu_item = gtk_check_menu_item_new_with_mnemonic (_("_Show main window")); + GtkWidget * image; + + menu = gtk_menu_new(); + + show_menu_item + = gtk_check_menu_item_new_with_mnemonic(_("_Show main window")); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), TRUE); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), show_menu_item); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), show_menu_item); g_signal_connect(G_OBJECT (show_menu_item), "toggled", - G_CALLBACK (show_hide), - NULL); - - menu_items = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_QUIT, get_accel_group()); + G_CALLBACK (show_hide), + NULL); + + hangup_menu_item = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); + image = gtk_image_new_from_file(ICONS_DIR "/icon_hangup.svg"); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(hangup_menu_item), image); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), hangup_menu_item); + g_signal_connect(G_OBJECT (hangup_menu_item), "activate", + G_CALLBACK (status_hangup), + NULL); + + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + + menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, + get_accel_group()); g_signal_connect_swapped (G_OBJECT (menu_items), "activate", - G_CALLBACK (status_quit), - NULL); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - - gtk_widget_show_all (menu); - + G_CALLBACK (status_quit), + NULL); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + + gtk_widget_show_all(menu); + return menu; } @@ -119,43 +160,67 @@ show_status_icon() { status = gtk_status_icon_new_from_file(LOGO); g_signal_connect (G_OBJECT (status), "activate", - G_CALLBACK (status_click), - NULL); + G_CALLBACK (status_click), + NULL); g_signal_connect (G_OBJECT (status), "popup-menu", - G_CALLBACK (menu), - create_menu()); + G_CALLBACK (menu), + create_menu()); + + statusicon_set_tooltip(); +} + +void hide_status_icon (void) { + + g_object_unref (status); + status = NULL; +} + + +void +statusicon_set_tooltip() +{ + int count; + gchar *tip; // Add a tooltip to the system tray icon - int count = account_list_get_size(); - gchar *tip = g_markup_printf_escaped ("%s - %s" , - _("SFLphone"), - g_markup_printf_escaped(n_("%i account configured", "%i accounts configured", count),count)); - gtk_status_icon_set_tooltip( status , tip ); + count = account_list_get_registered_accounts(); + tip = g_markup_printf_escaped("%s - %s", _("SFLphone"), + g_markup_printf_escaped( + n_("%i active account", "%i active accounts", count), count)); + gtk_status_icon_set_tooltip(status, tip); g_free(tip); } -void status_tray_icon_blink (gboolean active) +void +status_tray_icon_blink(gboolean active) { - // Set a different icon to notify of an event - active ? gtk_status_icon_set_from_file (status, LOGO_NOTIF) : gtk_status_icon_set_from_file (status, LOGO); + if (status) { + // Set a different icon to notify of an event + active ? gtk_status_icon_set_from_file(status, LOGO_NOTIF) + : gtk_status_icon_set_from_file(status, LOGO); + } } -void status_tray_icon_online (gboolean online) +void +status_tray_icon_online(gboolean online) { - // Set a different icon to notify of an event - online ? gtk_status_icon_set_from_file (status, LOGO) : gtk_status_icon_set_from_file (status, LOGO_OFFLINE); + if (status) { + // Set a different icon to notify of an event + online ? gtk_status_icon_set_from_file(status, LOGO) + : gtk_status_icon_set_from_file(status, LOGO_OFFLINE); + } } -GtkStatusIcon* -get_status_icon( void ) +GtkStatusIcon* +get_status_icon(void) { return status; } void -set_minimized( gboolean state) +set_minimized(gboolean state) { - __minimized = state ; + __minimized = state; gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(show_menu_item), !state); } diff --git a/sflphone-client-gnome/src/statusicon.h b/sflphone-client-gnome/src/statusicon.h index 4a841c4ea0ae2c81a9dfcaf74b32320bd4e7f51b..fc45eeec5b12555a4e1de3f030fccb55c2320f45 100644 --- a/sflphone-client-gnome/src/statusicon.h +++ b/sflphone-client-gnome/src/statusicon.h @@ -36,15 +36,34 @@ void popup_main_window (void); /** - * Create the status icon + * Create the system tray icon */ -void show_status_icon(); +void show_status_icon (); + + +/** + * Hide the system tray icon + */ +void hide_status_icon (); /** * Set the menu active */ void status_icon_unminimize(); +/** + * Show hangup icon + */ +void show_status_hangup_icon(); + + +/** + * Show hangup icon + */ +void hide_status_hangup_icon(); + + + /** * Tells if the main window if minimized or not * @return gboolean TRUE if the main window is minimized @@ -72,6 +91,11 @@ void status_tray_icon_blink( gboolean active ); */ GtkStatusIcon* get_status_icon( void ); +/** + * Attach a tooltip to the status icon + */ +void statusicon_set_tooltip (void); + #endif // GTK_CHECK_VERSION #endif diff --git a/sflphone-client-gnome/src/ui.xml b/sflphone-client-gnome/src/ui.xml index 6d3fe1f77ca80a1e3983b439a07352460b83345e..449e67b0bfff5d38e0b613656444a15b717f975a 100644 --- a/sflphone-client-gnome/src/ui.xml +++ b/sflphone-client-gnome/src/ui.xml @@ -25,15 +25,15 @@ <menuitem action="Preferences"/> </menu> - <menu name="ViewMenu" action="View"> + <menu name="ViewMenu" action="View"> <menuitem action="Toolbar"/> <separator/> <menuitem action="Dialpad"/> <!--menuitem name="VolumeControlsToggle" action="VolumeControls"/--> <menuitem action="VolumeControls"/> <separator/> - <menuitem action="History"/> - <menuitem action="Addressbook"/> + <menuitem action="History"/> + <menuitem action="Addressbook"/> </menu> <menu name="HelpMenu" action="Help"> @@ -41,25 +41,25 @@ <menuitem action="About"/> </menu> - </menubar> + </menubar> - <toolbar name="ToolbarActions"> - <toolitem name="NewCallToolbar" action="NewCall"/> - <toolitem name="PickUpToolbar" action="PickUp"/> - <toolitem name="HangUpToolbar" action="HangUp"/> - <toolitem name="OnHoldToolbar" action="OnHold"/> - <toolitem name="OffHoldToolbar" action="OffHold"/> - <toolitem name="TransferToolbar" action="Transfer"/> - <toolitem name="RecordToolbar" action="Record"/> - <separator/> - <toolitem name="VoicemailToolbar" action="Voicemail"/> - <toolitem name="HistoryToolbar" action="History"/> - <toolitem name="AddressbookToolbar" action="Addressbook"/> - </toolbar> + <toolbar name="ToolbarActions"> + <toolitem name="NewCallToolbar" action="NewCall"/> + <toolitem name="PickUpToolbar" action="PickUp"/> + <toolitem name="HangUpToolbar" action="HangUp"/> + <toolitem name="OnHoldToolbar" action="OnHold"/> + <toolitem name="OffHoldToolbar" action="OffHold"/> + <toolitem name="TransferToolbar" action="Transfer"/> + <toolitem name="RecordToolbar" action="Record"/> + <separator/> + <toolitem name="VoicemailToolbar" action="Voicemail"/> + <toolitem name="HistoryToolbar" action="History"/> + <toolitem name="AddressbookToolbar" action="Addressbook"/> + </toolbar> - <popup name="PopupMenu"> - <menuitem action="Copy"/> - <menuitem action="Paste"/> - <separator/> - </popup> + <popup name="PopupMenu"> + <menuitem action="Copy"/> + <menuitem action="Paste"/> + <separator/> + </popup> </ui> diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 1a4632c5898cb0c75e8c07bf5ce968830eeda8a6..26b35661b5ae22367fe6d355df1360cbd3d79cf4 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -27,11 +27,13 @@ #include <glib/gprintf.h> #include <libgnome/gnome-help.h> #include <uimanager.h> +#include <statusicon.h> static GtkWidget *toolbar; static GtkWidget *toolbarWindows; guint transfertButtonConnId; //The button toggled signal connection ID +guint recordButtonConnId; //The button toggled signal connection ID GtkAction * pickUpAction; GtkWidget * pickUpWidget; @@ -53,1304 +55,1471 @@ GtkWidget * voicemailToolbar; GtkWidget * editable_num; GtkDialog * edit_dialog; - -enum { - CALLTREE_CALLS, - CALLTREE_HISTORY, - CALLTREE_CONTACTS +enum +{ + CALLTREE_CALLS, CALLTREE_HISTORY, CALLTREE_CONTACTS }; - -static gboolean is_inserted (GtkWidget* button, GtkWidget *current_toolbar) +static gboolean +is_inserted(GtkWidget* button, GtkWidget *current_toolbar) { - return (GTK_WIDGET (button)->parent == GTK_WIDGET (current_toolbar)); + return (GTK_WIDGET (button)->parent == GTK_WIDGET (current_toolbar)); } -void update_actions() +void +update_actions() { - DEBUG("Update action"); - - gtk_action_set_sensitive( GTK_ACTION (newCallAction), TRUE); - gtk_action_set_sensitive (GTK_ACTION (pickUpAction), FALSE); - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), FALSE); - - g_object_ref (hangUpWidget); - g_object_ref (recordWidget); - g_object_ref (holdToolbar); - g_object_ref (offHoldToolbar); - g_object_ref (contactButton); - g_object_ref (transferToolbar); - g_object_ref (voicemailToolbar); - - if (is_inserted (GTK_WIDGET(hangUpWidget), GTK_WIDGET (toolbar))) - { - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (hangUpWidget)); - } - - if (is_inserted (GTK_WIDGET(recordWidget), GTK_WIDGET (toolbar))) - { - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (recordWidget)); - } - - if (is_inserted (GTK_WIDGET(transferToolbar), GTK_WIDGET (toolbar))) - { - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (transferToolbar)); - } - - if (is_inserted (GTK_WIDGET(contactButton), GTK_WIDGET (toolbar))) - { - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (contactButton)); - } - - if (is_inserted (GTK_WIDGET (voicemailToolbar), GTK_WIDGET (toolbar))) - { - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (voicemailToolbar)); - } - - gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), FALSE); - gtk_action_set_sensitive (GTK_ACTION (recordAction), FALSE); - gtk_action_set_sensitive (GTK_ACTION (copyAction), FALSE); - gtk_widget_set_sensitive( GTK_WIDGET(contactButton), FALSE); - gtk_widget_set_tooltip_text (GTK_WIDGET (contactButton), _("No address book selected")); - - if (is_inserted (GTK_WIDGET (holdToolbar), GTK_WIDGET (toolbar))) - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (holdToolbar)); - if (is_inserted (GTK_WIDGET (offHoldToolbar), GTK_WIDGET (toolbar))) - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (offHoldToolbar)); - - if (is_inserted (GTK_WIDGET (newCallWidget), GTK_WIDGET (toolbar))) - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); - if (is_inserted (GTK_WIDGET (pickUpWidget), GTK_WIDGET (toolbar))) - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (pickUpWidget)); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (newCallWidget), 0); - - // If addressbook support has been enabled and all addressbooks are loaded, display the icon - if (addressbook_is_enabled () && addressbook_is_ready ()) { - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (contactButton), -1); - // Make the icon clickable only if at least one address book is active - if (addressbook_is_active ()) - { - gtk_widget_set_sensitive( GTK_WIDGET(contactButton), TRUE); - gtk_widget_set_tooltip_text (GTK_WIDGET (contactButton), _("Address book")); - } - } - - // g_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); - // gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (transferToolbar), FALSE); - // g_signal_handler_unblock ( GTK_OBJECT (transferToolbar), transfertButtonConnId); - - callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); - conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree); - - if (selectedCall) - { - // DEBUG("------------------------- selected call ---------------------------\n"); - gtk_action_set_sensitive (GTK_ACTION (copyAction), TRUE); - - switch(selectedCall->_state) - { - case CALL_STATE_INCOMING: - // Make the button toolbar clickable - gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE); - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - // Replace the dial button with the hangup button - g_object_ref (newCallWidget); - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET(newCallWidget)); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), 0); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - break; - case CALL_STATE_HOLD: - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (newCallWidget), TRUE); - // Replace the hold button with the off-hold button - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_toolbar_insert (GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM (offHoldToolbar), 2); - break; - case CALL_STATE_RINGING: - gtk_action_set_sensitive (GTK_ACTION (pickUpAction), TRUE); - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - break; - case CALL_STATE_DIALING: - gtk_action_set_sensitive (GTK_ACTION(pickUpAction), TRUE); - if (active_calltree == current_calls) gtk_action_set_sensitive( GTK_ACTION(hangUpAction), TRUE); - //gtk_action_set_sensitive( GTK_ACTION(newCallMenu),TRUE); - g_object_ref (newCallWidget); - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), 0); - if (active_calltree == current_calls) gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - break; - case CALL_STATE_CURRENT: - case CALL_STATE_RECORD: - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); - //gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (holdMenu), gtk_image_new_from_stock (GTK_STOCK_ONHOLD, GTK_ICON_SIZE_MENU)); - gtk_widget_set_sensitive (GTK_WIDGET (transferToolbar), TRUE); - //gtk_action_set_sensitive( GTK_ACTION(newCallMenu),TRUE); - gtk_action_set_sensitive( GTK_ACTION (recordAction), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), 2); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (transferToolbar), 3); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (recordWidget), 4); - gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (transferToolbar), FALSE); - gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); - break; - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - gtk_action_set_sensitive( GTK_ACTION(hangUpAction), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - break; - case CALL_STATE_TRANSFERT: - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (transferToolbar), 2); - gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); - gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (transferToolbar), TRUE); - gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdMenu), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (transferToolbar), TRUE); - break; - default: - WARN("Should not happen in update_actions()!"); - break; - } - } - else if (selectedConf){ - - // DEBUG("------------------------- selected conf ---------------------------\n"); - - switch(selectedConf->_state) { - - case CONFERENCE_STATE_ACTIVE_ATACHED: - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), 2); - break; - - case CONFERENCE_STATE_ACTIVE_DETACHED: - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), 2); - break; - - case CONFERENCE_STATE_RECORD: - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (holdToolbar), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), 2); - break; - - case CONFERENCE_STATE_HOLD: - gtk_action_set_sensitive (GTK_ACTION (hangUpAction), TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (offHoldToolbar), TRUE); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), 1); - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (offHoldToolbar), 2); - break; - - default: - WARN("Should not happen in update_action()!"); - break; - - } - } - - else { - if( account_list_get_size() > 0 && current_account_has_mailbox ()) - { - gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (voicemailToolbar), -2); - update_voicemail_status (); - } - } + DEBUG("Update action"); + + gtk_action_set_sensitive(GTK_ACTION (newCallAction), TRUE); + gtk_action_set_sensitive(GTK_ACTION (pickUpAction), FALSE); + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), FALSE); + + g_object_ref(hangUpWidget); + g_object_ref(recordWidget); + g_object_ref(holdToolbar); + g_object_ref(offHoldToolbar); + g_object_ref(contactButton); + g_object_ref(transferToolbar); + g_object_ref(voicemailToolbar); + + if (is_inserted(GTK_WIDGET(hangUpWidget), GTK_WIDGET (toolbar))) + { + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (hangUpWidget)); + } + + if (is_inserted(GTK_WIDGET(recordWidget), GTK_WIDGET (toolbar))) + { + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (recordWidget)); + } + + if (is_inserted(GTK_WIDGET(transferToolbar), GTK_WIDGET (toolbar))) + { + gtk_container_remove(GTK_CONTAINER (toolbar), + GTK_WIDGET (transferToolbar)); + } + + if (is_inserted(GTK_WIDGET(contactButton), GTK_WIDGET (toolbar))) + { + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (contactButton)); + } + + if (is_inserted(GTK_WIDGET (voicemailToolbar), GTK_WIDGET (toolbar))) + { + gtk_container_remove(GTK_CONTAINER (toolbar), + GTK_WIDGET (voicemailToolbar)); + } + + gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET (offHoldToolbar), FALSE); + gtk_action_set_sensitive(GTK_ACTION (recordAction), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET (recordWidget), FALSE); + gtk_action_set_sensitive(GTK_ACTION (copyAction), FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(contactButton), FALSE); + gtk_widget_set_tooltip_text(GTK_WIDGET (contactButton), + _("No address book selected")); + + if (is_inserted(GTK_WIDGET (holdToolbar), GTK_WIDGET (toolbar))) + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (holdToolbar)); + if (is_inserted(GTK_WIDGET (offHoldToolbar), GTK_WIDGET (toolbar))) + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (offHoldToolbar)); + + if (is_inserted(GTK_WIDGET (newCallWidget), GTK_WIDGET (toolbar))) + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (newCallWidget)); + if (is_inserted(GTK_WIDGET (pickUpWidget), GTK_WIDGET (toolbar))) + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET (pickUpWidget)); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (newCallWidget), 0); + + // If addressbook support has been enabled and all addressbooks are loaded, display the icon + if (addressbook_is_enabled() && addressbook_is_ready()) + { + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (contactButton), + -1); + // Make the icon clickable only if at least one address book is active + if (addressbook_is_active()) + { + gtk_widget_set_sensitive(GTK_WIDGET(contactButton), TRUE); + gtk_widget_set_tooltip_text(GTK_WIDGET (contactButton), + _("Address book")); + } + } + + // g_signal_handler_block (GTK_OBJECT (recordWidget), recordButtonConnId); + // gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (recordWidget), FALSE); + // g_signal_handler_unblock ( GTK_OBJECT (recordWidget), recordButtonConnId); + + callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree); + conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree); + + if (selectedCall) + { + // update icon in systray + show_status_hangup_icon(); + + gtk_action_set_sensitive(GTK_ACTION (copyAction), TRUE); + + switch (selectedCall->_state) + { + case CALL_STATE_INCOMING: + // Make the button toolbar clickable + gtk_action_set_sensitive(GTK_ACTION (pickUpAction), TRUE); + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + // Replace the dial button with the hangup button + g_object_ref(newCallWidget); + gtk_container_remove(GTK_CONTAINER (toolbar), GTK_WIDGET(newCallWidget)); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), + 0); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + break; + case CALL_STATE_HOLD: + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (offHoldToolbar), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (newCallWidget), TRUE); + // Replace the hold button with the off-hold button + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert(GTK_TOOLBAR(toolbar), + GTK_TOOL_ITEM (offHoldToolbar), 2); + break; + case CALL_STATE_RINGING: + gtk_action_set_sensitive(GTK_ACTION (pickUpAction), TRUE); + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + break; + case CALL_STATE_DIALING: + gtk_action_set_sensitive(GTK_ACTION(pickUpAction), TRUE); + if (active_calltree == current_calls) + gtk_action_set_sensitive(GTK_ACTION(hangUpAction), TRUE); + //gtk_action_set_sensitive( GTK_ACTION(newCallMenu),TRUE); + g_object_ref(newCallWidget); + gtk_container_remove(GTK_CONTAINER (toolbar), + GTK_WIDGET (newCallWidget)); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (pickUpWidget), + 0); + if (active_calltree == current_calls) + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (hangUpWidget), 1); + break; + case CALL_STATE_CURRENT: + case CALL_STATE_RECORD: + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (transferToolbar), TRUE); + gtk_action_set_sensitive(GTK_ACTION (recordAction), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (transferToolbar), 3); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (recordWidget), + 4); + gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); + gtk_toggle_tool_button_set_active( + GTK_TOGGLE_TOOL_BUTTON (transferToolbar), FALSE); + gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); + + break; + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + gtk_action_set_sensitive(GTK_ACTION(hangUpAction), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + break; + case CALL_STATE_TRANSFERT: + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (transferToolbar), 2); + gtk_signal_handler_block (GTK_OBJECT (transferToolbar), transfertButtonConnId); + gtk_toggle_tool_button_set_active( + GTK_TOGGLE_TOOL_BUTTON (transferToolbar), TRUE); + gtk_signal_handler_unblock (transferToolbar, transfertButtonConnId); + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdMenu), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (transferToolbar), TRUE); + break; + default: + WARN("Should not happen in update_actions()!") + ; + break; + } + } + else if (selectedConf) + { + + // update icon in systray + show_status_hangup_icon(); + + switch (selectedConf->_state) + { + + case CONFERENCE_STATE_ACTIVE_ATACHED: + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + break; + + case CONFERENCE_STATE_ACTIVE_DETACHED: + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + break; + + case CONFERENCE_STATE_RECORD: + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (holdToolbar), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (holdToolbar), + 2); + break; + + case CONFERENCE_STATE_HOLD: + gtk_action_set_sensitive(GTK_ACTION (hangUpAction), TRUE); + gtk_widget_set_sensitive(GTK_WIDGET (offHoldToolbar), TRUE); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (hangUpWidget), + 1); + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (offHoldToolbar), 2); + break; + + default: + WARN("Should not happen in update_action()!") + ; + break; + + } + } + + else + { + + // update icon in systray + hide_status_hangup_icon(); + + if (account_list_get_size() > 0 && current_account_has_mailbox()) + { + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), + GTK_TOOL_ITEM (voicemailToolbar), -2); + update_voicemail_status(); + } + } } -void update_voicemail_status (void) +void +update_voicemail_status(void) { - gchar *messages = ""; - messages = g_markup_printf_escaped (_("Voicemail (%i)"), current_account_get_message_number ()); - (current_account_has_new_message ()) ? - gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (voicemailToolbar), "mail-message-new"): - gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (voicemailToolbar), "mail-read"); - gtk_tool_button_set_label (GTK_TOOL_BUTTON (voicemailToolbar), messages); - g_free (messages); + gchar *messages = ""; + messages = g_markup_printf_escaped(_("Voicemail (%i)"), + current_account_get_message_number()); + (current_account_has_new_message()) ? gtk_tool_button_set_icon_name( + GTK_TOOL_BUTTON (voicemailToolbar), "mail-message-new") + : gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (voicemailToolbar), + "mail-read"); + gtk_tool_button_set_label(GTK_TOOL_BUTTON (voicemailToolbar), messages); + g_free(messages); } -static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) +static void +volume_bar_cb(GtkToggleAction *togglemenuitem, gpointer user_data) { - gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); - if (toggled == SHOW_VOLUME) - return; - main_window_volume_controls(toggled); - if (toggled || SHOW_VOLUME) - dbus_set_volume_controls(toggled); + gboolean toggled = gtk_toggle_action_get_active(togglemenuitem); + if (toggled == SHOW_VOLUME) + return; + main_window_volume_controls(toggled); + if (toggled || SHOW_VOLUME) + dbus_set_volume_controls(toggled); } -static void dialpad_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) +static void +dialpad_bar_cb(GtkToggleAction *togglemenuitem, gpointer user_data) { - gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); - if (toggled == SHOW_DIALPAD) - return; - main_window_dialpad (toggled); - if (toggled || SHOW_DIALPAD) - dbus_set_dialpad(toggled); + gboolean toggled = gtk_toggle_action_get_active(togglemenuitem); + if (toggled == SHOW_DIALPAD) + return; + main_window_dialpad(toggled); + if (toggled || SHOW_DIALPAD) + dbus_set_dialpad(toggled); } -static void help_contents_cb (GtkAction *action) +static void +help_contents_cb(GtkAction *action) { - GError *error = NULL; - - gnome_help_display ("sflphone.xml", NULL, &error); - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } + GError *error = NULL; + + gnome_help_display("sflphone.xml", NULL, &error); + if (error != NULL) + { + g_warning("%s", error->message); + g_error_free(error); + } } -static void help_about ( void * foo UNUSED) +static void +help_about(void * foo UNUSED) { - gchar *authors[] = { - "Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>", - "Jean-Philippe Barrette-LaPierre", - "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", - "Julien Bonjean <julien.bonjean@savoirfairelinux.com>", - "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", - "Laurielle Lea", - "Yun Liu <yun.liu@savoirfairelinux.com>", - "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", - "Yan Morin <yan.morin@savoirfairelinux.com>", - "Jérôme Oufella <jerome.oufella@savoirfairelinux.com>", - "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", - "Alexandre Savard <alexandre.savard@savoirfairelinux.com>", - NULL}; - gchar *artists[] = { - "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", - "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", - NULL}; - - gtk_show_about_dialog( GTK_WINDOW(get_main_window()), - "artists", artists, - "authors", authors, - "comments", _("SFLphone is a VoIP client compatible with SIP and IAX2 protocols."), - "copyright", "Copyright © 2004-2009 Savoir-faire Linux Inc.", - "name", PACKAGE, - "title", _("About SFLphone"), - "version", VERSION, - "website", "http://www.sflphone.org", - NULL); + gchar + *authors[] = + { + "Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>", + "Jean-Philippe Barrette-LaPierre", + "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", + "Julien Bonjean <julien.bonjean@savoirfairelinux.com>", + "Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>", + "Laurielle Lea", + "Yun Liu <yun.liu@savoirfairelinux.com>", + "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", + "Yan Morin <yan.morin@savoirfairelinux.com>", + "Jérôme Oufella <jerome.oufella@savoirfairelinux.com>", + "Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>", + "Alexandre Savard <alexandre.savard@savoirfairelinux.com>", NULL }; + gchar *artists[] = + { "Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>", + "Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>", NULL }; + + gtk_show_about_dialog(GTK_WINDOW(get_main_window()), "artists", artists, + "authors", authors, "comments", + _("SFLphone is a VoIP client compatible with SIP and IAX2 protocols."), + "copyright", "Copyright © 2004-2009 Savoir-faire Linux Inc.", "name", + PACKAGE, "title", _("About SFLphone"), "version", VERSION, "website", + "http://www.sflphone.org", NULL); } /* ----------------------------------------------------------------- */ - static void -call_new_call ( void * foo UNUSED) +static void +call_new_call(void * foo UNUSED) { - sflphone_new_call(); + sflphone_new_call(); } - static void -call_quit ( void * foo UNUSED) +static void +call_quit(void * foo UNUSED) { - sflphone_quit(); + sflphone_quit(); } - static void -call_minimize ( void * foo UNUSED) +static void +call_minimize(void * foo UNUSED) { -#if GTK_CHECK_VERSION(2,10,0) - gtk_widget_hide(GTK_WIDGET( get_main_window() )); - set_minimized( TRUE ); -#endif + + if (g_strcasecmp (dbus_is_status_icon_enabled (), "true") == 0) { + gtk_widget_hide(GTK_WIDGET( get_main_window() )); + set_minimized(TRUE); + } + else { + sflphone_quit (); + } } - static void -switch_account( GtkWidget* item , gpointer data UNUSED) +static void +switch_account(GtkWidget* item, gpointer data UNUSED) { - account_t* acc = g_object_get_data( G_OBJECT(item) , "account" ); - DEBUG("%s" , acc->accountID); - account_list_set_current (acc); - status_bar_display_account (); + account_t* acc = g_object_get_data(G_OBJECT(item), "account"); + DEBUG("%s" , acc->accountID); + account_list_set_current(acc); + status_bar_display_account(); } - static void -call_hold (void* foo UNUSED) +static void +call_hold(void* foo UNUSED) { - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - conference_obj_t * selectedConf = calltab_get_selected_conf(); - - if(selectedCall) - { - if(selectedCall->_state == CALL_STATE_HOLD) - { - sflphone_off_hold(); - } - else - { - sflphone_on_hold(); - } - } - else if (selectedConf) { - - switch(selectedConf->_state) { - - case CONFERENCE_STATE_HOLD: - { - selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - sflphone_conference_off_hold(selectedConf); - } - break; - - case CONFERENCE_STATE_ACTIVE_ATACHED: - case CONFERENCE_STATE_ACTIVE_DETACHED: { - selectedConf->_state = CONFERENCE_STATE_HOLD; - sflphone_conference_on_hold(selectedConf); - } - break; - default: - break; - } - - } + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); + conference_obj_t * selectedConf = calltab_get_selected_conf(); + + if (selectedCall) + { + if (selectedCall->_state == CALL_STATE_HOLD) + { + sflphone_off_hold(); + } + else + { + sflphone_on_hold(); + } + } + else if (selectedConf) + { + + switch (selectedConf->_state) + { + + case CONFERENCE_STATE_HOLD: + { + selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + sflphone_conference_off_hold(selectedConf); + } + break; + + case CONFERENCE_STATE_ACTIVE_ATACHED: + case CONFERENCE_STATE_ACTIVE_DETACHED: + { + selectedConf->_state = CONFERENCE_STATE_HOLD; + sflphone_conference_on_hold(selectedConf); + } + break; + default: + break; + } + + } } - static void -conference_hold (void* foo UNUSED) +static void +conference_hold(void* foo UNUSED) { - conference_obj_t * selectedConf = calltab_get_selected_conf(); - - switch(selectedConf->_state) - { - case CONFERENCE_STATE_HOLD: - { - selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; - sflphone_conference_off_hold(selectedConf); - } - break; - - case CONFERENCE_STATE_ACTIVE_ATACHED: - case CONFERENCE_STATE_ACTIVE_DETACHED: - { - selectedConf->_state = CONFERENCE_STATE_HOLD; - sflphone_conference_on_hold(selectedConf); - } - break; - default: - break; - } + conference_obj_t * selectedConf = calltab_get_selected_conf(); + + switch (selectedConf->_state) + { + case CONFERENCE_STATE_HOLD: + { + selectedConf->_state = CONFERENCE_STATE_ACTIVE_ATACHED; + sflphone_conference_off_hold(selectedConf); + } + break; + + case CONFERENCE_STATE_ACTIVE_ATACHED: + case CONFERENCE_STATE_ACTIVE_DETACHED: + { + selectedConf->_state = CONFERENCE_STATE_HOLD; + sflphone_conference_on_hold(selectedConf); + } + break; + default: + break; + } } - static void -call_pick_up ( void * foo UNUSED) +static void +call_pick_up(void * foo UNUSED) { - DEBUG("------ call_button -----"); - callable_obj_t * selectedCall; - callable_obj_t* new_call; - - selectedCall = calltab_get_selected_call(active_calltree); - - if(calllist_get_size(current_calls)>0) - sflphone_pick_up(); - - else if(calllist_get_size(active_calltree) > 0){ - if( selectedCall) - { - create_new_call (CALL, CALL_STATE_DIALING, "", "", "", selectedCall->_peer_number, &new_call); - - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); - calltree_display (current_calls); - } - else - { - sflphone_new_call(); - calltree_display(current_calls); - } - } - else - { - sflphone_new_call(); - calltree_display(current_calls); - } + DEBUG("------ call_button -----"); + callable_obj_t * selectedCall; + callable_obj_t* new_call; + + selectedCall = calltab_get_selected_call(active_calltree); + + if (calllist_get_size(current_calls) > 0) + sflphone_pick_up(); + + else if (calllist_get_size(active_calltree) > 0) + { + if (selectedCall) + { + create_new_call(CALL, CALL_STATE_DIALING, "", "", "", + selectedCall->_peer_number, &new_call); + + calllist_add(current_calls, new_call); + calltree_add_call(current_calls, new_call, NULL); + sflphone_place_call(new_call); + calltree_display(current_calls); + } + else + { + sflphone_new_call(); + calltree_display(current_calls); + } + } + else + { + sflphone_new_call(); + calltree_display(current_calls); + } } -static void call_hang_up (void) +static void +call_hang_up(void) { + /* + * [#3020] Restore the record toggle button + * We set it to FALSE, as when we hang up a call, the recording is stopped. + */ + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (recordWidget), FALSE); + sflphone_hang_up(); + } -static void conference_hang_up (void) +static void +conference_hang_up(void) { - sflphone_conference_hang_up(); + sflphone_conference_hang_up(); } -static void call_record (void) +static void +call_record(void) { - sflphone_rec_call(); + sflphone_rec_call(); } - static void -call_configuration_assistant ( void * foo UNUSED) +static void +call_configuration_assistant(void * foo UNUSED) { #if GTK_CHECK_VERSION(2,10,0) - build_wizard(); + build_wizard(); #endif } - static void -remove_from_history( void * foo UNUSED) +static void +remove_from_history(void * foo UNUSED) { - callable_obj_t* c = calltab_get_selected_call( history ); - if(c){ - DEBUG("Remove the call from the history"); - calllist_remove_from_history( c ); - } + callable_obj_t* c = calltab_get_selected_call(history); + if (c) + { + DEBUG("Remove the call from the history"); + calllist_remove_from_history(c); + } } - static void -call_back( void * foo UNUSED) +static void +call_back(void * foo UNUSED) { - callable_obj_t *selected_call, *new_call; + callable_obj_t *selected_call, *new_call; - selected_call = calltab_get_selected_call( active_calltree ); + selected_call = calltab_get_selected_call(active_calltree); - if( selected_call ) - { - create_new_call (CALL, CALL_STATE_DIALING, "", "", selected_call->_peer_name, selected_call->_peer_number, &new_call); + if (selected_call) + { + create_new_call(CALL, CALL_STATE_DIALING, "", "", + selected_call->_peer_name, selected_call->_peer_number, &new_call); - calllist_add(current_calls, new_call); - calltree_add_call(current_calls, new_call, NULL); - sflphone_place_call(new_call); - calltree_display (current_calls); - } + calllist_add(current_calls, new_call); + calltree_add_call(current_calls, new_call, NULL); + sflphone_place_call(new_call); + calltree_display(current_calls); + } } - static void -edit_preferences ( void * foo UNUSED) +static void +edit_preferences(void * foo UNUSED) { - show_preferences_dialog(); + show_preferences_dialog(); } - static void -edit_accounts ( void * foo UNUSED) +static void +edit_accounts(void * foo UNUSED) { - show_account_list_config_dialog(); + show_account_list_config_dialog(); } // The menu Edit/Copy should copy the current selected call's number - static void -edit_copy ( void * foo UNUSED) +static void +edit_copy(void * foo UNUSED) { - GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - gchar * no = NULL; - - if(selectedCall) - { - switch(selectedCall->_state) - { - case CALL_STATE_TRANSFERT: - case CALL_STATE_DIALING: - case CALL_STATE_RINGING: - no = selectedCall->_peer_number; - break; - case CALL_STATE_CURRENT: - case CALL_STATE_HOLD: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - case CALL_STATE_INCOMING: - default: - no = selectedCall->_peer_number; - break; - } - DEBUG("Clipboard number: %s\n", no); - gtk_clipboard_set_text (clip, no, strlen(no) ); - } + GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); + gchar * no = NULL; + + if (selectedCall) + { + switch (selectedCall->_state) + { + case CALL_STATE_TRANSFERT: + case CALL_STATE_DIALING: + case CALL_STATE_RINGING: + no = selectedCall->_peer_number; + break; + case CALL_STATE_CURRENT: + case CALL_STATE_HOLD: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + case CALL_STATE_INCOMING: + default: + no = selectedCall->_peer_number; + break; + } + DEBUG("Clipboard number: %s\n", no); + gtk_clipboard_set_text(clip, no, strlen(no)); + } } // The menu Edit/Paste should paste the clipboard into the current selected call - static void -edit_paste ( void * foo UNUSED) +static void +edit_paste(void * foo UNUSED) { - GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); - callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); - gchar * no = gtk_clipboard_wait_for_text (clip); - - if(no && selectedCall) - { - switch(selectedCall->_state) - { - case CALL_STATE_TRANSFERT: - case CALL_STATE_DIALING: - // Add the text to the number - { - gchar * before; - before = selectedCall->_peer_number; - DEBUG("TO: %s\n", before); - selectedCall->_peer_number = g_strconcat(before, no, NULL); - - if(selectedCall->_state == CALL_STATE_DIALING) - { - selectedCall->_peer_info = g_strconcat("\"\" <", selectedCall->_peer_number, ">", NULL); - } - calltree_update_call(current_calls, selectedCall, NULL); - } - break; - case CALL_STATE_RINGING: - case CALL_STATE_INCOMING: - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - case CALL_STATE_HOLD: - { // Create a new call to hold the new text - selectedCall = sflphone_new_call(); - - gchar * before = selectedCall->_peer_number; - selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, no, NULL); - DEBUG("TO: %s", selectedCall->_peer_number); - - selectedCall->_peer_info = g_strconcat("\"\" <", selectedCall->_peer_number, ">", NULL); - - calltree_update_call(current_calls, selectedCall, NULL); - } - break; - case CALL_STATE_CURRENT: - default: - { - unsigned int i; - for(i = 0; i < strlen(no); i++) - { - gchar * oneNo = g_strndup(&no[i], 1); - DEBUG("<%s>", oneNo); - dbus_play_dtmf(oneNo); - - gchar * temp = g_strconcat(selectedCall->_peer_number, oneNo, NULL); - selectedCall->_peer_info = get_peer_info (temp, selectedCall->_peer_name); - // g_free(temp); - calltree_update_call(current_calls, selectedCall, NULL); - - } - } - break; - } - - } - else // There is no current call, create one - { - selectedCall = sflphone_new_call(); - - gchar * before = selectedCall->_peer_number; - selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, no, NULL); - g_free(before); - DEBUG("TO: %s", selectedCall->_peer_number); - - g_free(selectedCall->_peer_info); - selectedCall->_peer_info = g_strconcat("\"\" <", selectedCall->_peer_number, ">", NULL); - calltree_update_call(current_calls, selectedCall, NULL); - } + GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + callable_obj_t * selectedCall = calltab_get_selected_call(current_calls); + gchar * no = gtk_clipboard_wait_for_text(clip); + + if (no && selectedCall) + { + switch (selectedCall->_state) + { + case CALL_STATE_TRANSFERT: + case CALL_STATE_DIALING: + // Add the text to the number + { + gchar * before; + before = selectedCall->_peer_number; + DEBUG("TO: %s\n", before); + selectedCall->_peer_number = g_strconcat(before, no, NULL); + + if (selectedCall->_state == CALL_STATE_DIALING) + { + selectedCall->_peer_info = g_strconcat("\"\" <", + selectedCall->_peer_number, ">", NULL); + } + calltree_update_call(current_calls, selectedCall, NULL); + } + break; + case CALL_STATE_RINGING: + case CALL_STATE_INCOMING: + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + case CALL_STATE_HOLD: + { // Create a new call to hold the new text + selectedCall = sflphone_new_call(); + + gchar * before = selectedCall->_peer_number; + selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, + no, NULL); + DEBUG("TO: %s", selectedCall->_peer_number); + + selectedCall->_peer_info = g_strconcat("\"\" <", + selectedCall->_peer_number, ">", NULL); + + calltree_update_call(current_calls, selectedCall, NULL); + } + break; + case CALL_STATE_CURRENT: + default: + { + unsigned int i; + for (i = 0; i < strlen(no); i++) + { + gchar * oneNo = g_strndup(&no[i], 1); + DEBUG("<%s>", oneNo); + dbus_play_dtmf(oneNo); + + gchar * temp = g_strconcat(selectedCall->_peer_number, oneNo, + NULL); + selectedCall->_peer_info = get_peer_info(temp, + selectedCall->_peer_name); + // g_free(temp); + calltree_update_call(current_calls, selectedCall, NULL); + + } + } + break; + } + + } + else // There is no current call, create one + { + selectedCall = sflphone_new_call(); + + gchar * before = selectedCall->_peer_number; + selectedCall->_peer_number = g_strconcat(selectedCall->_peer_number, no, + NULL); + g_free(before); + DEBUG("TO: %s", selectedCall->_peer_number); + + g_free(selectedCall->_peer_info); + selectedCall->_peer_info = g_strconcat("\"\" <", + selectedCall->_peer_number, ">", NULL); + calltree_update_call(current_calls, selectedCall, NULL); + } } -static void clear_history (void) +static void +clear_history(void) { - if( calllist_get_size( history ) != 0 ){ - calllist_clean_history(); - } + if (calllist_get_size(history) != 0) + { + calllist_clean_history(); + } } /** * Transfert the line */ -static void call_transfer_cb () +static void +call_transfer_cb() { - gboolean active = gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (transferToolbar)); - active ? sflphone_set_transfert() : sflphone_unset_transfert() ; + gboolean active = gtk_toggle_tool_button_get_active( + GTK_TOGGLE_TOOL_BUTTON (transferToolbar)); + active ? sflphone_set_transfert() : sflphone_unset_transfert(); } -static void call_mailbox_cb (void) +static void +call_mailbox_cb(void) { - account_t* current; - callable_obj_t *mailbox_call; - gchar *to, *from, *account_id; - - current = account_list_get_current (); - if( current == NULL ) // Should not happens - return; - - to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); - account_id = g_strdup (current->accountID); - - create_new_call (CALL, CALL_STATE_DIALING, "", account_id, _("Voicemail"), to, &mailbox_call); - DEBUG("TO : %s" , mailbox_call->_peer_number); - calllist_add( current_calls , mailbox_call ); - calltree_add_call( current_calls, mailbox_call, NULL); - update_actions(); - sflphone_place_call( mailbox_call ); - calltree_display(current_calls); + account_t* current; + callable_obj_t *mailbox_call; + gchar *to, *from, *account_id; + + current = account_list_get_current(); + if (current == NULL) // Should not happens + return; + + to = g_strdup(g_hash_table_lookup(current->properties, ACCOUNT_MAILBOX)); + account_id = g_strdup(current->accountID); + + create_new_call(CALL, CALL_STATE_DIALING, "", account_id, _("Voicemail"), to, + &mailbox_call); + DEBUG("TO : %s" , mailbox_call->_peer_number); + calllist_add(current_calls, mailbox_call); + calltree_add_call(current_calls, mailbox_call, NULL); + update_actions(); + sflphone_place_call(mailbox_call); + calltree_display(current_calls); } -static void toggle_history_cb (GtkToggleAction *action, gpointer user_data) +static void +toggle_history_cb(GtkToggleAction *action, gpointer user_data) { - gboolean toggle; - toggle = gtk_toggle_action_get_active (action); - (toggle)? calltree_display (history) : calltree_display (current_calls); + gboolean toggle; + toggle = gtk_toggle_action_get_active(action); + (toggle) ? calltree_display(history) : calltree_display(current_calls); } -static void toggle_addressbook_cb (GtkToggleAction *action, gpointer user_data) +static void +toggle_addressbook_cb(GtkToggleAction *action, gpointer user_data) { - gboolean toggle; - toggle = gtk_toggle_action_get_active (action); - (toggle)? calltree_display (contacts) : calltree_display (current_calls); + gboolean toggle; + toggle = gtk_toggle_action_get_active(action); + (toggle) ? calltree_display(contacts) : calltree_display(current_calls); } -static const GtkActionEntry menu_entries[] = { - - // Call Menu - { "Call", NULL, N_("Call") }, - { "NewCall", GTK_STOCK_DIAL, N_("_New call"), "<control>N", N_("Place a new call"), G_CALLBACK (call_new_call) }, - { "PickUp", GTK_STOCK_PICKUP, N_("_Pick up"), NULL, N_("Answer the call"), G_CALLBACK (call_pick_up) }, - { "HangUp", GTK_STOCK_HANGUP, N_("_Hang up"), "<control>S", N_("Finish the call"), G_CALLBACK (call_hang_up) }, - { "OnHold", GTK_STOCK_ONHOLD, N_("O_n hold"), "<control>P", N_("Place the call on hold"), G_CALLBACK (call_hold) }, - { "OffHold", GTK_STOCK_OFFHOLD, N_("O_ff hold"), "<control>P", N_("Place the call off hold"), G_CALLBACK (call_hold) }, - { "Record", GTK_STOCK_MEDIA_RECORD, N_("_Record"), "<control>R", N_("Record the current conversation"), G_CALLBACK (call_record) }, - { "AccountAssistant", NULL, N_("Configuration _Assistant"), NULL, N_("Run the configuration assistant"), G_CALLBACK (call_configuration_assistant) }, - { "Voicemail", "mail-read", N_("Voicemail"), NULL, N_("Call your voicemail"), G_CALLBACK (call_mailbox_cb) }, - { "Close", GTK_STOCK_CLOSE, N_("_Close"), "<control>W", N_("Minimize to system tray"), G_CALLBACK (call_minimize) }, - { "Quit", GTK_STOCK_CLOSE, N_("_Quit"), "<control>Q", N_("Quit the program"), G_CALLBACK (call_quit) }, - - // Edit Menu - { "Edit", NULL, N_("_Edit") }, - { "Copy", GTK_STOCK_COPY, N_("_Copy"), "<control>C", N_("Copy the selection"), G_CALLBACK (edit_copy) }, - { "Paste", GTK_STOCK_PASTE, N_("_Paste"), "<control>V", N_("Paste the clipboard"), G_CALLBACK (edit_paste) }, - { "ClearHistory", GTK_STOCK_CLEAR, N_("Clear _history"), NULL, N_("Clear the call history"), G_CALLBACK (clear_history) }, - { "Accounts", NULL, N_("_Accounts"), NULL, N_("Edit your accounts"), G_CALLBACK (edit_accounts) }, - { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, N_("Change your preferences"), G_CALLBACK (edit_preferences) }, - - // View Menu - { "View", NULL, N_("_View") }, - - // Help menu - { "Help", NULL, N_("_Help") }, - { "HelpContents", GTK_STOCK_HELP, N_("Contents"), "F1", N_("Open the manual"), G_CALLBACK (help_contents_cb) }, - { "About", GTK_STOCK_ABOUT, NULL, NULL, N_("About this application"), G_CALLBACK (help_about) } - -}; - -static const GtkToggleActionEntry toggle_menu_entries[] = { - - { "Transfer", GTK_STOCK_TRANSFER, N_("_Transfer"), "<control>T", N_("Transfer the call"), NULL }, //G_CALLBACK (call_transfer_cb) }, - { "Toolbar", NULL, N_("_Show toolbar"), "<control>T", N_("Show the toolbar"), NULL }, - { "Dialpad", NULL, N_("_Dialpad"), "<control>D", N_("Show the dialpad"), G_CALLBACK (dialpad_bar_cb) }, - { "VolumeControls",NULL, N_("_Volume controls"), "<control>V", N_("Show the volume controls"), G_CALLBACK (volume_bar_cb) }, - { "History", "appointment-soon", N_("_History"), NULL, N_("Calls history"), G_CALLBACK (toggle_history_cb), FALSE}, - { "Addressbook", GTK_STOCK_ADDRESSBOOK, N_("_Address book"), NULL, N_("Address book"), G_CALLBACK (toggle_addressbook_cb), FALSE} - -}; +static const GtkActionEntry menu_entries[] = + { + + // Call Menu + { "Call", NULL, N_("Call") }, + { "NewCall", GTK_STOCK_DIAL, N_("_New call"), "<control>N", + N_("Place a new call"), G_CALLBACK (call_new_call) }, + { "PickUp", GTK_STOCK_PICKUP, N_("_Pick up"), NULL, + N_("Answer the call"), G_CALLBACK (call_pick_up) }, + { "HangUp", GTK_STOCK_HANGUP, N_("_Hang up"), "<control>S", + N_("Finish the call"), G_CALLBACK (call_hang_up) }, + { "OnHold", GTK_STOCK_ONHOLD, N_("O_n hold"), "<control>P", + N_("Place the call on hold"), G_CALLBACK (call_hold) }, + { "OffHold", GTK_STOCK_OFFHOLD, N_("O_ff hold"), "<control>P", + N_("Place the call off hold"), G_CALLBACK (call_hold) }, + { "AccountAssistant", NULL, N_("Configuration _Assistant"), NULL, + N_("Run the configuration assistant"), + G_CALLBACK (call_configuration_assistant) }, + { "Voicemail", "mail-read", N_("Voicemail"), NULL, + N_("Call your voicemail"), G_CALLBACK (call_mailbox_cb) }, + { "Close", GTK_STOCK_CLOSE, N_("_Close"), "<control>W", + N_("Minimize to system tray"), G_CALLBACK (call_minimize) }, + { "Quit", GTK_STOCK_CLOSE, N_("_Quit"), "<control>Q", + N_("Quit the program"), G_CALLBACK (call_quit) }, + + // Edit Menu + { "Edit", NULL, N_("_Edit") }, + { "Copy", GTK_STOCK_COPY, N_("_Copy"), "<control>C", + N_("Copy the selection"), G_CALLBACK (edit_copy) }, + { "Paste", GTK_STOCK_PASTE, N_("_Paste"), "<control>V", + N_("Paste the clipboard"), G_CALLBACK (edit_paste) }, + { "ClearHistory", GTK_STOCK_CLEAR, N_("Clear _history"), NULL, + N_("Clear the call history"), G_CALLBACK (clear_history) }, + { "Accounts", NULL, N_("_Accounts"), NULL, N_("Edit your accounts"), + G_CALLBACK (edit_accounts) }, + { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences"), NULL, + N_("Change your preferences"), G_CALLBACK (edit_preferences) }, + + // View Menu + { "View", NULL, N_("_View") }, + + // Help menu + { "Help", NULL, N_("_Help") }, + { "HelpContents", GTK_STOCK_HELP, N_("Contents"), "F1", + N_("Open the manual"), G_CALLBACK (help_contents_cb) }, + { "About", GTK_STOCK_ABOUT, NULL, NULL, N_("About this application"), + G_CALLBACK (help_about) } + + }; + +static const GtkToggleActionEntry toggle_menu_entries[] = + { + + { "Transfer", GTK_STOCK_TRANSFER, N_("_Transfer"), "<control>T", + N_("Transfer the call"), NULL }, //G_CALLBACK (call_transfer_cb) }, + { "Record", GTK_STOCK_MEDIA_RECORD, N_("_Record"), "<control>R", + N_("Record the current conversation"), NULL }, // G_CALLBACK (call_record) }, + { "Toolbar", NULL, N_("_Show toolbar"), "<control>T", + N_("Show the toolbar"), NULL }, + { "Dialpad", NULL, N_("_Dialpad"), "<control>D", + N_("Show the dialpad"), G_CALLBACK (dialpad_bar_cb) }, + { "VolumeControls", NULL, N_("_Volume controls"), "<control>V", + N_("Show the volume controls"), G_CALLBACK (volume_bar_cb) }, + { "History", "appointment-soon", N_("_History"), NULL, + N_("Calls history"), G_CALLBACK (toggle_history_cb), FALSE }, + { "Addressbook", GTK_STOCK_ADDRESSBOOK, N_("_Address book"), NULL, + N_("Address book"), G_CALLBACK (toggle_addressbook_cb), FALSE } + + }; + +gboolean +uimanager_new(GtkUIManager **_ui_manager) +{ -gboolean uimanager_new (GtkUIManager **_ui_manager) { - - GtkUIManager *ui_manager; - GtkActionGroup *action_group; - GtkWidget *window; - gchar *path; - GError *error = NULL; - - window = get_main_window (); - ui_manager = gtk_ui_manager_new (); - - /* Create an accel group for window's shortcuts */ - path = g_build_filename (SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL); - if (g_file_test (path, G_FILE_TEST_EXISTS)) { - gtk_ui_manager_add_ui_from_file (ui_manager, path, &error); - - if (error != NULL) - { - g_error_free (error); - return FALSE; - } - g_free (path); - } - else { - path = g_build_filename (SFLPHONE_UIDIR, "./ui.xml", NULL); - if (g_file_test (path, G_FILE_TEST_EXISTS)) { - gtk_ui_manager_add_ui_from_file (ui_manager, path, &error); - - if (error != NULL) - { - g_error_free (error); - return FALSE; - } - g_free (path); - } - else - return FALSE; - } - action_group = gtk_action_group_new ("SFLphoneWindowActions"); - // To translate label and tooltip entries - gtk_action_group_set_translation_domain (action_group, "sflphone-client-gnome"); - gtk_action_group_add_actions (action_group, menu_entries, G_N_ELEMENTS (menu_entries), window); - gtk_action_group_add_toggle_actions (action_group, toggle_menu_entries, G_N_ELEMENTS (toggle_menu_entries), window); - //gtk_action_group_add_radio_actions (action_group, radio_menu_entries, G_N_ELEMENTS (radio_menu_entries), CALLTREE_CALLS, G_CALLBACK (calltree_switch_cb), window); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - *_ui_manager = ui_manager; - - return TRUE; + GtkUIManager *ui_manager; + GtkActionGroup *action_group; + GtkWidget *window; + gchar *path; + GError *error = NULL; + + window = get_main_window(); + ui_manager = gtk_ui_manager_new(); + + /* Create an accel group for window's shortcuts */ + path = g_build_filename(SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL); + if (g_file_test(path, G_FILE_TEST_EXISTS)) + { + gtk_ui_manager_add_ui_from_file(ui_manager, path, &error); + + if (error != NULL) + { + g_error_free(error); + return FALSE; + } + g_free(path); + } + else + { + path = g_build_filename(SFLPHONE_UIDIR, "./ui.xml", NULL); + if (g_file_test(path, G_FILE_TEST_EXISTS)) + { + gtk_ui_manager_add_ui_from_file(ui_manager, path, &error); + + if (error != NULL) + { + g_error_free(error); + return FALSE; + } + g_free(path); + } + else + return FALSE; + } + action_group = gtk_action_group_new("SFLphoneWindowActions"); + // To translate label and tooltip entries + gtk_action_group_set_translation_domain(action_group, "sflphone-client-gnome"); + gtk_action_group_add_actions(action_group, menu_entries, + G_N_ELEMENTS (menu_entries), window); + gtk_action_group_add_toggle_actions(action_group, toggle_menu_entries, + G_N_ELEMENTS (toggle_menu_entries), window); + //gtk_action_group_add_radio_actions (action_group, radio_menu_entries, G_N_ELEMENTS (radio_menu_entries), CALLTREE_CALLS, G_CALLBACK (calltree_switch_cb), window); + gtk_ui_manager_insert_action_group(ui_manager, action_group, 0); + + *_ui_manager = ui_manager; + + return TRUE; } -static void edit_number_cb (GtkWidget *widget UNUSED, gpointer user_data) { - +static void +edit_number_cb(GtkWidget *widget UNUSED, gpointer user_data) +{ - show_edit_number ((callable_obj_t*)user_data); + show_edit_number((callable_obj_t*) user_data); } -void add_registered_accounts_to_menu (GtkWidget *menu) { - - GtkWidget *menu_items; - unsigned int i; - account_t* acc, *current; - gchar* alias; - - menu_items = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show (menu_items); - - for( i = 0 ; i < account_list_get_size() ; i++ ){ - acc = account_list_get_nth(i); - // Display only the registered accounts - if( g_strcasecmp( account_state_name(acc->state) , account_state_name(ACCOUNT_STATE_REGISTERED) ) == 0 ){ - alias = g_strconcat( g_hash_table_lookup(acc->properties , ACCOUNT_ALIAS) , " - ",g_hash_table_lookup(acc->properties , ACCOUNT_TYPE), NULL); - menu_items = gtk_check_menu_item_new_with_mnemonic(alias); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_object_set_data( G_OBJECT( menu_items ) , "account" , acc ); - g_free( alias ); - current = account_list_get_current(); - if(current){ - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (g_strcasecmp( acc->accountID , current->accountID) == 0)? TRUE : FALSE); - } - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (switch_account), - NULL); - gtk_widget_show (menu_items); - } // fi - } +void +add_registered_accounts_to_menu(GtkWidget *menu) +{ -} + GtkWidget *menu_items; + unsigned int i; + account_t* acc, *current; + gchar* alias; + + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show(menu_items); + + for (i = 0; i < account_list_get_size(); i++) + { + acc = account_list_get_nth(i); + // Display only the registered accounts + if (g_strcasecmp(account_state_name(acc->state), account_state_name( + ACCOUNT_STATE_REGISTERED)) == 0) + { + alias = g_strconcat(g_hash_table_lookup(acc->properties, + ACCOUNT_ALIAS), " - ", g_hash_table_lookup(acc->properties, + ACCOUNT_TYPE), NULL); + menu_items = gtk_check_menu_item_new_with_mnemonic(alias); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_object_set_data(G_OBJECT( menu_items ), "account", acc); + g_free(alias); + current = account_list_get_current(); + if (current) + { + gtk_check_menu_item_set_active( + GTK_CHECK_MENU_ITEM(menu_items), + (g_strcasecmp(acc->accountID, current->accountID) == 0) ? TRUE + : FALSE); + } + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (switch_account), + NULL); + gtk_widget_show(menu_items); + } // fi + } +} - void -show_popup_menu (GtkWidget *my_widget, GdkEventButton *event) +void +show_popup_menu(GtkWidget *my_widget, GdkEventButton *event) { - // TODO update the selection to make sure the call under the mouse is the call selected - - // call type boolean - gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = FALSE, detach = FALSE; - gboolean accounts = FALSE; - - // conference type boolean - gboolean hangup_conf = FALSE, hold_conf = FALSE; - - callable_obj_t * selectedCall; - conference_obj_t * selectedConf; - - if (calltab_get_selected_type(current_calls) == A_CALL) - { - DEBUG("MENUS: SELECTED A CALL"); - selectedCall = calltab_get_selected_call(current_calls); - - if (selectedCall) - { - copy = TRUE; - switch(selectedCall->_state) - { - case CALL_STATE_INCOMING: - pickup = TRUE; - hangup = TRUE; - detach = TRUE; - break; - case CALL_STATE_HOLD: - hangup = TRUE; - hold = TRUE; - detach = TRUE; - break; - case CALL_STATE_RINGING: - hangup = TRUE; - detach = TRUE; - break; - case CALL_STATE_DIALING: - pickup = TRUE; - hangup = TRUE; - accounts = TRUE; - break; - case CALL_STATE_RECORD: - case CALL_STATE_CURRENT: - hangup = TRUE; - hold = TRUE; - record = TRUE; - detach = TRUE; - break; - case CALL_STATE_BUSY: - case CALL_STATE_FAILURE: - hangup = TRUE; - break; - default: - WARN("Should not happen in show_popup_menu for calls!"); - break; - } - } - } - else - { - DEBUG("MENUS: SELECTED A CONF"); - selectedConf = calltab_get_selected_conf(); - - if (selectedConf) - { - switch(selectedConf->_state) - { - case CONFERENCE_STATE_ACTIVE_ATACHED: - hangup_conf = TRUE; - hold_conf = TRUE; - break; - case CONFERENCE_STATE_ACTIVE_DETACHED: - break; - case CONFERENCE_STATE_HOLD: - hangup_conf = TRUE; - hold_conf = TRUE; - break; - default: - WARN("Should not happen in show_popup_menu for conferences!"); - break; - } - } - - } - - GtkWidget *menu; - GtkWidget *image; - int button, event_time; - GtkWidget * menu_items; - - menu = gtk_menu_new (); - //g_signal_connect (menu, "deactivate", - // G_CALLBACK (gtk_widget_destroy), NULL); - if (calltab_get_selected_type(current_calls) == A_CALL) - { - DEBUG("BUILD CALL MENU"); - - if(copy) - { - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_COPY, get_accel_group()); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (edit_copy), - NULL); - gtk_widget_show (menu_items); - } - - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_PASTE, get_accel_group()); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (edit_paste), - NULL); - gtk_widget_show (menu_items); - - if(pickup || hangup || hold) - { - menu_items = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show (menu_items); - } - - if(pickup) - { - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Pick up")); - image = gtk_image_new_from_file( ICONS_DIR "/icon_accept.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_pick_up), - NULL); - gtk_widget_show (menu_items); - } - - if(hangup) - { - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); - image = gtk_image_new_from_file( ICONS_DIR "/icon_hangup.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_hang_up), - NULL); - gtk_widget_show (menu_items); - } - - if(hold) - { - menu_items = gtk_check_menu_item_new_with_mnemonic (_("On _Hold")); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); - g_signal_connect(G_OBJECT (menu_items), "activate", - G_CALLBACK (call_hold), - NULL); - gtk_widget_show (menu_items); - } - - if(record) - { - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Record")); - image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_RECORD, GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (call_record), - NULL); - gtk_widget_show (menu_items); - } - - } - else - { - DEBUG("BUILD CONFERENCE MENU"); - - if(hangup_conf) - { - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); - image = gtk_image_new_from_file( ICONS_DIR "/icon_hangup.svg"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", - G_CALLBACK (conference_hang_up), - NULL); - gtk_widget_show (menu_items); - } - - if(hold_conf) - { - menu_items = gtk_check_menu_item_new_with_mnemonic (_("On _Hold")); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), - (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); - g_signal_connect(G_OBJECT (menu_items), "activate", - G_CALLBACK (conference_hold), - NULL); - gtk_widget_show (menu_items); - } - } - - if(accounts) - { - add_registered_accounts_to_menu (menu); - } - - if (event) - { - button = event->button; - event_time = event->time; - } - else - { - button = 0; - event_time = gtk_get_current_event_time (); - } - - gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - button, event_time); + // TODO update the selection to make sure the call under the mouse is the call selected + + // call type boolean + gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = + FALSE, detach = FALSE; + gboolean accounts = FALSE; + + // conference type boolean + gboolean hangup_conf = FALSE, hold_conf = FALSE; + + callable_obj_t * selectedCall; + conference_obj_t * selectedConf; + + if (calltab_get_selected_type(current_calls) == A_CALL) + { + DEBUG("MENUS: SELECTED A CALL"); + selectedCall = calltab_get_selected_call(current_calls); + + if (selectedCall) + { + copy = TRUE; + switch (selectedCall->_state) + { + case CALL_STATE_INCOMING: + pickup = TRUE; + hangup = TRUE; + detach = TRUE; + break; + case CALL_STATE_HOLD: + hangup = TRUE; + hold = TRUE; + detach = TRUE; + break; + case CALL_STATE_RINGING: + hangup = TRUE; + detach = TRUE; + break; + case CALL_STATE_DIALING: + pickup = TRUE; + hangup = TRUE; + accounts = TRUE; + break; + case CALL_STATE_RECORD: + case CALL_STATE_CURRENT: + hangup = TRUE; + hold = TRUE; + record = TRUE; + detach = TRUE; + break; + case CALL_STATE_BUSY: + case CALL_STATE_FAILURE: + hangup = TRUE; + break; + default: + WARN("Should not happen in show_popup_menu for calls!") + ; + break; + } + } + } + else + { + DEBUG("MENUS: SELECTED A CONF"); + selectedConf = calltab_get_selected_conf(); + + if (selectedConf) + { + switch (selectedConf->_state) + { + case CONFERENCE_STATE_ACTIVE_ATACHED: + hangup_conf = TRUE; + hold_conf = TRUE; + break; + case CONFERENCE_STATE_ACTIVE_DETACHED: + break; + case CONFERENCE_STATE_HOLD: + hangup_conf = TRUE; + hold_conf = TRUE; + break; + default: + WARN("Should not happen in show_popup_menu for conferences!") + ; + break; + } + } + + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new(); + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + if (calltab_get_selected_type(current_calls) == A_CALL) + { + DEBUG("BUILD CALL MENU"); + + if (copy) + { + menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_COPY, + get_accel_group()); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (edit_copy), + NULL); + gtk_widget_show(menu_items); + } + + menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_PASTE, + get_accel_group()); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (edit_paste), + NULL); + gtk_widget_show(menu_items); + + if (pickup || hangup || hold) + { + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show(menu_items); + } + + if (pickup) + { + + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Pick up")); + image = gtk_image_new_from_file(ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_pick_up), + NULL); + gtk_widget_show(menu_items); + } + + if (hangup) + { + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); + image = gtk_image_new_from_file(ICONS_DIR "/icon_hangup.svg"); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_hang_up), + NULL); + gtk_widget_show(menu_items); + } + + if (hold) + { + menu_items = gtk_check_menu_item_new_with_mnemonic(_("On _Hold")); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), + (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); + g_signal_connect(G_OBJECT (menu_items), "activate", + G_CALLBACK (call_hold), + NULL); + gtk_widget_show(menu_items); + } + + if (record) + { + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Record")); + image = gtk_image_new_from_stock(GTK_STOCK_MEDIA_RECORD, + GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (call_record), + NULL); + gtk_widget_show(menu_items); + } + + } + else + { + DEBUG("BUILD CONFERENCE MENU"); + + if (hangup_conf) + { + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Hang up")); + image = gtk_image_new_from_file(ICONS_DIR "/icon_hangup.svg"); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", + G_CALLBACK (conference_hang_up), + NULL); + gtk_widget_show(menu_items); + } + + if (hold_conf) + { + menu_items = gtk_check_menu_item_new_with_mnemonic(_("On _Hold")); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_items), + (selectedCall->_state == CALL_STATE_HOLD ? TRUE : FALSE)); + g_signal_connect(G_OBJECT (menu_items), "activate", + G_CALLBACK (conference_hold), + NULL); + gtk_widget_show(menu_items); + } + } + + if (accounts) + { + add_registered_accounts_to_menu(menu); + } + + if (event) + { + button = event->button; + event_time = event->time; + } + else + { + button = 0; + event_time = gtk_get_current_event_time(); + } + + gtk_menu_attach_to_widget(GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } - - void +void show_popup_menu_history(GtkWidget *my_widget, GdkEventButton *event) { - gboolean pickup = FALSE; - gboolean remove = FALSE; - gboolean edit = FALSE; - gboolean accounts = FALSE; - - callable_obj_t * selectedCall = calltab_get_selected_call( history ); - if (selectedCall) - { - remove = TRUE; - pickup = TRUE; - edit = TRUE; - accounts = TRUE; - } - - GtkWidget *menu; - GtkWidget *image; - int button, event_time; - GtkWidget * menu_items; - - menu = gtk_menu_new (); - //g_signal_connect (menu, "deactivate", - // G_CALLBACK (gtk_widget_destroy), NULL); - - if(pickup) - { - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Call back")); - image = gtk_image_new_from_file( ICONS_DIR "/icon_accept.svg"); - gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( menu_items ), image ); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); - gtk_widget_show (menu_items); - } - - menu_items = gtk_separator_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - gtk_widget_show (menu_items); - - if (edit) - { - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_EDIT, get_accel_group()); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); - gtk_widget_show (menu_items); - } - - - if(remove) - { - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_DELETE, get_accel_group()); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate", G_CALLBACK (remove_from_history), NULL); - gtk_widget_show (menu_items); - } - - if(accounts) - { - add_registered_accounts_to_menu (menu); - } - - if (event) - { - button = event->button; - event_time = event->time; - } - else - { - button = 0; - event_time = gtk_get_current_event_time (); - } - - gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - button, event_time); + gboolean pickup = FALSE; + gboolean remove = FALSE; + gboolean edit = FALSE; + gboolean accounts = FALSE; + + callable_obj_t * selectedCall = calltab_get_selected_call(history); + if (selectedCall) + { + remove = TRUE; + pickup = TRUE; + edit = TRUE; + accounts = TRUE; + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new(); + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + + if (pickup) + { + + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Call back")); + image = gtk_image_new_from_file(ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM ( menu_items ), image); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); + gtk_widget_show(menu_items); + } + + menu_items = gtk_separator_menu_item_new(); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + gtk_widget_show(menu_items); + + if (edit) + { + menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_EDIT, + get_accel_group()); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); + gtk_widget_show(menu_items); + } + + if (remove) + { + menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_DELETE, + get_accel_group()); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate", G_CALLBACK (remove_from_history), NULL); + gtk_widget_show(menu_items); + } + + if (accounts) + { + add_registered_accounts_to_menu(menu); + } + + if (event) + { + button = event->button; + event_time = event->time; + } + else + { + button = 0; + event_time = gtk_get_current_event_time(); + } + + gtk_menu_attach_to_widget(GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } - void +void show_popup_menu_contacts(GtkWidget *my_widget, GdkEventButton *event) { - gboolean pickup = FALSE; - gboolean accounts = FALSE; - gboolean edit = FALSE; - - callable_obj_t * selectedCall = calltab_get_selected_call( contacts ); - if (selectedCall) - { - pickup = TRUE; - accounts = TRUE; - edit = TRUE; - } - - GtkWidget *menu; - GtkWidget *image; - int button, event_time; - GtkWidget * menu_items; - - menu = gtk_menu_new (); - //g_signal_connect (menu, "deactivate", - // G_CALLBACK (gtk_widget_destroy), NULL); - - if(pickup) - { - - menu_items = gtk_image_menu_item_new_with_mnemonic(_("_New call")); - image = gtk_image_new_from_file( ICONS_DIR "/icon_accept.svg"); - gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM ( menu_items ), image ); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); - gtk_widget_show (menu_items); - } - - if (edit) - { - menu_items = gtk_image_menu_item_new_from_stock( GTK_STOCK_EDIT, get_accel_group()); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_items); - g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); - gtk_widget_show (menu_items); - } - - if(accounts) - { - add_registered_accounts_to_menu (menu); - } - - if (event) - { - button = event->button; - event_time = event->time; - } - else - { - button = 0; - event_time = gtk_get_current_event_time (); - } - - gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - button, event_time); + gboolean pickup = FALSE; + gboolean accounts = FALSE; + gboolean edit = FALSE; + + callable_obj_t * selectedCall = calltab_get_selected_call(contacts); + if (selectedCall) + { + pickup = TRUE; + accounts = TRUE; + edit = TRUE; + } + + GtkWidget *menu; + GtkWidget *image; + int button, event_time; + GtkWidget * menu_items; + + menu = gtk_menu_new(); + //g_signal_connect (menu, "deactivate", + // G_CALLBACK (gtk_widget_destroy), NULL); + + if (pickup) + { + + menu_items = gtk_image_menu_item_new_with_mnemonic(_("_New call")); + image = gtk_image_new_from_file(ICONS_DIR "/icon_accept.svg"); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM ( menu_items ), image); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (call_back), NULL); + gtk_widget_show(menu_items); + } + + if (edit) + { + menu_items = gtk_image_menu_item_new_from_stock(GTK_STOCK_EDIT, + get_accel_group()); + gtk_menu_shell_append(GTK_MENU_SHELL (menu), menu_items); + g_signal_connect (G_OBJECT (menu_items), "activate",G_CALLBACK (edit_number_cb), selectedCall); + gtk_widget_show(menu_items); + } + + if (accounts) + { + add_registered_accounts_to_menu(menu); + } + + if (event) + { + button = event->button; + event_time = event->time; + } + else + { + button = 0; + event_time = gtk_get_current_event_time(); + } + + gtk_menu_attach_to_widget(GTK_MENU (menu), my_widget, NULL); + gtk_menu_popup(GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } +static void +ok_cb(GtkWidget *widget UNUSED, gpointer userdata) +{ -static void ok_cb (GtkWidget *widget UNUSED, gpointer userdata) { - - gchar *new_number; - callable_obj_t *modified_call, *original; + gchar *new_number; + callable_obj_t *modified_call, *original; - // Change the number of the selected call before calling - new_number = (gchar*) gtk_entry_get_text (GTK_ENTRY (editable_num)); - original = (callable_obj_t*)userdata; + // Change the number of the selected call before calling + new_number = (gchar*) gtk_entry_get_text(GTK_ENTRY (editable_num)); + original = (callable_obj_t*) userdata; - // Create the new call - create_new_call (CALL, CALL_STATE_DIALING, "", g_strdup (original->_accountID), original->_peer_name, g_strdup (new_number), &modified_call); + // Create the new call + create_new_call(CALL, CALL_STATE_DIALING, "", g_strdup(original->_accountID), + original->_peer_name, g_strdup(new_number), &modified_call); - // Update the internal data structure and the GUI - calllist_add(current_calls, modified_call); - calltree_add_call(current_calls, modified_call, NULL); - sflphone_place_call(modified_call); - calltree_display (current_calls); + // Update the internal data structure and the GUI + calllist_add(current_calls, modified_call); + calltree_add_call(current_calls, modified_call, NULL); + sflphone_place_call(modified_call); + calltree_display(current_calls); - // Close the contextual menu - gtk_widget_destroy (GTK_WIDGET (edit_dialog)); + // Close the contextual menu + gtk_widget_destroy(GTK_WIDGET (edit_dialog)); } -static void on_delete (GtkWidget * widget) +static void +on_delete(GtkWidget * widget) { - gtk_widget_destroy (widget); + gtk_widget_destroy(widget); } -void show_edit_number (callable_obj_t *call) { +void +show_edit_number(callable_obj_t *call) +{ - GtkWidget *ok, *hbox, *image; - GdkPixbuf *pixbuf; + GtkWidget *ok, *hbox, *image; + GdkPixbuf *pixbuf; - edit_dialog = GTK_DIALOG (gtk_dialog_new()); + edit_dialog = GTK_DIALOG (gtk_dialog_new()); - // Set window properties - gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 300, 20); - gtk_window_set_title(GTK_WINDOW(edit_dialog), _("Edit phone number")); - gtk_window_set_resizable (GTK_WINDOW (edit_dialog), FALSE); + // Set window properties + gtk_window_set_default_size(GTK_WINDOW(edit_dialog), 300, 20); + gtk_window_set_title(GTK_WINDOW(edit_dialog), _("Edit phone number")); + gtk_window_set_resizable(GTK_WINDOW (edit_dialog), FALSE); - g_signal_connect (G_OBJECT (edit_dialog), "delete-event", G_CALLBACK (on_delete), NULL); + g_signal_connect (G_OBJECT (edit_dialog), "delete-event", G_CALLBACK (on_delete), NULL); - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start(GTK_BOX (edit_dialog->vbox), hbox, TRUE, TRUE, 0); + hbox = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX (edit_dialog->vbox), hbox, TRUE, TRUE, 0); - // Set the number to be edited - editable_num = gtk_entry_new (); + // Set the number to be edited + editable_num = gtk_entry_new(); #if GTK_CHECK_VERSION(2,12,0) - gtk_widget_set_tooltip_text(GTK_WIDGET(editable_num), _("Edit the phone number before making a call")); + gtk_widget_set_tooltip_text(GTK_WIDGET(editable_num), + _("Edit the phone number before making a call")); #endif - if (call) - gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup (call->_peer_number)); - else - ERROR ("This a bug, the call should be defined. menus.c line 1051"); + if (call) + gtk_entry_set_text(GTK_ENTRY(editable_num), g_strdup(call->_peer_number)); + else + ERROR ("This a bug, the call should be defined. menus.c line 1051"); - gtk_box_pack_start(GTK_BOX (hbox), editable_num, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX (hbox), editable_num, TRUE, TRUE, 0); - // Set a custom image for the button - pixbuf = gdk_pixbuf_new_from_file_at_scale (ICONS_DIR "/outgoing.svg", 32, 32, TRUE, NULL); - image = gtk_image_new_from_pixbuf (pixbuf); - ok = gtk_button_new (); - gtk_button_set_image (GTK_BUTTON (ok), image); - gtk_box_pack_start(GTK_BOX (hbox), ok, TRUE, TRUE, 0); - g_signal_connect(G_OBJECT (ok), "clicked", G_CALLBACK (ok_cb), call); + // Set a custom image for the button + pixbuf = gdk_pixbuf_new_from_file_at_scale(ICONS_DIR "/outgoing.svg", 32, 32, + TRUE, NULL); + image = gtk_image_new_from_pixbuf(pixbuf); + ok = gtk_button_new(); + gtk_button_set_image(GTK_BUTTON (ok), image); + gtk_box_pack_start(GTK_BOX (hbox), ok, TRUE, TRUE, 0); + g_signal_connect(G_OBJECT (ok), "clicked", G_CALLBACK (ok_cb), call); - gtk_widget_show_all (edit_dialog->vbox); + gtk_widget_show_all(edit_dialog->vbox); - gtk_dialog_run(edit_dialog); + gtk_dialog_run(edit_dialog); } -GtkWidget* create_waiting_icon() +GtkWidget* +create_waiting_icon() { - GtkWidget * waiting_icon; - waiting_icon = gtk_image_menu_item_new_with_label(""); - gtk_image_menu_item_set_image ( - GTK_IMAGE_MENU_ITEM(waiting_icon), - gtk_image_new_from_animation( - gdk_pixbuf_animation_new_from_file(ICONS_DIR "/wait-on.gif", NULL))); - gtk_menu_item_set_right_justified(GTK_MENU_ITEM(waiting_icon),TRUE); - - return waiting_icon; + GtkWidget * waiting_icon; + waiting_icon = gtk_image_menu_item_new_with_label(""); + gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(waiting_icon), + gtk_image_new_from_animation(gdk_pixbuf_animation_new_from_file( + ICONS_DIR "/wait-on.gif", NULL))); + gtk_menu_item_set_right_justified(GTK_MENU_ITEM(waiting_icon), TRUE); + + return waiting_icon; } -void create_menus (GtkUIManager *ui_manager, GtkWidget **widget) +void +create_menus(GtkUIManager *ui_manager, GtkWidget **widget) { - GtkWidget * menu_bar; - - menu_bar = gtk_ui_manager_get_widget (ui_manager, "/MenuBar"); - pickUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/PickUp"); - newCallAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/NewCall"); - hangUpAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/HangUp"); - holdMenu = gtk_ui_manager_get_widget (ui_manager, "/MenuBar/CallMenu/OnHoldMenu"); - recordAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/CallMenu/Record"); - copyAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Copy"); - pasteAction = gtk_ui_manager_get_action (ui_manager, "/MenuBar/EditMenu/Paste"); - volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls"); - - // Set the toggle buttons - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), (gboolean) SHOW_DIALPAD); - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME); - - gtk_action_set_sensitive (GTK_ACTION (volumeToggle), SHOW_ALSA_CONF); - - // Disable it right now - gtk_action_set_sensitive (GTK_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Toolbar")), FALSE); - - waitingLayer = create_waiting_icon (); - gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), waitingLayer); - - *widget = menu_bar; + GtkWidget * menu_bar; + + menu_bar = gtk_ui_manager_get_widget(ui_manager, "/MenuBar"); + pickUpAction = gtk_ui_manager_get_action(ui_manager, + "/MenuBar/CallMenu/PickUp"); + newCallAction = gtk_ui_manager_get_action(ui_manager, + "/MenuBar/CallMenu/NewCall"); + hangUpAction = gtk_ui_manager_get_action(ui_manager, + "/MenuBar/CallMenu/HangUp"); + holdMenu = gtk_ui_manager_get_widget(ui_manager, + "/MenuBar/CallMenu/OnHoldMenu"); + recordAction = gtk_ui_manager_get_action(ui_manager, + "/MenuBar/CallMenu/Record"); + copyAction = gtk_ui_manager_get_action(ui_manager, "/MenuBar/EditMenu/Copy"); + pasteAction + = gtk_ui_manager_get_action(ui_manager, "/MenuBar/EditMenu/Paste"); + volumeToggle = gtk_ui_manager_get_action(ui_manager, + "/MenuBar/ViewMenu/VolumeControls"); + + // Set the toggle buttons + gtk_toggle_action_set_active( + GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), + (gboolean) SHOW_DIALPAD); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION (volumeToggle), + (gboolean) SHOW_VOLUME); + + gtk_action_set_sensitive(GTK_ACTION (volumeToggle), SHOW_ALSA_CONF); + + // Disable it right now + gtk_action_set_sensitive( + GTK_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Toolbar")), + FALSE); + + waitingLayer = create_waiting_icon(); + gtk_menu_shell_append(GTK_MENU_SHELL (menu_bar), waitingLayer); + + *widget = menu_bar; } -void create_toolbar_actions (GtkUIManager *ui_manager, GtkWidget **widget) +void +create_toolbar_actions(GtkUIManager *ui_manager, GtkWidget **widget) { - toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions"); - - holdToolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/OnHoldToolbar"); - offHoldToolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/OffHoldToolbar"); - transferToolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/TransferToolbar"); - voicemailAction = gtk_ui_manager_get_action (ui_manager, "/ToolbarActions/Voicemail"); - voicemailToolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/VoicemailToolbar"); - newCallWidget = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/NewCallToolbar"); - pickUpWidget = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/PickUpToolbar"); - hangUpWidget = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/HangUpToolbar"); - recordWidget = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/RecordToolbar"); - historyButton = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/HistoryToolbar"); - contactButton = gtk_ui_manager_get_widget (ui_manager, "/ToolbarActions/AddressbookToolbar"); - - // Set the handler ID for the transfer - transfertButtonConnId = g_signal_connect (G_OBJECT (transferToolbar), "toggled", G_CALLBACK (call_transfer_cb), NULL); - active_calltree = current_calls; - - *widget = toolbar; + toolbar = gtk_ui_manager_get_widget(ui_manager, "/ToolbarActions"); + + holdToolbar = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/OnHoldToolbar"); + offHoldToolbar = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/OffHoldToolbar"); + transferToolbar = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/TransferToolbar"); + voicemailAction = gtk_ui_manager_get_action(ui_manager, + "/ToolbarActions/Voicemail"); + voicemailToolbar = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/VoicemailToolbar"); + newCallWidget = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/NewCallToolbar"); + pickUpWidget = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/PickUpToolbar"); + hangUpWidget = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/HangUpToolbar"); + recordWidget = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/RecordToolbar"); + historyButton = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/HistoryToolbar"); + contactButton = gtk_ui_manager_get_widget(ui_manager, + "/ToolbarActions/AddressbookToolbar"); + + // Set the handler ID for the transfer + transfertButtonConnId + = g_signal_connect (G_OBJECT (transferToolbar), "toggled", G_CALLBACK (call_transfer_cb), NULL); + recordButtonConnId + = g_signal_connect (G_OBJECT (recordWidget), "toggled", G_CALLBACK (call_record), NULL); + active_calltree = current_calls; + + *widget = toolbar; } diff --git a/sflphone-client-kde/CMakeLists.txt b/sflphone-client-kde/CMakeLists.txt index 65b269cfd0d95d8477259389787519d1fa829449..c16efdcb6e584685facfd002d0a085e729deb982 100644 --- a/sflphone-client-kde/CMakeLists.txt +++ b/sflphone-client-kde/CMakeLists.txt @@ -8,7 +8,7 @@ SET(CMAKE_MODULE_PATH "${LOCAL_CMAKE_MODULE_PATH}") # --- custom targets: --- INCLUDE( ${LOCAL_CMAKE_MODULE_PATH}/TargetDistclean.cmake REQUIRED) -FIND_PACKAGE ( Kabc REQUIRED ) +#FIND_PACKAGE ( Kabc REQUIRED ) # FIND_PACKAGE ( PkgConfig REQUIRED ) FIND_PACKAGE ( KDE4 REQUIRED ) FIND_PACKAGE ( Qt4 REQUIRED ) diff --git a/sflphone-client-kde/README b/sflphone-client-kde/README index 3db5b30eedc0bcf455d2c3d2a050d077ae5f6c34..12f57ce7bb04de1ee0aca358621a62f747e2fead 100644 --- a/sflphone-client-kde/README +++ b/sflphone-client-kde/README @@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Refer to the development site for further information: http://dev.savoirfairelinux.net/sflphone +Refer to the development site for further information: https://projects.savoirfairelinux.com/projects/show/sflphone Thank you diff --git a/sflphone-client-kde/man/sflphone-client-kde.1.docbook b/sflphone-client-kde/man/sflphone-client-kde.1.docbook index c676275b815baa14f79a7df9cd53beef61951035..ff0fa5ca504436ae792babddfe2f12b0a30e3612 100644 --- a/sflphone-client-kde/man/sflphone-client-kde.1.docbook +++ b/sflphone-client-kde/man/sflphone-client-kde.1.docbook @@ -44,7 +44,7 @@ sflphone-client-kde is a KDE client for SFLphone; it communicates with the core <refsect1> <title>Bugs</title> -<para>Please report bugs at http://dev.savoirfairelinux.net/sflphone/newticket.</para> +<para>Please report bugs at https://projects.savoirfairelinux.com/projects/sflphone/issues/new.</para> </refsect1> diff --git a/sflphone-client-kde/man/sflphone-client-kde.pod b/sflphone-client-kde/man/sflphone-client-kde.pod index 9aa07b2e59bc6af6c50a694adcc276ed1fa2c0c1..559160f429bbabf2d079efdc27c29d90241de5cf 100644 --- a/sflphone-client-kde/man/sflphone-client-kde.pod +++ b/sflphone-client-kde/man/sflphone-client-kde.pod @@ -14,7 +14,7 @@ B<sflphone-client-kde> is a KDE client for SFLphone; it communicates with the co =head1 BUGS -Please report bugs at http://dev.savoirfairelinux.net/sflphone/newticket. +Please report bugs at https://projects.savoirfairelinux.com/projects/show/sflphone. =head1 AUTHORS diff --git a/sflphone-client-kde/src/SFLPhone.cpp b/sflphone-client-kde/src/SFLPhone.cpp index 783ac4d33319fe3d1ef4840d3b1e906dee5daa19..20aaa87a8e21ad75699c5fbf59e237216913bb0f 100644 --- a/sflphone-client-kde/src/SFLPhone.cpp +++ b/sflphone-client-kde/src/SFLPhone.cpp @@ -18,7 +18,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - +#include <unistd.h> #include "SFLPhone.h" #include <unistd.h> diff --git a/sflphone-client-kde/src/conf/dlgaccounts.cpp b/sflphone-client-kde/src/conf/dlgaccounts.cpp index a46c4028f2bde415b382db07231a7f83e913945b..711e3ef407ffef33dd9c0950b3681ff9561f882f 100644 --- a/sflphone-client-kde/src/conf/dlgaccounts.cpp +++ b/sflphone-client-kde/src/conf/dlgaccounts.cpp @@ -54,10 +54,10 @@ DlgAccounts::DlgAccounts(KConfigDialog *parent) this, SLOT(changedAccountList())); connect(edit6_mailbox, SIGNAL(textEdited(const QString &)), this, SLOT(changedAccountList())); - connect(checkbox_stun, SIGNAL(toggled(bool)), - this, SLOT(changedAccountList())); - connect(checkbox_zrtp, SIGNAL(toggled(bool)), - this, SLOT(changedAccountList())); + connect(spinbox_regExpire, SIGNAL(editingFinished()), + this, SLOT(changedAccountList())); + connect(checkBox_conformRFC, SIGNAL(clicked(bool)), + this, SLOT(changedAccountList())); connect(button_accountUp, SIGNAL(clicked()), this, SLOT(changedAccountList())); connect(button_accountDown, SIGNAL(clicked()), @@ -66,37 +66,40 @@ DlgAccounts::DlgAccounts(KConfigDialog *parent) this, SLOT(changedAccountList())); connect(button_accountRemove, SIGNAL(clicked()), this, SLOT(changedAccountList())); - connect(edit_tls_private_key_password_2, SIGNAL(textEdited(const QString &)), + connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)), this, SLOT(changedAccountList())); - connect(spinbox_tls_listener_2, SIGNAL(editingFinished()), + connect(spinbox_tls_listener, SIGNAL(editingFinished()), this, SLOT(changedAccountList())); - connect(file_tls_authority_2, SIGNAL(textChanged(const QString &)), + connect(file_tls_authority, SIGNAL(textChanged(const QString &)), this, SLOT(changedAccountList())); - connect(file_tls_endpoint_2, SIGNAL(textChanged(const QString &)), + connect(file_tls_endpoint, SIGNAL(textChanged(const QString &)), this, SLOT(changedAccountList())); - connect(file_tls_private_key_2, SIGNAL(textChanged(const QString &)), + connect(file_tls_private_key, SIGNAL(textChanged(const QString &)), this, SLOT(changedAccountList())); - connect(combo_tls_method_2, SIGNAL(currentIndexChanged(int)), + connect(combo_tls_method, SIGNAL(currentIndexChanged(int)), this, SLOT(changedAccountList())); - connect(edit_tls_cipher_2, SIGNAL(textEdited(const QString &)), + connect(edit_tls_cipher, SIGNAL(textEdited(const QString &)), this, SLOT(changedAccountList())); - connect(edit_tls_outgoing_2, SIGNAL(textEdited(const QString &)), + connect(edit_tls_outgoing, SIGNAL(textEdited(const QString &)), this, SLOT(changedAccountList())); - connect(spinbox_tls_timeout_sec_2, SIGNAL(editingFinished()), + connect(spinbox_tls_timeout_sec, SIGNAL(editingFinished()), this, SLOT(changedAccountList())); - connect(spinbox_tls_timeout_msec_2, SIGNAL(editingFinished()), + connect(spinbox_tls_timeout_msec, SIGNAL(editingFinished()), this, SLOT(changedAccountList())); - connect(check_tls_incoming_2, SIGNAL(clicked(bool)), + connect(check_tls_incoming, SIGNAL(clicked(bool)), this, SLOT(changedAccountList())); - connect(check_tls_answer_2, SIGNAL(clicked(bool)), + connect(check_tls_answer, SIGNAL(clicked(bool)), this, SLOT(changedAccountList())); - connect(check_tls_requier_cert_2, SIGNAL(clicked(bool)), + connect(check_tls_requier_cert, SIGNAL(clicked(bool)), this, SLOT(changedAccountList())); connect(group_security_tls, SIGNAL(clicked(bool)), this, SLOT(changedAccountList())); + + connect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(updateAccountStates())); - connect(&configurationManager, SIGNAL(accountsChanged()), - this, SLOT(updateAccountStates())); + connect(edit_tls_private_key_password, SIGNAL(textEdited(const QString &)), + this, SLOT(changedAccountList())); connect(this, SIGNAL(updateButtons()), parent, SLOT(updateButtons())); @@ -199,20 +202,20 @@ void DlgAccounts::saveAccount(QListWidgetItem * item) account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); //Security - account->setAccountDetail(TLS_PASSWORD,edit_tls_private_key_password_2->text()); - account->setAccountDetail(TLS_LISTENER_PORT,QString::number(spinbox_tls_listener_2->value())); - account->setAccountDetail(TLS_CA_LIST_FILE,file_tls_authority_2->text()); - account->setAccountDetail(TLS_CERTIFICATE_FILE,file_tls_endpoint_2->text()); - account->setAccountDetail(TLS_PRIVATE_KEY_FILE,file_tls_private_key_2->text()); - qDebug() << "\n\n\n\nSET: " << combo_tls_method_2->currentText() << "\n\n\n"; - account->setAccountDetail(TLS_METHOD,combo_tls_method_2->currentText()); - account->setAccountDetail(TLS_CIPHERS,edit_tls_cipher_2->text()); - account->setAccountDetail(TLS_SERVER_NAME,edit_tls_outgoing_2->text()); - account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC,QString::number(spinbox_tls_timeout_sec_2->value())); - account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC,QString::number(spinbox_tls_timeout_msec_2->value())); - account->setAccountDetail(TLS_VERIFY_SERVER,check_tls_incoming_2->isChecked()?"true":"false"); - account->setAccountDetail(TLS_VERIFY_CLIENT,check_tls_answer_2->isChecked()?"true":"false"); - account->setAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE,check_tls_requier_cert_2->isChecked()?"true":"false"); + account->setAccountDetail(TLS_PASSWORD,edit_tls_private_key_password->text()); + account->setAccountDetail(TLS_LISTENER_PORT,QString::number(spinbox_tls_listener->value())); + account->setAccountDetail(TLS_CA_LIST_FILE,file_tls_authority->text()); + account->setAccountDetail(TLS_CERTIFICATE_FILE,file_tls_endpoint->text()); + account->setAccountDetail(TLS_PRIVATE_KEY_FILE,file_tls_private_key->text()); + //qDebug() << "\n\n\n\nSET: " << combo_tls_method->currentText() << "\n\n\n"; + account->setAccountDetail(TLS_METHOD,combo_tls_method->currentText()); + account->setAccountDetail(TLS_CIPHERS,edit_tls_cipher->text()); + account->setAccountDetail(TLS_SERVER_NAME,edit_tls_outgoing->text()); + account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC,QString::number(spinbox_tls_timeout_sec->value())); + account->setAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC,QString::number(spinbox_tls_timeout_msec->value())); + account->setAccountDetail(TLS_VERIFY_SERVER,check_tls_incoming->isChecked()?"true":"false"); + account->setAccountDetail(TLS_VERIFY_CLIENT,check_tls_answer->isChecked()?"true":"false"); + account->setAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE,check_tls_requier_cert->isChecked()?"true":"false"); account->setAccountDetail(TLS_ENABLE,group_security_tls->isChecked()?"true":"false"); account->setAccountDetail(TLS_METHOD, QString::number(combo_security_STRP->currentIndex())); } @@ -241,45 +244,71 @@ void DlgAccounts::loadAccount(QListWidgetItem * item) edit4_user->setText( account->getAccountDetail(ACCOUNT_USERNAME)); edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); - +// <<<<<<< HEAD +// +// //Security +// edit_tls_private_key_password_2->setText( account->getAccountDetail(TLS_PASSWORD )); +// spinbox_tls_listener_2->setValue( account->getAccountDetail(TLS_LISTENER_PORT ).toInt()); +// file_tls_authority_2->setText( account->getAccountDetail(TLS_CA_LIST_FILE )); +// file_tls_endpoint_2->setText( account->getAccountDetail(TLS_CERTIFICATE_FILE )); +// file_tls_private_key_2->setText( account->getAccountDetail(TLS_PRIVATE_KEY_FILE )); +// qDebug() << "\n\n\n\nTHIS: " << account->getAccountDetail(TLS_METHOD ) << "\n\n\n"; +// combo_tls_method_2->setCurrentIndex( combo_tls_method_2->findText(account->getAccountDetail(TLS_METHOD ))); +// edit_tls_cipher_2->setText( account->getAccountDetail(TLS_CIPHERS )); +// edit_tls_outgoing_2->setText( account->getAccountDetail(TLS_SERVER_NAME )); +// spinbox_tls_timeout_sec_2->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC ).toInt()); +// spinbox_tls_timeout_msec_2->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC ).toInt()); +// check_tls_incoming_2->setChecked( (account->getAccountDetail(TLS_VERIFY_SERVER ) == "true")?1:0); +// check_tls_answer_2->setChecked( (account->getAccountDetail(TLS_VERIFY_CLIENT ) == "true")?1:0); +// check_tls_requier_cert_2->setChecked( (account->getAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE ) == "true")?1:0); +// ======= + checkBox_conformRFC->setChecked( account->getAccountDetail(ACCOUNT_RESOLVE_ONCE) != "TRUE" ); + bool ok; + int val = account->getAccountDetail(ACCOUNT_EXPIRE).toInt(&ok); + spinbox_regExpire->setValue(ok ? val : ACCOUNT_EXPIRE_DEFAULT); + //Security - edit_tls_private_key_password_2->setText( account->getAccountDetail(TLS_PASSWORD )); - spinbox_tls_listener_2->setValue( account->getAccountDetail(TLS_LISTENER_PORT ).toInt()); - file_tls_authority_2->setText( account->getAccountDetail(TLS_CA_LIST_FILE )); - file_tls_endpoint_2->setText( account->getAccountDetail(TLS_CERTIFICATE_FILE )); - file_tls_private_key_2->setText( account->getAccountDetail(TLS_PRIVATE_KEY_FILE )); - qDebug() << "\n\n\n\nTHIS: " << account->getAccountDetail(TLS_METHOD ) << "\n\n\n"; - combo_tls_method_2->setCurrentIndex( combo_tls_method_2->findText(account->getAccountDetail(TLS_METHOD ))); - edit_tls_cipher_2->setText( account->getAccountDetail(TLS_CIPHERS )); - edit_tls_outgoing_2->setText( account->getAccountDetail(TLS_SERVER_NAME )); - spinbox_tls_timeout_sec_2->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC ).toInt()); - spinbox_tls_timeout_msec_2->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC ).toInt()); - check_tls_incoming_2->setChecked( (account->getAccountDetail(TLS_VERIFY_SERVER ) == "true")?1:0); - check_tls_answer_2->setChecked( (account->getAccountDetail(TLS_VERIFY_CLIENT ) == "true")?1:0); - check_tls_requier_cert_2->setChecked( (account->getAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE ) == "true")?1:0); + edit_tls_private_key_password->setText( account->getAccountDetail(TLS_PASSWORD )); + spinbox_tls_listener->setValue( account->getAccountDetail(TLS_LISTENER_PORT ).toInt()); + file_tls_authority->setText( account->getAccountDetail(TLS_CA_LIST_FILE )); + file_tls_endpoint->setText( account->getAccountDetail(TLS_CERTIFICATE_FILE )); + file_tls_private_key->setText( account->getAccountDetail(TLS_PRIVATE_KEY_FILE )); + //qDebug() << "\n\n\n\nTHIS: " << account->getAccountDetail(TLS_METHOD ) << "\n\n\n"; + combo_tls_method->setCurrentIndex( combo_tls_method->findText(account->getAccountDetail(TLS_METHOD ))); + edit_tls_cipher->setText( account->getAccountDetail(TLS_CIPHERS )); + edit_tls_outgoing->setText( account->getAccountDetail(TLS_SERVER_NAME )); + spinbox_tls_timeout_sec->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_SEC ).toInt()); + spinbox_tls_timeout_msec->setValue( account->getAccountDetail(TLS_NEGOTIATION_TIMEOUT_MSEC ).toInt()); + check_tls_incoming->setChecked( (account->getAccountDetail(TLS_VERIFY_SERVER ) == "true")?1:0); + check_tls_answer->setChecked( (account->getAccountDetail(TLS_VERIFY_CLIENT ) == "true")?1:0); + check_tls_requier_cert->setChecked( (account->getAccountDetail(TLS_REQUIRE_CLIENT_CERTIFICATE ) == "true")?1:0); +// >>>>>>> master group_security_tls->setChecked( (account->getAccountDetail(TLS_ENABLE ) == "true")?1:0); combo_security_STRP->setCurrentIndex(account->getAccountDetail(TLS_METHOD ).toInt()); - if(protocolIndex == 0) // if sip selected - { - checkbox_stun->setChecked(account->getAccountDetail(ACCOUNT_SIP_STUN_ENABLED) == ACCOUNT_ENABLED_TRUE); - edit_stunServer->setText( account->getAccountDetail(ACCOUNT_SIP_STUN_SERVER) ); - checkbox_zrtp->setChecked(account->getAccountDetail(ACCOUNT_SRTP_ENABLED) == ACCOUNT_ENABLED_TRUE); - - tab_advanced->setEnabled(true); - edit_stunServer->setEnabled(checkbox_stun->isChecked()); - } - else - { - checkbox_stun->setChecked(false); - edit_stunServer->setText( account->getAccountDetail(ACCOUNT_SIP_STUN_SERVER) ); - checkbox_zrtp->setChecked(false); - - tab_advanced->setEnabled(false); - } - +// <<<<<<< HEAD +// if(protocolIndex == 0) // if sip selected +// { +// checkbox_stun->setChecked(account->getAccountDetail(ACCOUNT_SIP_STUN_ENABLED) == ACCOUNT_ENABLED_TRUE); +// edit_stunServer->setText( account->getAccountDetail(ACCOUNT_SIP_STUN_SERVER) ); +// checkbox_zrtp->setChecked(account->getAccountDetail(ACCOUNT_SRTP_ENABLED) == ACCOUNT_ENABLED_TRUE); +// +// tab_advanced->setEnabled(true); +// edit_stunServer->setEnabled(checkbox_stun->isChecked()); +// } +// else +// { +// checkbox_stun->setChecked(false); +// edit_stunServer->setText( account->getAccountDetail(ACCOUNT_SIP_STUN_SERVER) ); +// checkbox_zrtp->setChecked(false); +// +// tab_advanced->setEnabled(false); +// } + +// ======= +// >>>>>>> master updateStatusLabel(account); frame2_editAccounts->setEnabled(true); } @@ -314,18 +343,21 @@ void DlgAccounts::changedAccountList() accountListHasChanged = true; emit updateButtons(); //toolButton_accountsApply->setEnabled(true); +//<<<<<<< HEAD - int currentIndex = edit2_protocol->currentIndex(); - - if(currentIndex==0) - { - tab_advanced->setEnabled(true); - edit_stunServer->setEnabled(checkbox_stun->isChecked()); - } - else - { - tab_advanced->setEnabled(false); - } +// int currentIndex = edit2_protocol->currentIndex(); + +// if(currentIndex==0) +// { +// tab_advanced->setEnabled(true); +// edit_stunServer->setEnabled(checkbox_stun->isChecked()); +// } +// else +// { +// tab_advanced->setEnabled(false); +// } +//======= +//>>>>>>> master } @@ -393,12 +425,21 @@ void DlgAccounts::on_button_accountRemove_clicked() listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r ); } +//<<<<<<< HEAD /*void DlgAccounts::on_toolButton_accountsApply_clicked() { qDebug() << "on_toolButton_accountsApply_clicked"; updateSettings(); updateWidgets(); }*/ +//======= +// void DlgAccounts::on_toolButton_accountsApply_clicked() //This button have been removed, coded kept for potential reversal +// { +// qDebug() << "on_toolButton_accountsApply_clicked"; +// updateSettings(); +// updateWidgets(); +// } +//>>>>>>> master void DlgAccounts::on_edit1_alias_textChanged(const QString & text) { diff --git a/sflphone-client-kde/src/conf/dlgaccounts.h b/sflphone-client-kde/src/conf/dlgaccounts.h index ca89fa17ce6ee9d84da21dc88990b92320ba0be2..dcb8fb23f04c39a43668945b54f769418bc61985 100644 --- a/sflphone-client-kde/src/conf/dlgaccounts.h +++ b/sflphone-client-kde/src/conf/dlgaccounts.h @@ -78,7 +78,7 @@ private slots: void on_button_accountRemove_clicked(); void on_edit1_alias_textChanged(const QString & text); void on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); - //void on_toolButton_accountsApply_clicked(); +// //void on_toolButton_accountsApply_clicked(); //Disabled for future removal void updateAccountStates(); void addAccountToAccountList(Account * account); void updateAccountListCommands(); diff --git a/sflphone-client-kde/src/conf/dlgaccountsbase.ui b/sflphone-client-kde/src/conf/dlgaccountsbase.ui index d477ac8da6d3f8a82bdb787b7e0bb20cdc00733f..a794240e5a4d840c83d7c9b795cfec75f651467a 100644 --- a/sflphone-client-kde/src/conf/dlgaccountsbase.ui +++ b/sflphone-client-kde/src/conf/dlgaccountsbase.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>787</width> - <height>455</height> + <width>748</width> + <height>447</height> </rect> </property> <property name="windowTitle"> @@ -30,7 +30,7 @@ <widget class="QFrame" name="frame1_accountList"> <property name="sizePolicy"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>1</horstretch> + <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> @@ -46,6 +46,12 @@ <height>16777215</height> </size> </property> + <property name="sizeIncrement"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> @@ -220,9 +226,6 @@ </item> <item> <widget class="QTabWidget" name="frame2_editAccounts"> - <property name="enabled"> - <bool>true</bool> - </property> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <horstretch>3</horstretch> @@ -230,7 +233,7 @@ </sizepolicy> </property> <property name="currentIndex"> - <number>3</number> + <number>0</number> </property> <widget class="QWidget" name="tab_basic"> <attribute name="title"> @@ -379,57 +382,34 @@ </layout> </widget> <widget class="QWidget" name="tab_advanced"> - <property name="enabled"> - <bool>false</bool> - </property> <attribute name="title"> <string>Advanced</string> </attribute> <layout class="QFormLayout" name="formLayout_2"> - <item row="5" column="1"> - <widget class="QCheckBox" name="checkbox_stun"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QLabel" name="label_regExpire"> <property name="text"> - <string/> + <string>Registration expire</string> </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QCheckBox" name="checkbox_zrtp"> - <property name="text"> - <string/> + <property name="buddy"> + <cstring>spinbox_regExpire</cstring> </property> </widget> </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_zrtp"> - <property name="text"> - <string>Secure with ZRTP</string> + <item row="0" column="1"> + <widget class="KIntSpinBox" name="spinbox_regExpire"> + <property name="maximum"> + <number>16777215</number> </property> </widget> </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_stun"> + <item row="3" column="0" colspan="2"> + <widget class="QCheckBox" name="checkBox_conformRFC"> <property name="text"> - <string>Enable Stun</string> - </property> - </widget> - </item> - <item row="6" column="0" colspan="2"> - <widget class="KLineEdit" name="edit_stunServer"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="toolTip"> - <string>Format : name.server:port</string> - </property> - <property name="squeezedTextEnabled"> - <bool>false</bool> - </property> - <property name="clickMessage"> - <string>choose Stun server (example : stunserver.org)</string> - </property> - <property name="showClearButton" stdset="0"> - <bool>false</bool> + <string>Conform to RFC 3263</string> </property> </widget> </item> @@ -440,7 +420,7 @@ <string>Credential</string> </attribute> <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0" colspan="3"> + <item row="0" column="0" rowspan="2" colspan="3"> <widget class="QListWidget" name="list_credential"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> @@ -450,34 +430,20 @@ </property> </widget> </item> - <item row="1" column="0"> + <item row="2" column="0"> <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>248</width> + <width>327</width> <height>23</height> </size> </property> </spacer> </item> - <item row="1" column="1"> - <widget class="QToolButton" name="button_add_credential"> - <property name="text"> - <string>Add</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QToolButton" name="button_remove_credential"> - <property name="text"> - <string>Remove</string> - </property> - </widget> - </item> - <item row="2" column="0" colspan="3"> + <item row="3" column="0" colspan="3"> <widget class="QGroupBox" name="group_credential"> <property name="title"> <string>Details</string> @@ -516,14 +482,28 @@ </layout> </widget> </item> + <item row="2" column="1"> + <widget class="QToolButton" name="button_add_credential"> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item row="2" column="2"> + <widget class="QToolButton" name="button_remove_credential"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> </layout> </widget> <widget class="QWidget" name="tab_2"> <attribute name="title"> <string>Security</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0"> <widget class="QScrollArea" name="scrollArea"> <property name="widgetResizable"> <bool>true</bool> @@ -533,8 +513,8 @@ <rect> <x>0</x> <y>0</y> - <width>465</width> - <height>580</height> + <width>426</width> + <height>588</height> </rect> </property> <layout class="QGridLayout" name="gridLayout_5"> @@ -610,23 +590,23 @@ <property name="checked"> <bool>false</bool> </property> - <layout class="QGridLayout" name="gridLayout_6"> + <layout class="QGridLayout" name="gridLayout_4"> <item row="0" column="0"> - <widget class="QLabel" name="label_tls_listener_2"> + <widget class="QLabel" name="label_tls_listener"> <property name="text"> <string>Global TLS listener*</string> </property> </widget> </item> <item row="0" column="1" colspan="3"> - <widget class="KIntSpinBox" name="spinbox_tls_listener_2"> + <widget class="KIntSpinBox" name="spinbox_tls_listener"> <property name="maximum"> <number>65535</number> </property> </widget> </item> <item row="0" column="4" colspan="5"> - <spacer name="horizontalSpacer_6"> + <spacer name="horizontalSpacer_4"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -639,54 +619,54 @@ </spacer> </item> <item row="1" column="0"> - <widget class="QLabel" name="label_tls_authority_2"> + <widget class="QLabel" name="label_tls_authority"> <property name="text"> <string>Authority certificate list</string> </property> </widget> </item> <item row="1" column="1" colspan="8"> - <widget class="KUrlRequester" name="file_tls_authority_2"/> + <widget class="KUrlRequester" name="file_tls_authority"/> </item> <item row="2" column="0"> - <widget class="QLabel" name="label_tls_endpoint_2"> + <widget class="QLabel" name="label_tls_endpoint"> <property name="text"> <string>Public endpoint certificate</string> </property> </widget> </item> <item row="2" column="1" colspan="8"> - <widget class="KUrlRequester" name="file_tls_endpoint_2"/> + <widget class="KUrlRequester" name="file_tls_endpoint"/> </item> <item row="3" column="0"> - <widget class="QLabel" name="label_tls_private_key_2"> + <widget class="QLabel" name="label_tls_private_key"> <property name="text"> <string>Private key</string> </property> </widget> </item> <item row="3" column="1" colspan="8"> - <widget class="KUrlRequester" name="file_tls_private_key_2"/> + <widget class="KUrlRequester" name="file_tls_private_key"/> </item> <item row="4" column="0"> - <widget class="QLabel" name="label_tls_private_key_password_2"> + <widget class="QLabel" name="label_tls_private_key_password"> <property name="text"> <string>Private key password</string> </property> </widget> </item> <item row="4" column="1" colspan="8"> - <widget class="KLineEdit" name="edit_tls_private_key_password_2"/> + <widget class="KLineEdit" name="edit_tls_private_key_password"/> </item> <item row="5" column="0"> - <widget class="QLabel" name="label_tls_method_2"> + <widget class="QLabel" name="label_tls_method"> <property name="text"> <string>TLS protocol method</string> </property> </widget> </item> <item row="5" column="1" colspan="3"> - <widget class="QComboBox" name="combo_tls_method_2"> + <widget class="QComboBox" name="combo_tls_method"> <item> <property name="text"> <string>Default</string> @@ -715,7 +695,7 @@ </widget> </item> <item row="5" column="4" colspan="5"> - <spacer name="horizontalSpacer_7"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -728,34 +708,34 @@ </spacer> </item> <item row="6" column="0"> - <widget class="QLabel" name="label_tls_cipher_2"> + <widget class="QLabel" name="label_tls_cipher"> <property name="text"> <string>TLS cipher list</string> </property> </widget> </item> <item row="6" column="1" colspan="8"> - <widget class="KLineEdit" name="edit_tls_cipher_2"/> + <widget class="KLineEdit" name="edit_tls_cipher"/> </item> <item row="7" column="0"> - <widget class="QLabel" name="label_tls_outgoing_2"> + <widget class="QLabel" name="label_tls_outgoing"> <property name="text"> <string>Outgoing TLS server name</string> </property> </widget> </item> <item row="7" column="1" colspan="8"> - <widget class="KLineEdit" name="edit_tls_outgoing_2"/> + <widget class="KLineEdit" name="edit_tls_outgoing"/> </item> <item row="8" column="0"> - <widget class="QLabel" name="label_tls_timeout_2"> + <widget class="QLabel" name="label_tls_timeout"> <property name="text"> <string>Negotiation timeout (s:ms)</string> </property> </widget> </item> <item row="8" column="1"> - <widget class="KIntSpinBox" name="spinbox_tls_timeout_sec_2"> + <widget class="KIntSpinBox" name="spinbox_tls_timeout_sec"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -771,35 +751,35 @@ </widget> </item> <item row="9" column="0" colspan="5"> - <widget class="QCheckBox" name="check_tls_incoming_2"> + <widget class="QCheckBox" name="check_tls_incoming"> <property name="text"> <string>Verify incoming certificates (server side)</string> </property> </widget> </item> <item row="10" column="0" colspan="5"> - <widget class="QCheckBox" name="check_tls_answer_2"> + <widget class="QCheckBox" name="check_tls_answer"> <property name="text"> <string>Verify answer certificates (client side)</string> </property> </widget> </item> <item row="11" column="0" colspan="5"> - <widget class="QCheckBox" name="check_tls_requier_cert_2"> + <widget class="QCheckBox" name="check_tls_requier_cert"> <property name="text"> <string>Require a certificate for incoming TLS connections</string> </property> </widget> </item> <item row="12" column="0"> - <widget class="QLabel" name="label_tls_details_2"> + <widget class="QLabel" name="label_tls_details"> <property name="text"> <string>*Apply to all accounts</string> </property> </widget> </item> <item row="13" column="0"> - <spacer name="verticalSpacer_2"> + <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -812,7 +792,7 @@ </spacer> </item> <item row="8" column="4" colspan="5"> - <spacer name="horizontalSpacer_8"> + <spacer name="horizontalSpacer_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -825,7 +805,7 @@ </spacer> </item> <item row="8" column="3"> - <widget class="KIntSpinBox" name="spinbox_tls_timeout_msec_2"> + <widget class="KIntSpinBox" name="spinbox_tls_timeout_msec"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -841,7 +821,7 @@ </widget> </item> <item row="8" column="2"> - <widget class="QLabel" name="label_timeout2_2"> + <widget class="QLabel" name="label_timeout2"> <property name="sizePolicy"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <horstretch>0</horstretch> @@ -879,6 +859,58 @@ </layout> </widget> </item> + <item> + <widget class="QGroupBox" name="groupBox_commonSettings"> + <property name="title"> + <string/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_10"> + <item> + <widget class="QLabel" name="label_commonSettings"> + <property name="text"> + <string>Stun parameters will be applied on each SIP account created.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QFormLayout" name="formLayout_commonSettings"> + <property name="fieldGrowthPolicy"> + <enum>QFormLayout::ExpandingFieldsGrow</enum> + </property> + <item row="0" column="0"> + <widget class="QCheckBox" name="kcfg_enableStun"> + <property name="text"> + <string>Enable Stun</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="KLineEdit" name="kcfg_stunServer"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Format : name.server:port</string> + </property> + <property name="squeezedTextEnabled"> + <bool>false</bool> + </property> + <property name="clickMessage"> + <string>choose Stun server (example : stunserver.org)</string> + </property> + <property name="showClearButton" stdset="0"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> </layout> </widget> <customwidgets> @@ -901,5 +933,22 @@ <resources> <include location="../qrc/resources.qrc"/> </resources> - <connections/> + <connections> + <connection> + <sender>kcfg_enableStun</sender> + <signal>toggled(bool)</signal> + <receiver>kcfg_stunServer</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>71</x> + <y>414</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>419</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/sflphone-client-kde/src/main.cpp b/sflphone-client-kde/src/main.cpp index 988c3a87a4d0c821a0bb7421e8b5ddeaeb27a168..de08783a7bdcdbfac1ef854a3bb3533ec2d0e760 100644 --- a/sflphone-client-kde/src/main.cpp +++ b/sflphone-client-kde/src/main.cpp @@ -1,5 +1,4 @@ #include <unistd.h> - #include <QApplication> #include <QtCore/QString> #include <QtGui/QMenu> diff --git a/sflphone-client-kde/src/sflphone_const.h b/sflphone-client-kde/src/sflphone_const.h index 8993df27f9448298f63d98228c50fbac62e2ff58..54b6f6e4666b58c12df9459526d244dd2184cda3 100644 --- a/sflphone-client-kde/src/sflphone_const.h +++ b/sflphone-client-kde/src/sflphone_const.h @@ -246,6 +246,35 @@ #define CONST_ALSA 0 #define CONST_PULSEAUDIO 1 - +/** TLS */ +#define TLS_LISTENER_PORT "TLS.listenerPort" +#define TLS_ENABLE "TLS.enable" +#define TLS_PORT "TLS.port" +#define TLS_CA_LIST_FILE "TLS.certificateListFile" +#define TLS_CERTIFICATE_FILE "TLS.certificateFile" +#define TLS_PRIVATE_KEY_FILE "TLS.privateKeyFile" +#define TLS_PASSWORD "TLS.password" +#define TLS_METHOD "TLS.method" +#define TLS_CIPHERS "TLS.ciphers" +#define TLS_SERVER_NAME "TLS.serverName" +#define TLS_VERIFY_SERVER "TLS.verifyServer" +#define TLS_VERIFY_CLIENT "TLS.verifyClient" +#define TLS_REQUIRE_CLIENT_CERTIFICATE "TLS.requireClientCertificate" +#define TLS_NEGOTIATION_TIMEOUT_SEC "TLS.negotiationTimeoutSec" +#define TLS_NEGOTIATION_TIMEOUT_MSEC "TLS.negotiationTimemoutMsec" + +#define ACCOUNT_PASSWORD "password" +#define ACCOUNT_AUTHENTICATION_USERNAME "authenticationUsername" +#define ACCOUNT_REALM "realm" +#define ACCOUNT_KEY_EXCHANGE "SRTP.keyExchange" +#define ACCOUNT_SRTP_ENABLED "SRTP.enable" +#define ACCOUNT_SRTP_RTP_FALLBACK "SRTP.rtpFallback" +#define ACCOUNT_ZRTP_DISPLAY_SAS "ZRTP.displaySAS" +#define ACCOUNT_ZRTP_NOT_SUPP_WARNING "ZRTP.notSuppWarning" +#define ACCOUNT_ZRTP_HELLO_HASH "ZRTP.helloHashEnable" +#define ACCOUNT_DISPLAY_SAS_ONCE "ZRTP.displaySasOnce" +#define KEY_EXCHANGE_NONE "0" +#define ZRTP "1" +#define SDES "2" #endif diff --git a/sflphone-common/.cproject b/sflphone-common/.cproject new file mode 100644 index 0000000000000000000000000000000000000000..2f2b2a83bbc18134deb427278add4fd75d92e257 --- /dev/null +++ b/sflphone-common/.cproject @@ -0,0 +1,937 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<?fileVersion 4.0.0?> + +<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> +<storageModule moduleId="org.eclipse.cdt.core.settings"> +<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1334434668"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1334434668" moduleId="org.eclipse.cdt.core.settings" name="Debug"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="sflphone-common" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1334434668" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug"> +<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1334434668." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1440064034" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.1326164352" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/> +<builder buildPath="${workspace_loc:/sflphone-common}" id="cdt.managedbuild.target.gnu.builder.exe.debug.943929430" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="-1" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/> +<tool id="cdt.managedbuild.tool.gnu.archiver.base.346381185" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.27143558" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug"> +<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.921724511" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> +<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.1752614994" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.548320150" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.8935091" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug"> +<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1442755176" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.exe.debug.option.debugging.level.768478086" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1769752022" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1740382896" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1001572120" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug"> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2023620584" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1753020190" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.384585975" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +</toolChain> +</folderInfo> +<sourceEntries> +<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/> +</sourceEntries> +</configuration> +</storageModule> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1334434668;cdt.managedbuild.config.gnu.exe.debug.1334434668.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.8935091;cdt.managedbuild.tool.gnu.c.compiler.input.1769752022"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.418162094;cdt.managedbuild.config.gnu.exe.release.418162094.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1870258177;cdt.managedbuild.tool.gnu.c.compiler.input.186132729"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.418162094;cdt.managedbuild.config.gnu.exe.release.418162094.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.270168324;cdt.managedbuild.tool.gnu.cpp.compiler.input.758787020"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1334434668;cdt.managedbuild.config.gnu.exe.debug.1334434668.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.27143558;cdt.managedbuild.tool.gnu.cpp.compiler.input.548320150"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +</cconfiguration> +<cconfiguration id="cdt.managedbuild.config.gnu.exe.release.418162094"> +<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.418162094" moduleId="org.eclipse.cdt.core.settings" name="Release"> +<externalSettings/> +<extensions> +<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/> +<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> +</extensions> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<configuration artifactName="sflphone-common" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.418162094" name="Release" parent="cdt.managedbuild.config.gnu.exe.release"> +<folderInfo id="cdt.managedbuild.config.gnu.exe.release.418162094." name="/" resourcePath=""> +<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.1224261522" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release"> +<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1551176649" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/> +<builder buildPath="${workspace_loc:/sflphone-common}" id="cdt.managedbuild.target.gnu.builder.exe.release.821405347" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="-1" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/> +<tool id="cdt.managedbuild.tool.gnu.archiver.base.808688542" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.270168324" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release"> +<option id="gnu.cpp.compiler.exe.release.option.optimization.level.324641683" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> +<option id="gnu.cpp.compiler.exe.release.option.debugging.level.1322686559" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> +<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.758787020" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.1870258177" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release"> +<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.1967167078" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/> +<option id="gnu.c.compiler.exe.release.option.debugging.level.1326539031" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/> +<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.186132729" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> +</tool> +<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1339934122" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/> +<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1247653269" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release"> +<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2024163167" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> +<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> +<additionalInput kind="additionalinput" paths="$(LIBS)"/> +</inputType> +</tool> +<tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.779475213" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release"> +<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1675601061" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> +</tool> +</toolChain> +</folderInfo> +</configuration> +</storageModule> +<storageModule moduleId="scannerConfiguration"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1334434668;cdt.managedbuild.config.gnu.exe.debug.1334434668.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.8935091;cdt.managedbuild.tool.gnu.c.compiler.input.1769752022"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.418162094;cdt.managedbuild.config.gnu.exe.release.418162094.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.1870258177;cdt.managedbuild.tool.gnu.c.compiler.input.186132729"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.418162094;cdt.managedbuild.config.gnu.exe.release.418162094.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.270168324;cdt.managedbuild.tool.gnu.cpp.compiler.input.758787020"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1334434668;cdt.managedbuild.config.gnu.exe.debug.1334434668.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.27143558;cdt.managedbuild.tool.gnu.cpp.compiler.input.548320150"> +<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="makefileGenerator"> +<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/${specs_file}"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'g++ -E -P -v -dD "${plugin_state_location}/specs.cpp"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"> +<buildOutputProvider> +<openAction enabled="true" filePath=""/> +<parser enabled="true"/> +</buildOutputProvider> +<scannerInfoProvider id="specsFile"> +<runAction arguments="-c 'gcc -E -P -v -dD "${plugin_state_location}/specs.c"'" command="sh" useDefault="true"/> +<parser enabled="true"/> +</scannerInfoProvider> +</profile> +</scannerConfigBuildInfo> +</storageModule> +<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/> +<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> +<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> +<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/> +</cconfiguration> +</storageModule> +<storageModule moduleId="cdtBuildSystem" version="4.0.0"> +<project id="sflphone-common.cdt.managedbuild.target.gnu.exe.246189308" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/> +</storageModule> +</cproject> diff --git a/.project b/sflphone-common/.project similarity index 91% rename from .project rename to sflphone-common/.project index f9b08154597ee09847322ef15e715a9a244a7b75..889ad35fbb41203bf3b6ff6423d3f3da57cd9058 100644 --- a/.project +++ b/sflphone-common/.project @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>sflphone</name> + <name>sflphone-common</name> <comment></comment> <projects> </projects> @@ -23,12 +23,16 @@ </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.buildArguments</key> - <value></value> + <value>-j</value> </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.buildCommand</key> <value>make</value> </dictionary> + <dictionary> + <key>org.eclipse.cdt.make.core.buildLocation</key> + <value>${workspace_loc:/sflphone-common}</value> + </dictionary> <dictionary> <key>org.eclipse.cdt.make.core.cleanBuildTarget</key> <value>clean</value> @@ -70,9 +74,9 @@ </buildCommand> </buildSpec> <natures> + <nature>org.eclipse.cdt.core.cnature</nature> <nature>org.eclipse.cdt.core.ccnature</nature> - <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> - <nature>org.eclipse.cdt.core.cnature</nature> + <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> </natures> </projectDescription> diff --git a/sflphone-common/Makefile.am b/sflphone-common/Makefile.am index 6d464df1bf37e8d39e06d4e3e91f6ecc220143b6..c5de2501fbb765d640061938f15ce4b259270a3a 100644 --- a/sflphone-common/Makefile.am +++ b/sflphone-common/Makefile.am @@ -18,6 +18,12 @@ unittest: @echo " -- You need the cppunit devel package to compile the unitary tests." endif +doc: + @(cd doc; make) + @echo "" + @echo "D-Bus API HTML documentation has been generated in doc/dbus-api/doc/spec" + @echo "" + indent: @echo "Indenting code:" if [ -f $(ASTYLERC) ] ; then \ diff --git a/sflphone-common/VERSION b/sflphone-common/VERSION index 06fa200552505d51e9a42251eb6ed4432c78ce90..53cdfba097a32837dc5677c91e725e0471b96d61 100644 --- a/sflphone-common/VERSION +++ b/sflphone-common/VERSION @@ -1 +1 @@ -0.9.7~beta +0.9.8~beta diff --git a/sflphone-common/configure.ac b/sflphone-common/configure.ac index fe7cdfcc927b1878cab573e780f0984c19be50c1..7a8d3e8f45cc74e16e08435206c52fc5d00f0ad9 100644 --- a/sflphone-common/configure.ac +++ b/sflphone-common/configure.ac @@ -3,7 +3,7 @@ dnl dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) - AC_INIT([sflphone],[0.9.7~beta],[sflphoneteam@savoirfairelinux.com],[sflphone]) + AC_INIT([sflphone],[0.9.8~beta],[sflphoneteam@savoirfairelinux.com],[sflphone]) AC_COPYRIGHT([[Copyright (c) Savoir-Faire Linux 2004-2009]]) AC_REVISION([$Revision$]) @@ -19,7 +19,7 @@ AM_CONFIG_HEADER([config.h]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) dnl Use this variable in the program - AC_SUBST(PACKAGE_VERSION) +AC_SUBST(PACKAGE_VERSION) AM_PROG_LIBTOOL @@ -70,12 +70,12 @@ AC_CONFIG_FILES([Makefile]) dnl Unitary test section AC_CONFIG_FILES([test/Makefile]) - AC_CONFIG_FILES([ringtones/Makefile]) AC_CONFIG_FILES([man/Makefile]) AC_CONFIG_FILES([doc/Makefile \ + doc/dbus-api/Makefile \ doc/doxygen/Makefile]) dnl the file stamp-h.in should be there before (instead of AC_CONFIG_HEADERS(config.h)) @@ -254,27 +254,9 @@ AC_SUBST(dbus_LIBS) CXXFLAGS="-g -Wall -O2" fi - - - if test "$enable_glib" = "yes" ; then - PKG_CHECK_MODULES([glib], glib-2.0) - AC_SUBST(glib_CFLAGS) - AC_SUBST(glib_LIBS) - AM_CONDITIONAL(ENABLE_GLIB, test 1 = 1) -PKG_CHECK_MODULES([gtkmm], gtkmm-2.4, - AM_CONDITIONAL(HAVE_GTKMM, test 1 = 1), - AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) - ) - AC_SUBST(gtkmm_CFLAGS) -AC_SUBST(gtkmm_LIBS) - else - AM_CONDITIONAL(ENABLE_GLIB, test 0 = 1) -AM_CONDITIONAL(HAVE_GTKMM, test 0 = 1) - fi - AC_CHECK_LIB([expat], XML_ParserCreate_MM, [AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false)], - have_expat=false) + have_expat=false) if ! $have_expat; then AC_MSG_ERROR([You need the eXpat xml parser] @@ -284,7 +266,7 @@ fi xml_CFLAGS= xml_LIBS=-lexpat -AC_SUBST(xml_CFLAGS) + AC_SUBST(xml_CFLAGS) AC_SUBST(xml_LIBS) AC_CHECK_LIB([pthread], pthread_create, @@ -304,9 +286,9 @@ AC_CHECK_LIB([pcre], pcre_free, AC_MSG_ERROR([You need the Perl-Compatible Regular Expressions library (pcre)]) fi -PCRE_LIBS=-lpcre -PCRE_CFLAGS= -AC_SUBST(PCRE_LIBS) + PCRE_LIBS=-lpcre + PCRE_CFLAGS= + AC_SUBST(PCRE_LIBS) AC_SUBST(PCRE_CFLAGS) @@ -375,18 +357,9 @@ AC_DEFINE([HAVE_SPEEX], test "x$with_speex" = "xyes", [Define if you have libspe AM_CONDITIONAL(ENABLE_SPEEXDSP, test $HAVE_SPEEXDSP = yes) dnl Check for celt. Compile it only if a recent enough version is found - LIBCELT_MIN_VERSION=0.5.1 + LIBCELT_MIN_VERSION=0.7.1 PKG_CHECK_MODULES(CELT, celt >= ${LIBCELT_MIN_VERSION}, AM_CONDITIONAL(BUILD_CELT, test 1 = 1 ), AM_CONDITIONAL(BUILD_CELT, test 0 = 1 )) - dnl Check for ilbc support -AC_ARG_WITH([ilbc], - [AS_HELP_STRING([--without-ilbc], - [disable support for the ilbc codec])], - [], - [with_ilbc=no]) - -AM_CONDITIONAL(BUILD_ILBC, test "x$with_ilbc" = "xyes" ) - dnl Check for IAX AC_ARG_WITH([iax2], [AS_HELP_STRING([--without-iax2], diff --git a/sflphone-common/doc/Makefile.am b/sflphone-common/doc/Makefile.am index bbe34b9b1a6c74986447496e5d138d4902d5f937..f742c26ce5b69235cbafa55a31bf5292ffffa0e7 100644 --- a/sflphone-common/doc/Makefile.am +++ b/sflphone-common/doc/Makefile.am @@ -1,6 +1,6 @@ -SUBDIRS = doxygen +SUBDIRS = doxygen dbus-api .PHONY: doc doc: - $(MAKE) -C doxygen doc \ No newline at end of file + $(MAKE) -C doxygen doc diff --git a/sflphone-common/doc/dbus-api/Makefile.am b/sflphone-common/doc/dbus-api/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ced9bceb9dcbb3635220042dfdc8cacd9f35fe13 --- /dev/null +++ b/sflphone-common/doc/dbus-api/Makefile.am @@ -0,0 +1,28 @@ +include $(top_srcdir)/globals.mak + +XSLTPROC=xsltproc --xinclude --nonet +PYTHON=python + +XMLS= $(wildcard $(top_srcdir)/src/dbus/spec/*.xml) +TEMPLATES= $(wildcard doc/templates/*) + +GENERATED_FILES = \ + doc/spec.html \ + doc/spec/index.html + +doc/spec.html: $(XMLS) tools/doc-generator.xsl + @install -d tmp/doc + $(XSLTPROC) tools/doc-generator.xsl spec/all.xml > tmp/$@ + mv tmp/$@ $@ + +doc/spec/index.html: $(XMLS) tools/doc-generator.py tools/specparser.py $(TEMPLATES) + @install -d tmp/doc + $(PYTHON) tools/doc-generator.py spec/all.xml doc/spec sflphone-spec org.sflphone.SFLphone + +all: $(GENERATED_FILES) + +clean: + rm -rf $(GENERATED_FILES) + rm -rf doc/spec + rm -rf tmp + diff --git a/sflphone-common/doc/dbus-api/README b/sflphone-common/doc/dbus-api/README new file mode 100644 index 0000000000000000000000000000000000000000..3adb69af24b6160d4339180ba0d31cc003ab850e --- /dev/null +++ b/sflphone-common/doc/dbus-api/README @@ -0,0 +1,7 @@ +SFLphone D-Bus API documentation. Generated with xsltproc. + +Wiki reference: https://projects.savoirfairelinux.com/wiki/sflphone/Dbus-API + +Run Makefile to generate the HTML API documentation, from the xml interfaces in *sflphone-common/src/dbus*. + +The documentation is generated in *sflphone-common/doc/dbus-api/doc/spec* diff --git a/sflphone-common/doc/dbus-api/doc/templates/devhelp.devhelp2 b/sflphone-common/doc/dbus-api/doc/templates/devhelp.devhelp2 new file mode 100644 index 0000000000000000000000000000000000000000..af327fa6d99be647dc588b574b489ab6f6bf8ace --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/devhelp.devhelp2 @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<book xmlns="http://www.devhelp.net/book" title="$spec.title" name="$name" link="index.html"> + <chapters> +#for $interface in $spec.interfaces + <sub name="$interface.name" link="$interface.get_url()"/> +#end for + <sub name="Generic Types" link="generic-types.html"/> + <sub name="Errors" link="errors.html"/> + <sub name="Full Index" link="fullindex.html"/> + </chapters> + <functions> +#for $obj in $spec.everything.values() + $spec.types.values() + $spec.errors.values() + <keyword type="$obj.devhelp_name" name="$obj.get_title()" link="$obj.get_url()" #slurp +#if $obj.deprecated: deprecated="true" #slurp +/> +#end for + </functions> +</book> diff --git a/sflphone-common/doc/dbus-api/doc/templates/errors.html b/sflphone-common/doc/dbus-api/doc/templates/errors.html new file mode 100644 index 0000000000000000000000000000000000000000..907d6601c2145a5c825a82165b3cc493528076ca --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/errors.html @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ""> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>Errors</title> + <link rel="stylesheet" href="style.css" type="text/css"/> + </head> + <body> + <div class="header"> + <h1>Errors</h1> + <a href="index.html">Interface Index</a> + (<a href="interfaces.html">Compact</a>) + | <a href="#summary">Summary</a> + | <a href="#errors">Errors</a> + </div> + <div class="main"> + <div class="summary"> + <a name="summary"></a> + <h3>Errors</h3> + <table class="summary"> + #for $error in $spec.errors.values() + #if $error.deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td><a href="$error.get_url()">$error.short_name</a></td> + <td> + #if $error.deprecated: (deprecated) + </td> + </tr> + #end for + </table> + </div> + + <div class="outset errors error"> + <a name="errors"></a> + <h1>Errors</h1> + #for $error in $spec.errors.values() + <div class="inset error"> + <a name="$error.name"></a> + <span class="permalink">(<a href="$error.get_url()">Permalink</a>)</span> + <h2> + $error.short_name + </h2> + + <div class="indent"> + <code>$error.name</code> + </div> + + $error.get_added() + $error.get_deprecated() + $error.get_docstring() + </div> + #end for + </div> + </div> + + </body> +</html> diff --git a/sflphone-common/doc/dbus-api/doc/templates/fullindex.html b/sflphone-common/doc/dbus-api/doc/templates/fullindex.html new file mode 100644 index 0000000000000000000000000000000000000000..2c465e1dd71271750111de42d7c471f0d01686fd --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/fullindex.html @@ -0,0 +1,60 @@ +#from itertools import groupby +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ""> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>Full Index</title> + <link rel="stylesheet" href="style.css" type="text/css"/> + </head> + +#set $star = [] +#for $item in $spec.everything.values() + $spec.errors.values() + $spec.generic_types + #echo $star.append(($item.short_name, $item)) + #slurp +#end for +#echo $star.sort(key = lambda t: t[0].title()) +#slurp +## one use iterators... +#set $groups = [ (l, list(g)) for l, g in (groupby($star, key = lambda t: t[0][0].upper())) ] +#set $letters = set(map(lambda t: t[0], groups)) + + <body> + <div class="header"> + <h1>Full Index</h1> + <a href="index.html">Interface Index</a> + (<a href="interfaces.html">Compact</a>) + #for $a in map(chr, xrange(ord('A'), ord('Z')+1)) + #if $a in $letters + | <a href="#$a">$a</a> + #else + | $a + #end if + #end for + </div> + + <div class="main"> + <table class="summary"> + #for l, g in $groups + <tr><th colspan="3"><a name="$l"></a>$l</th></tr> + #for $n in $g + #if $n[1].deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td> + <a href="$n[1].get_url()" title="$n[1].get_title()">$n[0]</a> + #if $n[1].deprecated: (deprecated) + </td> + <td>$n[1].get_type_name()</td> + <td> + #if $n[1].parent.__class__.__name__ == 'Interface': $n[1].parent.name + </td> + </tr> + #end for + #end for + <table> + </div> + + </body> +</html> diff --git a/sflphone-common/doc/dbus-api/doc/templates/generic-types.html b/sflphone-common/doc/dbus-api/doc/templates/generic-types.html new file mode 100644 index 0000000000000000000000000000000000000000..0bb209e432210d364402ce23987000dbe66b7185 --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/generic-types.html @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ""> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>Generic Types</title> + <link rel="stylesheet" href="style.css" type="text/css"/> + </head> + <body> + <div class="header"> + <h1>Generic Types</h1> + <a href="index.html">Interface Index</a> + (<a href="interfaces.html">Compact</a>) + | <a href="#summary">Summary</a> + | <a href="#types">Types</a> + </div> + <div class="main"> + <div class="summary"> + <a name="summary"></a> + <h3>Generic Types</h3> + <table class="summary"> + #for $type in $spec.generic_types + #if $type.deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td><a href="$type.get_url()">$type.short_name</a></td> + <td>$type.get_type_name()</td> + <td>$type.dbus_type</td> + <td> + #if $type.deprecated: (deprecated) + </td> + </tr> + #end for + </table> + </div> + + <div class="outset types type"> + <a name="types"></a> + <h1>Generic Types</h1> + #for $type in $spec.generic_types + <div class="inset type"> + <a name="$type.name"></a> + <span class="permalink">$type.get_type_name() (<a href="$type.get_url()">Permalink</a>)</span> + <h2> + $type.short_name — $type.dbus_type + </h2> + + $type.get_added() + $type.get_deprecated() + $type.get_docstring() + $type.get_breakdown() + </div> + #end for + </div> + </div> + + </body> +</html> diff --git a/sflphone-common/doc/dbus-api/doc/templates/index.html b/sflphone-common/doc/dbus-api/doc/templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..efc38d4e8ec411eb9721c5e01f222f0c4d392913 --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/index.html @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ""> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>$spec.title &mdash v$spec.version</title> + <link rel="stylesheet" href="style.css" type="text/css"/> + </head> + <body> + <div class="header"> + <h1>$spec.title</h1> + <a href="#interfaces">Interfaces</a> + (<a href="interfaces.html">Compact</a>) + | <a href="generic-types.html">Generic Types</a> + | <a href="errors.html">Errors</a> + | <a href="fullindex.html">Full Index</a> + </div> + + <div class="main"> + <h3 class="version">Version $spec.version</h3> + <p class="copyrights"> + #echo '<br/>'.join($spec.copyrights) + </p> + $spec.license + + <a name="interfaces"></a> + <h3>Interfaces</h3> + <ul> + #def output($items) + #for $item in $items + #if $item.__class__.__name__ == 'Section' + <li class="chapter">$item.short_name</li> + $item.get_docstring() + <ul> + $output($item.items) + </ul> + #else + #if $item.causes_havoc + <li class="causes-havoc"> + #elif $item.deprecated + <li class="deprecated"> + #else + <li> + #end if + <a href="$item.get_url()">$item.name</a> + #if $item.causes_havoc + (unstable) + #elif $item.deprecated + (deprecated) + #end if + </li> + #end if + #end for + #end def + $output($spec.items) + </ul> + + <a name="other"></a> + <h3>Other</h3> + <ul> + <li><a href="generic-types.html">Generic Types</a></li> + <li><a href="errors.html">Errors</a></li> + </ul> + + </div> + </body> +</html> diff --git a/sflphone-common/doc/dbus-api/doc/templates/interface.html b/sflphone-common/doc/dbus-api/doc/templates/interface.html new file mode 100644 index 0000000000000000000000000000000000000000..79c35b201c8c6d001022567028311f38c8390dee --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/interface.html @@ -0,0 +1,424 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ""> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>$interface.name</title> + <link rel="stylesheet" href="style.css" type="text/css"/> + </head> + <body> + <div class="header"> + <h1>Interface $interface.name</h1> + <a href="index.html">Interface Index</a> + (<a href="interfaces.html">Compact</a>) + | <a href="#summary">Summary</a> + #if $interface.docstring: | <a href="#description">Description</a> + #if $interface.methods: | <a href="#methods">Methods</a> + #if $interface.signals: | <a href="#signals">Signals</a> + #if $interface.properties: | <a href="#properties">Properties</a> + #if $interface.tpproperties: | <a href="#tpproperties">Telepathy Properties</a> + #if $interface.contact_attributes: | <a href="#contact-attributes">Contact Attributes</a> + #if $interface.handler_capability_tokens: | <a href="#handler-capability-tokens">Handler Capability Tokens</a> + #if $interface.types: | <a href="#types">Types</a> + </div> + <div class="main"> + + #if $interface.methods or $interface.signals or $interface.properties or $interface.types or $interface.tpproperties + <div class="summary"> + <a name="summary"></a> + #if $interface.methods + <h3>Methods</h3> + <table class="summary"> + #for $method in $interface.methods + #if $method.deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td><a href="$method.get_url()">$method.short_name</a></td> + <td>($method.get_in_args())</td> + <td>→</td> + <td>$method.get_out_args()</td> + <td> + #if $method.deprecated: (deprecated) + </td> + </tr> + #end for + </table> + #end if + + #if $interface.signals + <h3>Signals</h3> + <table class="summary"> + #for $signal in $interface.signals + #if $signal.deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td><a href="$signal.get_url()">$signal.short_name</a></td> + <td>($signal.get_args())</td> + <td> + #if $signal.deprecated: (deprecated) + </td> + </tr> + #end for + </table> + #end if + + #if $interface.properties + <h3>Properties</h3> + <table class="summary"> + #for $property in $interface.properties + #if $property.deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td><a href="$property.get_url()">$property.short_name</a></td> + <td> + $property.dbus_type + #if $property.type: (<a href="$property.get_type_url()" title="$property.get_type_title()">$property.get_type().short_name</a>) + </td> + <td>$property.get_access()</td> + <td> + #if $property.deprecated: (deprecated) + </td> + </tr> + #end for + </table> + #end if + + #if $interface.tpproperties + <h3>Telepathy Properties</h3> + <table class="summary"> + #for $property in $interface.tpproperties + <tr class="deprecated"> + <td><a href="$property.get_url()">$property.short_name</a></td> + <td> + $property.dbus_type + #if $property.type: (<a href="$property.get_type_url()" title="$property.get_type_title()">$property.get_type().short_name</a>) + </td> + </tr> + #end for + </table> + #end if + + #if $interface.contact_attributes + <h3>Contact Attributes</h3> + <table class="summary"> + #for $token in $interface.contact_attributes + <tr class="contact-attribute"> + <td><a href="$token.get_url()">$token.name</a></td> + <td> + $token.dbus_type + #if $token.type: (<a href="$token.get_type_url()" title="$token.get_type_title()">$token.get_type().short_name</a>) + </td> + </tr> + #end for + </table> + #end if + + #if $interface.handler_capability_tokens + <h3>Handler Capability Tokens</h3> + <table class="summary"> + #for $token in $interface.handler_capability_tokens + <tr class="handler-capability-token"> + <td><a href="$token.get_url()">$token.name</a> + #if $token.is_family + (etc.) + #end if + </td> + <td> + </td> + </tr> + #end for + </table> + #end if + + #if $interface.types + <h3>Types</h3> + <table class="summary"> + #for $type in $interface.types + #if type.deprecated + <tr class="deprecated"> + #else + <tr> + #end if + <td><a href="$type.get_url()">$type.short_name</a></td> + <td>$type.get_type_name()</td> + <td>$type.dbus_type</td> + <td> + #if $type.deprecated: (deprecated) + </td> + </tr> + #end for + </table> + #end if + </div> + #end if + + #if $interface.causes_havoc + <div class="havoc"><span class="warning">WARNING:</span> + This interface is $interface.causes_havoc and is likely to cause havoc + to your API/ABI if bindings are generated. Do not include this interface + in libraries that care about compatibility. + </div> + #end if + $interface.get_added() + $interface.get_changed() + $interface.get_deprecated() + + #if $interface.requires + <div class="requires"> + Objects implementing this interface must also implement: + <ul> + #for $req in $interface.get_requires() + <li><a href="$req.get_url()" title="$req.get_title()">$req.name</a></li> + #end for + </ul> + </div> + #end if + + #if $interface.docstring + <a name="description"></a> + <h3>Description</h3> + $interface.get_docstring() + #end if + + #if $interface.methods + <div class="outset methods method"> + <a name="methods"></a> + <h1>Methods</h1> + #for $method in $interface.methods + <div class="inset method"> + <a name="$method.name"></a> + <span class="permalink">(<a href="$method.get_url()">Permalink</a>)</span> + <h2>$method.short_name ($method.get_in_args()) → $method.get_out_args()</h2> + + $method.get_added() + $method.get_changed() + $method.get_deprecated() + + #if $method.in_args + <div class="indent"> + <h3>Parameters</h3> + <ul> + #for $arg in $method.in_args + <li> + $arg.short_name — $arg.dbus_type + #if $arg.get_type(): (<a href="$arg.get_type_url()" title="$arg.get_type_title()">$arg.get_type().short_name</a>) + </li> + $arg.get_added() + $arg.get_changed() + $arg.get_deprecated() + $arg.get_docstring() + #end for + </ul> + </div> + #end if + + #if $method.out_args + <div class="indent"> + <h3>Returns</h3> + <ul> + #for $arg in $method.out_args + <li> + $arg.short_name — $arg.dbus_type + #if $arg.get_type(): (<a href="$arg.get_type_url()" title="$arg.get_type_title()">$arg.get_type().short_name</a>) + </li> + $arg.get_added() + $arg.get_changed() + $arg.get_deprecated() + $arg.get_docstring() + #end for + </ul> + </div> + #end if + + $method.get_docstring() + + #if $method.possible_errors + <hr/> + <div class="indent"> + <h3>Possible Errors</h3> + <ul> + #for $error in $method.possible_errors + <li><a href="$error.get_url()" title="$error.get_title()">$error.get_error().short_name</a></li> + $error.get_added() + $error.get_changed() + $error.get_deprecated() + $error.get_docstring() + #end for + </ul> + </div> + #end if + </div> + #end for + </div> + #end if + + #if $interface.signals + <div class="outset signals signal"> + <a name="signals"></a> + <h1>Signals</h1> + #for $signal in $interface.signals + <div class="inset signal"> + <a name="$signal.name"></a> + <span class="permalink">(<a href="$signal.get_url()">Permalink</a>)</span> + <h2>$signal.short_name ($signal.get_args())</h2> + + $signal.get_added() + $signal.get_changed() + $signal.get_deprecated() + + #if $signal.args + <div class="indent"> + <h3>Parameters</h3> + <ul> + #for $arg in $signal.args + <li> + $arg.short_name — $arg.dbus_type + #if $arg.get_type(): (<a href="$arg.get_type_url()" title="$arg.get_type_title()">$arg.get_type().short_name</a>) + </li> + $arg.get_added() + $arg.get_changed() + $arg.get_deprecated() + $arg.get_docstring() + #end for + </ul> + </div> + #end if + + $signal.get_docstring() + </div> + #end for + </div> + #end if + + #if $interface.properties + <div class="outset properties property"> + <a name="properties"></a> + <h1>Properties</h1> + <div> + Accessed using the org.freedesktop.DBus.Properties interface. + </div> + #for $property in $interface.properties + <div class="inset property"> + <a name="$property.name"></a> + <span class="permalink">(<a href="$property.get_url()">Permalink</a>)</span> + <h2> + $property.short_name — $property.dbus_type + #if $property.type: (<a href="$property.get_type_url()" title="$property.get_type_title()">$property.get_type().short_name</a>) + </h2> + <div class="access">$property.get_access()</div> + + $property.get_added() + $property.get_changed() + $property.get_deprecated() + $property.get_docstring() + </div> + #end for + </div> + #end if + + #if $interface.tpproperties + <div class="outset tpproperties tpproperty"> + <a name="tpproperties"></a> + <h1>Telepathy Properties</h1> + <div> + Accessed using the org.freedesktop.Telepathy.Properties interface. + </div> + #for $property in $interface.tpproperties + <div class="inset tpproperty"> + <a name="$property.name"></a> + <span class="permalink">(<a href="$property.get_url()">Permalink</a>)</span> + <h2> + $property.short_name — $property.dbus_type + #if $property.type: (<a href="$property.get_type_url()" title="$property.get_type_title()">$property.get_type().short_name</a>) + </h2> + $property.get_added() + $property.get_changed() + $property.get_deprecated() + $property.get_docstring() + </div> + #end for + </div> + #end if + + #if $interface.contact_attributes + <div class="outset contact-attributes"> + <a name="contact-attributes"></a> + <h1>Contact Attributes</h1> + <div> + Attributes that a contact can have, accessed with the + org.freedesktop.Telepathy.Connection.Interface.Contacts interface. + </div> + #for $token in $interface.contact_attributes + <div class="inset contact-attribute"> + <a name="$token.name"></a> + <span class="permalink">(<a href="$token.get_url()">Permalink</a>)</span> + <h2> + $token.name — $token.dbus_type + #if $token.type: (<a href="$token.get_type_url()" title="$token.get_type_title()">$token.get_type().short_name</a>) + </h2> + $token.get_added() + $token.get_changed() + $token.get_deprecated() + $token.get_docstring() + </div> + #end for + </div> + #end if + + #if $interface.handler_capability_tokens + <div class="outset handler-capability-tokens"> + <a name="handler-capability-tokens"></a> + <h1>Handler Capability Tokens</h1> + <div> + Tokens representing capabilities that a Client.Handler can have. + </div> + #for $token in $interface.handler_capability_tokens + <div class="inset handler-capability-token"> + <a name="$token.name"></a> + <span class="permalink">(<a href="$token.get_url()">Permalink</a>)</span> + <h2> + $token.name + #if $token.is_family + (etc.) + #end if + </h2> + $token.get_added() + $token.get_changed() + $token.get_deprecated() + $token.get_docstring() + </div> + #end for + </div> + #end if + + #if $interface.types + <div class="outset types type"> + <a name="types"></a> + <h1>Types</h1> + #for $type in $interface.types + <div class="inset type"> + <a name="$type.name"></a> + <span class="permalink">$type.get_type_name() (<a href="$type.get_url()">Permalink</a>)</span> + <h2> + $type.short_name — $type.dbus_type + </h2> + + $type.get_added() + $type.get_changed() + $type.get_deprecated() + $type.get_docstring() + $type.get_breakdown() + </div> + #end for + </div> + #end if + + </div> + + </body> +</html> diff --git a/sflphone-common/doc/dbus-api/doc/templates/interfaces.html b/sflphone-common/doc/dbus-api/doc/templates/interfaces.html new file mode 100644 index 0000000000000000000000000000000000000000..a93334c65de98f8e1a8933316778579d3e18d6a7 --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/interfaces.html @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ""> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <title>$spec.title &mdash v$spec.version</title> + <link rel="stylesheet" href="style.css" type="text/css"/> + </head> + <body> + <div class="header"> + <h1>$spec.title</h1> + <a href="index.html">Full</a> + | <a href="generic-types.html">Generic Types</a> + | <a href="errors.html">Errors</a> + | <a href="fullindex.html">Full Index</a> + </div> + + <div class="main"> + <b>Version $spec.version</b> + + <a name="interfaces"></a> + <h3>Interfaces</h3> + <ul> + #for $interface in $spec.interfaces + #if $interface.causes_havoc + <li class="causes-havoc"> + #elif $interface.deprecated + <li class="deprecated"> + #else + <li> + #end if + <a href="$interface.get_url()">$interface.name</a> + #if $interface.causes_havoc + (unstable) + #elif $interface.deprecated + (deprecated) + #end if + </li> + #end for + </ul> + + <a name="other"></a> + <h3>Other</h3> + <ul> + <li><a href="generic-types.html">Generic Types</a></li> + <li><a href="errors.html">Errors</a></li> + </ul> + + </div> + </body> +</html> diff --git a/sflphone-common/doc/dbus-api/doc/templates/style.css b/sflphone-common/doc/dbus-api/doc/templates/style.css new file mode 100644 index 0000000000000000000000000000000000000000..979ced8caee61b00d127e83feb7c5576fbf1c191 --- /dev/null +++ b/sflphone-common/doc/dbus-api/doc/templates/style.css @@ -0,0 +1,237 @@ +html, body, +h1, h2 { + font-family: "Georgia"; + margin: 0; + padding: 0; +} + +h3 { + margin-top: 2pt; + margin-bottom: 2pt; +} + +ul { + margin: 1ex; + margin-left: 1.5em; + padding: 0; +} + +hr { + border-style: none; + color: #cccccc; + background-color: #cccccc; + height: 1px; +} + +div.header { + position: fixed; + height: 4em; + background-color: AliceBlue; + width: 100%; + margin: 0; + padding: 0.5ex; + border-bottom: 1px solid black; + top: 0; + left: 0; + z-index: 1; +} + +div.header h1 { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +div.main { + margin-top: 5em; + margin-left: 1ex; + margin-right: 1ex; + margin-bottom: 1ex; +} + +div.main a[name] { + position: relative; + top: -4.5em; +} + +div.outset { + padding: 1ex; + margin-top: 1ex; + margin-bottom: 1ex; +} + +div.inset { + background-color: white; + margin-top: 1ex; + margin-bottom: 1ex; + padding: 0.5ex; +} + +div.indent { + margin-left: 1em; +} + +div.methods { + background-color: #fcaf3e; +} + +div.method { + border: 1px solid #f57900; +} + +div.signals { + background-color: #729fcf; +} + +div.signal { + border: 1px solid #3465a4; +} + +div.properties { + background-color: #ad7fa8; +} + +div.property { + border: 1px solid #75507b; +} + +div.tpproperties { + background-color: #999999; +} + +div.tpproperty { + border: 1px solid #333333; +} + +div.contact-attributes { + background-color: #ccccff; + border: 1px solid #9999cc; +} + +div.contact-attribute { + border: 1px solid #9999cc; +} + +div.handler-capability-tokens { + background-color: #339933; + border: 1px solid #228822; +} + +div.handler-capability-token { + border: 1px solid #228822; +} + +div.types { + background-color: #e9b96e; +} + +div.type { + border: 1px solid #c17d11; +} + +div.errors { + background-color: #ef2929; +} + +div.error { + border: 1px solid #cc0000; +} + +div.access { + font-weight: bold; + margin-left: 1ex; +} + +div.summary { + padding: 0.5ex; + background-color: #eeeeec; + border: 1px solid #d3d7cf; +} + +table.summary { + margin: 1ex; + font-size: small; +} + +table.summary td { + padding-right: 1ex; +} + +li.chapter { + margin-top: 1ex; + font-weight: bold; +} + +li.causes-havoc { + font-style: italic; +} + +li.deprecated, +li.deprecated a, +table.summary tr.deprecated td, +table.summary tr.deprecated td a { + color: gray; +} + +div.requires, +div.docstring { + margin: 1ex; +} + +div.added { + border-left: 2px solid #4e9a06; + margin: 1ex; + padding-left: 1ex; +} + +div.added span.version { + color: #4e9a06; + font-weight: bold; +} + +div.changed { + border-left: 2px solid #8f5902; + margin: 1ex; + padding-left: 1ex; +} + +div.changed span.version { + color: #8f5902; + font-weight: bold; +} + +div.deprecated, +div.havoc { + border-left: 2px solid #a40000; + margin: 1ex; + padding-left: 1ex; +} + +div.deprecated span.version, +span.warning { + color: #a40000; + font-weight: bold; +} + +div.rationale { + border-left: 2px solid gray; + margin: 1ex; + padding-left: 1ex; +} + +span.permalink { + float: right; + font-size: x-small; +} + +.license { + clear: both; + border: 1px solid #dedede; + font-style: italic; + padding: 15px; +} + +.copyrights { + clear: both; + float: right; +} diff --git a/sflphone-common/doc/dbus-api/spec/all.xml b/sflphone-common/doc/dbus-api/spec/all.xml new file mode 100644 index 0000000000000000000000000000000000000000..b87a0e1e41083510f2666fdb62b8c339087eef61 --- /dev/null +++ b/sflphone-common/doc/dbus-api/spec/all.xml @@ -0,0 +1,55 @@ +<tp:spec + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" + xmlns:xi="http://www.w3.org/2001/XInclude"> + +<tp:title>SFLphone D-Bus Interface Specification</tp:title> +<tp:version>0.9.8</tp:version> + +<tp:copyright>Copyright © 2005-2010 Savoir-faire Linux Inc</tp:copyright> + +<tp:license xmlns="http://www.w3.org/1999/xhtml"> +<p>This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version.</p> + +<p>This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details.</p> + +<p>You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p> +</tp:license> + +<tp:section name="Instances Manager"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p> + An Instance Manager to handle multiple clients connections. Count the number of clients actually registered to the core. When initializing your client, you need to register it against the core by using this interface. + </p> + </tp:docstring> + <xi:include href="instance-introspec.xml"/> +</tp:section> + +<tp:section name="Call Manager"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p> + A Call Manager to handle call-related features. + </p> + </tp:docstring> + <xi:include href="callmanager-introspec.xml"/> +</tp:section> + +<tp:section name="Configuration Manager"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p> + A Configuration Manager to handle account configuration, user preferences, ... + </p> + </tp:docstring> + <xi:include href="configurationmanager-introspec.xml"/> +</tp:section> + +<xi:include href="generic-types.xml"/> + +</tp:spec> diff --git a/sflphone-common/doc/dbus-api/spec/callmanager-introspec.xml b/sflphone-common/doc/dbus-api/spec/callmanager-introspec.xml new file mode 120000 index 0000000000000000000000000000000000000000..2150eca25d2f7405bf1f7c8684247457538207c6 --- /dev/null +++ b/sflphone-common/doc/dbus-api/spec/callmanager-introspec.xml @@ -0,0 +1 @@ +../../../src/dbus/callmanager-introspec.xml \ No newline at end of file diff --git a/sflphone-common/doc/dbus-api/spec/configurationmanager-introspec.xml b/sflphone-common/doc/dbus-api/spec/configurationmanager-introspec.xml new file mode 120000 index 0000000000000000000000000000000000000000..d340519f1a8287c927fa3e8c516b256438dc2a63 --- /dev/null +++ b/sflphone-common/doc/dbus-api/spec/configurationmanager-introspec.xml @@ -0,0 +1 @@ +../../../src/dbus/configurationmanager-introspec.xml \ No newline at end of file diff --git a/sflphone-common/doc/dbus-api/spec/errors.xml b/sflphone-common/doc/dbus-api/spec/errors.xml new file mode 100644 index 0000000000000000000000000000000000000000..22a629baff276dbeb4439352acb7df7a90b319be --- /dev/null +++ b/sflphone-common/doc/dbus-api/spec/errors.xml @@ -0,0 +1,417 @@ +<?xml version="1.0" ?> +<tp:errors xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" namespace="org.freedesktop.Telepathy.Error"> + <tp:error name="Network Error"> + <tp:docstring> + Raised when there is an error reading from or writing to the network. + </tp:docstring> + </tp:error> + + <tp:error name="Not Implemented"> + <tp:docstring> + Raised when the requested method, channel, etc is not available on this connection. + </tp:docstring> + </tp:error> + + <tp:error name="Invalid Argument"> + <tp:docstring> + Raised when one of the provided arguments is invalid. + </tp:docstring> + </tp:error> + + <tp:error name="Not Available"> + <tp:docstring> + Raised when the requested functionality is temporarily unavailable. + </tp:docstring> + </tp:error> + + <tp:error name="Permission Denied"> + <tp:docstring> + The user is not permitted to perform the requested operation. + </tp:docstring> + </tp:error> + + <tp:error name="Disconnected"> + <tp:docstring> + The connection is not currently connected and cannot be used. + This error may also be raised when operations are performed on a + Connection for which + <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">StatusChanged</tp:dbus-ref> + has signalled status Disconnected for reason None. + + <tp:rationale> + The second usage corresponds to None in the + <tp:type>Connection_Status_Reason</tp:type> enum; if a better reason + is available, the corresponding error should be used instead. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Invalid Handle"> + <tp:docstring> + The handle specified is unknown on this channel or connection. + </tp:docstring> + </tp:error> + + <tp:error name="Channel.Banned"> + <tp:docstring> + You are banned from the channel. + </tp:docstring> + </tp:error> + + <tp:error name="Channel.Full"> + <tp:docstring> + The channel is full. + </tp:docstring> + </tp:error> + + <tp:error name="Channel.Invite Only"> + <tp:docstring> + The requested channel is invite-only. + </tp:docstring> + </tp:error> + + <tp:error name="Not Yours"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p>The requested channel or other resource already exists, and another + user interface in this session is responsible for it.</p> + + <p>User interfaces SHOULD handle this error unobtrusively, since it + indicates that some other user interface is already processing the + channel.</p> + </tp:docstring> + </tp:error> + + <tp:error name="Cancelled"> + <tp:docstring> + Raised by an ongoing request if it is cancelled by user request before + it has completed, or when operations are performed on an object which + the user has asked to close (for instance, a Connection where the user + has called Disconnect, or a Channel where the user has called Close). + + <tp:rationale> + The second form can be used to correspond to the Requested member in + the <tp:type>Connection_Status_Reason</tp:type> enum, or to + to represent the situation where disconnecting a Connection, + closing a Channel, etc. has been requested by the user but this + request has not yet been acted on, for instance because the + service will only act on the request when it has finished processing + an event queue. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Authentication Failed"> + <tp:docstring> + Raised when authentication with a service was unsuccessful. + <tp:rationale> + This corresponds to Authentication_Failed in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Encryption Not Available"> + <tp:docstring> + Raised if a user request insisted that encryption should be used, + but encryption was not actually available. + + <tp:rationale> + This corresponds to part of Encryption_Error in the + <tp:type>Connection_Status_Reason</tp:type> enum. It's been separated + into a distinct error here because the two concepts that were part + of EncryptionError seem to be things that could reasonably appear + differently in the UI. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Encryption Error"> + <tp:docstring> + Raised if encryption appears to be available, but could not actually be + used (for instance if SSL/TLS negotiation fails). + <tp:rationale> + This corresponds to part of Encryption_Error in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Not Provided"> + <tp:docstring> + Raised if the server did not provide a SSL/TLS certificate. This error + MUST NOT be used to represent the absence of a client certificate + provided by the Telepathy connection manager. + <tp:rationale> + This corresponds to Cert_Not_Provided in the + <tp:type>Connection_Status_Reason</tp:type> enum. That error + explicitly applied only to server SSL certificates, so this one + is similarly limited; having the CM present a client certificate + is a possible future feature, but it should have its own error + handling. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Untrusted"> + <tp:docstring> + Raised if the server provided a SSL/TLS certificate signed by an + untrusted certifying authority. This error SHOULD NOT be used to + represent a self-signed certificate: see the Self Signed error for that. + <tp:rationale> + This corresponds to Cert_Untrusted in the + <tp:type>Connection_Status_Reason</tp:type> enum, with a clarification + to avoid ambiguity. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Expired"> + <tp:docstring> + Raised if the server provided an expired SSL/TLS certificate. + <tp:rationale> + This corresponds to Cert_Expired in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Not Activated"> + <tp:docstring> + Raised if the server provided an SSL/TLS certificate that will become + valid at some point in the future. + <tp:rationale> + This corresponds to Cert_Not_Activated in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Fingerprint Mismatch"> + <tp:docstring> + Raised if the server provided an SSL/TLS certificate that did not have + the expected fingerprint. + <tp:rationale> + This corresponds to Cert_Fingerprint_Mismatch in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Hostname Mismatch"> + <tp:docstring> + Raised if the server provided an SSL/TLS certificate that did not match + its hostname. + <tp:rationale> + This corresponds to Cert_Hostname_Mismatch in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Self Signed"> + <tp:docstring> + Raised if the server provided an SSL/TLS certificate that is self-signed + and untrusted. + <tp:rationale> + This corresponds to Cert_Hostname_Mismatch in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Cert.Invalid"> + <tp:docstring> + Raised if the server provided an SSL/TLS certificate that is + unacceptable in some way that does not have a more specific error. + <tp:rationale> + This corresponds to Cert_Other_Error in the + <tp:type>Connection_Status_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Not Capable"> + <tp:docstring> + Raised when requested functionality is unavailable due to contact + not having required capabilities. + </tp:docstring> + </tp:error> + + <tp:error name="Offline"> + <tp:docstring> + Raised when requested functionality is unavailable because a contact is + offline. + + <tp:rationale> + This corresponds to Offline in the + <tp:type>Channel_Group_Change_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Channel.Kicked"> + <tp:docstring> + Used to represent a user being ejected from a channel by another user, + for instance being kicked from a chatroom. + + <tp:rationale> + This corresponds to Kicked in the + <tp:type>Channel_Group_Change_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Busy"> + <tp:docstring> + Used to represent a user being removed from a channel because of a + "busy" indication. This error SHOULD NOT be used to represent a server + or other infrastructure being too busy to process a request - for that, + see ServerBusy. + + <tp:rationale> + This corresponds to Busy in the + <tp:type>Channel_Group_Change_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="No Answer"> + <tp:docstring> + Used to represent a user being removed from a channel because they did + not respond, e.g. to a StreamedMedia call. + + <tp:rationale> + This corresponds to No_Answer in the + <tp:type>Channel_Group_Change_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Does Not Exist"> + <tp:docstring> + Raised when the requested user does not, in fact, exist. + + <tp:rationale> + This corresponds to Invalid_Contact in the + <tp:type>Channel_Group_Change_Reason</tp:type> enum, but can also be + used to represent other things not existing (like chatrooms, perhaps). + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Terminated"> + <tp:docstring> + Raised when a channel is terminated for an unspecified reason. In + particular, this error SHOULD be used whenever normal termination of + a 1-1 StreamedMedia call by the remote user is represented as a D-Bus + error name. + + <tp:rationale> + This corresponds to None in the + <tp:type>Channel_Group_Change_Reason</tp:type> enum. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Connection Refused"> + <tp:docstring> + Raised when a connection is refused. + </tp:docstring> + </tp:error> + + <tp:error name="Connection Failed"> + <tp:docstring> + Raised when a connection can't be established. + </tp:docstring> + </tp:error> + + <tp:error name="Connection Lost"> + <tp:docstring> + Raised when a connection is broken. + </tp:docstring> + </tp:error> + + <tp:error name="Already Connected"> + <tp:docstring> + Raised when the user attempts to connect to an account but they are + already connected (perhaps from another client or computer), and the + protocol or account settings do not allow this. + + <tp:rationale> + XMPP can have this behaviour if the user chooses the same resource + in both clients (it is server-dependent whether the result is + AlreadyConnected on the new connection, ConnectionReplaced on the + old connection, or two successful connections). + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Connection Replaced"> + <tp:docstring> + Raised by an existing connection to an account if it is replaced by + a new connection (perhaps from another client or computer). + + <tp:rationale> + In MSNP, when connecting twice with the same Passport, the new + connection "wins" and the old one is automatically disconnected. + XMPP can also have this behaviour if the user chooses the same + resource in two clients (it is server-dependent whether the result is + AlreadyConnected on the new connection, ConnectionReplaced on the + old connection, or two successful connections). + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Registration Exists"> + <tp:docstring> + Raised during in-band registration if the server indicates that the + requested account already exists. + </tp:docstring> + </tp:error> + + <tp:error name="Service Busy"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + Raised if a server or some other piece of infrastructure cannot process + the request, e.g. due to resource limitations. Clients MAY try again + later. + + <tp:rationale> + This is not the same error as Busy, which indicates that a + <em>user</em> is busy. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:error name="Resource Unavailable"> + <tp:docstring> + Raised if a request cannot be satisfied because a process local to the + user has insufficient resources. Clients MAY try again + later. + + <tp:rationale> + For instance, the <tp:dbus-ref + namespace="org.freedesktop.Telepathy">ChannelDispatcher</tp:dbus-ref> + might raise this error for some or all channel requests if it has + detected that there is not enough free memory. + </tp:rationale> + </tp:docstring> + </tp:error> + + <tp:copyright>Copyright © 2005-2009 Collabora Limited</tp:copyright> + <tp:copyright>Copyright © 2005-2009 Nokia Corporation</tp:copyright> + <tp:license xmlns="http://www.w3.org/1999/xhtml"> +<p>This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version.</p> + +<p>This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details.</p> + +<p>You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p> + </tp:license> +</tp:errors> diff --git a/sflphone-common/doc/dbus-api/spec/generic-types.xml b/sflphone-common/doc/dbus-api/spec/generic-types.xml new file mode 100644 index 0000000000000000000000000000000000000000..d4dce1552dcaaf6fa37f61ffd499dfcb03ea49e8 --- /dev/null +++ b/sflphone-common/doc/dbus-api/spec/generic-types.xml @@ -0,0 +1,168 @@ +<tp:generic-types + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + + <tp:simple-type name="Unix_Timestamp" type="u"> + <tp:docstring>An unsigned 32-bit integer representing time as the number + of seconds elapsed since the Unix epoch + (1970-01-01T00:00:00Z)</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="Unix_Timestamp64" type="x"> + <tp:docstring>An signed 64-bit integer representing time as the number + of seconds elapsed since the Unix epoch + (1970-01-01T00:00:00Z); negative for times before the epoch</tp:docstring> + + <tp:rationale>The Text interface is the only user of Unix_Timestamp so + far, and we'd like to be Y2038 compatible in future + interfaces.</tp:rationale> + </tp:simple-type> + + <tp:simple-type name="DBus_Bus_Name" type="s" + array-name="DBus_Bus_Name_List"> + <tp:docstring>A string representing a D-Bus bus name - either a well-known + name like "org.freedesktop.Telepathy.MissionControl" or a unique name + like ":1.123"</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Well_Known_Name" type="s" + array-name="DBus_Well_Known_Name_List"> + <tp:docstring>A string representing a D-Bus well-known + name like "org.freedesktop.Telepathy.MissionControl".</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Unique_Name" type="s" + array-name="DBus_Unique_Name_List"> + <tp:docstring>A string representing a D-Bus unique name, such as + ":1.123"</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Interface" type="s" + array-name="DBus_Interface_List"> + <tp:docstring>An ASCII string representing a D-Bus interface - two or more + elements separated by dots, where each element is a non-empty + string of ASCII letters, digits and underscores, not starting with + a digit. The maximum total length is 255 characters. For example, + "org.freedesktop.DBus.Peer".</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Error_Name" type="s"> + <tp:docstring>An ASCII string representing a D-Bus error. This is + syntactically the same as a <tp:type>DBus_Interface</tp:type>, but the + meaning is different.</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Signature" type="s"> + <tp:docstring>A string representing a D-Bus signature + (the 'g' type isn't used because of poor interoperability, particularly + with dbus-glib)</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Member" type="s"> + <tp:docstring>An ASCII string representing a D-Bus method, signal + or property name - a non-empty string of ASCII letters, digits and + underscores, not starting with a digit, with a maximum length of 255 + characters. For example, "Ping".</tp:docstring> + </tp:simple-type> + + <tp:simple-type name="DBus_Qualified_Member" type="s" + array-name="DBus_Qualified_Member_List"> + <tp:docstring>A string representing the full name of a D-Bus method, + signal or property, consisting of a DBus_Interface, followed by + a dot, followed by a DBus_Member. For example, + "org.freedesktop.DBus.Peer.Ping".</tp:docstring> + </tp:simple-type> + + <tp:mapping name="Qualified_Property_Value_Map" + array-name="Qualified_Property_Value_Map_List"> + <tp:docstring>A mapping from strings representing D-Bus + properties (by their namespaced names) to their values.</tp:docstring> + <tp:member type="s" name="Key" tp:type="DBus_Qualified_Member"> + <tp:docstring> + A D-Bus interface name, followed by a dot and a D-Bus property name. + </tp:docstring> + </tp:member> + <tp:member type="v" name="Value"> + <tp:docstring> + The value of the property. + </tp:docstring> + </tp:member> + </tp:mapping> + + <tp:mapping name="String_Variant_Map" array-name="String_Variant_Map_List"> + <tp:docstring>A mapping from strings to variants representing extra + key-value pairs.</tp:docstring> + <tp:member type="s" name="Key"/> + <tp:member type="v" name="Value"/> + </tp:mapping> + + <tp:mapping name="String_String_Map" array-name="String_String_Map_List"> + <tp:docstring>A mapping from strings to strings representing extra + key-value pairs.</tp:docstring> + <tp:member type="s" name="Key"/> + <tp:member type="s" name="Value"/> + </tp:mapping> + + <tp:struct name="Socket_Address_IP" array-name="Socket_Address_IP_List"> + <tp:docstring>An IP address and port.</tp:docstring> + <tp:member type="s" name="Address"> + <tp:docstring>Either a dotted-quad IPv4 address literal as for + <tp:type>Socket_Address_IPv4</tp:type>, or an RFC2373 IPv6 address + as for <tp:type>Socket_Address_IPv6</tp:type>. + </tp:docstring> + </tp:member> + <tp:member type="q" name="Port"> + <tp:docstring>The TCP or UDP port number.</tp:docstring> + </tp:member> + </tp:struct> + + <tp:struct name="Socket_Address_IPv4"> + <tp:docstring>An IPv4 address and port.</tp:docstring> + <tp:member type="s" name="Address"> + <tp:docstring>A dotted-quad IPv4 address literal: four ASCII decimal + numbers, each between 0 and 255 inclusive, e.g. + "192.168.0.1".</tp:docstring> + </tp:member> + <tp:member type="q" name="Port"> + <tp:docstring>The TCP or UDP port number.</tp:docstring> + </tp:member> + </tp:struct> + + <tp:struct name="Socket_Address_IPv6"> + <tp:docstring>An IPv6 address and port.</tp:docstring> + <tp:member type="s" name="Address"> + <tp:docstring>An IPv6 address literal as specified by RFC2373 + section 2.2, e.g. "2001:DB8::8:800:200C:4171".</tp:docstring> + </tp:member> + <tp:member type="q" name="Port"> + <tp:docstring>The TCP or UDP port number.</tp:docstring> + </tp:member> + </tp:struct> + + <tp:struct name="Socket_Netmask_IPv4"> + <tp:docstring>An IPv4 network or subnet.</tp:docstring> + <tp:member type="s" name="Address"> + <tp:docstring>A dotted-quad IPv4 address literal: four ASCII decimal + numbers, each between 0 and 255 inclusive, e.g. + "192.168.0.1".</tp:docstring> + </tp:member> + <tp:member type="y" name="Prefix_Length"> + <tp:docstring>The number of leading bits of the address that must + match, for this netmask to be considered to match an + address.</tp:docstring> + </tp:member> + </tp:struct> + + <tp:struct name="Socket_Netmask_IPv6"> + <tp:docstring>An IPv6 network or subnet.</tp:docstring> + <tp:member type="s" name="Address"> + <tp:docstring>An IPv6 address literal as specified by RFC2373 + section 2.2, e.g. "2001:DB8::8:800:200C:4171".</tp:docstring> + </tp:member> + <tp:member type="y" name="Prefix_Length"> + <tp:docstring>The number of leading bits of the address that must + match, for this netmask to be considered to match an + address.</tp:docstring> + </tp:member> + </tp:struct> + +</tp:generic-types> diff --git a/sflphone-common/doc/dbus-api/spec/instance-introspec.xml b/sflphone-common/doc/dbus-api/spec/instance-introspec.xml new file mode 120000 index 0000000000000000000000000000000000000000..2e02dfe7239982ae1df5ef975ddacafb9897839a --- /dev/null +++ b/sflphone-common/doc/dbus-api/spec/instance-introspec.xml @@ -0,0 +1 @@ +../../../src/dbus/instance-introspec.xml \ No newline at end of file diff --git a/sflphone-common/doc/dbus-api/tools/devhelp.xsl b/sflphone-common/doc/dbus-api/tools/devhelp.xsl new file mode 100644 index 0000000000000000000000000000000000000000..60f9e1c5304f68e8db9c6cb0cefc7db78d04398d --- /dev/null +++ b/sflphone-common/doc/dbus-api/tools/devhelp.xsl @@ -0,0 +1,91 @@ +<!-- Generate a Devhelp index from the Telepathy specification. +The master copy of this stylesheet is in the Telepathy spec repository - +please make any changes there. + +Copyright (C) 2006-2008 Collabora Limited + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +--> + +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <xsl:template match="/"> + <book xmlns="http://www.devhelp.net/book" title="Telepathy Specification" + name="telepathy-spec" link="spec.html"> + <xsl:text>
</xsl:text> + <chapters> + <xsl:text>
</xsl:text> + <xsl:apply-templates select="//interface" /> + </chapters> + <xsl:text>
</xsl:text> + <functions> + <xsl:text>
</xsl:text> + <xsl:apply-templates select="//method" /> + <xsl:apply-templates select="//signal" /> + <xsl:apply-templates select="//property" /> + <xsl:apply-templates select="//tp:enum" /> + <xsl:apply-templates select="//tp:simple-type" /> + <xsl:apply-templates select="//tp:mapping" /> + <xsl:apply-templates select="//tp:flags" /> + <xsl:apply-templates select="//tp:struct" /> + </functions> + <xsl:text>
</xsl:text> + </book> + </xsl:template> + + <xsl:template match="interface"> + <xsl:text> </xsl:text> + <sub xmlns="http://www.devhelp.net/book" name="{@name}" + link="{concat('spec.html#', @name)}" /> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="method"> + <xsl:text> </xsl:text> + <keyword type="function" xmlns="http://www.devhelp.net/book" name="{@name}" + link="spec.html#{../@name}.{@name}" /> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="signal | property"> + <xsl:text> </xsl:text> + <keyword type="" xmlns="http://www.devhelp.net/book" name="{@name}" + link="spec.html#{../@name}.{@name}" /> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="tp:simple-type"> + <xsl:text> </xsl:text> + <keyword type="typedef" xmlns="http://www.devhelp.net/book" name="{@name}" + link="spec.html#type-{@name}" /> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="tp:enum | tp:flags"> + <xsl:text> </xsl:text> + <keyword type="enum" xmlns="http://www.devhelp.net/book" name="{@name}" + link="spec.html#type-{@name}" /> + <xsl:text>
</xsl:text> + </xsl:template> + + <xsl:template match="tp:mapping | tp:struct"> + <xsl:text> </xsl:text> + <keyword type="struct" xmlns="http://www.devhelp.net/book" name="{@name}" + link="spec.html#type-{@name}" /> + <xsl:text>
</xsl:text> + </xsl:template> + +</xsl:stylesheet> diff --git a/sflphone-common/doc/dbus-api/tools/doc-generator.py b/sflphone-common/doc/dbus-api/tools/doc-generator.py new file mode 100755 index 0000000000000000000000000000000000000000..5fc19ce907435806cabd31baa75b05f0a9b76d82 --- /dev/null +++ b/sflphone-common/doc/dbus-api/tools/doc-generator.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# +# doc-generator.py +# +# Generates HTML documentation from the parsed spec using Cheetah templates. +# +# Copyright (C) 2009 Collabora Ltd. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: Davyd Madeley <davyd.madeley@collabora.co.uk> +# + +import sys +import os +import os.path +import shutil + +try: + from Cheetah.Template import Template +except ImportError, e: + print >> sys.stderr, e + print >> sys.stderr, "Install `python-cheetah'?" + sys.exit(-1) + +import specparser + +program, spec_file, output_path, project, namespace = sys.argv + +template_path = os.path.join(os.path.dirname(program), '../doc/templates') + +# make the output path +try: + os.mkdir(output_path) +except OSError: + pass +# copy in the CSS +shutil.copy(os.path.join(template_path, 'style.css'), output_path) + +def load_template(filename): + try: + file = open(os.path.join(template_path, filename)) + template_def = file.read() + file.close() + except IOError, e: + print >> sys.stderr, "Could not load template file `%s'" % filename + print >> sys.stderr, e + sys.exit(-1) + + return template_def + +spec = specparser.parse(spec_file, namespace) + +# write out HTML files for each of the interfaces + +# Not using render_template here to avoid recompiling it n times. +namespace = {} +template_def = load_template('interface.html') +t = Template(template_def, namespaces = [namespace]) +for interface in spec.interfaces: + namespace['interface'] = interface + + # open the output file + out = open(os.path.join(output_path, '%s.html' % interface.name), 'w') + print >> out, unicode(t).encode('utf-8') + out.close() + +def render_template(name, namespaces, target=None): + if target is None: + target = name + + namespace = { 'spec': spec } + template_def = load_template(name) + t = Template(template_def, namespaces=namespaces) + out = open(os.path.join(output_path, target), 'w') + print >> out, unicode(t).encode('utf-8') + out.close() + +namespaces = { 'spec': spec } + +render_template('generic-types.html', namespaces) +render_template('errors.html', namespaces) +render_template('interfaces.html', namespaces) +render_template('fullindex.html', namespaces) + +dh_namespaces = { 'spec': spec, 'name': project } +render_template('devhelp.devhelp2', dh_namespaces, + target=('%s.devhelp2' % project)) + +# write out the TOC last, because this is the file used as the target in the +# Makefile. +render_template('index.html', namespaces) diff --git a/sflphone-common/doc/dbus-api/tools/doc-generator.xsl b/sflphone-common/doc/dbus-api/tools/doc-generator.xsl new file mode 100644 index 0000000000000000000000000000000000000000..fe9cd9f08d193606f37f41259cb75601b431602f --- /dev/null +++ b/sflphone-common/doc/dbus-api/tools/doc-generator.xsl @@ -0,0 +1,1266 @@ +<!-- Generate HTML documentation from the Telepathy specification. +The master copy of this stylesheet is in the Telepathy spec repository - +please make any changes there. + +Copyright (C) 2006-2008 Collabora Limited + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +--> + +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" + xmlns:html="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="tp html"> + <!--Don't move the declaration of the HTML namespace up here — XMLNSs + don't work ideally in the presence of two things that want to use the + absence of a prefix, sadly. --> + + <xsl:param name="allow-undefined-interfaces" select="false()"/> + + <xsl:template match="html:* | @*" mode="html"> + <xsl:copy> + <xsl:apply-templates mode="html" select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="tp:type" mode="html"> + <xsl:call-template name="tp-type"> + <xsl:with-param name="tp-type" select="string(.)"/> + </xsl:call-template> + </xsl:template> + + <!-- tp:dbus-ref: reference a D-Bus interface, signal, method or property --> + <xsl:template match="tp:dbus-ref" mode="html"> + <xsl:variable name="name"> + <xsl:choose> + <xsl:when test="@namespace"> + <xsl:value-of select="@namespace"/> + <xsl:text>.</xsl:text> + </xsl:when> + </xsl:choose> + <xsl:value-of select="string(.)"/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="//interface[@name=$name] + or //interface/method[concat(../@name, '.', @name)=$name] + or //interface/signal[concat(../@name, '.', @name)=$name] + or //interface/property[concat(../@name, '.', @name)=$name] + or //interface[@name=concat($name, '.DRAFT')] + or //interface/method[ + concat(../@name, '.', @name)=concat($name, '.DRAFT')] + or //interface/signal[ + concat(../@name, '.', @name)=concat($name, '.DRAFT')] + or //interface/property[ + concat(../@name, '.', @name)=concat($name, '.DRAFT')] + "> + <a xmlns="http://www.w3.org/1999/xhtml" href="#{$name}"> + <xsl:value-of select="string(.)"/> + </a> + </xsl:when> + + <xsl:when test="$allow-undefined-interfaces"> + <span xmlns="http://www.w3.org/1999/xhtml" title="defined elsewhere"> + <xsl:value-of select="string(.)"/> + </span> + </xsl:when> + + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: cannot find D-Bus interface, method, </xsl:text> + <xsl:text>signal or property called '</xsl:text> + <xsl:value-of select="$name"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- tp:member-ref: reference a property of the current interface --> + <xsl:template match="tp:member-ref" mode="html"> + <xsl:variable name="prefix" select="concat(ancestor::interface/@name, + '.')"/> + <xsl:variable name="name" select="string(.)"/> + + <xsl:if test="not(ancestor::interface)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: Cannot use tp:member-ref when not in an</xsl:text> + <xsl:text> <interface> </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:choose> + <xsl:when test="ancestor::interface/signal[@name=$name]"/> + <xsl:when test="ancestor::interface/method[@name=$name]"/> + <xsl:when test="ancestor::interface/property[@name=$name]"/> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: interface </xsl:text> + <xsl:value-of select="ancestor::interface/@name"/> + <xsl:text> has no signal/method/property called </xsl:text> + <xsl:value-of select="$name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + + <a xmlns="http://www.w3.org/1999/xhtml" href="#{$prefix}{$name}"> + <xsl:value-of select="$name"/> + </a> + </xsl:template> + + <xsl:template match="*" mode="identity"> + <xsl:copy> + <xsl:apply-templates mode="identity"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="tp:docstring"> + <xsl:apply-templates mode="html"/> + </xsl:template> + + <xsl:template match="tp:added"> + <p class="added" xmlns="http://www.w3.org/1999/xhtml">Added in + version <xsl:value-of select="@version"/>. + <xsl:apply-templates select="node()" mode="html"/></p> + </xsl:template> + + <xsl:template match="tp:changed"> + <xsl:choose> + <xsl:when test="node()"> + <p class="changed" xmlns="http://www.w3.org/1999/xhtml">Changed in + version <xsl:value-of select="@version"/>: + <xsl:apply-templates select="node()" mode="html"/></p> + </xsl:when> + <xsl:otherwise> + <p class="changed">Changed in version + <xsl:value-of select="@version"/></p> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template match="tp:deprecated"> + <p class="deprecated" xmlns="http://www.w3.org/1999/xhtml">Deprecated + since version <xsl:value-of select="@version"/>. + <xsl:apply-templates select="node()" mode="html"/></p> + </xsl:template> + + <xsl:template match="tp:rationale" mode="html"> + <div xmlns="http://www.w3.org/1999/xhtml" class="rationale"> + <xsl:apply-templates select="node()" mode="html"/> + </div> + </xsl:template> + + <xsl:template match="tp:errors"> + <h1 xmlns="http://www.w3.org/1999/xhtml">Errors</h1> + <xsl:apply-templates/> + </xsl:template> + + <xsl:template match="tp:generic-types"> + <h1 xmlns="http://www.w3.org/1999/xhtml">Generic types</h1> + <xsl:call-template name="do-types"/> + </xsl:template> + + <xsl:template name="do-types"> + <xsl:if test="tp:simple-type"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Simple types</h2> + <xsl:apply-templates select="tp:simple-type"/> + </xsl:if> + + <xsl:if test="tp:enum"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Enumerated types:</h2> + <xsl:apply-templates select="tp:enum"/> + </xsl:if> + + <xsl:if test="tp:flags"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Sets of flags:</h2> + <xsl:apply-templates select="tp:flags"/> + </xsl:if> + + <xsl:if test="tp:struct"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Structure types</h2> + <xsl:apply-templates select="tp:struct"/> + </xsl:if> + + <xsl:if test="tp:mapping"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Mapping types</h2> + <xsl:apply-templates select="tp:mapping"/> + </xsl:if> + + <xsl:if test="tp:external-type"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Types defined elsewhere</h2> + <dl><xsl:apply-templates select="tp:external-type"/></dl> + </xsl:if> + </xsl:template> + + <xsl:template match="tp:error"> + <h2 xmlns="http://www.w3.org/1999/xhtml"><a name="{concat(../@namespace, '.', translate(@name, ' ', ''))}"></a><xsl:value-of select="concat(../@namespace, '.', translate(@name, ' ', ''))"/></h2> + <xsl:apply-templates select="tp:docstring"/> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </xsl:template> + + <xsl:template match="/tp:spec/tp:copyright"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates mode="text"/> + </div> + </xsl:template> + <xsl:template match="/tp:spec/tp:license"> + <div xmlns="http://www.w3.org/1999/xhtml" class="license"> + <xsl:apply-templates mode="html"/> + </div> + </xsl:template> + + <xsl:template match="tp:copyright"/> + <xsl:template match="tp:license"/> + + <xsl:template match="interface"> + <h1 xmlns="http://www.w3.org/1999/xhtml"><a name="{@name}"></a><xsl:value-of select="@name"/></h1> + + <xsl:if test="@tp:causes-havoc"> + <p xmlns="http://www.w3.org/1999/xhtml" class="causes-havoc"> + This interface is <xsl:value-of select="@tp:causes-havoc"/> + and is likely to cause havoc to your API/ABI if bindings are generated. + Don't include it in libraries that care about compatibility. + </p> + </xsl:if> + + <xsl:if test="tp:requires"> + <p>Implementations of this interface must also implement:</p> + <ul xmlns="http://www.w3.org/1999/xhtml"> + <xsl:for-each select="tp:requires"> + <li><code><a href="#{@interface}"><xsl:value-of select="@interface"/></a></code></li> + </xsl:for-each> + </ul> + </xsl:if> + + <xsl:apply-templates select="tp:docstring" /> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + + <xsl:choose> + <xsl:when test="method"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Methods:</h2> + <xsl:apply-templates select="method"/> + </xsl:when> + <xsl:otherwise> + <p xmlns="http://www.w3.org/1999/xhtml">Interface has no methods.</p> + </xsl:otherwise> + </xsl:choose> + + <xsl:choose> + <xsl:when test="signal"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Signals:</h2> + <xsl:apply-templates select="signal"/> + </xsl:when> + <xsl:otherwise> + <p xmlns="http://www.w3.org/1999/xhtml">Interface has no signals.</p> + </xsl:otherwise> + </xsl:choose> + + <xsl:choose> + <xsl:when test="tp:property"> + <h2 xmlns="http://www.w3.org/1999/xhtml">Telepathy Properties:</h2> + <p xmlns="http://www.w3.org/1999/xhtml">Accessed using the + <a href="#org.freedesktop.Telepathy.Properties">Telepathy + Properties</a> interface.</p> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:property"/> + </dl> + </xsl:when> + <xsl:otherwise> + <p xmlns="http://www.w3.org/1999/xhtml">Interface has no Telepathy + properties.</p> + </xsl:otherwise> + </xsl:choose> + + <xsl:choose> + <xsl:when test="property"> + <h2 xmlns="http://www.w3.org/1999/xhtml">D-Bus core Properties:</h2> + <p xmlns="http://www.w3.org/1999/xhtml">Accessed using the + org.freedesktop.DBus.Properties interface.</p> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="property"/> + </dl> + </xsl:when> + <xsl:otherwise> + <p xmlns="http://www.w3.org/1999/xhtml">Interface has no D-Bus core + properties.</p> + </xsl:otherwise> + </xsl:choose> + + <xsl:call-template name="do-types"/> + + </xsl:template> + + <xsl:template match="tp:flags"> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a tp:flags type </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @type on tp:flags type</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <h3> + <a name="type-{@name}"> + <xsl:value-of select="@name"/> + </a> + </h3> + <xsl:apply-templates select="tp:docstring" /> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:variable name="value-prefix"> + <xsl:choose> + <xsl:when test="@value-prefix"> + <xsl:value-of select="@value-prefix"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@name"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="tp:flag"> + <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt> + <xsl:choose> + <xsl:when test="tp:docstring"> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:docstring" /> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </dd> + </xsl:when> + <xsl:otherwise> + <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </dl> + </xsl:template> + + <xsl:template match="tp:enum"> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a tp:enum type </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @type on tp:enum type</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <h3 xmlns="http://www.w3.org/1999/xhtml"> + <a name="type-{@name}"> + <xsl:value-of select="@name"/> + </a> + </h3> + <xsl:apply-templates select="tp:docstring" /> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:variable name="value-prefix"> + <xsl:choose> + <xsl:when test="@value-prefix"> + <xsl:value-of select="@value-prefix"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@name"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:for-each select="tp:enumvalue"> + <dt xmlns="http://www.w3.org/1999/xhtml"><code><xsl:value-of select="concat($value-prefix, '_', @suffix)"/> = <xsl:value-of select="@value"/></code></dt> + <xsl:choose> + <xsl:when test="tp:docstring"> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:docstring" /> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </dd> + </xsl:when> + <xsl:otherwise> + <dd xmlns="http://www.w3.org/1999/xhtml">(Undocumented)</dd> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </dl> + </xsl:template> + + <xsl:template name="binding-name-check"> + <xsl:if test="not(@tp:name-for-bindings)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: Binding name missing from </xsl:text> + <xsl:value-of select="parent::interface/@name"/> + <xsl:text>.</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="translate(@tp:name-for-bindings, '_', '') != @name"> + <xsl:message terminate="yes"> + <xsl:text>ERR: Binding name </xsl:text> + <xsl:value-of select="@tp:name-for-bindings"/> + <xsl:text> doesn't correspond to D-Bus name </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + </xsl:template> + + <xsl:template match="property"> + + <xsl:call-template name="binding-name-check"/> + + <xsl:if test="not(parent::interface)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: property </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> does not have an interface as parent </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a property of </xsl:text> + <xsl:value-of select="../@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @type on property </xsl:text> + <xsl:value-of select="concat(../@name, '.', @name)"/> + <xsl:text>: '</xsl:text> + <xsl:value-of select="@access"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:if> + + <dt xmlns="http://www.w3.org/1999/xhtml"> + <a name="{concat(../@name, '.', @name)}"> + <code><xsl:value-of select="@name"/></code> + </a> + <xsl:text> − </xsl:text> + <code><xsl:value-of select="@type"/></code> + <xsl:call-template name="parenthesized-tp-type"/> + <xsl:text>, </xsl:text> + <xsl:choose> + <xsl:when test="@access = 'read'"> + <xsl:text>read-only</xsl:text> + </xsl:when> + <xsl:when test="@access = 'write'"> + <xsl:text>write-only</xsl:text> + </xsl:when> + <xsl:when test="@access = 'readwrite'"> + <xsl:text>read/write</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: unknown or missing value for </xsl:text> + <xsl:text>@access on property </xsl:text> + <xsl:value-of select="concat(../@name, '.', @name)"/> + <xsl:text>: '</xsl:text> + <xsl:value-of select="@access"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </dt> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:docstring"/> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </dd> + </xsl:template> + + <xsl:template match="tp:property"> + <dt xmlns="http://www.w3.org/1999/xhtml"> + <xsl:if test="@name"> + <code><xsl:value-of select="@name"/></code> − + </xsl:if> + <code><xsl:value-of select="@type"/></code> + </dt> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:docstring"/> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </dd> + </xsl:template> + + <xsl:template match="tp:mapping"> + <div xmlns="http://www.w3.org/1999/xhtml" class="struct"> + <h3> + <a name="type-{@name}"> + <xsl:value-of select="@name"/> + </a> − a{ + <xsl:for-each select="tp:member"> + <xsl:value-of select="@type"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="@name"/> + <xsl:if test="position() != last()"> → </xsl:if> + </xsl:for-each> + } + </h3> + <div class="docstring"> + <xsl:apply-templates select="tp:docstring"/> + <xsl:if test="string(@array-name) != ''"> + <p>In bindings that need a separate name, arrays of + <xsl:value-of select="@name"/> should be called + <xsl:value-of select="@array-name"/>.</p> + </xsl:if> + </div> + <div> + <h4>Members</h4> + <dl> + <xsl:apply-templates select="tp:member" mode="members-in-docstring"/> + </dl> + </div> + </div> + </xsl:template> + + <xsl:template match="tp:docstring" mode="in-index"/> + + <xsl:template match="tp:simple-type | tp:enum | tp:flags | tp:external-type" + mode="in-index"> + − <xsl:value-of select="@type"/> + </xsl:template> + + <xsl:template match="tp:simple-type"> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a tp:simple-type </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @type on tp:simple-type</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <div xmlns="http://www.w3.org/1999/xhtml" class="simple-type"> + <h3> + <a name="type-{@name}"> + <xsl:value-of select="@name"/> + </a> − <xsl:value-of select="@type"/> + </h3> + <div class="docstring"> + <xsl:apply-templates select="tp:docstring"/> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </div> + </div> + </xsl:template> + + <xsl:template match="tp:external-type"> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a tp:external-type </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @type on tp:external-type</xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <div xmlns="http://www.w3.org/1999/xhtml" class="external-type"> + <dt> + <a name="type-{@name}"> + <xsl:value-of select="@name"/> + </a> − <xsl:value-of select="@type"/> + </dt> + <dd>Defined by: <xsl:value-of select="@from"/></dd> + </div> + </xsl:template> + + <xsl:template match="tp:struct" mode="in-index"> + − ( <xsl:for-each select="tp:member"> + <xsl:value-of select="@type"/> + <xsl:if test="position() != last()">, </xsl:if> + </xsl:for-each> ) + </xsl:template> + + <xsl:template match="tp:mapping" mode="in-index"> + − a{ <xsl:for-each select="tp:member"> + <xsl:value-of select="@type"/> + <xsl:if test="position() != last()"> → </xsl:if> + </xsl:for-each> } + </xsl:template> + + <xsl:template match="tp:struct"> + <div xmlns="http://www.w3.org/1999/xhtml" class="struct"> + <h3> + <a name="type-{@name}"> + <xsl:value-of select="@name"/> + </a> − ( + <xsl:for-each select="tp:member"> + <xsl:value-of select="@type"/> + <xsl:text>: </xsl:text> + <xsl:value-of select="@name"/> + <xsl:if test="position() != last()">, </xsl:if> + </xsl:for-each> + ) + </h3> + <div class="docstring"> + <xsl:apply-templates select="tp:docstring"/> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </div> + <xsl:choose> + <xsl:when test="string(@array-name) != ''"> + <p>In bindings that need a separate name, arrays of + <xsl:value-of select="@name"/> should be called + <xsl:value-of select="@array-name"/>.</p> + </xsl:when> + <xsl:otherwise> + <p>Arrays of <xsl:value-of select="@name"/> don't generally + make sense.</p> + </xsl:otherwise> + </xsl:choose> + <div> + <h4>Members</h4> + <dl> + <xsl:apply-templates select="tp:member" mode="members-in-docstring"/> + </dl> + </div> + </div> + </xsl:template> + + <xsl:template match="method"> + + <xsl:call-template name="binding-name-check"/> + + <xsl:if test="not(parent::interface)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: method </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> does not have an interface as parent </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a method of </xsl:text> + <xsl:value-of select="../@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:for-each select="arg"> + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of method </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no type</xsl:text> + </xsl:message> + </xsl:if> + <xsl:choose> + <xsl:when test="@direction='in'"> + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: an 'in' arg of method </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no name</xsl:text> + </xsl:message> + </xsl:if> + </xsl:when> + <xsl:when test="@direction='out'"> + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="no"> + <xsl:text>WARNING: an 'out' arg of method </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no name</xsl:text> + </xsl:message> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of method </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has direction neither 'in' nor 'out'</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + + <div xmlns="http://www.w3.org/1999/xhtml" class="method"> + <h3 xmlns="http://www.w3.org/1999/xhtml"> + <a name="{concat(../@name, concat('.', @name))}"> + <xsl:value-of select="@name"/> + </a> ( + <xsl:for-each xmlns="" select="arg[@direction='in']"> + <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/> + <xsl:if test="position() != last()">, </xsl:if> + </xsl:for-each> + ) → + <xsl:choose> + <xsl:when test="arg[@direction='out']"> + <xsl:for-each xmlns="" select="arg[@direction='out']"> + <xsl:value-of select="@type"/> + <xsl:if test="position() != last()">, </xsl:if> + </xsl:for-each> + </xsl:when> + <xsl:otherwise>nothing</xsl:otherwise> + </xsl:choose> + </h3> + <div xmlns="http://www.w3.org/1999/xhtml" class="docstring"> + <xsl:apply-templates select="tp:docstring" /> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </div> + + <xsl:if test="arg[@direction='in']"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h4>Parameters</h4> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="arg[@direction='in']" + mode="parameters-in-docstring"/> + </dl> + </div> + </xsl:if> + + <xsl:if test="arg[@direction='out']"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h4>Returns</h4> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="arg[@direction='out']" + mode="returns-in-docstring"/> + </dl> + </div> + </xsl:if> + + <xsl:if test="tp:possible-errors"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h4>Possible errors</h4> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:possible-errors/tp:error"/> + </dl> + </div> + </xsl:if> + + </div> + </xsl:template> + + <xsl:template name="tp-type"> + <xsl:param name="tp-type"/> + <xsl:param name="type"/> + + <xsl:variable name="single-type"> + <xsl:choose> + <xsl:when test="contains($tp-type, '[]')"> + <xsl:value-of select="substring-before($tp-type, '[]')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$tp-type"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="type-of-single-tp-type"> + <xsl:choose> + <xsl:when test="//tp:simple-type[@name=$single-type]"> + <xsl:value-of select="string(//tp:simple-type[@name=$single-type]/@type)"/> + </xsl:when> + <xsl:when test="//tp:struct[@name=$single-type]"> + <xsl:text>(</xsl:text> + <xsl:for-each select="//tp:struct[@name=$single-type]/tp:member"> + <xsl:value-of select="@type"/> + </xsl:for-each> + <xsl:text>)</xsl:text> + </xsl:when> + <xsl:when test="//tp:enum[@name=$single-type]"> + <xsl:value-of select="string(//tp:enum[@name=$single-type]/@type)"/> + </xsl:when> + <xsl:when test="//tp:flags[@name=$single-type]"> + <xsl:value-of select="string(//tp:flags[@name=$single-type]/@type)"/> + </xsl:when> + <xsl:when test="//tp:mapping[@name=$single-type]"> + <xsl:text>a{</xsl:text> + <xsl:for-each select="//tp:mapping[@name=$single-type]/tp:member"> + <xsl:value-of select="@type"/> + </xsl:for-each> + <xsl:text>}</xsl:text> + </xsl:when> + <xsl:when test="//tp:external-type[@name=$single-type]"> + <xsl:value-of select="string(//tp:external-type[@name=$single-type]/@type)"/> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: Unable to find type '</xsl:text> + <xsl:value-of select="$tp-type"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="type-of-tp-type"> + <xsl:if test="contains($tp-type, '[]')"> + <!-- one 'a', plus one for each [ after the [], and delete all ] --> + <xsl:value-of select="concat('a', + translate(substring-after($tp-type, '[]'), '[]', 'a'))"/> + </xsl:if> + <xsl:value-of select="$type-of-single-tp-type"/> + </xsl:variable> + + <xsl:if test="string($type) != '' and + string($type-of-tp-type) != string($type)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: tp:type '</xsl:text> + <xsl:value-of select="$tp-type"/> + <xsl:text>' has D-Bus type '</xsl:text> + <xsl:value-of select="$type-of-tp-type"/> + <xsl:text>' but has been used with type='</xsl:text> + <xsl:value-of select="$type"/> + <xsl:text>' </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="contains($tp-type, '[]')"> + <xsl:call-template name="tp-type-array-usage-check"> + <xsl:with-param name="single-type" select="$single-type"/> + <xsl:with-param name="type-of-single-tp-type" + select="$type-of-single-tp-type"/> + </xsl:call-template> + </xsl:if> + + <a href="#type-{$single-type}"><xsl:value-of select="$tp-type"/></a> + + </xsl:template> + + <xsl:template name="tp-type-array-usage-check"> + <xsl:param name="single-type"/> + <xsl:param name="type-of-single-tp-type"/> + + <xsl:variable name="array-name"> + <xsl:choose> + <xsl:when test="//tp:struct[@name=$single-type]"> + <xsl:value-of select="//tp:struct[@name=$single-type]/@array-name"/> + </xsl:when> + <xsl:when test="//tp:mapping[@name=$single-type]"> + <xsl:value-of select="//tp:mapping[@name=$single-type]/@array-name"/> + </xsl:when> + <xsl:when test="//tp:external-type[@name=$single-type]"> + <xsl:value-of select="//tp:external-type[@name=$single-type]/@array-name"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="''"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:if test="not(contains('ybnqiuxtdsvog', $type-of-single-tp-type))"> + <xsl:if test="not($array-name) or $array-name=''"> + <xsl:message terminate="yes"> + <xsl:text>No array-name specified for complex type </xsl:text> + <xsl:value-of select="$single-type"/> + <xsl:text>, but array used </xsl:text> + </xsl:message> + </xsl:if> + </xsl:if> + </xsl:template> + + <xsl:template name="parenthesized-tp-type"> + <xsl:if test="@tp:type"> + <xsl:text> (</xsl:text> + <xsl:call-template name="tp-type"> + <xsl:with-param name="tp-type" select="@tp:type"/> + <xsl:with-param name="type" select="@type"/> + </xsl:call-template> + <xsl:text>)</xsl:text> + </xsl:if> + </xsl:template> + + <xsl:template match="tp:member" mode="members-in-docstring"> + <dt xmlns="http://www.w3.org/1999/xhtml"> + <code><xsl:value-of select="@name"/></code> − + <code><xsl:value-of select="@type"/></code> + <xsl:call-template name="parenthesized-tp-type"/> + </dt> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:choose> + <xsl:when test="tp:docstring"> + <xsl:apply-templates select="tp:docstring" /> + </xsl:when> + <xsl:otherwise> + <em>(undocumented)</em> + </xsl:otherwise> + </xsl:choose> + </dd> + </xsl:template> + + <xsl:template match="arg" mode="parameters-in-docstring"> + <dt xmlns="http://www.w3.org/1999/xhtml"> + <code><xsl:value-of select="@name"/></code> − + <code><xsl:value-of select="@type"/></code> + <xsl:call-template name="parenthesized-tp-type"/> + </dt> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:docstring" /> + </dd> + </xsl:template> + + <xsl:template match="arg" mode="returns-in-docstring"> + <dt xmlns="http://www.w3.org/1999/xhtml"> + <xsl:if test="@name"> + <code><xsl:value-of select="@name"/></code> − + </xsl:if> + <code><xsl:value-of select="@type"/></code> + <xsl:call-template name="parenthesized-tp-type"/> + </dt> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="tp:docstring"/> + </dd> + </xsl:template> + + <xsl:template match="tp:possible-errors/tp:error"> + <dt xmlns="http://www.w3.org/1999/xhtml"> + <code><xsl:value-of select="@name"/></code> + </dt> + <dd xmlns="http://www.w3.org/1999/xhtml"> + <xsl:variable name="name" select="@name"/> + <xsl:choose> + <xsl:when test="tp:docstring"> + <xsl:apply-templates select="tp:docstring"/> + </xsl:when> + <xsl:when test="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring"> + <xsl:apply-templates select="//tp:errors/tp:error[concat(../@namespace, '.', translate(@name, ' ', ''))=$name]/tp:docstring"/> <em xmlns="http://www.w3.org/1999/xhtml">(generic description)</em> + </xsl:when> + <xsl:otherwise> + (Undocumented.) + </xsl:otherwise> + </xsl:choose> + </dd> + </xsl:template> + + <xsl:template match="signal"> + + <xsl:call-template name="binding-name-check"/> + + <xsl:if test="not(parent::interface)"> + <xsl:message terminate="yes"> + <xsl:text>ERR: signal </xsl:text> + <xsl:value-of select="@name"/> + <xsl:text> does not have an interface as parent </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: missing @name on a signal of </xsl:text> + <xsl:value-of select="../@name"/> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:if> + + <xsl:for-each select="arg"> + <xsl:if test="not(@type) or @type = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no type</xsl:text> + </xsl:message> + </xsl:if> + <xsl:if test="not(@name) or @name = ''"> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has no name</xsl:text> + </xsl:message> + </xsl:if> + <xsl:choose> + <xsl:when test="not(@direction)"/> + <xsl:when test="@direction='in'"> + <xsl:message terminate="no"> + <xsl:text>INFO: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has unnecessary direction 'in'</xsl:text> + </xsl:message> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>ERR: an arg of signal </xsl:text> + <xsl:value-of select="concat(../../@name, '.', ../@name)"/> + <xsl:text> has direction other than 'in'</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + + <div xmlns="http://www.w3.org/1999/xhtml" class="signal"> + <h3 xmlns="http://www.w3.org/1999/xhtml"> + <a name="{concat(../@name, concat('.', @name))}"> + <xsl:value-of select="@name"/> + </a> ( + <xsl:for-each xmlns="" select="arg"> + <xsl:value-of select="@type"/>: <xsl:value-of select="@name"/> + <xsl:if test="position() != last()">, </xsl:if> + </xsl:for-each> + )</h3> + + <div xmlns="http://www.w3.org/1999/xhtml" class="docstring"> + <xsl:apply-templates select="tp:docstring"/> + <xsl:apply-templates select="tp:added"/> + <xsl:apply-templates select="tp:changed"/> + <xsl:apply-templates select="tp:deprecated"/> + </div> + + <xsl:if test="arg"> + <div xmlns="http://www.w3.org/1999/xhtml"> + <h4>Parameters</h4> + <dl xmlns="http://www.w3.org/1999/xhtml"> + <xsl:apply-templates select="arg" mode="parameters-in-docstring"/> + </dl> + </div> + </xsl:if> + </div> + </xsl:template> + + <xsl:output method="xml" indent="no" encoding="ascii" + omit-xml-declaration="yes" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" /> + + <xsl:template match="/tp:spec"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title> + <xsl:value-of select="tp:title"/> + <xsl:if test="tp:version"> + <xsl:text> version </xsl:text> + <xsl:value-of select="tp:version"/> + </xsl:if> + </title> + <style type="text/css"> + + body { + font-family: sans-serif; + margin: 2em; + height: 100%; + font-size: 1.2em; + } + h1 { + padding-top: 5px; + padding-bottom: 5px; + font-size: 1.6em; + background: #dadae2; + } + h2 { + font-size: 1.3em; + } + h3 { + font-size: 1.2em; + } + a:link, a:visited, a:link:hover, a:visited:hover { + font-weight: bold; + } + .topbox { + padding-top: 10px; + padding-left: 10px; + border-bottom: black solid 1px; + padding-bottom: 10px; + background: #dadae2; + font-size: 2em; + font-weight: bold; + color: #5c5c5c; + } + .topnavbox { + padding-left: 10px; + padding-top: 5px; + padding-bottom: 5px; + background: #abacba; + border-bottom: black solid 1px; + font-size: 1.2em; + } + .topnavbox a{ + color: black; + font-weight: normal; + } + .sidebar { + float: left; + /* width:9em; + border-right:#abacba solid 1px; + border-left: #abacba solid 1px; + height:100%; */ + border: #abacba solid 1px; + padding-left: 10px; + margin-left: 10px; + padding-right: 10px; + margin-right: 10px; + color: #5d5d5d; + background: #dadae2; + } + .sidebar a { + text-decoration: none; + border-bottom: #e29625 dotted 1px; + color: #e29625; + font-weight: normal; + } + .sidebar h1 { + font-size: 1.2em; + color: black; + } + .sidebar ul { + padding-left: 25px; + padding-bottom: 10px; + border-bottom: #abacba solid 1px; + } + .sidebar li { + padding-top: 2px; + padding-bottom: 2px; + } + .sidebar h2 { + font-style:italic; + font-size: 0.81em; + padding-left: 5px; + padding-right: 5px; + font-weight: normal; + } + .date { + font-size: 0.6em; + float: right; + font-style: italic; + } + .method, .signal, .property { + margin-left: 1em; + margin-right: 4em; + } + .rationale { + font-style: italic; + border-left: 0.25em solid #808080; + padding-left: 0.5em; + } + + .added { + color: #006600; + background: #ffffff; + } + .deprecated { + color: #ff0000; + background: #ffffff; + } + table, tr, td, th { + border: 1px solid #666; + } + + </style> + </head> + <body> + <h1 class="topbox"> + <xsl:value-of select="tp:title" /> + </h1> + <xsl:if test="tp:version"> + <h2>Version <xsl:value-of select="string(tp:version)"/></h2> + </xsl:if> + <xsl:apply-templates select="tp:copyright"/> + <xsl:apply-templates select="tp:license"/> + <xsl:apply-templates select="tp:docstring"/> + + <h2>Interfaces</h2> + <ul> + <xsl:for-each select="//node/interface"> + <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li> + </xsl:for-each> + </ul> + + <xsl:apply-templates select="//node"/> + <xsl:apply-templates select="tp:generic-types"/> + <xsl:apply-templates select="tp:errors"/> + + <h1>Index</h1> + <h2>Index of interfaces</h2> + <ul> + <xsl:for-each select="//node/interface"> + <li><code><a href="#{@name}"><xsl:value-of select="@name"/></a></code></li> + </xsl:for-each> + </ul> + <h2>Index of types</h2> + <ul> + <xsl:for-each select="//tp:simple-type | //tp:enum | //tp:flags | //tp:mapping | //tp:struct | //tp:external-type"> + <xsl:sort select="@name"/> + <li> + <code> + <a href="#type-{@name}"> + <xsl:value-of select="@name"/> + </a> + </code> + <xsl:apply-templates mode="in-index" select="."/> + </li> + </xsl:for-each> + </ul> + </body> + </html> + </xsl:template> + + <xsl:template match="node"> + <xsl:apply-templates /> + </xsl:template> + + <xsl:template match="text()"> + <xsl:if test="normalize-space(.) != ''"> + <xsl:message terminate="yes"> + <xsl:text>Stray text: {{{</xsl:text> + <xsl:value-of select="." /> + <xsl:text>}}} </xsl:text> + </xsl:message> + </xsl:if> + </xsl:template> + + <xsl:template match="*"> + <xsl:message terminate="yes"> + <xsl:text>Unrecognised element: {</xsl:text> + <xsl:value-of select="namespace-uri(.)" /> + <xsl:text>}</xsl:text> + <xsl:value-of select="local-name(.)" /> + <xsl:text> </xsl:text> + </xsl:message> + </xsl:template> +</xsl:stylesheet> + +<!-- vim:set sw=2 sts=2 et: --> diff --git a/sflphone-common/doc/dbus-api/tools/specparser.py b/sflphone-common/doc/dbus-api/tools/specparser.py new file mode 100644 index 0000000000000000000000000000000000000000..4208ad4104cab3c2a73aa75c71e05b3a53541b43 --- /dev/null +++ b/sflphone-common/doc/dbus-api/tools/specparser.py @@ -0,0 +1,866 @@ +# +# specparser.py +# +# Reads in a spec document and generates pretty data structures from it. +# +# Copyright (C) 2009 Collabora Ltd. +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Authors: Davyd Madeley <davyd.madeley@collabora.co.uk> +# + +import sys +import xml.dom.minidom + +import xincludator + +XMLNS_TP = 'http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0' + +class UnknownAccess(Exception): pass +class UnknownDirection(Exception): pass +class UnknownType(Exception): pass +class UnnamedItem(Exception): pass +class UntypedItem(Exception): pass +class UnsupportedArray(Exception): pass + +def getText(dom): + try: + if dom.childNodes[0].nodeType == dom.TEXT_NODE: + return dom.childNodes[0].data + else: + return '' + except IndexError: + return '' + +def getChildrenByName(dom, namespace, name): + return filter(lambda n: n.nodeType == n.ELEMENT_NODE and \ + n.namespaceURI == namespace and \ + n.localName == name, + dom.childNodes) + +def build_name(namespace, name): + """Returns a name by appending `name' to the namespace of this object. + """ + return '.'.join( + filter(lambda n: n is not None and n != '', + [namespace, name.replace(' ', '')]) + ) + +class Base(object): + """The base class for any type of XML node in the spec that implements the + 'name' attribute. + + Don't instantiate this class directly. + """ + devhelp_name = "" + + def __init__(self, parent, namespace, dom): + self.short_name = name = dom.getAttribute('name') + self.namespace = namespace + self.name = build_name(namespace, name) + self.parent = parent + + try: + self.docstring = getChildrenByName(dom, XMLNS_TP, 'docstring')[0] + except IndexError: + self.docstring = None + + try: + self.added = getChildrenByName(dom, XMLNS_TP, 'added')[0] + except IndexError: + self.added = None + + try: + self.deprecated = getChildrenByName(dom, XMLNS_TP, 'deprecated')[0] + except IndexError: + self.deprecated = None + + self.changed = getChildrenByName(dom, XMLNS_TP, 'changed') + + self.validate() + + def validate(self): + if self.short_name == '': + raise UnnamedItem("Node %s of %s has no name" % ( + self.__class__.__name__, self.parent)) + + def get_type_name(self): + return self.__class__.__name__ + + def get_spec(self): + return self.parent.get_spec() + + def get_root_namespace(self): + return self.get_interface().name + + def get_interface(self): + return self.parent.get_interface() + + def get_url(self): + return "%s#%s" % (self.get_interface().get_url(), self.name) + + def _get_generic_with_ver(self, nnode, htmlclass, txt): + if nnode is None: + return '' + else: + # make a copy of this node, turn it into a HTML <div> tag + node = nnode.cloneNode(True) + node.tagName = 'div' + node.baseURI = None + node.setAttribute('class', htmlclass) + + try: + node.removeAttribute('version') + + span = xml.dom.minidom.parseString( + ('<span class="version">%s\n</span>' % txt) % + nnode.getAttribute('version')).firstChild + node.insertBefore(span, node.firstChild) + except xml.dom.NotFoundErr: + print >> sys.stderr, \ + 'WARNING: %s was %s, but gives no version' % (self, htmlclass) + + self._convert_to_html(node) + + return node.toxml().encode('ascii', 'xmlcharrefreplace') + + def get_added(self): + return self._get_generic_with_ver(self.added, 'added', + "Added in %s.") + + def get_deprecated(self): + return self._get_generic_with_ver(self.deprecated, 'deprecated', + "Deprecated since %s.") + + def get_changed(self): + return '\n'.join(map(lambda n: + self._get_generic_with_ver(n, 'changed', "Changed in %s."), + self.changed)) + + def get_docstring(self): + """Get the docstring for this node, but do node substitution to + rewrite types, interfaces, etc. as links. + """ + if self.docstring is None: + return '' + else: + # make a copy of this node, turn it into a HTML <div> tag + node = self.docstring.cloneNode(True) + node.tagName = 'div' + node.baseURI = None + node.setAttribute('class', 'docstring') + + self._convert_to_html(node) + + return node.toxml().encode('ascii', 'xmlcharrefreplace') + + def _convert_to_html(self, node): + spec = self.get_spec() + namespace = self.get_root_namespace() + + # rewrite <tp:rationale> + for n in node.getElementsByTagNameNS(XMLNS_TP, 'rationale'): + n.tagName = 'div' + n.namespaceURI = None + n.setAttribute('class', 'rationale') + + # rewrite <tp:type> + for n in node.getElementsByTagNameNS(XMLNS_TP, 'type'): + t = spec.lookup_type(getText(n)) + n.tagName = 'a' + n.namespaceURI = None + n.setAttribute('href', t.get_url()) + + # rewrite <tp:member-ref> + for n in node.getElementsByTagNameNS(XMLNS_TP, 'member-ref'): + key = getText(n) + try: + o = spec.lookup(key, namespace=namespace) + except KeyError: + print >> sys.stderr, \ + "WARNING: Key '%s' not known in namespace '%s'" % ( + key, namespace) + continue + + n.tagName = 'a' + n.namespaceURI = None + n.setAttribute('href', o.get_url()) + n.setAttribute('title', o.get_title()) + + # rewrite <tp:dbus-ref> + for n in node.getElementsByTagNameNS(XMLNS_TP, 'dbus-ref'): + namespace = n.getAttribute('namespace') + key = getText(n) + try: + o = spec.lookup(key, namespace=namespace) + except KeyError: + print >> sys.stderr, \ + "WARNING: Key '%s' not known in namespace '%s'" % ( + key, namespace) + continue + + n.tagName = 'a' + n.namespaceURI = None + n.setAttribute('href', o.get_url()) + n.setAttribute('title', o.get_title()) + + def get_title(self): + return '%s %s' % (self.get_type_name(), self.name) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.name) + +class PossibleError(Base): + def __init__(self, parent, namespace, dom): + super(PossibleError, self).__init__(parent, namespace, dom) + + def get_error(self): + spec = self.get_spec() + try: + return spec.errors[self.name] + except KeyError: + return External(self.name) + + def get_url(self): + return self.get_error().get_url() + + def get_title(self): + return self.get_error().get_title() + + def get_docstring(self): + d = super(PossibleError, self).get_docstring() + if d == '': + return self.get_error().get_docstring() + else: + return d + +class Method(Base): + devhelp_name = "function" + + def __init__(self, parent, namespace, dom): + super(Method, self).__init__(parent, namespace, dom) + + args = build_list(self, Arg, self.name, + dom.getElementsByTagName('arg')) + + # separate arguments as input and output arguments + self.in_args = filter(lambda a: a.direction == Arg.DIRECTION_IN, args) + self.out_args = filter(lambda a: a.direction == Arg.DIRECTION_OUT, args) + + for arg in args: + if arg.direction == Arg.DIRECTION_IN or \ + arg.direction == Arg.DIRECTION_OUT: + continue + + print >> sys.stderr, "WARNING: '%s' of method '%s' does not specify a suitable direction" % (arg, self) + + self.possible_errors = build_list(self, PossibleError, None, + dom.getElementsByTagNameNS(XMLNS_TP, 'error')) + + def get_in_args(self): + return ', '.join(map(lambda a: a.spec_name(), self.in_args)) + + def get_out_args(self): + if len(self.out_args) > 0: + return ', '.join(map(lambda a: a.spec_name(), self.out_args)) + else: + return 'nothing' + +class Typed(Base): + """The base class for all typed nodes (i.e. Arg and Property). + + Don't instantiate this class directly. + """ + + def __init__(self, parent, namespace, dom): + super(Typed, self).__init__(parent, namespace, dom) + + self.type = dom.getAttributeNS(XMLNS_TP, 'type') + self.dbus_type = dom.getAttribute('type') + + # check we have a dbus type + if self.dbus_type == '': + raise UntypedItem("Node referred to by '%s' has no type" % dom.toxml()) + def get_type(self): + return self.get_spec().lookup_type(self.type) + + def get_type_url(self): + t = self.get_type() + if t is None: return '' + else: return t.get_url() + + def get_type_title(self): + t = self.get_type() + if t is None: return '' + else: return t.get_title() + + def spec_name(self): + return '%s: %s' % (self.dbus_type, self.short_name) + + def __repr__(self): + return '%s(%s:%s)' % (self.__class__.__name__, self.name, self.dbus_type) + +class Property(Typed): + ACCESS_READ = 1 + ACCESS_WRITE = 2 + + ACCESS_READWRITE = ACCESS_READ | ACCESS_WRITE + + def __init__(self, parent, namespace, dom): + super(Property, self).__init__(parent, namespace, dom) + + access = dom.getAttribute('access') + if access == 'read': + self.access = self.ACCESS_READ + elif access == 'write': + self.access = self.ACCESS_WRITE + elif access == 'readwrite': + self.access = self.ACCESS_READWRITE + else: + raise UnknownAccess("Unknown access '%s' on %s" % (access, self)) + + def get_access(self): + if self.access & self.ACCESS_READ and self.access & self.ACCESS_WRITE: + return 'Read/Write' + elif self.access & self.ACCESS_READ: + return 'Read only' + elif self.access & self.ACCESS_WRITE: + return 'Write only' + +class AwkwardTelepathyProperty(Typed): + def get_type_name(self): + return 'Telepathy Property' + +class Arg(Typed): + DIRECTION_IN, DIRECTION_OUT, DIRECTION_UNSPECIFIED = range(3) + + def __init__(self, parent, namespace, dom): + super(Arg, self).__init__(parent, namespace, dom) + + direction = dom.getAttribute('direction') + if direction == 'in': + self.direction = self.DIRECTION_IN + elif direction == 'out': + self.direction = self.DIRECTION_OUT + elif direction == '': + self.direction = self.DIRECTION_UNSPECIFIED + else: + raise UnknownDirection("Unknown direction '%s' on %s" % ( + direction, self.parent)) + +class Signal(Base): + def __init__(self, parent, namespace, dom): + super(Signal, self).__init__(parent, namespace, dom) + + self.args = build_list(self, Arg, self.name, + dom.getElementsByTagName('arg')) + + for arg in self.args: + if arg.direction == Arg.DIRECTION_UNSPECIFIED: + continue + + print >> sys.stderr, "WARNING: '%s' of signal '%s' does not specify a suitable direction" % (arg, self) + + def get_args(self): + return ', '.join(map(lambda a: a.spec_name(), self.args)) + +class External(object): + """External objects are objects that are referred to in another spec. + + We have to attempt to look them up if at all possible. + """ + + def __init__(self, name): + self.name = self.short_name = name + + def get_url(self): + return None + + def get_title(self): + return 'External %s' % self.name + + def get_docstring(self): + return None + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.name) + +class Interface(Base): + def __init__(self, parent, namespace, dom, spec_namespace): + super(Interface, self).__init__(parent, namespace, dom) + + # If you're writing a spec with more than one top-level namespace, you + # probably want to replace spec_namespace with a list. + if self.name.startswith(spec_namespace + "."): + self.short_name = self.name[len(spec_namespace) + 1:] + else: + self.short_name = self.name + + # build lists of methods, etc., in this interface + self.methods = build_list(self, Method, self.name, + dom.getElementsByTagName('method')) + self.properties = build_list(self, Property, self.name, + dom.getElementsByTagName('property')) + self.signals = build_list(self, Signal, self.name, + dom.getElementsByTagName('signal')) + self.tpproperties = build_list(self, AwkwardTelepathyProperty, + self.name, dom.getElementsByTagNameNS(XMLNS_TP, 'property')) + self.handler_capability_tokens = build_list(self, + HandlerCapabilityToken, self.name, + dom.getElementsByTagNameNS(XMLNS_TP, + 'handler-capability-token')) + self.contact_attributes = build_list(self, ContactAttribute, self.name, + dom.getElementsByTagNameNS(XMLNS_TP, 'contact-attribute')) + + # build a list of types in this interface + self.types = parse_types(self, dom, self.name) + + # find out if this interface causes havoc + self.causes_havoc = dom.getAttributeNS(XMLNS_TP, 'causes-havoc') + if self.causes_havoc == '': self.causes_havoc = None + + # find out what we're required to also implement + self.requires = map(lambda n: n.getAttribute('interface'), + getChildrenByName(dom, XMLNS_TP, 'requires')) + + def get_interface(self): + return self + + def get_requires(self): + spec = self.get_spec() + + def lookup(r): + try: + return spec.lookup(r) + except KeyError: + return External(r) + + return map(lookup, self.requires) + + def get_url(self): + return '%s.html' % self.name + +class Error(Base): + def get_url(self): + return 'errors.html#%s' % self.name + + def get_root_namespace(self): + return self.namespace + +class DBusList(object): + """Stores a list of a given DBusType. Provides some basic validation to + determine whether or not the type is sane. + """ + def __init__(self, child): + self.child = child + + if isinstance(child, DBusType): + self.ultimate = child + self.depth = 1 + + if self.child.array_name == '': + raise UnsupportedArray("Type '%s' does not support being " + "used in an array" % self.child.name) + else: + self.name = build_name(self.child.namespace, + self.child.array_name) + self.short_name = self.child.array_name + + elif isinstance(child, DBusList): + self.ultimate = child.ultimate + self.depth = child.depth + 1 + self.name = self.child.name + '_List' + self.short_name = self.child.short_name + '_List' + + # check that our child can operate at this depth + maxdepth = int(self.ultimate.array_depth) + if self.depth > maxdepth: + raise TypeError("Type '%s' has exceeded its maximum depth (%i)" % (self, maxdepth)) + + else: + raise TypeError("DBusList can contain only a DBusType or DBusList not '%s'" % child) + + self.dbus_type = 'a' + self.child.dbus_type + + def get_url(self): + return self.ultimate.get_url() + + def get_title(self): + return "Array of %s" % self.child.get_title() + + def __repr__(self): + return 'Array(%s)' % self.child + +class DBusType(Base): + """The base class for all D-Bus types referred to in the spec. + + Don't instantiate this class directly. + """ + + devhelp_name = "typedef" + + def __init__(self, parent, namespace, dom): + super(DBusType, self).__init__(parent, namespace, dom) + + self.dbus_type = dom.getAttribute('type') + self.array_name = dom.getAttribute('array-name') + self.array_depth = dom.getAttribute('array-depth') + + def get_root_namespace(self): + return self.namespace + + def get_breakdown(self): + return '' + + def get_url(self): + if isinstance(self.parent, Interface): + html = self.parent.get_url() + else: + html = 'generic-types.html' + + return '%s#%s' % (html, self.name) + +class SimpleType(DBusType): + def get_type_name(self): + return 'Simple Type' + +class ExternalType(DBusType): + def __init__(self, parent, namespace, dom): + super(ExternalType, self).__init__(parent, namespace, dom) + + # FIXME: until we are able to cross reference external types to learn + # about their array names, we're just going to assume they work like + # this + self.array_name = self.short_name + '_List' + + def get_type_name(self): + return 'External Type' + +class StructLike(DBusType): + """Base class for all D-Bus types that look kind of like Structs + + Don't instantiate this class directly. + """ + + class StructMember(Typed): + def get_root_namespace(self): + return self.parent.get_root_namespace() + + def __init__(self, parent, namespace, dom): + super(StructLike, self).__init__(parent, namespace, dom) + + self.members = build_list(self, StructLike.StructMember, None, + dom.getElementsByTagNameNS(XMLNS_TP, 'member')) + + def get_breakdown(self): + str = '' + str += '<ul>\n' + for member in self.members: + # attempt to lookup the member up in the type system + t = member.get_type() + + str += '<li>%s — %s' % (member.name, member.dbus_type) + if t: str += ' (<a href="%s" title="%s">%s</a>)' % ( + t.get_url(), t.get_title(), t.short_name) + str += '</li>\n' + str += member.get_docstring() + str += '</ul>\n' + + return str + +class Mapping(StructLike): + def __init__(self, parent, namespace, dom): + super(Mapping, self).__init__(parent, namespace, dom) + + # rewrite the D-Bus type + self.dbus_type = 'a{%s}' % ''.join(map(lambda m: m.dbus_type, self.members)) + +class Struct(StructLike): + + devhelp_name = "struct" + + def __init__(self, parent, namespace, dom): + super(Struct, self).__init__(parent, namespace, dom) + + # rewrite the D-Bus type + self.dbus_type = '(%s)' % ''.join(map(lambda m: m.dbus_type, self.members)) + +class EnumLike(DBusType): + """Base class for all D-Bus types that look kind of like Enums + + Don't instantiate this class directly. + """ + class EnumValue(Base): + def __init__(self, parent, namespace, dom): + super(EnumLike.EnumValue, self).__init__(parent, namespace, dom) + + # rewrite self.name + self.short_name = dom.getAttribute('suffix') + self.name = build_name(namespace, self.short_name) + + self.value = dom.getAttribute('value') + + super(EnumLike.EnumValue, self).validate() + + def validate(self): + pass + + def get_root_namespace(self): + return self.parent.get_root_namespace() + + def get_breakdown(self): + str = '' + str += '<ul>\n' + for value in self.values: + # attempt to lookup the member.name as a type in the type system + str += '<li>%s (%s)</li>\n' % (value.short_name, value.value) + str += value.get_added() + str += value.get_changed() + str += value.get_deprecated() + str += value.get_docstring() + str += '</ul>\n' + + return str + +class Enum(EnumLike): + + devhelp_name = "enum" + + def __init__(self, parent, namespace, dom): + super(Enum, self).__init__(parent, namespace, dom) + + self.values = build_list(self, EnumLike.EnumValue, self.name, + dom.getElementsByTagNameNS(XMLNS_TP, 'enumvalue')) + +class Flags(EnumLike): + def __init__(self, parent, namespace, dom): + super(Flags, self).__init__(parent, namespace, dom) + + self.values = build_list(self, EnumLike.EnumValue, self.name, + dom.getElementsByTagNameNS(XMLNS_TP, 'flag')) + self.flags = self.values # in case you're looking for it + +class TokenBase(Base): + + devhelp_name = "macro" # it's a constant, which is near enough... + separator = '/' + + def __init__(self, parent, namespace, dom): + super(TokenBase, self).__init__(parent, namespace, dom) + self.name = namespace + '/' + self.short_name + +class ContactAttribute(TokenBase, Typed): + + def get_type_name(self): + return 'Contact Attribute' + +class HandlerCapabilityToken(TokenBase): + + def get_type_name(self): + return 'Handler Capability Token' + + def __init__(self, parent, namespace, dom): + super(HandlerCapabilityToken, self).__init__(parent, namespace, dom) + + is_family = dom.getAttribute('is-family') + assert is_family in ('yes', 'no', '') + self.is_family = (is_family == 'yes') + +class SectionBase(object): + """A SectionBase is an abstract base class for any type of node that can + contain a <tp:section>, which means the top-level Spec object, or any + Section object. + + It should not be instantiated directly. + """ + + def __init__(self, dom, spec_namespace): + + self.items = [] + + def recurse(nodes): + # iterate through the list of child nodes + for node in nodes: + if node.nodeType != node.ELEMENT_NODE: continue + + if node.tagName == 'node': + # recurse into this level for interesting items + recurse(node.childNodes) + elif node.namespaceURI == XMLNS_TP and \ + node.localName == 'section': + self.items.append(Section(self, None, node, + spec_namespace)) + elif node.tagName == 'interface': + self.items.append(Interface(self, None, node, + spec_namespace)) + + recurse(dom.childNodes) + +class Section(Base, SectionBase): + def __init__(self, parent, namespace, dom, spec_namespace): + Base.__init__(self, parent, namespace, dom) + SectionBase.__init__(self, dom, spec_namespace) + + def get_root_namespace(self): + return None + +class Spec(SectionBase): + def __init__(self, dom, spec_namespace): + # build a dictionary of errors in this spec + try: + errorsnode = dom.getElementsByTagNameNS(XMLNS_TP, 'errors')[0] + self.errors = build_dict(self, Error, + errorsnode.getAttribute('namespace'), + errorsnode.getElementsByTagNameNS(XMLNS_TP, 'error')) + except IndexError: + self.errors = {} + + # build a list of generic types + self.generic_types = reduce (lambda a, b: a + b, + map(lambda l: parse_types(self, l), + dom.getElementsByTagNameNS(XMLNS_TP, 'generic-types')), + []) + + # create a top-level section for this Spec + SectionBase.__init__(self, dom.documentElement, spec_namespace) + + # build a list of interfaces in this spec + self.interfaces = [] + def recurse(items): + for item in items: + if isinstance(item, Section): recurse(item.items) + elif isinstance(item, Interface): self.interfaces.append(item) + recurse(self.items) + + # build a giant dictionary of everything (interfaces, methods, signals + # and properties); also build a dictionary of types + self.everything = {} + self.types = {} + + for type in self.generic_types: self.types[type.short_name] = type + + for interface in self.interfaces: + self.everything[interface.name] = interface + + for method in interface.methods: + self.everything[method.name] = method + for signal in interface.signals: + self.everything[signal.name] = signal + for property in interface.properties: + self.everything[property.name] = property + for property in interface.tpproperties: + self.everything[property.name] = property + for token in interface.contact_attributes: + self.everything[token.name] = token + for token in interface.handler_capability_tokens: + self.everything[token.name] = token + + for type in interface.types: + self.types[type.short_name] = type + + # get some extra bits for the HTML + node = dom.getElementsByTagNameNS(XMLNS_TP, 'spec')[0] + self.title = getText(getChildrenByName(node, XMLNS_TP, 'title')[0]) + + try: + self.version = getText(getChildrenByName(node, XMLNS_TP, 'version')[0]) + except IndexError: + self.version = None + + self.copyrights = map(getText, + getChildrenByName(node, XMLNS_TP, 'copyright')) + + try: + license = getChildrenByName(node, XMLNS_TP, 'license')[0] + license.tagName = 'div' + license.namespaceURI = None + license.setAttribute('class', 'license') + self.license = license.toxml() + except IndexError: + self.license = '' + + # FIXME: we need to check all args for type correctness + + def get_spec(self): + return self + + def lookup(self, name, namespace=None): + key = build_name(namespace, name) + return self.everything[key] + + def lookup_type(self, type_): + if type_.endswith('[]'): + return DBusList(self.lookup_type(type_[:-2])) + + if type_ == '': return None + elif type_ in self.types: + return self.types[type_] + + raise UnknownType("Type '%s' is unknown" % type_) + + def __repr__(self): + return '%s(%s)' % (self.__class__.__name__, self.title) + +def build_dict(parent, type_, namespace, nodes): + """Build a dictionary of D-Bus names to Python objects representing that + name using the XML node for that item in the spec. + + e.g. 'org.freedesktop.Telepathy.Channel' : Interface(Channel) + + Works for any Python object inheriting from 'Base' whose XML node + implements the 'name' attribute. + """ + + def build_tuple(node): + o = type_(parent, namespace, node) + return(o.name, o) + + return dict(build_tuple(n) for n in nodes) + +def build_list(parent, type_, namespace, nodes): + return map(lambda node: type_(parent, namespace, node), nodes) + +def parse_types(parent, dom, namespace = None): + """Parse all of the types of type nodes mentioned in 't' from the node + 'dom' and insert them into the dictionary 'd'. + """ + t = [ + (SimpleType, 'simple-type'), + (Enum, 'enum'), + (Flags, 'flags'), + (Mapping, 'mapping'), + (Struct, 'struct'), + (ExternalType, 'external-type'), + ] + + types = [] + + for (type_, tagname) in t: + types += build_list(parent, type_, namespace, + dom.getElementsByTagNameNS(XMLNS_TP, tagname)) + + return types + +def parse(filename, spec_namespace): + dom = xml.dom.minidom.parse(filename) + xincludator.xincludate(dom, filename) + + spec = Spec(dom, spec_namespace) + + return spec + +if __name__ == '__main__': + parse(sys.argv[1]) diff --git a/sflphone-common/doc/dbus-api/tools/specparser.pyc b/sflphone-common/doc/dbus-api/tools/specparser.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a26b0bf150ae052a840cee27735b00ecd9ea6b0 Binary files /dev/null and b/sflphone-common/doc/dbus-api/tools/specparser.pyc differ diff --git a/sflphone-common/doc/dbus-api/tools/xincludator.py b/sflphone-common/doc/dbus-api/tools/xincludator.py new file mode 100644 index 0000000000000000000000000000000000000000..63e106ace13664eb71571342bec39780175e25bd --- /dev/null +++ b/sflphone-common/doc/dbus-api/tools/xincludator.py @@ -0,0 +1,39 @@ +#!/usr/bin/python + +from sys import argv, stdout, stderr +import codecs, locale +import os +import xml.dom.minidom + +stdout = codecs.getwriter('utf-8')(stdout) + +NS_XI = 'http://www.w3.org/2001/XInclude' + +def xincludate(dom, base, dropns = []): + remove_attrs = [] + for i in xrange(dom.documentElement.attributes.length): + attr = dom.documentElement.attributes.item(i) + if attr.prefix == 'xmlns': + if attr.localName in dropns: + remove_attrs.append(attr) + else: + dropns.append(attr.localName) + for attr in remove_attrs: + dom.documentElement.removeAttributeNode(attr) + for include in dom.getElementsByTagNameNS(NS_XI, 'include'): + href = include.getAttribute('href') + # FIXME: assumes Unixy paths + filename = os.path.join(os.path.dirname(base), href) + subdom = xml.dom.minidom.parse(filename) + xincludate(subdom, filename, dropns) + if './' in href: + subdom.documentElement.setAttribute('xml:base', href) + include.parentNode.replaceChild(subdom.documentElement, include) + +if __name__ == '__main__': + argv = argv[1:] + dom = xml.dom.minidom.parse(argv[0]) + xincludate(dom, argv[0]) + xml = dom.toxml() + stdout.write(xml) + stdout.write('\n') diff --git a/sflphone-common/doc/dbus-api/tools/xincludator.pyc b/sflphone-common/doc/dbus-api/tools/xincludator.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1172f2daf89056937b733fe218beea72eb72f4fa Binary files /dev/null and b/sflphone-common/doc/dbus-api/tools/xincludator.pyc differ diff --git a/sflphone-common/doc/misc/debian-package.txt b/sflphone-common/doc/misc/debian-package.txt deleted file mode 100644 index 23409b79dfb4227ac49caad79578864f0db85c38..0000000000000000000000000000000000000000 --- a/sflphone-common/doc/misc/debian-package.txt +++ /dev/null @@ -1,33 +0,0 @@ -***************************** HOW_TO DEBIAN PACKAGE ******************************** - -This document aims at explaining how to build a binary debian package. - -- Identify the dependencies at the runtime. You can describe them in the control file. -- Build the directory tree - - packagename_version - | - | - _____|______ - | | - \|/ \|/ - /usr DEBIAN - -- Write the control file in the DEBIAN directory (you must have at least this one file), and prerm, postinst scripts,.. -- Describe the files you need in the package, that is the files you need to make run the program (executables, libraries), docs, images, etc... and where you need it. For instance, the binary executables should be in /usr/bin, images in /usr/share, ... -- Build the debian package: - dpkg --build packagename packagename.deb . -Note: Be careful to debian package naming conventions (packagename_version_arch.deb) - -- Install the package: - dpkg --install packagename.deb (as a root) -If the dependant packages are not automatically configured, launch sudo apt-get -f install. It will configure the package you need to make run the application. -Note: The graphical interface of the debian package manager does configures the missing dependant packages automatically. - -- To remove the package, run : dpkg --remove packagename (must be root) - - - - - - diff --git a/sflphone-common/doc/misc/echange.txt b/sflphone-common/doc/misc/echange.txt deleted file mode 100644 index ee2058e56b2423aace9d6a577012cfd4ee30b0cb..0000000000000000000000000000000000000000 --- a/sflphone-common/doc/misc/echange.txt +++ /dev/null @@ -1,21 +0,0 @@ - --> INVITE (20) --> 0 0 IN IP4 192.168.1.172 c=IN IP4 192.168.1.172 m=audio 56198 - <-- 407 Proxy Auth - --> ACK 20 - --> INVITE (21) 0 0 IN IP4 192.168.1.172 c=IN IP4 192.168.1.172 m=audio 56198 (proxy-auth) - <-- 100 Trying (21 INVITE) - <-- 180 Ringing (21 INVITE) - <-- 200 OK root 26195 26195 IN IP4 192.168.1.10 c=IN IP4 192.168.1.10 m=audio 15792 - --> ACK 21 - <-- INVITE (102) root 26195 26196 IN IP4 192.168.1.124 c=IN IP4 192.168.1.124 m=audio 53628 - --> 100 Trying (102 INVITE) - --> 403 Forbidden (102 INVITE) - --> ACK (192.168.1.172) (102 ACK) - --> INVITE (103) root 26195 26197 IN IP4 192.168.1.10 c=IN IP4 192.168.1.10 m=audio 15792 - <-- 100 Trying (103 INVITE) - <-- 500 Retry Later (103 INVITE) -# -U 192.168.1.172:5060 -> 192.168.1.10:5060 - SIP/2.0 500 Retry Later..Via: SIP/2.0/UDP 192.168.1.10:5060;branch=z9hG4bK2af68dba;rport=5060..From - : <sip:124@savoirfairelinux.net>;tag=as46619d38..To: "Yan Morin 2" <sip:sfl-127@savoirfairelinux.ne - t>;tag=785584300..Call-ID: 1746410696@192.168.1.172..CSeq: 103 INVITE..Retry-After: 10..Allow: INVI - TE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, MESSAGE, INFO, REFER, UPDATE..Content-Length: 0.. \ No newline at end of file diff --git a/sflphone-common/doc/misc/libsamplerate.png b/sflphone-common/doc/misc/libsamplerate.png deleted file mode 100644 index 4d918b85924c7934527adcaf5d744e42e47030fc..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/misc/libsamplerate.png and /dev/null differ diff --git a/sflphone-common/doc/misc/matrice-comparaison.ods b/sflphone-common/doc/misc/matrice-comparaison.ods deleted file mode 100644 index 4543641697d34036c785a0991a5ab26b8918ec09..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/misc/matrice-comparaison.ods and /dev/null differ diff --git a/sflphone-common/doc/misc/outgoingcall.txt b/sflphone-common/doc/misc/outgoingcall.txt deleted file mode 100644 index b08053381261641d87ab6995b748c971bfc66a86..0000000000000000000000000000000000000000 --- a/sflphone-common/doc/misc/outgoingcall.txt +++ /dev/null @@ -1,15 +0,0 @@ -1. outgoingCall() -1.1 generateNewCallId() (short) -1.2 pushBackNewCall() -1.2.1 new Call(id, type, _voIPLinkVector.at(DFT_VOIP_LINK)) -1.2.1.1 _state = NotExist; -1.2.1.2 _voIPLink->newOutgoingCall(_id); -1.2.1.2.1 new SipCall(callid, Manager::instance().getCodecDescVector())); -1.2.1.2.2 _sipcallVector.push_back(sipcall); -1.2.1.2.3 sipcall->setStandBy(true); -1.2.2 _callVector.push_back(call); -1.3 call->setStatus(string(TRYING_STATUS)); -1.4 call->setState(Progressing); -1.5 call->setCallerIdNumber(to); -1.6 call->outgoingCall(to); - diff --git a/sflphone-common/doc/misc/playtone.txt b/sflphone-common/doc/misc/playtone.txt deleted file mode 100644 index f8efb9212fd25fbdd0dd73ffa8e79d65b6608b11..0000000000000000000000000000000000000000 --- a/sflphone-common/doc/misc/playtone.txt +++ /dev/null @@ -1,9 +0,0 @@ -Appel: -playtone s1 [joue tant que playtone = false] -playdtmf s2 1 [si playtone = true ( playtone = false) flush, start playdtmf] -playdtmf s3 0 [] -playdtmf s4 3 [] - - - - diff --git a/sflphone-common/doc/misc/sflphoneqt-startup.txt b/sflphone-common/doc/misc/sflphoneqt-startup.txt deleted file mode 100644 index 5b2af9b903d9f53eec081a8969d88993112853db..0000000000000000000000000000000000000000 --- a/sflphone-common/doc/misc/sflphoneqt-startup.txt +++ /dev/null @@ -1,61 +0,0 @@ -main.cpp: main() --> app = new SFLPhoneApp - -> new SessionIO, 3999 - -> new session - -> new SessionId - -> new SessionIO (create) - -> Requester::registerSession() - -> envoie session a ConfigurationManager - -> envoie session a PhoneLineManager(initialize) - -> new Session(session) - -> new Account <-- supprimé - -> configure le nombre de ligne de PhoneLineManager::setNbLines - -> new PhoneLine - - -> new Request Object (commande) - -> new NumericKeypad --> new and show splash --> sfl = new SFLPhoneWindow - -> positionne fenêtre - -> new ConfigurationPanel - -> connection updates au panel - -> connection bouton panel a la fenetre - -> peinture apres 50 milli-seconde - -> initialisation graphique - --> initConnections(sfl) - -> associe les PhoneLineButton au PhoneLine - -> associe needRegister - -> associe soundDriverChanged - -> connecte les boutons de la fenetre au phonelinemanager - -> associe phonelinemanager au lcd (messages texet) - -> associe evenement daemon - -> associe lauching (daemon) - -> associe status - phone line - -> associe evenement update, setup --> launch - -> Launcher->start() --> PhoneLineManager::connect et attend "connected" --> loadSkin --> exec - -Evenement: --Lorsque le PhoneLineManager est connectée (connected) - le splash disparait splash.hide() --Lorsque le PhoneLineManager gère le getEvents - app.handleArg() - -TCPSessionIOCreator::create --> TCPSessionIO::connected| - PhoneLineManagerImpl::connected| - -> PhoneLineManagerImpl::readyToSendStatus| - -> PhoneLineManagerImpl::startSession() - -> mSession::getCallStatus() - -> SFLPhoneWindow::show - -> splash::hide - -CallStatusRequest - -> onSuccess -> PhoneLineManager::selectLine() - -> PhoneLineManager::handleEvents() - -> onEntry -> CallStatus::execute() -> PhoneLineManager::addCall() - -> onError -> PhoneLineManager::errorOnCallStatus() diff --git a/sflphone-common/doc/screenshots/accounts.png b/sflphone-common/doc/screenshots/accounts.png deleted file mode 100644 index 2a1d033892ad357faf1e79c20141ffb9b6bd1d80..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/accounts.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/audio-parameters.png b/sflphone-common/doc/screenshots/audio-parameters.png deleted file mode 100644 index 7be7badab519fd06a3c5ef00f9c2916f12511f4b..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/audio-parameters.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/desktop-notif-voice mail.png b/sflphone-common/doc/screenshots/desktop-notif-voice mail.png deleted file mode 100644 index 4d2899877f696477da49f7cee1935e52d43189bf..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/desktop-notif-voice mail.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/desktop-notification.png b/sflphone-common/doc/screenshots/desktop-notification.png deleted file mode 100644 index c854b8252253f8fdb9c89ee41fc02b2ef2ca9c3a..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/desktop-notification.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/gtk gui.png b/sflphone-common/doc/screenshots/gtk gui.png deleted file mode 100644 index 958beb4ee40b156630d41ecb7c5ce77f35cb4256..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/gtk gui.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/several-calls.png b/sflphone-common/doc/screenshots/several-calls.png deleted file mode 100644 index 65dc12dbcbba742c04f3d974bca9fe660a004756..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/several-calls.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/sflphoneDialpad_gtk_0.8.png b/sflphone-common/doc/screenshots/sflphoneDialpad_gtk_0.8.png deleted file mode 100644 index 00d6ce8a0620d1a81244146884b22cf641a26906..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/sflphoneDialpad_gtk_0.8.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/sflphone_gtk_0.8.png b/sflphone-common/doc/screenshots/sflphone_gtk_0.8.png deleted file mode 100644 index 39b01d78d6c16ed71c20c13b548b7f5f2db9ff33..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/sflphone_gtk_0.8.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/sflphone_metal.png b/sflphone-common/doc/screenshots/sflphone_metal.png deleted file mode 100644 index ed34ee700257aa068667d3ebf6db1966f7cbd1c9..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/sflphone_metal.png and /dev/null differ diff --git a/sflphone-common/doc/screenshots/sflphone_qt3_0.6.2.png b/sflphone-common/doc/screenshots/sflphone_qt3_0.6.2.png deleted file mode 100644 index 3b53ce3190013f36ff1a4dc8bb54b051f51ca865..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/screenshots/sflphone_qt3_0.6.2.png and /dev/null differ diff --git a/sflphone-common/doc/sflphone_video/abstract.odt b/sflphone-common/doc/sflphone_video/abstract.odt deleted file mode 100644 index e9263f9cff27f087345e37418b363eba096349b0..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/sflphone_video/abstract.odt and /dev/null differ diff --git a/sflphone-common/doc/sflphone_video/ressources.odt b/sflphone-common/doc/sflphone_video/ressources.odt deleted file mode 100644 index 1c9cfed4cc410d060e1f4fc2bc4b959ccf66764b..0000000000000000000000000000000000000000 Binary files a/sflphone-common/doc/sflphone_video/ressources.odt and /dev/null differ diff --git a/sflphone-common/globals.mak b/sflphone-common/globals.mak index bcbb63eb257e6d4e7aaac61e40ba22f8639f5592..23f700e61f5cad26b71d0550c4a5ce63c3955780 100644 --- a/sflphone-common/globals.mak +++ b/sflphone-common/globals.mak @@ -14,15 +14,15 @@ PJSIP_LIBS= \ -L$(src)/libs/pjproject/pjlib/lib/ \ -L$(src)/libs/pjproject/pjlib-util/lib/ \ -L$(src)/libs/pjproject/pjmedia/lib/ \ - -lpjnath-sfl-$(target) \ - -lpjsua-sfl-$(target) \ - -lpjsip-sfl-$(target) \ - -lpjmedia-sfl-$(target) \ - -lpjsip-simple-sfl-$(target) \ - -lpjsip-ua-sfl-$(target) \ - -lpjmedia-codec-sfl-$(target) \ - -lpjlib-util-sfl-$(target) \ - -lpj-sfl-$(target) + -lpjnath-$(target) \ + -lpjsua-$(target) \ + -lpjsip-$(target) \ + -lpjmedia-$(target) \ + -lpjsip-simple-$(target) \ + -lpjsip-ua-$(target) \ + -lpjmedia-codec-$(target) \ + -lpjlib-util-$(target) \ + -lpj-$(target) SIP_CFLAGS=-I$(src)/libs/pjproject/pjsip/include \ -I$(src)/libs/pjproject/pjlib/include \ diff --git a/sflphone-common/libs/dbus-c++/src/Makefile.am b/sflphone-common/libs/dbus-c++/src/Makefile.am index 7bc99b89ca23aaf875c4406ff6445738cea1fc8b..26520ff252264fc65d3f8c06e04d73456063b6a8 100644 --- a/sflphone-common/libs/dbus-c++/src/Makefile.am +++ b/sflphone-common/libs/dbus-c++/src/Makefile.am @@ -5,10 +5,10 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/libs/dbus-c++/include \ -I$(top_builddir)/libs/dbus-c++/include -if ENABLE_GLIB -GLIB_H = $(HEADER_DIR)/glib-integration.h -GLIB_CPP = glib-integration.cpp -endif +#if ENABLE_GLIB +#GLIB_H = $(HEADER_DIR)/glib-integration.h +#GLIB_CPP = glib-integration.cpp +#endif CONFIG_H = $(top_builddir)/libs/dbus-c++/include/dbus-c++/config.h diff --git a/sflphone-common/libs/pjproject/Makefile b/sflphone-common/libs/pjproject/Makefile index 50f4da18e7c2c60459b47fe896bee13899388915..f8ed4b0de0d58def49de07bf0983cd19787e6fd3 100644 --- a/sflphone-common/libs/pjproject/Makefile +++ b/sflphone-common/libs/pjproject/Makefile @@ -29,17 +29,17 @@ doc: fi; \ done -LIBS = pjlib/lib/libpj-sfl-$(TARGET_NAME).a \ - pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME).a \ - pjnath/lib/libpjnath-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-audiodev-sfl-$(TARGET_NAME).a \ - pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-ua-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsip-simple-sfl-$(TARGET_NAME).a \ - pjsip/lib/libpjsua-sfl-$(TARGET_NAME).a -BINS = pjsip-apps/bin/pjsua-sfl-$(TARGET_NAME)$(HOST_EXE) +LIBS = pjlib/lib/libpj-$(TARGET_NAME).a \ + pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \ + pjnath/lib/libpjnath-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \ + pjsip/lib/libpjsua-$(TARGET_NAME).a +BINS = pjsip-apps/bin/pjsua-$(TARGET_NAME)$(HOST_EXE) size: @echo -n 'Date: ' @@ -70,6 +70,27 @@ xhdrid: cp /tmp/id $$f; \ done +selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test + +pjlib-test: pjlib/bin/pjlib-test-$(TARGET_NAME) + cd pjlib/build && ../bin/pjlib-test-$(TARGET_NAME) + +pjlib-util-test: pjlib-util/bin/pjlib-util-test-$(TARGET_NAME) + cd pjlib-util/build && ../bin/pjlib-util-test-$(TARGET_NAME) + +pjnath-test: pjnath/bin/pjnath-test-$(TARGET_NAME) + cd pjnath/build && ../bin/pjnath-test-$(TARGET_NAME) + +pjmedia-test: pjmedia/bin/pjmedia-test-$(TARGET_NAME) + cd pjmedia/build && ../bin/pjmedia-test-$(TARGET_NAME) + +pjsip-test: pjsip/bin/pjsip-test-$(TARGET_NAME) + cd pjsip/build && ../bin/pjsip-test-$(TARGET_NAME) + +pjsua-test: + cd tests/pjsua && python runall.py + +prefix = /usr/local install: mkdir -p $(DESTDIR)$(prefix)/lib cp -L $$(find . -name '*.a') $(DESTDIR)$(prefix)/lib @@ -79,4 +100,4 @@ install: ln -s $$i $$(echo $$i | sed -e "s/-$(TARGET_NAME)//");\ done mkdir -p $(DESTDIR)$(prefix)/lib/pkgconfig - sed -e "s!@PREFIX@!$(DESTDIR)$(prefix)!" libpj-sfl.pc.in > $(DESTDIR)/$(prefix)/lib/pkgconfig/libpj-sfl.pc + sed -e "s!@PREFIX@!$(DESTDIR)$(prefix)!" libpj.pc.in > $(DESTDIR)/$(prefix)/lib/pkgconfig/libpj.pc diff --git a/sflphone-common/libs/pjproject/aconfigure b/sflphone-common/libs/pjproject/aconfigure index 67e64d34bf2202ff74f386fc56484c071051ccf2..e5b8e4aec50cfe5594027fef1b4e412fb26dc834 100755 --- a/sflphone-common/libs/pjproject/aconfigure +++ b/sflphone-common/libs/pjproject/aconfigure @@ -4590,6 +4590,13 @@ if test "x$ac_cv_header_netinet_ip_h" = x""yes; then : fi +ac_fn_c_check_header_mongrel "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "$ac_includes_default" +if test "x$ac_cv_header_netinet_tcp_h" = x""yes; then : + $as_echo "#define PJ_HAS_NETINET_TCP_H 1" >>confdefs.h + +fi + + ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" if test "x$ac_cv_header_ifaddrs_h" = x""yes; then : $as_echo "#define PJ_HAS_IFADDRS_H 1" >>confdefs.h @@ -5771,7 +5778,9 @@ fi if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL library found, SSL support enabled" >&5 $as_echo "OpenSSL library found, SSL support enabled" >&6; } - $as_echo "#define PJSIP_HAS_TLS_TRANSPORT 1" >>confdefs.h + # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK + #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) + $as_echo "#define PJ_HAS_SSL_SOCK 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ** OpenSSL libraries not found, disabling SSL support **" >&5 diff --git a/sflphone-common/libs/pjproject/aconfigure.ac b/sflphone-common/libs/pjproject/aconfigure.ac index b8b7914f25ff93c29dc68d3179dee808dd1fb98c..92eaa9dcb2d13cf0791e3cb1f753fa7c1c7c0ece 100644 --- a/sflphone-common/libs/pjproject/aconfigure.ac +++ b/sflphone-common/libs/pjproject/aconfigure.ac @@ -150,6 +150,7 @@ AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[], # include <netinet/in_systm.h> #endif ]) +AC_CHECK_HEADER(netinet/tcp.h,[AC_DEFINE(PJ_HAS_NETINET_TCP_H,1)]) AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)]) AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)]) AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)]) @@ -763,7 +764,9 @@ AC_ARG_ENABLE(ssl, AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"]) if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then AC_MSG_RESULT([OpenSSL library found, SSL support enabled]) - AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) + # PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK + #AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1) + AC_DEFINE(PJ_HAS_SSL_SOCK, 1) else AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **]) fi diff --git a/sflphone-common/libs/pjproject/autogen.sh b/sflphone-common/libs/pjproject/autogen.sh old mode 100755 new mode 100644 diff --git a/sflphone-common/libs/pjproject/build.mak.in b/sflphone-common/libs/pjproject/build.mak.in index d9e9e09cbf6abf2b40e52bc06e999fc0cc92e1f8..11e0fbe03d94885f0503fa13f4e73ec34df34d6e 100644 --- a/sflphone-common/libs/pjproject/build.mak.in +++ b/sflphone-common/libs/pjproject/build.mak.in @@ -59,29 +59,29 @@ export APP_LDFLAGS := -L$(PJDIR)/pjlib/lib\ -L$(PJDIR)/pjsip/lib\ -L$(PJDIR)/third_party/lib\ @LDFLAGS@ -export APP_LDLIBS := -lpjsua-sfl-$(TARGET_NAME)\ - -lpjsip-ua-sfl-$(TARGET_NAME)\ - -lpjsip-simple-sfl-$(TARGET_NAME)\ - -lpjsip-sfl-$(TARGET_NAME)\ - -lpjmedia-codec-sfl-$(TARGET_NAME)\ - -lpjmedia-sfl-$(TARGET_NAME)\ - -lpjmedia-audiodev-sfl-$(TARGET_NAME)\ - -lpjnath-sfl-$(TARGET_NAME)\ - -lpjlib-util-sfl-$(TARGET_NAME)\ +export APP_LDLIBS := -lpjsua-$(TARGET_NAME)\ + -lpjsip-ua-$(TARGET_NAME)\ + -lpjsip-simple-$(TARGET_NAME)\ + -lpjsip-$(TARGET_NAME)\ + -lpjmedia-codec-$(TARGET_NAME)\ + -lpjmedia-$(TARGET_NAME)\ + -lpjmedia-audiodev-$(TARGET_NAME)\ + -lpjnath-$(TARGET_NAME)\ + -lpjlib-util-$(TARGET_NAME)\ $(APP_THIRD_PARTY_LIBS)\ - -lpj-sfl-$(TARGET_NAME)\ + -lpj-$(TARGET_NAME)\ @LIBS@ -export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjsip/lib/libpjsip-ua-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjsip/lib/libpjsip-simple-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjsip/lib/libpjsip-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjmedia/lib/libpjmedia-codec-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjmedia/lib/libpjmedia-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjnath/lib/libpjnath-sfl-$(LIB_SUFFIX) \ - $(PJ_DIR)/pjlib-util/lib/libpjlib-util-sfl-$(LIB_SUFFIX) \ +export APP_LIB_FILES = $(PJ_DIR)/pjsip/lib/libpjsua-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjsip/lib/libpjsip-ua-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjsip/lib/libpjsip-simple-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjsip/lib/libpjsip-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjmedia/lib/libpjmedia-codec-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjmedia/lib/libpjmedia-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjmedia/lib/libpjmedia-audiodev-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjnath/lib/libpjnath-$(LIB_SUFFIX) \ + $(PJ_DIR)/pjlib-util/lib/libpjlib-util-$(LIB_SUFFIX) \ $(APP_THIRD_PARTY_LIB_FILES) \ - $(PJ_DIR)/pjlib/lib/libpj-sfl-$(LIB_SUFFIX) + $(PJ_DIR)/pjlib/lib/libpj-$(LIB_SUFFIX) export PJ_DIR := $(PJDIR) export PJ_CC := $(APP_CC) diff --git a/sflphone-common/libs/pjproject/build.symbian/bld.inf b/sflphone-common/libs/pjproject/build.symbian/bld.inf index b516a1d9cf66984f9096e7b75dc1b145e5f0af57..7e26998768706f551cc33cd9cf8c06c0a8384658 100644 --- a/sflphone-common/libs/pjproject/build.symbian/bld.inf +++ b/sflphone-common/libs/pjproject/build.symbian/bld.inf @@ -1,6 +1,6 @@ prj_platforms winscw -//armv5 +armv5 gcce prj_mmpfiles @@ -30,7 +30,6 @@ libresample.mmp pjmedia_audiodev.mmp /* Applications */ -//pjlib_test.mmp //symsndtest.mmp symbian_ua.mmp ..\pjsip-apps\src\symbian_ua_gui\group\symbian_ua_gui.mmp diff --git a/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp b/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp index 95d379591fa1d795f1da432edf5353c375c0126f..814fcae6ee1d626fb840b6beaf89eb227730393f 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libg7221codec.mmp @@ -3,6 +3,7 @@ TARGETTYPE lib //OPTION CW -lang c++ OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp b/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp index 754bceac372cc4e51ad34d524c834088e3c2c174..1b301f8c39e06bf2c0b9dc7c52d80891e0f3ff8b 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libgsmcodec.mmp @@ -19,6 +19,7 @@ TARGETTYPE lib #endif //OPTION CW -lang c++ +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp b/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp index c4fb2775520173aa722828a1ad2839e1c00d6f18..3a1911714e466b178cf71acc01ef4f988f1871d6 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libpassthroughcodec.mmp @@ -9,6 +9,7 @@ MACRO PJ_SYMBIAN=1 // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu // // Passthrough codecs wrapper for pjmedia-codec diff --git a/sflphone-common/libs/pjproject/build.symbian/libresample.mmp b/sflphone-common/libs/pjproject/build.symbian/libresample.mmp index 1498714685a4e65620d094e67a2814756c060be4..0dd074ff08189bade7c9a3ccc750adcc7ba834d1 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libresample.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libresample.mmp @@ -7,6 +7,7 @@ SOURCEPATH ..\third_party\resample\src // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp b/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp index 1be8a19eea4e78053cbc9b60132be6977b0f7838..816d805370ec8773b65cdf8887a90ee6780fad33 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libspeexcodec.mmp @@ -9,6 +9,7 @@ MACRO PJ_SYMBIAN=1 // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu // // Speex files diff --git a/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp b/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp index 11384d22dfd1feaaa414d232c0540ee3743d50d5..4309e6dc10fc9f0276d88cde19ac89f7ba4fa419 100644 --- a/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/libsrtp.mmp @@ -8,6 +8,7 @@ MACRO PJ_SYMBIAN=1 // GCCE optimization setting // OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu // // Speex files diff --git a/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp b/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp index ea935bb236641bc9fddbcbd18672fffa660533ed..de1dcbdc69bfb7850edea16e53efb6aedb520295 100644 --- a/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/null_audio.mmp @@ -22,6 +22,7 @@ TARGETTYPE lib SOURCEPATH ..\pjmedia\src\pjmedia OPTION CW -lang c++ +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp b/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp index ec4a9902cec2857ebde9fbb644787b5d0f6e97a9..65ffcc5a09faa49659049cf170317026162e2084 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjlib.mmp @@ -24,7 +24,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -50,6 +50,7 @@ SOURCE pool_caching.c SOURCE rand.c SOURCE rbtree.c SOURCE sock_common.c +SOURCE sock_qos_common.c SOURCE types.c @@ -71,8 +72,11 @@ SOURCE os_timestamp_common.c SOURCE os_time_unix.c SOURCE os_timestamp_posix.c SOURCE pool_policy_new.cpp +SOURCE ssl_sock_common.c +SOURCE ssl_sock_symbian.cpp SOURCE sock_symbian.cpp SOURCE sock_select_symbian.cpp +SOURCE sock_qos_symbian.cpp SOURCE timer_symbian.cpp SOURCE unicode_symbian.cpp diff --git a/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp b/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp index 406b0d509397596071b4433e2c342307fbda2052..e48a332cc7dc6ff4200b0168e5d0578570fed899 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjlib_test.mmp @@ -10,7 +10,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -46,6 +46,7 @@ SOURCE select.c SOURCE sleep.c SOURCE sock.c SOURCE sock_perf.c +SOURCE ssl_sock.c SOURCE string.c SOURCE test_wrap.cpp SOURCE thread.c @@ -68,7 +69,7 @@ SYSTEMINCLUDE ..\pjlib\include SYSTEMINCLUDE \epoc32\include SYSTEMINCLUDE \epoc32\include\libc -LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib +LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib securesocket.lib #ifdef WINSCW STATICLIBRARY eexe.lib ecrt0.lib #endif @@ -76,3 +77,4 @@ STATICLIBRARY eexe.lib ecrt0.lib // Need a bit of mem for logging in the app. EPOCSTACKSIZE 32768 +CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment diff --git a/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp b/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp index 5dac2f8f9dbfe1206f92b4f2ffde06a852339948..3eb3701ac91365b7377dfd2f4db7c7bfc4fd0292 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjlib_util.mmp @@ -24,7 +24,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp b/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp index 7dd9fc79654048001e4b72d471de69cb7352ea42..b72934345adfe4d61ebab5be77d6652f873b5955 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjmedia.mmp @@ -30,7 +30,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp b/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp index da98b05effa7e62f46bc1e2f742dd714897aa164..f4e25d210fb1060d5af9fcbe2e123b48fa771888 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjmedia_audiodev.mmp @@ -7,6 +7,7 @@ SOURCEPATH ..\pjmedia\src\pjmedia-audiodev // GCCE optimization setting // //OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp b/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp index 7168313d19077f92057add6d8d4fe842b5c78fe2..76b64dda88d4fd29c2ff9c1ce4d175d9d1489054 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjnath.mmp @@ -17,6 +17,8 @@ TARGETTYPE lib #endif +OPTION ARMCC --gnu + SOURCEPATH ..\pjnath\src\pjnath MACRO PJ_M_I386=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp index 25f3db19fe68e86ad0fdca67f7721aa0ecae4cfd..e165704ee7875c542bf1ea2986d3a5491f1178f9 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsdp.mmp @@ -24,7 +24,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp index 785a799f36f35e61e79948a6afc8b5ae9eaae02b..6269b47df9434c8c87e483ed045d28bd7b687238 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsip.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -51,6 +51,7 @@ SOURCE sip_transport_wrap.cpp SOURCE sip_transport_loop.c SOURCE sip_transport_tcp.c SOURCE sip_transport_udp.c +SOURCE sip_transport_tls.c SOURCE sip_ua_layer.c SOURCE sip_uri.c SOURCE sip_util_wrap.cpp diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp index a6ddbf2d1328918d48544489485c06f2edadf1c9..9b83a9df97ee54ede312aa0429a06947a02b4da4 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsip_simple.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ @@ -37,6 +37,7 @@ SOURCE errno.c SOURCE evsub.c SOURCE evsub_msg.c SOURCE iscomposing.c +SOURCE mwi.c SOURCE pidf.c SOURCE presence.c SOURCE presence_body.c diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp index 59293049b3552a0284fd988bf5c825237d7842d2..609c0a39475abe40891043cb913de3fd0304bd32 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsip_ua.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp b/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp index fedb7a250c680d7e2f98d52e18cffc193cc04e62..6ca5eabcaee42ad64034ec50b00ffcc851c7592b 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjstun_client.mmp @@ -2,6 +2,8 @@ TARGET pjstun_client.exe TARGETTYPE exe UID 0x0 0xA000000A +OPTION ARMCC --gnu + SOURCEPATH ..\pjnath\src\pjstun-client MACRO PJ_M_I386=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp b/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp index 0b197819574e70fff63fa66aece6234a9a43fb43..ee7c6b085158154df17a29d1c8285b22560446aa 100644 --- a/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/pjsua_lib.mmp @@ -27,7 +27,7 @@ MACRO PJ_SYMBIAN=1 // Must compile as C++, otherwise exception would not work OPTION CW -lang c++ -OPTION ARMCC --cpp +OPTION ARMCC --cpp --gnu OPTION GCC -x c++ OPTION GCCE -x c++ diff --git a/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp b/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp index e53f4e893795d2a59332c916a6f1652cf95ce70b..bba9ce5fa08c5064f9703fa6cbac5e15f9638357 100644 --- a/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/symbian_audio.mmp @@ -25,6 +25,7 @@ SOURCEPATH ..\pjmedia\src\pjmedia OPTION CW -lang c++ OPTION GCCE -O2 -fno-unit-at-a-time +OPTION ARMCC --gnu MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 diff --git a/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp b/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp index 8ef9f73f31b2871fe13f2a5bb003e7ba4bad651e..9514cde3aa59b5310f2fccc20aeed488276032ef 100644 --- a/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/symbian_ua.mmp @@ -9,6 +9,8 @@ UID 0x0 0xA000000D SOURCEPATH ..\pjsip-apps\src\symbian_ua +OPTION ARMCC --gnu + MACRO PJ_M_I386=1 MACRO PJ_SYMBIAN=1 @@ -69,7 +71,7 @@ STATICLIBRARY libresample.lib STATICLIBRARY eexe.lib ecrt0.lib #endif -LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib commdb.lib apengine.lib +LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib commdb.lib apengine.lib securesocket.lib // The default 8KB seems to be insufficient with all bells and // whistles turned on diff --git a/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp b/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp index 415807df318baf4d9d1df67e0061282d3531b95a..c729e1c52b1d527a2d7c14b78584e80994c8d611 100644 --- a/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp +++ b/sflphone-common/libs/pjproject/build.symbian/symsndtest.mmp @@ -5,6 +5,8 @@ TARGET symsndtest.exe TARGETTYPE exe UID 0x0 0xA000000E +OPTION ARMCC --gnu + SOURCEPATH ..\pjsip-apps\src\symsndtest MACRO PJ_M_I386=1 diff --git a/sflphone-common/libs/pjproject/build/os-auto.mak b/sflphone-common/libs/pjproject/build/os-auto.mak deleted file mode 100644 index 62fa86b5c3682dcc2b18a5a8d2d5c3edca5d82dd..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/build/os-auto.mak +++ /dev/null @@ -1,11 +0,0 @@ -# build/os-auto.mak. Generated from os-auto.mak.in by configure. - -export OS_CFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 - -export OS_CXXFLAGS := $(CC_DEF)PJ_AUTOCONF=1 -O2 - -export OS_LDFLAGS := -lm -lnsl -lrt -lpthread -lasound -lssl -lcrypto - -export OS_SOURCES := - - diff --git a/sflphone-common/libs/pjproject/config.guess b/sflphone-common/libs/pjproject/config.guess deleted file mode 120000 index e019d6cb603867018bce360497c9a8dac8a764de..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/config.guess +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/rpm/config.guess \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/config.guess b/sflphone-common/libs/pjproject/config.guess new file mode 100755 index 0000000000000000000000000000000000000000..dff9e481b70f9505b49ce999629a168a19976f4f --- /dev/null +++ b/sflphone-common/libs/pjproject/config.guess @@ -0,0 +1,1317 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. + +timestamp='2001-09-04' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# Please send patches to <config-patches@gnu.org>. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c ; + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $dummy.c $dummy.o $dummy.rel ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-unknown ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <<EOF >$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + eval $set_cc_for_build + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + sparc*:NetBSD:*) + echo `uname -p`-unknown-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in + big) echo mips-unknown-linux-gnu && exit 0 ;; + little) echo mipsel-unknown-linux-gnu && exit 0 ;; + esac + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_supported_targets=`cd /; ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + cat >$dummy.c <<EOF +#include <features.h> +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-pc-linux-gnu\n", argv[1]); +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-pc-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-pc-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[KW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + ftp://ftp.gnu.org/pub/gnu/config/ + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/sflphone-common/libs/pjproject/config.sub b/sflphone-common/libs/pjproject/config.sub deleted file mode 120000 index a7d52c63542a219b06bf61cd18b2c8a28b9d3bf0..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/config.sub +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/rpm/config.sub \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/config.sub b/sflphone-common/libs/pjproject/config.sub new file mode 100755 index 0000000000000000000000000000000000000000..746ee208a175a4f263cc9a186f5dc8f420524274 --- /dev/null +++ b/sflphone-common/libs/pjproject/config.sub @@ -0,0 +1,1572 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-04-22' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + nios2*) + basic_machine=nios2-altera + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/sflphone-common/libs/pjproject/configure.ac b/sflphone-common/libs/pjproject/configure.ac deleted file mode 100644 index bf1644033a4f5cb86b7e9dc8e49804bfa092ee58..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/configure.ac +++ /dev/null @@ -1,5 +0,0 @@ -dnl Dummy configure.ac for autotools - -AC_INIT -LT_INIT -AC_OUTPUT diff --git a/sflphone-common/libs/pjproject/libpj-sfl.pc.in b/sflphone-common/libs/pjproject/libpj-sfl.pc.in deleted file mode 100644 index 8fa8d809cde3d2e8df03acdc7793ac68e5933094..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/libpj-sfl.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -# Package Information for pkg-config - -prefix=@PREFIX@ -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: libpj-sfl -Description: Multimedia communication library -Version: 0.5.10.3 -Libs: -L${libdir} -lpjsua-sfl -lpjsip-sfl -lpjmedia-sfl -lpjsip-ua-sfl -lpjsip-simple-sfl -lpjsip-ua-sfl -lpjmedia-codec-sfl -lpjlib-util-sfl -lpj-sfl -Cflags: -I${includedir} diff --git a/sflphone-common/libs/pjproject/pjlib-util/build/Makefile b/sflphone-common/libs/pjproject/pjlib-util/build/Makefile index 7dd8a9b27cb2a1345418fabe484be9aa2dc787e6..ef0939af690d2c30f6f230168b319f379b2e1323 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/build/Makefile +++ b/sflphone-common/libs/pjproject/pjlib-util/build/Makefile @@ -7,8 +7,8 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -export PJLIB_UTIL_LIB:=../lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +export PJLIB_UTIL_LIB:=../lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. diff --git a/sflphone-common/libs/pjproject/pjlib-util/build/os-auto.mak b/sflphone-common/libs/pjproject/pjlib-util/build/os-auto.mak deleted file mode 100644 index fe7975b64497ac781be78cb52d8fcbd9cb2a9842..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjlib-util/build/os-auto.mak +++ /dev/null @@ -1,3 +0,0 @@ -# pjlib-util/build/os-auto.mak. Generated from os-auto.mak.in by configure. -export UTIL_TEST_OBJS = main.o - diff --git a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h index 84259301c0dac413dc4510a52d7398234373866f..f1e5b1e9937d7317795ef6342d8fed0efea112aa 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h +++ b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJLIB_UTIL_CONFIG_H__ #define __PJLIB_UTIL_CONFIG_H__ @@ -59,7 +59,7 @@ * (the #pj_dns_packet_dup() function). * * Generally name compression is desired, since it saves some memory (see - * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of + * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of * a little processing overhead to perform name scanning and also a little * bit more stack usage (8 bytes per entry on 32bit platform). * @@ -84,7 +84,7 @@ /** - * Default retransmission delay, in miliseconds. The combination of + * Default retransmission delay, in miliseconds. The combination of * retransmission delay and count determines the query timeout. * * Default: 2000 (2 seconds, according to RFC 1035) @@ -106,8 +106,8 @@ /** - * Maximum life-time of DNS response in the resolver response cache, - * in seconds. If the value is zero, then DNS response caching will be + * Maximum life-time of DNS response in the resolver response cache, + * in seconds. If the value is zero, then DNS response caching will be * disabled. * * Default is 300 seconds (5 minutes). @@ -120,8 +120,8 @@ /** * The life-time of invalid DNS response in the resolver response cache. - * An invalid DNS response is a response which RCODE is non-zero and - * response without any answer section. These responses can be put in + * An invalid DNS response is a response which RCODE is non-zero and + * response without any answer section. These responses can be put in * the cache too to minimize message round-trip. * * Default: 60 (one minute). @@ -133,7 +133,7 @@ #endif /** - * The interval on which nameservers which are known to be good to be + * The interval on which nameservers which are known to be good to be * probed again to determine whether they are still good. Note that * this applies to both active nameserver (the one currently being used) * and idle nameservers (good nameservers that are not currently selected). diff --git a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h index 45e05357896f975ce8c393a55d7d446b38bf9b39..216e91b9e5d525d9807b1d26cd4896b639fba186 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h +++ b/sflphone-common/libs/pjproject/pjlib-util/include/pjlib-util/srv_resolver.h @@ -104,19 +104,7 @@ typedef enum pj_dns_srv_option * this option is not specified, the SRV resolver will query * the DNS A record for the target instead. */ - PJ_DNS_SRV_RESOLVE_AAAA = 4, - - /** - * Specify if the resolver should fallback to getaddrinfo - * under IPV4 mode if DNS A fails after DNS SRV. - */ - PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV4 = 8, - - /** - * Specify if the resolver should fallback to getaddrinfo - * under IPV6 mode if DNS A fails after DNS SRV. - */ - PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6 = 16, + PJ_DNS_SRV_RESOLVE_AAAA = 4 } pj_dns_srv_option; diff --git a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp index 19d306e1d0f872325d28a522f86970cce0c7e750..aece5356d7ae6cd2f685ba31f776372bfacfead5 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/resolver_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: resolver_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c index df15eb903318d0b0459962fb0678f8516bbd40b4..83963495574d53a1b9cfdaa596d02629eda89e1d 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c +++ b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/srv_resolver.c @@ -19,7 +19,6 @@ */ #include <pjlib-util/srv_resolver.h> #include <pjlib-util/errno.h> -#include <pj/addr_resolv.h> #include <pj/array.h> #include <pj/assert.h> #include <pj/log.h> @@ -584,53 +583,13 @@ static void dns_callback(void *user_data, } else if (status != PJ_SUCCESS) { char errmsg[PJ_ERR_MSG_SIZE]; - if ((query_job->option & - (PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV4 | PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6))) - { - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(query_job->objname, - "DNS A record resolution failed: %s," - " trying getaddrinfo()", - errmsg)); - - pj_addrinfo ai; - unsigned count; - int af; - - if ((query_job->option & PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6)) { - af = pj_AF_INET6(); - } else { - af = pj_AF_INET(); - } - - count = 1; - status = pj_getaddrinfo(af, &query_job->domain_part, &count, &ai); - if (status != PJ_SUCCESS) { - query_job->last_error = status; - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(query_job->objname, "DNS resolution failed with getaddrinfo(): %s", - errmsg)); - } else { - - if (srv->addr_cnt < ADDR_MAX_COUNT) { - srv->addr[srv->addr_cnt++].s_addr = ai.ai_addr.ipv4.sin_addr.s_addr; - } - - PJ_LOG(5,(query_job->objname, - "DNS getaddrinfo() for %.*s: %s", - (int)srv->target_name.slen, - srv->target_name.ptr, - pj_inet_ntoa(srv->addr[srv->addr_cnt]))); - } - } else { - /* Update last error */ - query_job->last_error = status; - - /* Log error */ - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(query_job->objname, "DNS A record resolution failed: %s", - errmsg)); - } + /* Update last error */ + query_job->last_error = status; + + /* Log error */ + pj_strerror(status, errmsg, sizeof(errmsg)); + PJ_LOG(4,(query_job->objname, "DNS A record resolution failed: %s", + errmsg)); } ++query_job->host_resolved; diff --git a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp index 66c9273931b692113d6cc3d48d0283cae24fdd29..b33e4d3cf145876a10313ff81af241f8e08a08cd 100644 --- a/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib-util/src/pjlib-util/xml_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: xml_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib/build/Makefile b/sflphone-common/libs/pjproject/pjlib/build/Makefile index 5fed97cd5cc3c55bc366c82c9cab422b4796ec7a..a3482e005e59827a8303613daaaeae73bed60f47 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/Makefile +++ b/sflphone-common/libs/pjproject/pjlib/build/Makefile @@ -4,7 +4,7 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -export PJLIB_LIB := ../lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) +export PJLIB_LIB := ../lib/libpj-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. @@ -25,7 +25,8 @@ export PJLIB_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ activesock.o array.o config.o ctype.o errno.o except.o fifobuf.o \ guid.o hash.o ip_helper_generic.o list.o lock.o log.o os_time_common.o \ pool.o pool_buf.o pool_caching.o pool_dbg.o rand.o \ - rbtree.o sock_common.o string.o timer.o types.o + rbtree.o sock_common.o sock_qos_common.o sock_qos_bsd.o \ + ssl_sock_common.o ssl_sock_ossl.o string.o timer.o types.o export PJLIB_CFLAGS += $(_CFLAGS) ############################################################################### @@ -36,7 +37,7 @@ export TEST_OBJS += activesock.o atomic.o echo_clt.o errno.o exception.o \ fifobuf.o file.o hash_test.o ioq_perf.o ioq_udp.o \ ioq_unreg.o ioq_tcp.o \ list.o mutex.o os.o pool.o pool_perf.o rand.o rbtree.o \ - select.o sleep.o sock.o sock_perf.o \ + select.o sleep.o sock.o sock_perf.o ssl_sock.o \ string.o test.o thread.o timer.o timestamp.o \ udp_echo_srv_sync.o udp_echo_srv_ioqueue.o \ util.o diff --git a/sflphone-common/libs/pjproject/pjlib/build/cacert.pem b/sflphone-common/libs/pjproject/pjlib/build/cacert.pem new file mode 100644 index 0000000000000000000000000000000000000000..0a2ee45bd6a3bbc342b001e88f11fcef37e9e6c6 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/build/cacert.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgIJAPqAwYU5OQLXMA0GCSqGSIb3DQEBBQUAMEYxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMQ4wDAYDVQQKDAVwanNpcDESMBAG +A1UEAwwJcGpzaXAubGFiMB4XDTA5MTAyMjE3MTczN1oXDTE5MTAyMDE3MTczN1ow +RjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxDjAMBgNVBAoMBXBq +c2lwMRIwEAYDVQQDDAlwanNpcC5sYWIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDWWvnL+oSC0Q6OwGLt2YuhXTEzIVv3B+SGQ7tajB6H3WXVeq+1NmU9 +Yzca33g4FRrU7n4smYmKLzm1aniBhNmJjA+t+gbyizKnLMaCLoG52tUoULcANGKU +aGwlmvZFugDn2eVg6UfUfRzEGbV3q3a/PzSsOEPwsMeF3YMQJPhkoyPQLtWgUXgP +89Nyq3XjGGtw/qmUgQjE8a6/P0yXc+myI0hmApmZ9nB3YmlB5W3q6WoU2gGhLXf4 +12rH/LgdnPhM4ijS554Kv9EcUDdQTTrm6bYg66tj+qTet7DolUOlTZ3vKpuCK3tt +eK9CbNPVzsMsB3yCALSLzQ347pIwfLaJAgMBAAGjUDBOMB0GA1UdDgQWBBRE/VNp +kNQmLEXKQ+NM4bOVj95zYTAfBgNVHSMEGDAWgBRE/VNpkNQmLEXKQ+NM4bOVj95z +YTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCj/gzJKTOZDEBD+zr7 +lvbVctiYE9o8ObxZQsnl/6zI2V9H/2yc1sqQyjBupzw6c37ehvk30yIyUfD3ts87 +2xaJ5VgtgUI3FI5DQ+ASyQXmDawUEmXIGqHb2gDrXBQLd6uMpvNDNW+7TouuniyA +F12JUCNITeXaVJ0c8d4A9J9DlszBfYUzI45yIQu1gbpnpH74Sp/hG77EMxrRau+x +EFFmV7gAmkCgOBnXm8jTKqNre/GfLfO7w2xoLsubSLnK46U3iLGBIJJRVGu3UQuN +k1o7CiIKf0SSWj1bQI99ipTj8obBKRqj1nSbgKF/U6FIfd8DGcVvbJCSAG2czzyA +5tdA +-----END CERTIFICATE----- diff --git a/sflphone-common/libs/pjproject/pjlib/build/os-auto.mak b/sflphone-common/libs/pjproject/pjlib/build/os-auto.mak deleted file mode 100644 index 7439bddaecf33cf8d65d1b04477b1aa58e6aa225..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjlib/build/os-auto.mak +++ /dev/null @@ -1,35 +0,0 @@ -# pjlib/build/os-auto.mak. Generated from os-auto.mak.in by configure. - -# Determine OS specific files -AC_OS_OBJS=ioqueue_select.o file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o - -# -# PJLIB_OBJS specified here are object files to be included in PJLIB -# (the library) for this specific operating system. Object files common -# to all operating systems should go in Makefile instead. -# -export PJLIB_OBJS += $(AC_OS_OBJS) \ - addr_resolv_sock.o \ - log_writer_stdout.o \ - os_timestamp_common.o \ - pool_policy_malloc.o sock_bsd.o sock_select.o - -# -# TEST_OBJS are operating system specific object files to be included in -# the test application. -# -export TEST_OBJS += main.o - -# -# Additional LDFLAGS for pjlib-test -# -export TEST_LDFLAGS += -lm -lnsl -lrt -lpthread -lasound -lssl -lcrypto - -# -# TARGETS are make targets in the Makefile, to be executed for this given -# operating system. -# -export TARGETS = pjlib pjlib-test - - - diff --git a/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak b/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak index b495bb212654b6c964552aeb4ad6d7aff8b8e720..0290fea955c5ed1c14c2a5c4d667bc0d9eadd9c5 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak +++ b/sflphone-common/libs/pjproject/pjlib/build/os-win32.mak @@ -13,8 +13,8 @@ export PJLIB_OBJS += addr_resolv_sock.o guid_win32.o \ os_timestamp_win32.o \ pool_policy_malloc.o sock_bsd.o sock_select.o -export PJLIB_OBJS += ioqueue_winnt.o -#export PJLIB_OBJS += ioqueue_select.o +#export PJLIB_OBJS += ioqueue_winnt.o +export PJLIB_OBJS += ioqueue_select.o export PJLIB_OBJS += file_io_win32.o file_access_win32.o #export PJLIB_OBJS += file_io_ansi.o diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp b/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp index 39d800cd26c46c51f205605958e62d61ca26b567..6977f8a9324cff54f9fdbdf4352961221743ac01 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib.dsp @@ -240,28 +240,11 @@ SOURCE=..\src\pj\ioqueue_common_abs.h # Begin Source File SOURCE=..\src\pj\ioqueue_select.c - -!IF "$(CFG)" == "pjlib - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "pjlib - Win32 Debug" - -!ENDIF - # End Source File # Begin Source File SOURCE=..\src\pj\ioqueue_winnt.c - -!IF "$(CFG)" == "pjlib - Win32 Release" - -!ELSEIF "$(CFG)" == "pjlib - Win32 Debug" - # PROP Exclude_From_Build 1 - -!ENDIF - # End Source File # Begin Source File @@ -341,10 +324,26 @@ SOURCE=..\src\pj\sock_common.c # End Source File # Begin Source File +SOURCE=..\src\pj\sock_qos_bsd.c +# End Source File +# Begin Source File + +SOURCE=..\src\pj\sock_qos_common.c +# End Source File +# Begin Source File + SOURCE=..\src\pj\sock_select.c # End Source File # Begin Source File +SOURCE=..\src\pj\ssl_sock_common.c +# End Source File +# Begin Source File + +SOURCE=..\src\pj\ssl_sock_ossl.c +# End Source File +# Begin Source File + SOURCE=..\src\pj\string.c # End Source File # Begin Source File @@ -589,10 +588,18 @@ SOURCE=..\include\pj\sock.h # End Source File # Begin Source File +SOURCE=..\include\pj\sock_qos.h +# End Source File +# Begin Source File + SOURCE=..\include\pj\sock_select.h # End Source File # Begin Source File +SOURCE=..\include\pj\ssl_sock.h +# End Source File +# Begin Source File + SOURCE=..\include\pj\string.h # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj b/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj index 2f0360398a7af945d7e3b701036370d475d5390a..d151dfbbf589a71a333a42ad443d62dd6f0c9ea6 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -91,10 +91,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -113,9 +113,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -129,7 +129,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -157,10 +157,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -179,9 +179,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -195,7 +195,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -222,12 +222,11 @@ /> </Configuration> <Configuration - Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -246,8 +245,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -261,6 +261,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -272,18 +273,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -302,9 +311,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -318,7 +327,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -345,11 +354,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -368,9 +377,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -384,7 +393,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -411,12 +420,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -435,8 +443,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -450,6 +459,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -461,18 +471,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -491,9 +510,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -507,7 +525,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -519,26 +536,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -557,9 +566,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -573,7 +582,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -600,12 +609,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -624,8 +632,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -639,6 +648,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -650,18 +660,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -680,9 +698,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -696,7 +714,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -723,11 +741,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -746,9 +764,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -762,7 +780,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -789,12 +807,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -813,8 +830,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -828,6 +846,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -839,18 +858,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -869,9 +896,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -885,7 +912,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -912,11 +939,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -935,9 +963,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -951,7 +978,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -963,27 +989,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1002,8 +1019,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1017,6 +1035,7 @@ /> <Tool Name="VCLibrarianTool" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1028,18 +1047,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1058,9 +1085,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1074,7 +1101,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1101,11 +1128,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1124,9 +1151,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1140,7 +1167,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1167,11 +1194,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1190,9 +1217,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1206,7 +1233,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1233,11 +1260,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1256,9 +1283,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1272,7 +1299,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1299,11 +1326,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1322,9 +1349,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1338,7 +1365,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1365,11 +1392,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1388,9 +1416,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1404,7 +1431,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1416,26 +1442,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1454,9 +1472,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1470,7 +1488,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1497,11 +1515,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1520,9 +1538,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1536,7 +1554,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1563,11 +1581,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1586,9 +1604,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1602,7 +1620,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1629,11 +1647,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1652,9 +1670,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1668,7 +1686,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1695,11 +1713,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1718,9 +1736,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1734,7 +1752,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1761,11 +1779,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1784,9 +1802,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1800,7 +1818,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1827,11 +1845,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1850,9 +1869,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1866,7 +1884,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1878,26 +1895,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1916,9 +1925,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1932,7 +1941,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1959,11 +1968,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1982,9 +1991,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1998,7 +2007,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2025,11 +2034,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2048,9 +2057,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2064,7 +2073,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2091,11 +2100,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2114,9 +2123,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2130,7 +2139,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2157,11 +2166,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2180,9 +2189,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2196,7 +2205,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2223,11 +2232,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2246,9 +2255,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2262,7 +2271,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2289,11 +2298,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2312,9 +2322,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2328,7 +2337,6 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2340,26 +2348,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2378,9 +2378,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2394,7 +2394,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2421,11 +2421,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2444,9 +2444,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2460,7 +2460,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2487,11 +2487,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2510,9 +2510,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2526,7 +2526,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2553,11 +2553,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2576,9 +2576,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2592,7 +2592,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2619,11 +2619,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2642,9 +2642,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2658,7 +2658,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2686,10 +2686,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2708,9 +2708,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2724,7 +2724,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\$(ProjectName)-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -3256,17 +3256,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3274,7 +3272,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3282,25 +3280,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3308,17 +3306,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3326,7 +3322,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3334,17 +3330,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3352,25 +3346,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3378,7 +3372,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3386,7 +3380,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3394,7 +3388,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3402,7 +3396,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3410,15 +3404,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3426,7 +3422,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3434,7 +3430,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3442,7 +3438,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3450,7 +3446,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3458,7 +3454,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3466,15 +3462,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3482,7 +3480,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3490,7 +3488,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3498,7 +3496,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3506,7 +3504,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3514,7 +3512,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3522,15 +3520,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3538,7 +3538,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3546,7 +3546,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3554,7 +3554,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3562,7 +3562,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3840,17 +3840,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3858,7 +3856,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3866,25 +3864,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3892,17 +3890,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3910,7 +3906,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3918,17 +3914,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3936,25 +3930,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3962,7 +3956,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3970,7 +3964,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3978,7 +3972,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3986,7 +3980,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3994,15 +3988,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4010,7 +4006,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4018,7 +4014,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4026,7 +4022,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4034,7 +4030,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4042,7 +4038,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4050,15 +4046,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4066,7 +4064,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4074,7 +4072,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4082,7 +4080,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4090,7 +4088,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4098,7 +4096,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4106,15 +4104,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4122,7 +4122,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4130,7 +4130,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4138,7 +4138,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4146,7 +4146,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4180,7 +4180,6 @@ </FileConfiguration> <FileConfiguration Name="Release|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -4199,7 +4198,6 @@ </FileConfiguration> <FileConfiguration Name="Release-Dynamic|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -4218,7 +4216,6 @@ </FileConfiguration> <FileConfiguration Name="Release-Static|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -4257,16 +4254,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4274,7 +4270,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4282,25 +4278,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4308,16 +4304,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4325,7 +4320,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4333,17 +4328,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4351,24 +4344,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4376,7 +4370,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4384,7 +4378,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4392,7 +4386,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4400,7 +4394,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4408,15 +4402,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4424,7 +4420,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4432,7 +4428,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4440,7 +4436,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4448,7 +4444,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4456,7 +4452,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4464,15 +4460,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4480,7 +4478,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4488,7 +4486,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4496,7 +4494,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4504,7 +4502,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4512,7 +4510,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4520,15 +4518,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4536,7 +4536,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4544,7 +4544,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4552,7 +4552,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4560,7 +4560,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5570,6 +5570,22 @@ RelativePath="..\src\pj\sock_common.c" > </File> + <File + RelativePath="..\src\pj\sock_qos_bsd.c" + > + </File> + <File + RelativePath="..\src\pj\sock_qos_common.c" + > + </File> + <File + RelativePath="..\src\pj\sock_qos_dummy.c" + > + </File> + <File + RelativePath="..\src\pj\sock_qos_wm.c" + > + </File> <File RelativePath="..\src\pj\sock_select.c" > @@ -5628,6 +5644,14 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pj\ssl_sock_common.c" + > + </File> + <File + RelativePath="..\src\pj\ssl_sock_ossl.c" + > + </File> <File RelativePath="..\src\pj\string.c" > @@ -5893,17 +5917,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -5911,7 +5933,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5919,25 +5941,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5945,17 +5967,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -5963,7 +5983,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -5971,17 +5991,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -5989,25 +6007,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6015,7 +6033,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6023,7 +6041,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6031,7 +6049,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6039,7 +6057,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6047,15 +6065,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6063,7 +6083,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6071,7 +6091,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6079,7 +6099,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6087,7 +6107,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6095,7 +6115,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6103,15 +6123,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6119,7 +6141,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6127,7 +6149,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6135,7 +6157,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6143,7 +6165,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6151,7 +6173,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6159,15 +6181,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6175,7 +6199,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6183,7 +6207,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6191,7 +6215,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6199,7 +6223,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6245,17 +6269,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6263,7 +6285,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6271,25 +6293,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6297,17 +6319,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6315,7 +6335,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6323,17 +6343,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6341,25 +6359,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6367,7 +6385,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6375,7 +6393,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6383,7 +6401,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6391,7 +6409,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6399,15 +6417,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6415,7 +6435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6423,7 +6443,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6431,7 +6451,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6439,7 +6459,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6447,7 +6467,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6455,15 +6475,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6471,7 +6493,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6479,7 +6501,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6487,7 +6509,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6495,7 +6517,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6503,7 +6525,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6511,15 +6533,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6527,7 +6551,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6535,7 +6559,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6543,7 +6567,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6551,7 +6575,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6597,17 +6621,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6615,7 +6637,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6623,25 +6645,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6649,17 +6671,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6667,7 +6687,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6675,17 +6695,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6693,25 +6711,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6719,7 +6737,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6727,7 +6745,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6735,7 +6753,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6743,7 +6761,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6751,15 +6769,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6767,7 +6787,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6775,7 +6795,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6783,7 +6803,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6791,7 +6811,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6799,7 +6819,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6807,15 +6827,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6823,7 +6845,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6831,7 +6853,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6839,7 +6861,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6847,7 +6869,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6855,7 +6877,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6863,15 +6885,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6879,7 +6903,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6887,7 +6911,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6895,7 +6919,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6903,7 +6927,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6949,17 +6973,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -6967,7 +6989,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -6975,25 +6997,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7001,17 +7023,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7019,7 +7039,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7027,17 +7047,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7045,25 +7063,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7071,7 +7089,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7079,7 +7097,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7087,7 +7105,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7095,7 +7113,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7103,15 +7121,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7119,7 +7139,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7127,7 +7147,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7135,7 +7155,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7143,7 +7163,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7151,7 +7171,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7159,15 +7179,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7175,7 +7197,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7183,7 +7205,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7191,7 +7213,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7199,7 +7221,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7207,7 +7229,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7215,15 +7237,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7231,7 +7255,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7239,7 +7263,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7247,7 +7271,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7255,7 +7279,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7299,7 +7323,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7307,7 +7331,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7315,7 +7339,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7323,7 +7347,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7331,7 +7355,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool @@ -7339,7 +7363,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7347,7 +7371,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7355,7 +7379,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7363,7 +7387,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7371,7 +7395,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7379,7 +7403,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7387,7 +7411,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool @@ -7395,7 +7419,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7403,7 +7427,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7411,7 +7435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7419,7 +7443,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7427,7 +7451,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7435,7 +7459,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7443,7 +7467,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool @@ -7451,7 +7475,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7459,7 +7483,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7467,7 +7491,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7475,7 +7499,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7483,7 +7507,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7491,7 +7515,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7499,7 +7523,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool @@ -7507,7 +7531,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7515,7 +7539,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7523,7 +7547,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7531,7 +7555,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7539,7 +7563,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7547,7 +7571,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7555,7 +7579,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool @@ -7563,7 +7587,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7571,7 +7595,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7579,7 +7603,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7587,7 +7611,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7595,7 +7619,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7641,17 +7665,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7659,7 +7681,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7667,25 +7689,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7693,17 +7715,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7711,7 +7731,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7719,17 +7739,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7737,25 +7755,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7763,7 +7781,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7771,7 +7789,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7779,7 +7797,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7787,7 +7805,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7795,15 +7813,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7811,7 +7831,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7819,7 +7839,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7827,7 +7847,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7835,7 +7855,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7843,7 +7863,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7851,15 +7871,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7867,7 +7889,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7875,7 +7897,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7883,7 +7905,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7891,7 +7913,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7899,7 +7921,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7907,15 +7929,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7923,7 +7947,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7931,7 +7955,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7939,7 +7963,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -7947,7 +7971,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -7993,17 +8017,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8011,7 +8033,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8019,25 +8041,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8045,17 +8067,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8063,7 +8083,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8071,17 +8091,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8089,25 +8107,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8115,7 +8133,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8123,7 +8141,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8131,7 +8149,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8139,7 +8157,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8147,15 +8165,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8163,7 +8183,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8171,7 +8191,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8179,7 +8199,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8187,7 +8207,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8195,7 +8215,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8203,15 +8223,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8219,7 +8241,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8227,7 +8249,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8235,7 +8257,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8243,7 +8265,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8251,7 +8273,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8259,15 +8281,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8275,7 +8299,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8283,7 +8307,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8291,7 +8315,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8299,7 +8323,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8345,17 +8369,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8363,7 +8385,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8371,25 +8393,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8397,17 +8419,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8415,7 +8435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8423,17 +8443,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8441,25 +8459,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8467,7 +8485,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8475,7 +8493,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8483,7 +8501,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8491,7 +8509,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8499,15 +8517,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8515,7 +8535,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8523,7 +8543,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8531,7 +8551,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8539,7 +8559,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8547,7 +8567,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8555,15 +8575,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8571,7 +8593,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8579,7 +8601,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8587,7 +8609,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8595,7 +8617,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8603,7 +8625,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8611,15 +8633,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8627,7 +8651,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8635,7 +8659,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8643,7 +8667,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8651,7 +8675,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8697,17 +8721,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8715,7 +8737,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8723,25 +8745,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8749,17 +8771,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8767,7 +8787,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8775,17 +8795,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8793,25 +8811,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8819,7 +8837,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8827,7 +8845,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8835,7 +8853,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8843,7 +8861,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8851,15 +8869,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8867,7 +8887,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8875,7 +8895,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8883,7 +8903,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8891,7 +8911,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8899,7 +8919,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8907,15 +8927,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8923,7 +8945,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8931,7 +8953,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8939,7 +8961,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8947,7 +8969,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8955,7 +8977,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8963,15 +8985,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8979,7 +9003,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -8987,7 +9011,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -8995,7 +9019,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9003,7 +9027,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9049,17 +9073,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9067,7 +9089,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9075,25 +9097,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9101,17 +9123,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9119,7 +9139,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9127,17 +9147,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9145,25 +9163,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9171,7 +9189,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9179,7 +9197,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9187,7 +9205,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9195,7 +9213,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9203,15 +9221,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9219,7 +9239,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9227,7 +9247,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9235,7 +9255,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9243,7 +9263,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9251,7 +9271,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9259,15 +9279,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9275,7 +9297,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9283,7 +9305,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9291,7 +9313,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9299,7 +9321,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9307,7 +9329,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9315,15 +9337,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9331,7 +9355,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9339,7 +9363,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9347,7 +9371,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9355,7 +9379,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9401,17 +9425,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9419,7 +9441,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9427,25 +9449,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9453,17 +9475,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9471,7 +9491,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9479,17 +9499,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9497,25 +9515,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9523,7 +9541,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9531,7 +9549,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9539,7 +9557,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9547,7 +9565,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9555,15 +9573,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9571,7 +9591,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9579,7 +9599,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9587,7 +9607,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9595,7 +9615,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9603,7 +9623,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9611,15 +9631,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9627,7 +9649,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9635,7 +9657,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9643,7 +9665,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9651,7 +9673,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9659,7 +9681,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9667,15 +9689,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9683,7 +9707,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9691,7 +9715,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9699,7 +9723,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9707,7 +9731,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9753,17 +9777,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9771,7 +9793,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9779,25 +9801,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9805,17 +9827,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9823,7 +9843,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9831,17 +9851,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9849,25 +9867,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9875,7 +9893,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9883,7 +9901,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9891,7 +9909,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9899,7 +9917,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9907,15 +9925,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9923,7 +9943,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9931,7 +9951,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9939,7 +9959,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9947,7 +9967,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9955,7 +9975,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9963,15 +9983,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9979,7 +10001,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -9987,7 +10009,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -9995,7 +10017,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10003,7 +10025,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10011,7 +10033,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10019,15 +10041,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10035,7 +10059,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10043,7 +10067,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10051,7 +10075,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10059,7 +10083,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10105,17 +10129,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10123,7 +10145,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10131,25 +10153,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10157,17 +10179,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10175,7 +10195,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10183,17 +10203,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10201,25 +10219,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10227,7 +10245,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10235,7 +10253,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10243,7 +10261,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10251,7 +10269,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10259,15 +10277,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10275,7 +10295,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10283,7 +10303,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10291,7 +10311,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10299,7 +10319,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10307,7 +10327,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10315,15 +10335,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10331,7 +10353,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10339,7 +10361,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10347,7 +10369,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10355,7 +10377,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10363,7 +10385,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10371,15 +10393,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10387,7 +10411,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10395,7 +10419,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10403,7 +10427,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10411,7 +10435,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10457,17 +10481,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10475,7 +10497,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10483,25 +10505,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10509,17 +10531,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10527,7 +10547,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10535,17 +10555,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10553,25 +10571,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10579,7 +10597,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10587,7 +10605,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10595,7 +10613,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10603,7 +10621,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10611,15 +10629,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10627,7 +10647,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10635,7 +10655,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10643,7 +10663,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10651,7 +10671,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10659,7 +10679,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10667,15 +10687,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10683,7 +10705,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10691,7 +10713,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10699,7 +10721,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10707,7 +10729,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10715,7 +10737,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10723,15 +10745,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10739,7 +10763,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10747,7 +10771,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10755,7 +10779,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10763,7 +10787,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10809,17 +10833,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10827,7 +10849,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10835,25 +10857,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10861,17 +10883,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10879,7 +10899,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10887,17 +10907,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10905,25 +10923,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10931,7 +10949,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10939,7 +10957,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10947,7 +10965,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10955,7 +10973,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10963,15 +10981,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10979,7 +10999,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -10987,7 +11007,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -10995,7 +11015,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11003,7 +11023,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11011,7 +11031,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11019,15 +11039,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11035,7 +11057,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11043,7 +11065,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11051,7 +11073,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11059,7 +11081,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11067,7 +11089,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11075,15 +11097,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11091,7 +11115,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11099,7 +11123,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11107,7 +11131,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11115,7 +11139,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11161,17 +11185,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11179,7 +11201,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11187,25 +11209,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11213,17 +11235,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11231,7 +11251,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11239,17 +11259,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11257,25 +11275,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11283,7 +11301,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11291,7 +11309,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11299,7 +11317,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11307,7 +11325,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11315,15 +11333,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11331,7 +11351,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11339,7 +11359,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11347,7 +11367,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11355,7 +11375,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11363,7 +11383,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11371,15 +11391,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11387,7 +11409,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11395,7 +11417,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11403,7 +11425,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11411,7 +11433,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11419,7 +11441,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11427,15 +11449,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11443,7 +11467,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11451,7 +11475,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11459,7 +11483,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -11467,7 +11491,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -11613,10 +11637,18 @@ RelativePath="..\include\pj\sock.h" > </File> + <File + RelativePath="..\include\pj\sock_qos.h" + > + </File> <File RelativePath="..\include\pj\sock_select.h" > </File> + <File + RelativePath="..\include\pj\ssl_sock.h" + > + </File> <File RelativePath="..\include\pj\string.h" > diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp index 8252f12fd3be924e4c73872b5c0a292ba3b2f81a..067dea1d258772ab4f62cd203dc4a35553f3895c 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.dsp @@ -74,7 +74,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/pjlib-test-i386-win32-vc6-debug.exe" /pdbtype:sept +# ADD LINK32 netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libeay32MT.lib ssleay32MT.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/pjlib-test-i386-win32-vc6-debug.exe" /pdbtype:sept !ENDIF @@ -193,6 +193,10 @@ SOURCE="..\src\pjlib-test\sock_perf.c" # End Source File # Begin Source File +SOURCE="..\src\pjlib-test\ssl_sock.c" +# End Source File +# Begin Source File + SOURCE="..\src\pjlib-test\string.c" # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj index 6156d7ce7a187e96d22a9e7d39b8e12fbd24674c..050f67920c4a7c074ee37defedfa3f1570c31ee4 100644 --- a/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj +++ b/sflphone-common/libs/pjproject/pjlib/build/pjlib_test.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -73,7 +73,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -102,10 +102,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -140,7 +140,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -168,10 +168,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -206,7 +206,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -233,12 +233,11 @@ /> </Configuration> <Configuration - Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -257,7 +256,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -272,15 +271,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -288,24 +284,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -340,7 +338,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -367,11 +365,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -406,7 +404,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -433,12 +431,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -457,7 +454,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -472,15 +469,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -488,24 +482,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -524,8 +521,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -539,12 +536,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -552,26 +552,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -606,7 +604,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -633,12 +631,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -657,7 +654,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -672,15 +669,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -688,24 +682,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -740,7 +736,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -767,11 +763,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -806,7 +802,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -833,12 +829,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -857,7 +852,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -872,15 +867,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -888,24 +880,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -940,7 +934,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -967,11 +961,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -990,8 +985,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -1005,12 +1000,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -1018,27 +1016,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1057,7 +1052,7 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_CONSOLE;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include" PrecompiledHeaderFile="" /> @@ -1072,15 +1067,12 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="ws2.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> - <Tool - Name="VCManifestTool" - /> <Tool Name="VCXDCMakeTool" /> @@ -1088,24 +1080,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool - Name="VCAppVerifierTool" + Name="VCPostBuildEventTool" /> - <Tool - Name="VCWebDeploymentTool" + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" /> - <Tool - Name="VCPostBuildEventTool" + <DebuggerTool /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1140,7 +1134,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1167,11 +1161,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1206,7 +1200,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1233,11 +1227,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1272,7 +1266,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1299,11 +1293,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1338,7 +1332,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1365,11 +1359,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1404,7 +1398,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1431,11 +1425,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1454,8 +1449,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -1469,12 +1464,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -1482,26 +1480,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1536,7 +1532,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1563,11 +1559,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1602,7 +1598,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1629,11 +1625,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1668,7 +1664,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1695,11 +1691,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1734,7 +1730,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1761,11 +1757,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1800,7 +1796,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1827,11 +1823,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1866,7 +1862,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -1893,11 +1889,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1916,8 +1913,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -1931,12 +1928,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -1944,26 +1944,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1998,7 +1996,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2025,11 +2023,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2064,7 +2062,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2091,11 +2089,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2130,7 +2128,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2157,11 +2155,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2196,7 +2194,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2223,11 +2221,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2262,7 +2260,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2289,11 +2287,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2328,7 +2326,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2355,11 +2353,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2378,8 +2377,8 @@ /> <Tool Name="VCCLCompilerTool" - ExecutionBucket="7" AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="_CONSOLE;" PrecompiledHeaderFile="" /> <Tool @@ -2393,12 +2392,15 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" + AdditionalDependencies="netapi32.lib mswsock.lib ws2_32.lib odbc32.lib odbccp32.lib oleaut32.lib ole32.lib" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" /> + <Tool + Name="VCManifestTool" + /> <Tool Name="VCXDCMakeTool" /> @@ -2406,26 +2408,24 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool - Name="VCPostBuildEventTool" + Name="VCAppVerifierTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" + <Tool + Name="VCWebDeploymentTool" /> - <DebuggerTool + <Tool + Name="VCPostBuildEventTool" /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2460,7 +2460,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2487,11 +2487,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2526,7 +2526,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2553,11 +2553,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2592,7 +2592,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2619,11 +2619,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2658,7 +2658,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2685,11 +2685,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2724,7 +2724,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -2752,10 +2752,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="1" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2790,7 +2790,7 @@ <Tool Name="VCLinkerTool" AdditionalDependencies="ws2.lib" - OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" + OutputFile="..\bin\pjlib-test-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).exe" /> <Tool Name="VCALinkTool" @@ -3499,16 +3499,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3516,7 +3515,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3524,24 +3523,24 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - ExcludedFromBuild="true" + Name="Release|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3549,16 +3548,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3566,7 +3564,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3574,16 +3572,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3591,24 +3588,24 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - ExcludedFromBuild="true" + Name="Debug-Static|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3616,7 +3613,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3624,7 +3621,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3632,7 +3629,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3640,7 +3637,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3648,15 +3645,16 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - ExcludedFromBuild="true" + Name="Release-Dynamic|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3664,7 +3662,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3672,7 +3670,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3680,7 +3678,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3688,7 +3686,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3696,7 +3694,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3704,15 +3702,16 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - ExcludedFromBuild="true" + Name="Debug-Dynamic|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3720,7 +3719,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3728,7 +3727,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3736,7 +3735,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3744,7 +3743,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3752,7 +3751,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3760,15 +3759,16 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - ExcludedFromBuild="true" + Name="Release-Static|Win32" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3776,7 +3776,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3784,7 +3784,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3792,7 +3792,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3800,7 +3800,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3846,17 +3846,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="Debug|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3864,7 +3862,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3872,25 +3870,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Win32" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3898,17 +3896,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Win32" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3916,7 +3912,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Release|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3924,17 +3920,15 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Win32" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3942,25 +3936,25 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Win32" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="" - PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3968,7 +3962,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3976,7 +3970,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -3984,7 +3978,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -3992,7 +3986,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4000,15 +3994,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4016,7 +4012,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Pocket PC 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4024,7 +4020,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4032,7 +4028,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4040,7 +4036,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4048,7 +4044,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4056,15 +4052,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Smartphone 2003 (ARMV4)" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4072,7 +4070,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4080,7 +4078,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4088,7 +4086,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4096,7 +4094,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4104,7 +4102,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4112,15 +4110,17 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" + Name="Release-Static|Win32" ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" /> </FileConfiguration> <FileConfiguration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4128,7 +4128,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4136,7 +4136,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4144,7 +4144,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Smartphone 2003 (ARMV4)" ExcludedFromBuild="true" > <Tool @@ -4152,7 +4152,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ExcludedFromBuild="true" > <Tool @@ -4812,6 +4812,10 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjlib-test\ssl_sock.c" + > + </File> <File RelativePath="..\src\pjlib-test\string.c" > diff --git a/sflphone-common/libs/pjproject/pjlib/build/privkey.pem b/sflphone-common/libs/pjproject/pjlib/build/privkey.pem new file mode 100644 index 0000000000000000000000000000000000000000..3241be208c6e216306bf716b0f40646cdcf2a2ad --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/build/privkey.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEA1lr5y/qEgtEOjsBi7dmLoV0xMyFb9wfkhkO7Woweh91l1Xqv +tTZlPWM3Gt94OBUa1O5+LJmJii85tWp4gYTZiYwPrfoG8osypyzGgi6BudrVKFC3 +ADRilGhsJZr2RboA59nlYOlH1H0cxBm1d6t2vz80rDhD8LDHhd2DECT4ZKMj0C7V +oFF4D/PTcqt14xhrcP6plIEIxPGuvz9Ml3PpsiNIZgKZmfZwd2JpQeVt6ulqFNoB +oS13+Ndqx/y4HZz4TOIo0ueeCr/RHFA3UE065um2IOurY/qk3rew6JVDpU2d7yqb +git7bXivQmzT1c7DLAd8ggC0i80N+O6SMHy2iQIDAQABAoIBAQCAke7Ujz2d7WDq +9LAh8+NRdUFGZtLvd9d1RPkCVZsWaRBknIL5kVfmGzV5M+K62MXQRACAJdOeg7b8 +fpErNpD4dH8PHjG+lwlZxnyGpvh+jqhd1xP81m7ujzeW0ry2k9tpNYPkveespyJy +6Oy0i67dBT9FsTXnD1GNlJDBRTuLuEkTTBqbn/2s3+gUfChJ4HPmYMeO9HU4PcfM +yUsHatBiIkXiCKdDZVMDr5AUVD0Wo3uHPGJ8ZreURAjH+ldG09+/EsVoPberbrDZ +ZxJ70VKG+ZZTY8HZr9OsZhDZDrHiw9PdG7Hvg7bCvv+gDzZ/z8F+7YHjRjmD5Tp5 +Ex5hDco1AoGBAPfdfzwmqb79AXwYH0HZkkl2EXpzbR9LRgvWlOMSN3GlZhusvGQR +up6iGk9QnmoEtQS2IAuK4JT3r+yoM/20Nadq5ZUpkZ49SHuZ6+eZpotv3Fh8Oay8 +TAi2vBGM7EQPUOjPOWMRaYGBz3FT/GvUGPTeQ8jYt1gy8F18+A8xD8pTAoGBAN1j +7+yTly+M47U6mIUXcwoelaS4f/kMcwKHO0O182S4ktfjzc3TpQbHm68ws1rB3iFZ +SFOP/d04tVxZqPBhN2SpXRHGqTJxXthdTbu3scLMedlf4jY11SRiHX4PDnoBQ1GJ +NpdkMoex25Fw3AqSVpP61zo8sJkqpqjFfeQDbfgzAoGBAKyGx1ZmDwc6cjsfSzp5 +p+JsRVQ3XcBHk9UPooi/mEoJd55RyLvav0xFxwxoMCvZZOqHnpyKKTJniVOv7Khu +NF55AJ6n1Y0QWRB3ngWSJKOv0+7fYQHD+yShlRyeO6JQCuBRxT8Y0phrc6oNbIjd +lBV1VDdL6aqBol9gagWg/72zAoGBAK1rAx1F3z+YFSZ459AZNjvPCVkmTNhBMDXi +yEGZ3TYgfqYuA6AfET3mTcVFWLjW87EbxtPuDuWi7i2Q7gydmk53fDfYbeDdfXXu +YF2S3uPAWBI2UXQ1ZuhBEukT0jsvkhPkb6bXDd3NLDkZNsPxLXBtJPqxX4QbLME3 +Mg3RweqRAoGAJ4iXP2b4XWhg17qpDtpn8nhFxLNdhxdaDSKRL8oKQLteds3wS0fi +ZlaU1P9a3ygTpNquKlmdLJTQEDAVjV5DDlrQAPxtSSytHulNzXRMQFaeydar3Ssv +J07BPdQs6JEgV071rGGzBcL8ulo7qCdnGxU6GmhLkS4MBbTuqR6jmgU= +-----END RSA PRIVATE KEY----- diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h b/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h index 71c0640cbf9f798048f9d957fbde8f34a624b941..04db2f08515a8a87d25c10c2190da84b704f0cac 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/addr_resolv.h @@ -1,4 +1,4 @@ -/* $Id: addr_resolv.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: addr_resolv.h 2908 2009-08-22 11:18:50Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -89,7 +89,8 @@ typedef struct pj_addrinfo * For host resolution function that also works with IPv6, please see * #pj_getaddrinfo(). * - * @param name Host name, or IPv4 address in standard dot notation. + * @param name Host name to resolve. Specifying IPv4 address here + * may fail on some platforms (e.g. Windows) * @param he The pj_hostent structure to be filled. Note that * the pointers in this structure points to temporary * variables which value will be reset upon subsequent diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h index 7bf1c91bad1be4426dbacfc27983f18394a9f931..a6b8dfe90711e8fb542e0fb65e047d136d98a4d2 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/cc_armcc.h @@ -1,4 +1,4 @@ -/* $Id: cc_armcc.h 2407 2009-01-01 20:56:36Z bennylp $ */ +/* $Id: cc_armcc.h 3046 2010-01-06 08:34:41Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -30,9 +30,9 @@ #endif #define PJ_CC_NAME "armcc" -#define PJ_CC_VER_1 __ARMCC__ -#define PJ_CC_VER_2 __ARMCC_MINOR__ -#define PJ_CC_VER_3 __ARMCC_PATCHLEVEL__ +#define PJ_CC_VER_1 (__ARMCC_VERSION/100000) +#define PJ_CC_VER_2 ((__ARMCC_VERSION%100000)/10000) +#define PJ_CC_VER_3 (__ARMCC_VERSION%10000) #ifdef __cplusplus # define PJ_INLINE_SPECIFIER inline diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in index e922a9b952a8bd9b7f9e7bb9a1d4c1223b52f837..187717519014d146281e6152995052f5251a7c4a 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_auto.h.in @@ -1,4 +1,4 @@ -/* $Id: os_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_auto.h.in 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -54,6 +54,7 @@ #undef PJ_HAS_NETINET_IN_SYSTM_H #undef PJ_HAS_NETINET_IN_H #undef PJ_HAS_NETINET_IP_H +#undef PJ_HAS_NETINET_TCP_H #undef PJ_HAS_NET_IF_H #undef PJ_HAS_IFADDRS_H #undef PJ_HAS_SEMAPHORE_H @@ -180,5 +181,11 @@ */ #undef PJ_THREAD_ALLOCATE_STACK +/* SSL socket availability. */ +#ifndef PJ_HAS_SSL_SOCK +#undef PJ_HAS_SSL_SOCK +#endif + + #endif /* __PJ_COMPAT_OS_AUTO_H__ */ diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h index 6fff31157966dbf56de4c5527299a1c5a10c0bb4..4afbe02aa6f45f102f54386f70b94f3910685db1 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_darwinos.h @@ -1,4 +1,4 @@ -/* $Id: os_darwinos.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_darwinos.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,6 +35,7 @@ #define PJ_HAS_MALLOC_H 0 #define PJ_HAS_NETDB_H 1 #define PJ_HAS_NETINET_IN_H 1 +#define PJ_HAS_NETINET_TCP_H 1 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h index c5c4e4b509eabacb27d05e205bbe9fc1a958e856..727cbc153d8d2b89757b4515785c3c43f0d960d6 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_symbian.h @@ -1,4 +1,4 @@ -/* $Id: os_symbian.h 2506 2009-03-12 18:11:37Z bennylp $ */ +/* $Id: os_symbian.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,6 +35,7 @@ #define PJ_HAS_MALLOC_H 0 #define PJ_HAS_NETDB_H 1 #define PJ_HAS_NETINET_IN_H 1 +#define PJ_HAS_NETINET_TCP_H 0 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h index 8283491ec688ecf0916f1bda481da3386314d6c0..496d4780506ad1c2fc23fda1239428466dfdaa1f 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32.h @@ -1,4 +1,4 @@ -/* $Id: os_win32.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: os_win32.h 3002 2009-11-10 04:30:46Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -41,6 +41,7 @@ #define PJ_HAS_MALLOC_H 1 #define PJ_HAS_NETDB_H 0 #define PJ_HAS_NETINET_IN_H 0 +#define PJ_HAS_NETINET_TCP_H 0 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 @@ -110,7 +111,12 @@ #ifndef PJ_OS_HAS_CHECK_STACK # define PJ_OS_HAS_CHECK_STACK 1 #endif -#define PJ_NATIVE_STRING_IS_UNICODE 0 + +#ifdef UNICODE +# define PJ_NATIVE_STRING_IS_UNICODE 1 +#else +# define PJ_NATIVE_STRING_IS_UNICODE 0 +#endif #define PJ_ATOMIC_VALUE_TYPE long diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h index 3dd00125944a69a656e0fb0d7797c1a90c6083a1..16d3019479b33654bdce848c8738db6e72eff316 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/os_win32_wince.h @@ -1,4 +1,4 @@ -/* $Id: os_win32_wince.h 2660 2009-04-28 19:38:43Z nanang $ */ +/* $Id: os_win32_wince.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -40,6 +40,7 @@ #define PJ_HAS_MALLOC_H 1 #define PJ_HAS_NETDB_H 0 #define PJ_HAS_NETINET_IN_H 0 +#define PJ_HAS_NETINET_TCP_H 0 #define PJ_HAS_SETJMP_H 1 #define PJ_HAS_STDARG_H 1 #define PJ_HAS_STDDEF_H 1 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h index 3f2e787f86f19ded0b714717972d4322f877158f..b091c40ba69fcb51e23e2e66619df9c9162a615b 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/compat/socket.h @@ -1,4 +1,4 @@ -/* $Id: socket.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: socket.h 2962 2009-10-24 00:00:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -104,6 +104,11 @@ # include <netinet/ip.h> #endif +#if defined(PJ_HAS_NETINET_TCP_H) && PJ_HAS_NETINET_TCP_H != 0 +/* To pull in TCP_NODELAY constants */ +# include <netinet/tcp.h> +#endif + #if defined(PJ_HAS_NET_IF_H) && PJ_HAS_NET_IF_H != 0 /* For interface enumeration in ip_helper */ # include <net/if.h> diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/config.h b/sflphone-common/libs/pjproject/pjlib/include/pj/config.h index aba3fa7070bfbd35d07634196d76276fdfa76ff8..7c21e8efa31bfbee83deb2c7676c1c986ce29210 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/config.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2843 2009-07-22 11:12:35Z bennylp $ */ -/* +/* $Id: config.h 2970 2009-10-26 15:47:52Z nanang $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJ_CONFIG_H__ #define __PJ_CONFIG_H__ @@ -49,78 +49,78 @@ * Include target OS specific configuration. */ #if defined(PJ_AUTOCONF) -/* - * Autoconf - */ + /* + * Autoconf + */ # include <pj/compat/os_auto.h> #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 -/* - * SymbianOS - */ + /* + * SymbianOS + */ # include <pj/compat/os_symbian.h> #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE) -/* - * Windows CE - */ + /* + * Windows CE + */ # undef PJ_WIN32_WINCE # define PJ_WIN32_WINCE 1 # include <pj/compat/os_win32_wince.h> -/* Also define Win32 */ + /* Also define Win32 */ # define PJ_WIN32 1 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \ defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__) -/* - * Win32 - */ + /* + * Win32 + */ # undef PJ_WIN32 # define PJ_WIN32 1 # include <pj/compat/os_win32.h> #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0 -/* - * Linux kernel - */ + /* + * Linux kernel + */ # include <pj/compat/os_linux_kernel.h> #elif defined(PJ_LINUX) || defined(linux) || defined(__linux) -/* - * Linux - */ + /* + * Linux + */ # undef PJ_LINUX # define PJ_LINUX 1 # include <pj/compat/os_linux.h> #elif defined(PJ_PALMOS) && PJ_PALMOS!=0 -/* - * Palm - */ + /* + * Palm + */ # include <pj/compat/os_palmos.h> #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun) -/* - * SunOS - */ + /* + * SunOS + */ # undef PJ_SUNOS # define PJ_SUNOS 1 # include <pj/compat/os_sunos.h> #elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \ defined (__APPLE__) || defined (__MACH__) -/* - * MacOS X - */ + /* + * MacOS X + */ # undef PJ_DARWINOS # define PJ_DARWINOS 1 # include <pj/compat/os_darwinos.h> #elif defined(PJ_RTEMS) && PJ_RTEMS!=0 -/* - * RTEMS - */ + /* + * RTEMS + */ # include <pj/compat/os_rtems.h> #else # error "Please specify target os." @@ -131,17 +131,17 @@ * Target machine specific configuration. */ #if defined(PJ_AUTOCONF) -/* - * Autoconf configured - */ + /* + * Autoconf configured + */ #include <pj/compat/m_auto.h> #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \ defined(_X86_) || defined(x86) || defined(__i386__) || \ defined(__i386) || defined(_M_IX86) || defined(__I86__) -/* - * Generic i386 processor family, little-endian - */ + /* + * Generic i386 processor family, little-endian + */ # undef PJ_M_I386 # define PJ_M_I386 1 # define PJ_M_NAME "i386" @@ -152,9 +152,9 @@ #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \ defined(__x86_64__) || defined(__x86_64) -/* - * AMD 64bit processor, little endian - */ + /* + * AMD 64bit processor, little endian + */ # undef PJ_M_X86_64 # define PJ_M_X86_64 1 # define PJ_M_NAME "x86_64" @@ -164,9 +164,9 @@ #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \ defined(__IA64__) || defined( _M_IA64) -/* - * Intel IA64 processor, little endian - */ + /* + * Intel IA64 processor, little endian + */ # undef PJ_M_IA64 # define PJ_M_IA64 1 # define PJ_M_NAME "ia64" @@ -176,9 +176,9 @@ #elif defined (PJ_M_M68K) && PJ_M_M68K != 0 -/* - * Motorola m64k processor, little endian - */ + /* + * Motorola m64k processor, little endian + */ # undef PJ_M_M68K # define PJ_M_M68K 1 # define PJ_M_NAME "m68k" @@ -189,9 +189,9 @@ #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \ defined (_M_ALPHA) -/* - * DEC Alpha processor, little endian - */ + /* + * DEC Alpha processor, little endian + */ # undef PJ_M_ALPHA # define PJ_M_ALPHA 1 # define PJ_M_NAME "alpha" @@ -202,9 +202,9 @@ #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \ defined(__MIPS__) || defined(MIPS) || defined(_MIPS_) -/* - * MIPS, default to little endian - */ + /* + * MIPS, default to little endian + */ # undef PJ_M_MIPS # define PJ_M_MIPS 1 # define PJ_M_NAME "mips" @@ -216,9 +216,9 @@ #elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc) -/* - * Sun Sparc, big endian - */ + /* + * Sun Sparc, big endian + */ # undef PJ_M_SPARC # define PJ_M_SPARC 1 # define PJ_M_NAME "sparc" @@ -228,9 +228,9 @@ #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \ defined(ARMV4) || defined(__arm__) -/* - * ARM, default to little endian - */ + /* + * ARM, default to little endian + */ # undef PJ_M_ARMV4 # define PJ_M_ARMV4 1 # define PJ_M_NAME "armv4" @@ -243,9 +243,9 @@ #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \ defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \ defined(_ARCH_PPC) -/* - * PowerPC, big endian - */ + /* + * PowerPC, big endian + */ # undef PJ_M_POWERPC # define PJ_M_POWERPC 1 # define PJ_M_NAME "powerpc" @@ -255,16 +255,16 @@ #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \ defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2) -/* - * Nios2, little endian - */ + /* + * Nios2, little endian + */ # undef PJ_M_NIOS2 # define PJ_M_NIOS2 1 # define PJ_M_NAME "nios2" # define PJ_HAS_PENTIUM 0 # define PJ_IS_LITTLE_ENDIAN 1 # define PJ_IS_BIG_ENDIAN 0 - + #else # error "Please specify target machine." #endif @@ -420,7 +420,7 @@ * in the application. * * This will slow down pool creation and destruction and will add - * few bytes of overhead, so application would normally want to + * few bytes of overhead, so application would normally want to * disable this feature on release build. * * Default: 0 @@ -449,14 +449,14 @@ * * Default: 8192 */ -#ifndef PJ_THREAD_DEFAULT_STACK_SIZE +#ifndef PJ_THREAD_DEFAULT_STACK_SIZE # define PJ_THREAD_DEFAULT_STACK_SIZE 8192 #endif /** - * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of - * the stack. The OS implementation may check that no stack overflow + * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of + * the stack. The OS implementation may check that no stack overflow * occurs, and it also may collect statistic about stack usage. Note * that this will increase the footprint of the libraries since it * tracks the filename and line number of each functions. @@ -486,7 +486,7 @@ #endif /** - * Support IPv6 in the library. If this support is disabled, some IPv6 + * Support IPv6 in the library. If this support is disabled, some IPv6 * related functions will return PJ_EIPV6NOTSUP. * * Default: 0 (disabled, for now) @@ -495,21 +495,21 @@ # define PJ_HAS_IPV6 0 #endif -/** -* Maximum hostname length. -* Libraries sometimes needs to make copy of an address to stack buffer; -* the value here affects the stack usage. -* -* Default: 128 -*/ + /** + * Maximum hostname length. + * Libraries sometimes needs to make copy of an address to stack buffer; + * the value here affects the stack usage. + * + * Default: 128 + */ #ifndef PJ_MAX_HOSTNAME # define PJ_MAX_HOSTNAME (128) #endif /** * Constants for declaring the maximum handles that can be supported by - * a single IOQ framework. This constant might not be relevant to the - * underlying I/O queue impelementation, but still, developers should be + * a single IOQ framework. This constant might not be relevant to the + * underlying I/O queue impelementation, but still, developers should be * aware of this constant, to make sure that the program will not break when * the underlying implementation changes. */ @@ -523,8 +523,8 @@ * things to ensure thread safety of handle unregistration operation by * employing reference counter to each handle. * - * In addition, the ioqueue will preallocate memory for the handles, - * according to the maximum number of handles that is specified during + * In addition, the ioqueue will preallocate memory for the handles, + * according to the maximum number of handles that is specified during * ioqueue creation. * * All applications would normally want this enabled, but you may disable @@ -545,7 +545,7 @@ * concurrently/in parallel. The default is yes, which means that if there * are more than one pending operations complete simultaneously, more * than one threads may call the key's callback at the same time. This - * generally would promote good scalability for application, at the + * generally would promote good scalability for application, at the * expense of more complexity to manage the concurrent accesses. * * Please see the ioqueue documentation for more info. @@ -600,14 +600,14 @@ * set to value lower than FD_SETSIZE. */ #if PJ_FD_SETSIZE_SETABLE -/* Only override FD_SETSIZE if the value has not been set */ + /* Only override FD_SETSIZE if the value has not been set */ # ifndef FD_SETSIZE # define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES # endif #else -/* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES - * is lower than FD_SETSIZE value. - */ + /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES + * is lower than FD_SETSIZE value. + */ # ifdef FD_SETSIZE # if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE # error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE" @@ -724,7 +724,7 @@ #ifndef PJ_NATIVE_ERR_POSITIVE # define PJ_NATIVE_ERR_POSITIVE 1 #endif - + /** * Include error message string in the library (pj_strerror()). * This is very much desirable! @@ -741,13 +741,56 @@ * functions to compare alnum strings. On some systems, they're faster * then stricmp/strcasecmp, but they can be slower on other systems. * When disabled, pjlib will fallback to stricmp/strnicmp. - * + * * Default: 0 */ #ifndef PJ_HAS_STRICMP_ALNUM # define PJ_HAS_STRICMP_ALNUM 0 #endif + +/* + * Types of QoS backend implementation. + */ + +/** + * Dummy QoS backend implementation, will always return error on all + * the APIs. + */ +#define PJ_QOS_DUMMY 1 + +/** QoS backend based on setsockopt(IP_TOS) */ +#define PJ_QOS_BSD 2 + +/** QoS backend for Windows Mobile 6 */ +#define PJ_QOS_WM 3 + +/** QoS backend for Symbian */ +#define PJ_QOS_SYMBIAN 4 + +/** + * Force the use of some QoS backend API for some platforms. + */ +#ifndef PJ_QOS_IMPLEMENTATION +# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502 + /* Windows Mobile 6 or later */ +# define PJ_QOS_IMPLEMENTATION PJ_QOS_WM +# endif +#endif + + +/** + * Enable secure socket. For most platforms, this is implemented using + * OpenSSL, so this will require OpenSSL to be installed. For Symbian + * platform, this is implemented natively using CSecureSocket. + * + * Default: 0 (for now) + */ +#ifndef PJ_HAS_SSL_SOCK +# define PJ_HAS_SSL_SOCK 0 +#endif + + /** @} */ /******************************************************************** @@ -761,7 +804,7 @@ * * The libraries support generation of dynamic link libraries for * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian - * terms). Similar procedures may be applied for Win32 DLL with some + * terms). Similar procedures may be applied for Win32 DLL with some * modification. * * Depending on the platforms, these steps may be necessary in order to @@ -769,7 +812,7 @@ * - Create the (Visual Studio) projects to produce DLL output. PJLIB * does not provide ready to use project files to produce DLL, so * you need to create these projects yourself. For Symbian, the MMP - * files have been setup to produce DSO files for targets that + * files have been setup to produce DSO files for targets that * require them. * - In the (Visual Studio) projects, some macros need to be declared * so that appropriate modifiers are added to symbol declarations @@ -778,49 +821,49 @@ * MMP files. * - Some build systems require .DEF file to be specified when creating * the DLL. For Symbian, .DEF files are included in pjlib distribution, - * in <tt>pjlib/build.symbian</tt> directory. These DEF files are + * in <tt>pjlib/build.symbian</tt> directory. These DEF files are * created by running <tt>./makedef.sh all</tt> from this directory, * inside Mingw. * * Macros related for building DLL/DSO files: * - For platforms that supports dynamic link libraries generation, * it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contains - * the prefix to be added to symbol definition, to export this + * the prefix to be added to symbol definition, to export this * symbol in the DLL/DSO. For example, on Win32/Visual Studio, the - * value of this macro is \a __declspec(dllexport), and for ARM - * ABIv2/Symbian, the value is \a EXPORT_C. + * value of this macro is \a __declspec(dllexport), and for ARM + * ABIv2/Symbian, the value is \a EXPORT_C. * - For platforms that supports linking with dynamic link libraries, * it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contains - * the prefix to be added to symbol declaration, to import this + * the prefix to be added to symbol declaration, to import this * symbol from a DLL/DSO. For example, on Win32/Visual Studio, the - * value of this macro is \a __declspec(dllimport), and for ARM - * ABIv2/Symbian, the value is \a IMPORT_C. - * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> + * value of this macro is \a __declspec(dllimport), and for ARM + * ABIv2/Symbian, the value is \a IMPORT_C. + * - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> * macros above can be declared in your \a config_site.h if they are not * declared by pjlib. - * - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and - * <tt>PJ_EXPORTING</tt> macros must be declared, so that + * - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and + * <tt>PJ_EXPORTING</tt> macros must be declared, so that * <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function * definition. * - When application wants to link dynamically with PJLIB, then it * must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header, - * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into + * so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into * symbol declarations. * * When <b>PJ_DLL</b> macro is not declared, static linking is assumed. * * For example, here are some settings to produce DLLs with Visual Studio * on Windows/Win32: - * - Create Visual Studio projects to produce DLL. Add the appropriate + * - Create Visual Studio projects to produce DLL. Add the appropriate * project dependencies to avoid link errors. - * - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> + * - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> * macros. * - Declare these macros in your <tt>config_site.h</tt>: \verbatim #define PJ_EXPORT_SPECIFIER __declspec(dllexport) #define PJ_IMPORT_SPECIFIER __declspec(dllimport) \endverbatim - * - And in the application (that links with the DLL) project, add + * - And in the application (that links with the DLL) project, add * <tt>PJ_DLL</tt> in the macro declarations. */ @@ -844,7 +887,7 @@ * is built as dynamic library. * * This macro should have been added by platform specific headers, - * if the platform supports building dynamic library target. + * if the platform supports building dynamic library target. */ #ifndef PJ_EXPORT_DECL_SPECIFIER # define PJ_EXPORT_DECL_SPECIFIER @@ -857,7 +900,7 @@ * is built as dynamic library. * * This macro should have been added by platform specific headers, - * if the platform supports building dynamic library target. + * if the platform supports building dynamic library target. */ #ifndef PJ_EXPORT_DEF_SPECIFIER # define PJ_EXPORT_DEF_SPECIFIER @@ -952,7 +995,7 @@ * @def PJ_DECL_DATA(type) * @param type The data type. * Declare a global data. - */ + */ #if defined(PJ_DLL) # if defined(PJ_EXPORTING) # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type @@ -968,7 +1011,7 @@ * @def PJ_DEF_DATA(type) * @param type The data type. * Define a global data. - */ + */ #if defined(PJ_DLL) && defined(PJ_EXPORTING) # define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type #elif !defined(PJ_DEF_DATA) @@ -1058,19 +1101,19 @@ PJ_BEGIN_DECL /** * PJLIB version string constant. @see pj_get_version() */ -PJ_DECL_DATA (const char*) PJ_VERSION; +PJ_DECL_DATA(const char*) PJ_VERSION; /** * Get PJLIB version string. * * @return #PJ_VERSION constant. */ -PJ_DECL (const char*) pj_get_version (void); +PJ_DECL(const char*) pj_get_version(void); /** * Dump configuration to log with verbosity equal to info(3). */ -PJ_DECL (void) pj_dump_config (void); +PJ_DECL(void) pj_dump_config(void); PJ_END_DECL diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/config_site.h b/sflphone-common/libs/pjproject/pjlib/include/pj/config_site.h deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h b/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h index fdc6cdf76c507ab46009b32ed3a598078a46e8c4..7576a4cf7accd1e6a974ef5e7a3a4b42313db806 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/errno.h @@ -1,4 +1,4 @@ -/* $Id: errno.h 2506 2009-03-12 18:11:37Z bennylp $ */ +/* $Id: errno.h 2992 2009-11-09 04:09:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -22,21 +22,24 @@ /** * @file errno.h - * @brief PJLIB Error Codes + * @brief PJLIB Error Subsystem */ #include <pj/types.h> #include <pj/compat/errno.h> +#include <stdarg.h> PJ_BEGIN_DECL /** - * @defgroup pj_errno Error Codes + * @defgroup pj_errno Error Subsystem * @{ * - * In PJLIB, error/status codes from operating system are translated - * into PJLIB error namespace, and stored in @a pj_status_t. All functions - * that work with @a pj_status_t expect to get PJLIB error code instead - * of native codes. + * The PJLIB Error Subsystem is a framework to unify all error codes + * produced by all components into a single error space, and provide + * uniform set of APIs to access them. With this framework, any error + * codes are encoded as pj_status_t value. The framework is extensible, + * application may register new error spaces to be recognized by + * the framework. * * @section pj_errno_retval Return Values * @@ -47,20 +50,33 @@ PJ_BEGIN_DECL * #PJ_STATUS_FROM_OS() macro. The function will do this automatically * before returning the error to caller. * - * @section pj_errno_errmsg Error Message + * @section err_services Retrieving and Displaying Error Messages * - * To get the error message corresponding to a particular code, use function - * #pj_strerror(). This function expects error code in PJLIB error namespace, - * not the native error code. Application can pass the value from the - * following sources to this function: - * - #pj_get_os_error() - * - #pj_get_netos_error() - * - any return value from function returning @a pj_status_t. + * The framework provides the following APIs to retrieve and/or display + * error messages: * - * Application MUST NOT pass native error code (such as error code from + * - #pj_strerror(): this is the base API to retrieve error string + * description for the specified pj_status_t error code. + * + * - #PJ_PERROR() macro: use this macro similar to PJ_LOG to format + * an error message and display them to the log + * + * - #pj_perror(): this function is similar to PJ_PERROR() but unlike + * #PJ_PERROR(), this function will always be included in the + * link process. Due to this reason, prefer to use #PJ_PERROR() + * if the application is concerned about the executable size. + * + * Application MUST NOT pass native error codes (such as error code from * functions like GetLastError() or errno) to PJLIB functions expecting * @a pj_status_t. * + * @section err_extending Extending the Error Space + * + * Application may register new error space to be recognized by the + * framework by using #pj_register_strerror(). Use the range started + * from PJ_ERRNO_START_USER to avoid conflict with existing error + * spaces. + * */ /** @@ -68,6 +84,14 @@ PJ_BEGIN_DECL */ #define PJ_ERR_MSG_SIZE 80 +/** + * Buffer for title string of #PJ_PERROR(). + */ +#ifndef PJ_PERROR_TITLE_BUF_SIZE +# define PJ_PERROR_TITLE_BUF_SIZE 120 +#endif + + /** * Get the last platform error/status, folded into pj_status_t. * @return OS dependent error code, folded into pj_status_t. @@ -111,6 +135,74 @@ PJ_DECL(void) pj_set_netos_error(pj_status_t code); PJ_DECL(pj_str_t) pj_strerror( pj_status_t statcode, char *buf, pj_size_t bufsize); +/** + * A utility macro to print error message pertaining to the specified error + * code to the log. This macro will construct the error message title + * according to the 'title_fmt' argument, and add the error string pertaining + * to the error code after the title string. A colon (':') will be added + * automatically between the title and the error string. + * + * This function is similar to pj_perror() function, but has the advantage + * that the function call can be omitted from the link process if the + * log level argument is below PJ_LOG_MAX_LEVEL threshold. + * + * Note that the title string constructed from the title_fmt will be built on + * a string buffer which size is PJ_PERROR_TITLE_BUF_SIZE, which normally is + * allocated from the stack. By default this buffer size is small (around + * 120 characters). Application MUST ensure that the constructed title string + * will not exceed this limit, since not all platforms support truncating + * the string. + * + * @see pj_perror() + * + * @param level The logging verbosity level, valid values are 0-6. Lower + * number indicates higher importance, with level zero + * indicates fatal error. Only numeral argument is + * permitted (e.g. not variable). + * @param arg Enclosed 'printf' like arguments, with the following + * arguments: + * - the sender (NULL terminated string), + * - the error code (pj_status_t) + * - the format string (title_fmt), and + * - optional variable number of arguments suitable for the + * format string. + * + * Sample: + * \verbatim + PJ_PERROR(2, (__FILE__, PJ_EBUSY, "Error making %s", "coffee")); + \endverbatim + * @hideinitializer + */ +#define PJ_PERROR(level,arg) do { \ + pj_perror_wrapper_##level(arg); \ + } while (0) + +/** + * A utility function to print error message pertaining to the specified error + * code to the log. This function will construct the error message title + * according to the 'title_fmt' argument, and add the error string pertaining + * to the error code after the title string. A colon (':') will be added + * automatically between the title and the error string. + * + * Unlike the PJ_PERROR() macro, this function takes the \a log_level argument + * as a normal argument, unlike in PJ_PERROR() where a numeral value must be + * given. However this function will always be linked to the executable, + * unlike PJ_PERROR() which can be omitted when the level is below the + * PJ_LOG_MAX_LEVEL. + * + * Note that the title string constructed from the title_fmt will be built on + * a string buffer which size is PJ_PERROR_TITLE_BUF_SIZE, which normally is + * allocated from the stack. By default this buffer size is small (around + * 120 characters). Application MUST ensure that the constructed title string + * will not exceed this limit, since not all platforms support truncating + * the string. + * + * @see PJ_PERROR() + */ +PJ_DECL(void) pj_perror(int log_level, const char *sender, pj_status_t status, + const char *title_fmt, ...); + + /** * Type of callback to be specified in #pj_register_strerror() * @@ -381,6 +473,102 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code, /* Internal */ void pj_errno_clear_handlers(void); + +/****** Internal for PJ_PERROR *******/ + +/** + * @def pj_perror_wrapper_1(arg) + * Internal function to write log with verbosity 1. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 1. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 1 + #define pj_perror_wrapper_1(arg) pj_perror_1 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_1(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_1(arg) +#endif + +/** + * @def pj_perror_wrapper_2(arg) + * Internal function to write log with verbosity 2. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 2. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 2 + #define pj_perror_wrapper_2(arg) pj_perror_2 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_2(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_2(arg) +#endif + +/** + * @def pj_perror_wrapper_3(arg) + * Internal function to write log with verbosity 3. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 3. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 3 + #define pj_perror_wrapper_3(arg) pj_perror_3 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_3(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_3(arg) +#endif + +/** + * @def pj_perror_wrapper_4(arg) + * Internal function to write log with verbosity 4. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 4. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 4 + #define pj_perror_wrapper_4(arg) pj_perror_4 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_4(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_4(arg) +#endif + +/** + * @def pj_perror_wrapper_5(arg) + * Internal function to write log with verbosity 5. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 5. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 5 + #define pj_perror_wrapper_5(arg) pj_perror_5 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_5(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_5(arg) +#endif + +/** + * @def pj_perror_wrapper_6(arg) + * Internal function to write log with verbosity 6. Will evaluate to + * empty expression if PJ_LOG_MAX_LEVEL is below 6. + * @param arg Log expression. + */ +#if PJ_LOG_MAX_LEVEL >= 6 + #define pj_perror_wrapper_6(arg) pj_perror_6 arg + /** Internal function. */ + PJ_DECL(void) pj_perror_6(const char *sender, pj_status_t status, + const char *title_fmt, ...); +#else + #define pj_perror_wrapper_6(arg) +#endif + + + + PJ_END_DECL #endif /* __PJ_ERRNO_H__ */ diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h b/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h index b0bbfe283c8e24342368a136954fd2468a094e0a..90c9f05ce8efdbf33344f25ffd8cc8dd7cff64f8 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/sock.h @@ -1,4 +1,4 @@ -/* $Id: sock.h 2863 2009-08-12 10:56:06Z bennylp $ */ +/* $Id: sock.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -290,6 +290,17 @@ extern const pj_uint16_t PJ_SO_RCVBUF; /** Buffer size for send. @see pj_SO_SNDBUF() */ extern const pj_uint16_t PJ_SO_SNDBUF; +/** Disables the Nagle algorithm for send coalescing. @see pj_TCP_NODELAY */ +extern const pj_uint16_t PJ_TCP_NODELAY; + +/** Allows the socket to be bound to an address that is already in use. + * @see pj_SO_REUSEADDR */ +extern const pj_uint16_t PJ_SO_REUSEADDR; + +/** Set the protocol-defined priority for all packets to be sent on socket. + */ +extern const pj_uint16_t PJ_SO_PRIORITY; + /** IP multicast interface. @see pj_IP_MULTICAST_IF() */ extern const pj_uint16_t PJ_IP_MULTICAST_IF; @@ -316,6 +327,15 @@ extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP; /** Get #PJ_SO_SNDBUF constant */ PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void); + /** Get #PJ_TCP_NODELAY constant */ + PJ_DECL(pj_uint16_t) pj_TCP_NODELAY(void); + + /** Get #PJ_SO_REUSEADDR constant */ + PJ_DECL(pj_uint16_t) pj_SO_REUSEADDR(void); + + /** Get #PJ_SO_PRIORITY constant */ + PJ_DECL(pj_uint16_t) pj_SO_PRIORITY(void); + /** Get #PJ_IP_MULTICAST_IF constant */ PJ_DECL(pj_uint16_t) pj_IP_MULTICAST_IF(void); @@ -340,6 +360,15 @@ extern const pj_uint16_t PJ_IP_DROP_MEMBERSHIP; /** Get #PJ_SO_SNDBUF constant */ # define pj_SO_SNDBUF() PJ_SO_SNDBUF + /** Get #PJ_TCP_NODELAY constant */ +# define pj_TCP_NODELAY() PJ_TCP_NODELAY + + /** Get #PJ_SO_REUSEADDR constant */ +# define pj_SO_REUSEADDR() PJ_SO_REUSEADDR + + /** Get #PJ_SO_PRIORITY constant */ +# define pj_SO_PRIORITY() PJ_SO_PRIORITY + /** Get #PJ_IP_MULTICAST_IF constant */ # define pj_IP_MULTICAST_IF() PJ_IP_MULTICAST_IF diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/sock_qos.h b/sflphone-common/libs/pjproject/pjlib/include/pj/sock_qos.h new file mode 100644 index 0000000000000000000000000000000000000000..4422253b6853f85a21166892f9df4e41724c0646 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/sock_qos.h @@ -0,0 +1,427 @@ +/* $Id: sock_qos.h 2967 2009-10-25 10:50:17Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJ_SOCK_QOS_H__ +#define __PJ_SOCK_QOS_H__ + +/** + * @file sock_qos.h + * @brief Socket QoS API + */ + +#include <pj/sock.h> + +PJ_BEGIN_DECL + + +/** + * @defgroup socket_qos Socket Quality of Service (QoS) API: TOS, DSCP, WMM, IEEE 802.1p + * @ingroup PJ_SOCK + * @{ + + + \section intro QoS Technologies + + QoS settings are available for both Layer 2 and 3 of TCP/IP protocols: + + \subsection intro_ieee8021p Layer 2: IEEE 802.1p for Ethernet + + IEEE 802.1p tagging will mark frames sent by a host for prioritized + delivery using a 3-bit Priority field in the virtual local area network + (VLAN) header of the Ethernet frame. The VLAN header is placed inside + the Ethernet header, between the Source Address field and either the + Length field (for an IEEE 802.3 frame) or the EtherType field (for an + Ethernet II frame). + + \subsection intro_wmm Layer 2: WMM + + At the Network Interface layer for IEEE 802.11 wireless, the Wi-Fi + Alliance certification for Wi-Fi Multimedia (WMM) defines four access + categories for prioritizing network traffic. These access categories + are (in order of highest to lowest priority) voice, video, best-effort, + and background. Host support for WMM prioritization requires that both + wireless network adapters and their drivers support WMM. Wireless + access points (APs) must have WMM enabled. + + \subsection intro_dscp Layer 3: DSCP + + At the Internet layer, you can use Differentiated Services/Diffserv and + set the value of the Differentiated Services Code Point (DSCP) in the + IP header. As defined in RFC 2474, the DSCP value is the high-order 6 bits + of the IP version 4 (IPv4) TOS field and the IP version 6 (IPv6) Traffic + Class field. + + \subsection intro_other Layer 3: Other + + Other mechanisms exist (such as RSVP, IntServ) but this will not be + implemented. + + + \section availability QoS Availability + + \subsection linux Linux + + DSCP is available via IP TOS option. + + Ethernet 802.1p tagging is done by setting setsockopt(SO_PRIORITY) option + of the socket, then with the set_egress_map option of the vconfig utility + to convert this to set vlan-qos field of the packet. + + WMM is not known to be available. + + \subsection windows Windows and Windows Mobile + + (It's a mess!) + + DSCP is settable with setsockopt() on Windows 2000 or older, but Windows + would silently ignore this call on WinXP or later, unless administrator + modifies the registry. On Windows 2000, Windows XP, and Windows Server + 2003, GQoS (Generic QoS) API is the standard API, but this API may not be + supported in the future. On Vista and Windows 7, the is a new QoS2 API, + also known as Quality Windows Audio-Video Experience (qWAVE). + + IEEE 802.1p tagging is available via Traffic Control (TC) API, available + on Windows XP SP2, but this needs administrator access. For Vista and + later, it's in qWAVE. + + WMM is available for mobile platforms on Windows Mobile 6 platform and + Windows Embedded CE 6, via setsockopt(IP_DSCP_TRAFFIC_TYPE). qWAVE + supports this as well. + + \subsection symbian Symbian S60 3rd Ed + + Both DSCP and WMM is supported via RSocket::SetOpt() with will set both + Layer 2 and Layer 3 QoS settings accordingly. Internally, PJLIB sets the + DSCP field of the socket, and based on certain DSCP values mapping, + Symbian will set the WMM tag accordingly. + + \section api PJLIB's QoS API Abstraction + + Based on the above, the following API is implemented. + + Declare the following "standard" traffic types. + + \code + typedef enum pj_qos_type + { + PJ_QOS_TYPE_BEST_EFFORT, + PJ_QOS_TYPE_BACKGROUND, + PJ_QOS_TYPE_VIDEO, + PJ_QOS_TYPE_VOICE, + PJ_QOS_TYPE_CONTROL + } pj_qos_type; + \endcode + + The traffic classes above will determine how the Layer 2 and 3 QoS + settings will be used. The standard mapping between the classes above + to the corresponding Layer 2 and 3 settings are as follows: + + \code + ================================================================= + PJLIB Traffic Type IP DSCP WMM 802.1p + ----------------------------------------------------------------- + BEST_EFFORT 0x00 BE (Bulk Effort) 0 + BACKGROUND 0x08 BK (Bulk) 2 + VIDEO 0x28 VI (Video) 5 + VOICE 0x30 VO (Voice) 6 + CONTROL 0x38 VO (Voice) 7 + ================================================================= + \endcode + + There are two sets of API provided to manipulate the QoS parameters. + + \subsection portable_api Portable API + + The first set of API is: + + \code + // Set QoS parameters + PJ_DECL(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type val); + + // Get QoS parameters + PJ_DECL(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_val); + \endcode + + The API will set the traffic type according to the DSCP class, for both + Layer 2 and Layer 3 QoS settings, where it's available. If any of the + layer QoS setting is not settable, the API will silently ignore it. + If both layers are not setable, the API will return error. + + The API above is the recommended use of QoS, since it is the most + portable across all platforms. + + \subsection detail_api Fine Grained Control API + + The second set of API is intended for application that wants to fine + tune the QoS parameters. + + The Layer 2 and 3 QoS parameters are stored in pj_qos_params structure: + + \code + typedef enum pj_qos_flag + { + PJ_QOS_PARAM_HAS_DSCP = 1, + PJ_QOS_PARAM_HAS_SO_PRIO = 2, + PJ_QOS_PARAM_HAS_WMM = 4 + } pj_qos_flag; + + typedef enum pj_qos_wmm_prio + { + PJ_QOS_WMM_PRIO_BULK_EFFORT, + PJ_QOS_WMM_PRIO_BULK, + PJ_QOS_WMM_PRIO_VIDEO, + PJ_QOS_WMM_PRIO_VOICE + } pj_qos_wmm_prio; + + typedef struct pj_qos_params + { + pj_uint8_t flags; // Determines which values to + // set, bitmask of pj_qos_flag + pj_uint8_t dscp_val; // The 6 bits DSCP value to set + pj_uint8_t so_prio; // SO_PRIORITY value + pj_qos_wmm_prio wmm_prio; // WMM priority value + } pj_qos_params; + \endcode + + The second set of API with more fine-grained control over the parameters + are: + + \code + // Retrieve QoS params for the specified traffic type + PJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type, + pj_qos_params *p); + + // Set QoS parameters to the socket + PJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + const pj_qos_params *p); + + // Get QoS parameters from the socket + PJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p); + \endcode + + + Important: + + The pj_sock_set/get_qos_params() APIs are not portable, and it's probably + only going to be implemented on Linux. Application should always try to + use pj_sock_set_qos_type() instead. + */ + + +/** + * High level traffic classification. + */ +typedef enum pj_qos_type +{ + PJ_QOS_TYPE_BEST_EFFORT, /**< Best effort traffic (default value). + Any QoS function calls with specifying + this value are effectively no-op */ + PJ_QOS_TYPE_BACKGROUND, /**< Background traffic. */ + PJ_QOS_TYPE_VIDEO, /**< Video traffic. */ + PJ_QOS_TYPE_VOICE, /**< Voice traffic. */ + PJ_QOS_TYPE_CONTROL /**< Control traffic. */ +} pj_qos_type; + +/** + * Bitmask flag to indicate which QoS layer setting is set in the + * \a flags field of the #pj_qos_params structure. + */ +typedef enum pj_qos_flag +{ + PJ_QOS_PARAM_HAS_DSCP = 1, /**< DSCP field is set. */ + PJ_QOS_PARAM_HAS_SO_PRIO = 2, /**< Socket SO_PRIORITY */ + PJ_QOS_PARAM_HAS_WMM = 4 /**< WMM field is set. */ +} pj_qos_flag; + + +/** + * Standard WMM priorities. + */ +typedef enum pj_qos_wmm_prio +{ + PJ_QOS_WMM_PRIO_BULK_EFFORT, /**< Bulk effort priority */ + PJ_QOS_WMM_PRIO_BULK, /**< Bulk priority. */ + PJ_QOS_WMM_PRIO_VIDEO, /**< Video priority */ + PJ_QOS_WMM_PRIO_VOICE /**< Voice priority */ +} pj_qos_wmm_prio; + + +/** + * QoS parameters to be set or retrieved to/from the socket. + */ +typedef struct pj_qos_params +{ + pj_uint8_t flags; /**< Determines which values to + set, bitmask of pj_qos_flag */ + pj_uint8_t dscp_val; /**< The 6 bits DSCP value to set */ + pj_uint8_t so_prio; /**< SO_PRIORITY value */ + pj_qos_wmm_prio wmm_prio; /**< WMM priority value */ +} pj_qos_params; + + + +/** + * This is the high level and portable API to enable QoS on the specified + * socket, by setting the traffic type to the specified parameter. + * + * @param sock The socket. + * @param type Traffic type to be set. + * + * @return PJ_SUCCESS if at least Layer 2 or Layer 3 setting is + * successfully set. If both Layer 2 and Layer 3 settings + * can't be set, this function will return error. + */ +PJ_DECL(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type); + +/** + * This is the high level and portable API to get the traffic type that has + * been set on the socket. On occasions where the Layer 2 or Layer 3 settings + * were modified by using low level API, this function may return approximation + * of the closest QoS type that matches the settings. + * + * @param sock The socket. + * @param p_type Pointer to receive the traffic type of the socket. + * + * @return PJ_SUCCESS if traffic type for the socket can be obtained + * or approximated.. + */ +PJ_DECL(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type); + + +/** + * This is a convenience function to apply QoS to the socket, and print error + * logging if the operations failed. Both QoS traffic type and the low level + * QoS parameters can be applied with this function. + * + * @param sock The socket handle. + * @param qos_type QoS traffic type. The QoS traffic type will be applied + * only if the value is not PJ_QOS_TYPE_BEST_EFFORT, + * @param qos_params Optional low-level QoS parameters. This will be + * applied only if this argument is not NULL and the + * flags inside the structure is non-zero. Upon return, + * the flags will indicate which parameters have been + * applied successfully. + * @param log_level This function will print to log at this level upon + * encountering errors. + * @param log_sender Optional sender name in the log. + * @param sock_name Optional name to help identify the socket in the log. + * + * @return PJ_SUCCESS if at least Layer 2 or Layer 3 setting is + * successfully set. If both Layer 2 and Layer 3 settings + * can't be set, this function will return error. + * + * @see pj_sock_apply_qos2() + */ +PJ_DECL(pj_status_t) pj_sock_apply_qos(pj_sock_t sock, + pj_qos_type qos_type, + pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name); + +/** + * Variant of #pj_sock_apply_qos() where the \a qos_params parameter is + * const. + * + * @see pj_sock_apply_qos() + */ +PJ_DECL(pj_status_t) pj_sock_apply_qos2(pj_sock_t sock, + pj_qos_type qos_type, + const pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name); + +/** + * Retrieve the standard mapping of QoS params for the specified traffic + * type. + * + * @param type The traffic type from which the QoS parameters + * are to be retrieved. + * @param p_param Pointer to receive the QoS parameters. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type, + pj_qos_params *p_param); + + +/** + * Retrieve the traffic type that matches the specified QoS parameters. + * If no exact matching is found, this function will return an + * approximation of the closest matching traffic type for the specified + * QoS parameters. + * + * @param param Structure containing QoS parameters to map into + * "standard" traffic types. + * @param p_type Pointer to receive the traffic type. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_qos_get_type(const pj_qos_params *param, + pj_qos_type *p_type); + + +/** + * This is a low level API to set QoS parameters to the socket. + * + * @param sock The socket. + * @param param Structure containing QoS parameters to be applied + * to the socket. Upon return, the \a flags field + * of this structure will be set with bitmask value + * indicating which QoS settings have successfully + * been applied to the socket. + * + * @return PJ_SUCCESS if at least one field setting has been + * successfully set. If no setting can't be set, + * this function will return error. + */ +PJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param); + +/** + * This is a low level API to get QoS parameters from the socket. + * + * @param sock The socket. + * @param p_param Pointer to receive the parameters. Upon returning + * successfully, the \a flags field of this structure + * will be initialized with the appropriate bitmask + * to indicate which fields have been successfully + * retrieved. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param); + + +/** + * @} + */ + + +PJ_END_DECL + +#endif /* __PJ_SOCK_QOS_H__ */ + diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/ssl_sock.h b/sflphone-common/libs/pjproject/pjlib/include/pj/ssl_sock.h new file mode 100644 index 0000000000000000000000000000000000000000..3ac2b7f2bfc54aaf249d2db25ac301eac8eec605 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/ssl_sock.h @@ -0,0 +1,874 @@ +/* $Id: ssl_sock.h 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJ_SSL_SOCK_H__ +#define __PJ_SSL_SOCK_H__ + +/** + * @file ssl_sock.h + * @brief Secure socket + */ + +#include <pj/ioqueue.h> +#include <pj/sock.h> +#include <pj/sock_qos.h> + + +PJ_BEGIN_DECL + +/** + * @defgroup PJ_SSL_SOCK Secure socket I/O + * @brief Secure socket provides security on socket operation using standard + * security protocols such as SSL and TLS. + * @ingroup PJ_IO + * @{ + * + * Secure socket wraps normal socket and applies security features, i.e: + * privacy and data integrity, on the socket traffic, using standard security + * protocols such as SSL and TLS. + * + * Secure socket employs active socket operations, which is similar to (and + * described more detail) in \ref PJ_ACTIVESOCK. + */ + + + /** + * This opaque structure describes the secure socket. + */ +typedef struct pj_ssl_sock_t pj_ssl_sock_t; + + +/** + * Opaque declaration of endpoint certificate or credentials. This may contains + * certificate, private key, and trusted Certificate Authorities list. + */ +typedef struct pj_ssl_cert_t pj_ssl_cert_t; + + +/** + * Describe structure of certificate info. + */ +typedef struct pj_ssl_cert_info { + pj_str_t subject; /**< Subject. */ + pj_str_t issuer; /**< Issuer. */ + unsigned version; /**< Certificate version. */ + pj_time_val validity_start; /**< Validity start. */ + pj_time_val validity_end; /**< Validity end. */ + pj_bool_t validity_use_gmt; /**< Flag if validity date/time + use GMT. */ +} pj_ssl_cert_info; + + +/** + * Create credential from files. + * + * @param CA_file The file of trusted CA list. + * @param cert_file The file of certificate. + * @param privkey_file The file of private key. + * @param privkey_pass The password of private key, if any. + * @param p_cert Pointer to credential instance to be created. + * + * @return PJ_SUCCESS when successful. + */ +PJ_DECL(pj_status_t) pj_ssl_cert_load_from_files(pj_pool_t *pool, + const pj_str_t *CA_file, + const pj_str_t *cert_file, + const pj_str_t *privkey_file, + const pj_str_t *privkey_pass, + pj_ssl_cert_t **p_cert); + + +/** + * Cipher suites enumeration. + */ +typedef enum pj_ssl_cipher { + + /* NULL */ + TLS_NULL_WITH_NULL_NULL = 0x00000000, + + /* TLS/SSLv3 */ + TLS_RSA_WITH_NULL_MD5 = 0x00000001, + TLS_RSA_WITH_NULL_SHA = 0x00000002, + TLS_RSA_WITH_NULL_SHA256 = 0x0000003B, + TLS_RSA_WITH_RC4_128_MD5 = 0x00000004, + TLS_RSA_WITH_RC4_128_SHA = 0x00000005, + TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x0000000A, + TLS_RSA_WITH_AES_128_CBC_SHA = 0x0000002F, + TLS_RSA_WITH_AES_256_CBC_SHA = 0x00000035, + TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003C, + TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x0000003D, + TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x0000000D, + TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000010, + TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x00000013, + TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000016, + TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x00000030, + TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x00000031, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x00000032, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x00000033, + TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x00000036, + TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x00000037, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x00000038, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x00000039, + TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x0000003E, + TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003F, + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x00000040, + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x00000067, + TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x00000068, + TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x00000069, + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x0000006A, + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x0000006B, + TLS_DH_anon_WITH_RC4_128_MD5 = 0x00000018, + TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x0000001B, + TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x00000034, + TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x0000003A, + TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x0000006C, + TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x0000006D, + + /* TLS (deprecated) */ + TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x00000003, + TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x00000006, + TLS_RSA_WITH_IDEA_CBC_SHA = 0x00000007, + TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000008, + TLS_RSA_WITH_DES_CBC_SHA = 0x00000009, + TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0000000B, + TLS_DH_DSS_WITH_DES_CBC_SHA = 0x0000000C, + TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0000000E, + TLS_DH_RSA_WITH_DES_CBC_SHA = 0x0000000F, + TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x00000011, + TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x00000012, + TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000014, + TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x00000015, + TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x00000017, + TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x00000019, + TLS_DH_anon_WITH_DES_CBC_SHA = 0x0000001A, + + /* SSLv3 */ + SSL_FORTEZZA_KEA_WITH_NULL_SHA = 0x0000001C, + SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA= 0x0000001D, + SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 0x0000001E, + + /* SSLv2 */ + SSL_CK_RC4_128_WITH_MD5 = 0x00010080, + SSL_CK_RC4_128_EXPORT40_WITH_MD5 = 0x00020080, + SSL_CK_RC2_128_CBC_WITH_MD5 = 0x00030080, + SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = 0x00040080, + SSL_CK_IDEA_128_CBC_WITH_MD5 = 0x00050080, + SSL_CK_DES_64_CBC_WITH_MD5 = 0x00060040, + SSL_CK_DES_192_EDE3_CBC_WITH_MD5 = 0x000700C0 + +} pj_ssl_cipher; + + +/** + * Get cipher list supported by SSL/TLS backend. + * + * @param ciphers The ciphers buffer to receive cipher list. + * @param cipher_num Maximum number of ciphers to be received. + * + * @return PJ_SUCCESS when successful. + */ +PJ_DECL(pj_status_t) pj_ssl_cipher_get_availables(pj_ssl_cipher ciphers[], + unsigned *cipher_num); + + +/** + * Get cipher name string. + * + * @param cipher The cipher. + * + * @return The cipher name or NULL if cipher is not recognized. + */ +PJ_DECL(const char*) pj_ssl_cipher_name(pj_ssl_cipher cipher); + + +/** + * This structure contains the callbacks to be called by the secure socket. + */ +typedef struct pj_ssl_sock_cb +{ + /** + * This callback is called when a data arrives as the result of + * pj_ssl_sock_start_read(). + * + * @param ssock The secure socket. + * @param data The buffer containing the new data, if any. If + * the status argument is non-PJ_SUCCESS, this + * argument may be NULL. + * @param size The length of data in the buffer. + * @param status The status of the read operation. This may contain + * non-PJ_SUCCESS for example when the TCP connection + * has been closed. In this case, the buffer may + * contain left over data from previous callback which + * the application may want to process. + * @param remainder If application wishes to leave some data in the + * buffer (common for TCP applications), it should + * move the remainder data to the front part of the + * buffer and set the remainder length here. The value + * of this parameter will be ignored for datagram + * sockets. + * + * @return PJ_TRUE if further read is desired, and PJ_FALSE + * when application no longer wants to receive data. + * Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_data_read)(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder); + /** + * This callback is called when a packet arrives as the result of + * pj_ssl_sock_start_recvfrom(). + * + * @param ssock The secure socket. + * @param data The buffer containing the packet, if any. If + * the status argument is non-PJ_SUCCESS, this + * argument will be set to NULL. + * @param size The length of packet in the buffer. If + * the status argument is non-PJ_SUCCESS, this + * argument will be set to zero. + * @param src_addr Source address of the packet. + * @param addr_len Length of the source address. + * @param status This contains + * + * @return PJ_TRUE if further read is desired, and PJ_FALSE + * when application no longer wants to receive data. + * Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_data_recvfrom)(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + const pj_sockaddr_t *src_addr, + int addr_len, + pj_status_t status); + + /** + * This callback is called when data has been sent. + * + * @param ssock The secure socket. + * @param send_key Key associated with the send operation. + * @param sent If value is positive non-zero it indicates the + * number of data sent. When the value is negative, + * it contains the error code which can be retrieved + * by negating the value (i.e. status=-sent). + * + * @return Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_data_sent)(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent); + + /** + * This callback is called when new connection arrives as the result + * of pj_ssl_sock_start_accept(). + * + * @param ssock The secure socket. + * @param newsock The new incoming secure socket. + * @param src_addr The source address of the connection. + * @param addr_len Length of the source address. + * + * @return PJ_TRUE if further accept() is desired, and PJ_FALSE + * when application no longer wants to accept incoming + * connection. Application may destroy the secure socket + * in the callback and return PJ_FALSE here. + */ + pj_bool_t (*on_accept_complete)(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len); + + /** + * This callback is called when pending connect operation has been + * completed. + * + * @param ssock The secure socket. + * @param status The connection result. If connection has been + * successfully established, the status will contain + * PJ_SUCCESS. + * + * @return Application may destroy the secure socket in the + * callback and return PJ_FALSE here. + */ + pj_bool_t (*on_connect_complete)(pj_ssl_sock_t *ssock, + pj_status_t status); + +} pj_ssl_sock_cb; + + +/** + * Enumeration of secure socket protocol types. + */ +typedef enum pj_ssl_sock_proto +{ + PJ_SSL_SOCK_PROTO_DEFAULT, /**< Default protocol of backend. */ + PJ_SSL_SOCK_PROTO_TLS1, /**< TLSv1.0 protocol. */ + PJ_SSL_SOCK_PROTO_SSL3, /**< SSLv3.0 protocol. */ + PJ_SSL_SOCK_PROTO_SSL23, /**< SSLv3.0 but can roll back to + SSLv2.0. */ + PJ_SSL_SOCK_PROTO_SSL2, /**< SSLv2.0 protocol. */ + PJ_SSL_SOCK_PROTO_DTLS1 /**< DTLSv1.0 protocol. */ +} pj_ssl_sock_proto; + + +/** + * Definition of secure socket info structure. + */ +typedef struct pj_ssl_sock_info +{ + /** + * Describes whether secure socket connection is established, i.e: TLS/SSL + * handshaking has been done successfully. + */ + pj_bool_t established; + + /** + * Describes secure socket protocol being used. + */ + pj_ssl_sock_proto proto; + + /** + * Describes cipher suite being used, this will only be set when connection + * is established. + */ + pj_ssl_cipher cipher; + + /** + * Describes local address. + */ + pj_sockaddr local_addr; + + /** + * Describes remote address. + */ + pj_sockaddr remote_addr; + + /** + * Describes active local certificate info. + */ + pj_ssl_cert_info local_cert_info; + + /** + * Describes active remote certificate info. + */ + pj_ssl_cert_info remote_cert_info; + +} pj_ssl_sock_info; + + +/** + * Definition of secure socket creation parameters. + */ +typedef struct pj_ssl_sock_param +{ + /** + * Specifies socket address family, either pj_AF_INET() and pj_AF_INET6(). + * + * Default is pj_AF_INET(). + */ + int sock_af; + + /** + * Specify socket type, either pj_SOCK_DGRAM() or pj_SOCK_STREAM(). + * + * Default is pj_SOCK_STREAM(). + */ + int sock_type; + + /** + * Specify the ioqueue to use. Secure socket uses the ioqueue to perform + * active socket operations, see \ref PJ_ACTIVESOCK for more detail. + */ + pj_ioqueue_t *ioqueue; + + /** + * Specify the timer heap to use. Secure socket uses the timer to provide + * auto cancelation on asynchronous operation when it takes longer time + * than specified timeout period, e.g: security negotiation timeout. + */ + pj_timer_heap_t *timer_heap; + + /** + * Specify secure socket callbacks, see #pj_ssl_sock_cb. + */ + pj_ssl_sock_cb cb; + + /** + * Specify secure socket user data. + */ + void *user_data; + + /** + * Specify security protocol to use, see #pj_ssl_sock_proto. + * + * Default is PJ_SSL_SOCK_PROTO_DEFAULT. + */ + pj_ssl_sock_proto proto; + + /** + * Number of concurrent asynchronous operations that is to be supported + * by the secure socket. This value only affects socket receive and + * accept operations -- the secure socket will issue one or more + * asynchronous read and accept operations based on the value of this + * field. Setting this field to more than one will allow more than one + * incoming data or incoming connections to be processed simultaneously + * on multiprocessor systems, when the ioqueue is polled by more than + * one threads. + * + * The default value is 1. + */ + unsigned async_cnt; + + /** + * The ioqueue concurrency to be forced on the socket when it is + * registered to the ioqueue. See #pj_ioqueue_set_concurrency() for more + * info about ioqueue concurrency. + * + * When this value is -1, the concurrency setting will not be forced for + * this socket, and the socket will inherit the concurrency setting of + * the ioqueue. When this value is zero, the secure socket will disable + * concurrency for the socket. When this value is +1, the secure socket + * will enable concurrency for the socket. + * + * The default value is -1. + */ + int concurrency; + + /** + * If this option is specified, the secure socket will make sure that + * asynchronous send operation with stream oriented socket will only + * call the callback after all data has been sent. This means that the + * secure socket will automatically resend the remaining data until + * all data has been sent. + * + * Please note that when this option is specified, it is possible that + * error is reported after partial data has been sent. Also setting + * this will disable the ioqueue concurrency for the socket. + * + * Default value is 1. + */ + pj_bool_t whole_data; + + /** + * Specify buffer size for sending operation. Buffering sending data + * is used for allowing application to perform multiple outstanding + * send operations. Whenever application specifies this setting too + * small, sending operation may return PJ_ENOMEM. + * + * Default value is 8192 bytes. + */ + pj_size_t send_buffer_size; + + /** + * Specify buffer size for receiving encrypted (and perhaps compressed) + * data on underlying socket. This setting is unused on Symbian, since + * SSL/TLS Symbian backend, CSecureSocket, can use application buffer + * directly. + * + * Default value is 1500. + */ + pj_size_t read_buffer_size; + + /** + * Number of ciphers contained in the specified cipher preference. + * If this is set to zero, then default cipher list of the backend + * will be used. + */ + unsigned ciphers_num; + + /** + * Ciphers and order preference. If empty, then default cipher list and + * its default order of the backend will be used. + */ + pj_ssl_cipher *ciphers; + + /** + * Security negotiation timeout. If this is set to zero (both sec and + * msec), the negotiation doesn't have a timeout. + * + * Default value is zero. + */ + pj_time_val timeout; + + /** + * Specify whether endpoint should verify peer certificate. + * + * Default value is PJ_FALSE. + */ + pj_bool_t verify_peer; + + /** + * When secure socket is acting as server (handles incoming connection), + * it will require the client to provide certificate. + * + * Default value is PJ_FALSE. + */ + pj_bool_t require_client_cert; + + /** + * When secure socket is acting as client (perform outgoing connection) + * and it needs to verify server name (e.g: host or domain name) by + * matching it to the name specified in the server certificate. This + * setting is useful when the server is hosting multiple domains for + * the same listening socket. + * + * Default value is zero/not-set. + */ + pj_str_t server_name; + + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + /** + * Specify if the transport should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + + +} pj_ssl_sock_param; + + +/** + * Initialize the secure socket parameters for its creation with + * the default values. + * + * @param param The parameter to be initialized. + */ +PJ_DECL(void) pj_ssl_sock_param_default(pj_ssl_sock_param *param); + + +/** + * Create secure socket instance. + * + * @param pool The pool for allocating secure socket instance. + * @param param The secure socket parameter, see #pj_ssl_sock_param. + * @param p_ssock Pointer to secure socket instance to be created. + * + * @return PJ_SUCCESS when successful. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_create(pj_pool_t *pool, + const pj_ssl_sock_param *param, + pj_ssl_sock_t **p_ssock); + + +/** + * Set secure socket certificate or credentials. Credentials may include + * certificate, private key and trusted Certification Authorities list. + * Normally, server socket must provide certificate (and private key). + * Socket client may also need to provide certificate in case requested + * by the server. + * + * @param ssock The secure socket instance. + * @param pool The pool. + * @param cert The endpoint certificate/credentials, see + * #pj_ssl_cert_t. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_set_certificate( + pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_ssl_cert_t *cert); + + +/** + * Close and destroy the secure socket. + * + * @param ssock The secure socket. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock); + + +/** + * Associate arbitrary data with the secure socket. Application may + * inspect this data in the callbacks and associate it with higher + * level processing. + * + * @param ssock The secure socket. + * @param user_data The user data to be associated with the secure + * socket. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_set_user_data(pj_ssl_sock_t *ssock, + void *user_data); + +/** + * Retrieve the user data previously associated with this secure + * socket. + * + * @param ssock The secure socket. + * + * @return The user data. + */ +PJ_DECL(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock); + + +/** + * Retrieve the local address and port used by specified secure socket. + * + * @param ssock The secure socket. + * @param info The info buffer to be set, see #pj_ssl_sock_info. + * + * @return PJ_SUCCESS on successful. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_get_info(pj_ssl_sock_t *ssock, + pj_ssl_sock_info *info); + + +/** + * Starts read operation on this secure socket. This function will create + * \a async_cnt number of buffers (the \a async_cnt parameter was given + * in \a pj_ssl_sock_create() function) where each buffer is \a buff_size + * long. The buffers are allocated from the specified \a pool. Once the + * buffers are created, it then issues \a async_cnt number of asynchronous + * \a recv() operations to the socket and returns back to caller. Incoming + * data on the socket will be reported back to application via the + * \a on_data_read() callback. + * + * Application only needs to call this function once to initiate read + * operations. Further read operations will be done automatically by the + * secure socket when \a on_data_read() callback returns non-zero. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param flags Flags to be given to pj_ioqueue_recv(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_read(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags); + +/** + * Same as #pj_ssl_sock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param readbuf Array of packet buffers, each has buff_size size. + * @param flags Flags to be given to pj_ioqueue_recv(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_read2(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); + +/** + * Same as pj_ssl_sock_start_read(), except that this function is used + * only for datagram sockets, and it will trigger \a on_data_recvfrom() + * callback instead. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param flags Flags to be given to pj_ioqueue_recvfrom(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_recvfrom(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags); + +/** + * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate buffers for incoming data. + * @param buff_size The size of each buffer, in bytes. + * @param readbuf Array of packet buffers, each has buff_size size. + * @param flags Flags to be given to pj_ioqueue_recvfrom(). + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_recvfrom2(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags); + +/** + * Send data using the socket. + * + * @param ssock The secure socket. + * @param send_key The operation key to send the data, which is useful + * if application wants to submit multiple pending + * send operations and want to track which exact data + * has been sent in the \a on_data_sent() callback. + * @param data The data to be sent. This data must remain valid + * until the data has been sent. + * @param size The size of the data. + * @param flags Flags to be given to pj_ioqueue_send(). + * + * @return PJ_SUCCESS if data has been sent immediately, or + * PJ_EPENDING if data cannot be sent immediately or + * PJ_ENOMEM when sending buffer could not handle all + * queued data, see \a send_buffer_size. The callback + * \a on_data_sent() will be called when data is actually + * sent. Any other return value indicates error condition. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_send(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags); + +/** + * Send datagram using the socket. + * + * @param ssock The secure socket. + * @param send_key The operation key to send the data, which is useful + * if application wants to submit multiple pending + * send operations and want to track which exact data + * has been sent in the \a on_data_sent() callback. + * @param data The data to be sent. This data must remain valid + * until the data has been sent. + * @param size The size of the data. + * @param flags Flags to be given to pj_ioqueue_send(). + * @param addr The destination address. + * @param addr_len Length of buffer containing destination address. + * + * @return PJ_SUCCESS if data has been sent immediately, or + * PJ_EPENDING if data cannot be sent immediately. In + * this case the \a on_data_sent() callback will be + * called when data is actually sent. Any other return + * value indicates error condition. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_sendto(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags, + const pj_sockaddr_t *addr, + int addr_len); + + +/** + * Starts asynchronous socket accept() operations on this secure socket. + * This function will issue \a async_cnt number of asynchronous \a accept() + * operations to the socket and returns back to caller. Incoming + * connection on the socket will be reported back to application via the + * \a on_accept_complete() callback. + * + * Application only needs to call this function once to initiate accept() + * operations. Further accept() operations will be done automatically by + * the secure socket when \a on_accept_complete() callback returns non-zero. + * + * @param ssock The secure socket. + * @param pool Pool used to allocate some internal data for the + * operation. + * @param localaddr Local address to bind on. + * @param addr_len Length of buffer containing local address. + * + * @return PJ_SUCCESS if the operation has been successful, + * or the appropriate error code on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_accept(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *local_addr, + int addr_len); + + +/** + * Starts asynchronous socket connect() operation and SSL/TLS handshaking + * for this socket. Once the connection is done (either successfully or not), + * the \a on_connect_complete() callback will be called. + * + * @param ssock The secure socket. + * @param pool The pool to allocate some internal data for the + * operation. + * @param localaddr Local address. + * @param remaddr Remote address. + * @param addr_len Length of buffer containing above addresses. + * + * @return PJ_SUCCESS if connection can be established immediately + * or PJ_EPENDING if connection cannot be established + * immediately. In this case the \a on_connect_complete() + * callback will be called when connection is complete. + * Any other return value indicates error condition. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_connect(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + const pj_sockaddr_t *remaddr, + int addr_len); + + +/** + * Starts SSL/TLS renegotiation over an already established SSL connection + * for this socket. This operation is performed transparently, no callback + * will be called once the renegotiation completed successfully. However, + * when the renegotiation fails, the connection will be closed and callback + * \a on_data_read() will be invoked with non-PJ_SUCCESS status code. + * + * @param ssock The secure socket. + * + * @return PJ_SUCCESS if renegotiation is completed immediately, + * or PJ_EPENDING if renegotiation has been started and + * waiting for completion, or the appropriate error code + * on failure. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock); + + +/** + * @} + */ + +PJ_END_DECL + +#endif /* __PJ_SSL_SOCK_H__ */ diff --git a/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h b/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h index b0cbdb6ef19a3cb7050f36fc27adcd4bbdc68afa..dfb8bb489426788e0b7d5b3a1bb9c080ae5d4fdb 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pj/timer.h @@ -1,4 +1,4 @@ -/* $Id: timer.h 2512 2009-03-13 15:49:06Z bennylp $ */ +/* $Id: timer.h 3034 2009-12-16 13:30:34Z bennylp $ */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,11 +64,7 @@ PJ_BEGIN_DECL /** * The type for internal timer ID. */ -#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 -typedef void *pj_timer_id_t; -#else typedef int pj_timer_id_t; -#endif /** * Forward declaration for pj_timer_entry. diff --git a/sflphone-common/libs/pjproject/pjlib/include/pjlib.h b/sflphone-common/libs/pjproject/pjlib/include/pjlib.h index acc12c426b5f324851ed502490de8421debe8ef0..dcfa3bed96faa38468bb18407868bc2a10ea2992 100644 --- a/sflphone-common/libs/pjproject/pjlib/include/pjlib.h +++ b/sflphone-common/libs/pjproject/pjlib/include/pjlib.h @@ -1,4 +1,4 @@ -/* $Id: pjlib.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjlib.h 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -50,7 +50,9 @@ #include <pj/rand.h> #include <pj/rbtree.h> #include <pj/sock.h> +#include <pj/sock_qos.h> #include <pj/sock_select.h> +#include <pj/ssl_sock.h> #include <pj/string.h> #include <pj/timer.h> #include <pj/unicode.h> diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c b/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c index 3d7451af7b5559082e1a860f6f36a80114fb1c88..2c19fc9fc016901f7341898c82147d17ec74e170 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/activesock.c @@ -1,4 +1,4 @@ -/* $Id: activesock.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: activesock.c 2980 2009-11-03 12:58:54Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -458,8 +458,15 @@ static void ioqueue_on_read_complete(pj_ioqueue_key_t *key, * connection. * If there is no remainder data, set the packet to NULL. */ - ret = (*asock->cb.on_data_read)(asock, (r->size? r->pkt:NULL), - r->size, status, &remainder); + + /* Shouldn't set the packet to NULL, as there may be active + * socket user, such as SSL socket, that needs to have access + * to the read buffer packet. + */ + //ret = (*asock->cb.on_data_read)(asock, (r->size? r->pkt:NULL), + // r->size, status, &remainder); + ret = (*asock->cb.on_data_read)(asock, r->pkt, r->size, + status, &remainder); } else if (asock->read_type == TYPE_RECV_FROM && asock->cb.on_data_recvfrom) @@ -711,12 +718,14 @@ static void ioqueue_on_accept_complete(pj_ioqueue_key_t *key, pj_activesock_t *asock = (pj_activesock_t*) pj_ioqueue_get_user_data(key); struct accept_op *accept_op = (struct accept_op*) op_key; + PJ_UNUSED_ARG(new_sock); + do { if (status==PJ_SUCCESS && asock->cb.on_accept_complete) { pj_bool_t ret; /* Notify callback */ - ret = (*asock->cb.on_accept_complete)(asock, new_sock, + ret = (*asock->cb.on_accept_complete)(asock, accept_op->new_sock, &accept_op->rem_addr, accept_op->rem_addr_len); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c index bdce279ee348cdccc3acf74eb7417a6cf2c8cd22..3c3a946741cb3bb20c2f2694e51da3f7c394c964 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_sock.c @@ -1,4 +1,4 @@ -/* $Id: addr_resolv_sock.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: addr_resolv_sock.c 3044 2010-01-04 16:54:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -73,18 +73,28 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, /* Check if nodename is IP address */ pj_bzero(&ai[0], sizeof(ai[0])); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - if (pj_inet_pton(af, nodename, pj_sockaddr_get_addr(&ai[0].ai_addr)) - == PJ_SUCCESS) - { - pj_str_t tmp; + if (af == PJ_AF_UNSPEC) { + if (pj_inet_pton(PJ_AF_INET, nodename, + &ai[0].ai_addr.ipv4.sin_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET; + } + else if (pj_inet_pton(PJ_AF_INET6, nodename, + &ai[0].ai_addr.ipv6.sin6_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET6; + } - tmp.ptr = ai[0].ai_canonname; - pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - *count = 1; + if (af != PJ_AF_UNSPEC) { + pj_str_t tmp; - return PJ_SUCCESS; + tmp.ptr = ai[0].ai_canonname; + pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); + ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; + *count = 1; + + return PJ_SUCCESS; + } } /* Copy node name to null terminated string. */ @@ -121,6 +131,7 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, /* Store address */ PJ_ASSERT_ON_FAIL(res->ai_addrlen <= sizeof(pj_sockaddr), continue); pj_memcpy(&ai[i].ai_addr, res->ai_addr, res->ai_addrlen); + PJ_SOCKADDR_RESET_LEN(&ai[i].ai_addr); /* Next slot */ ++i; @@ -139,18 +150,28 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, /* Check if nodename is IP address */ pj_bzero(&ai[0], sizeof(ai[0])); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - if (pj_inet_pton(af, nodename, pj_sockaddr_get_addr(&ai[0].ai_addr)) - == PJ_SUCCESS) - { - pj_str_t tmp; + if (af == PJ_AF_UNSPEC) { + if (pj_inet_pton(PJ_AF_INET, nodename, + &ai[0].ai_addr.ipv4.sin_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET; + } + else if (pj_inet_pton(PJ_AF_INET6, nodename, + &ai[0].ai_addr.ipv6.sin6_addr) == PJ_SUCCESS) + { + af = PJ_AF_INET6; + } - tmp.ptr = ai[0].ai_canonname; - pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); - ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; - *count = 1; + if (af != PJ_AF_UNSPEC) { + pj_str_t tmp; - return PJ_SUCCESS; + tmp.ptr = ai[0].ai_canonname; + pj_strncpy_with_null(&tmp, nodename, PJ_MAX_HOSTNAME); + ai[0].ai_addr.addr.sa_family = (pj_uint16_t)af; + *count = 1; + + return PJ_SUCCESS; + } } if (af == PJ_AF_INET || af == PJ_AF_UNSPEC) { @@ -180,6 +201,7 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, ai[*count].ai_addr.ipv4.sin_family = PJ_AF_INET; pj_memcpy(&ai[*count].ai_addr.ipv4.sin_addr, he.h_addr_list[i], he.h_length); + PJ_SOCKADDR_RESET_LEN(&ai[*count].ai_addr); (*count)++; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp index 98833dbedbc5ce0ae58fed8d41bba59eca827a0a..a0f4453dcef2545167dacd407b60f9560aadf640 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/addr_resolv_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: addr_resolv_symbian.cpp 2888 2009-08-17 11:29:39Z nanang $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/addr_resolv.h> #include <pj/assert.h> @@ -27,199 +27,175 @@ #include <pj/unicode.h> #include "os_symbian.h" - + #define THIS_FILE "addr_resolv_symbian.cpp" #define TRACE_ME 0 // PJLIB API: resolve hostname -PJ_DEF (pj_status_t) pj_gethostbyname (const pj_str_t *name, pj_hostent *he) +PJ_DEF(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he) { static pj_addrinfo ai; static char *aliases[2]; static char *addrlist[2]; unsigned count = 1; pj_status_t status; - - status = pj_getaddrinfo (PJ_AF_INET, name, &count, &ai); - + + status = pj_getaddrinfo(PJ_AF_INET, name, &count, &ai); if (status != PJ_SUCCESS) - return status; - + return status; + aliases[0] = ai.ai_canonname; - aliases[1] = NULL; - + addrlist[0] = (char*) &ai.ai_addr.ipv4.sin_addr; - addrlist[1] = NULL; - - pj_bzero (he, sizeof (*he)); - + + pj_bzero(he, sizeof(*he)); he->h_name = aliases[0]; - he->h_aliases = aliases; - he->h_addrtype = PJ_AF_INET; - he->h_length = 4; - he->h_addr_list = addrlist; - + return PJ_SUCCESS; } // Resolve for specific address family -static pj_status_t getaddrinfo_by_af (int af, const pj_str_t *name, - unsigned *count, pj_addrinfo ai[]) +static pj_status_t getaddrinfo_by_af(int af, const pj_str_t *name, + unsigned *count, pj_addrinfo ai[]) { unsigned i; pj_status_t status; - - PJ_ASSERT_RETURN (name && count && ai, PJ_EINVAL); + + PJ_ASSERT_RETURN(name && count && ai, PJ_EINVAL); #if !defined(PJ_HAS_IPV6) || !PJ_HAS_IPV6 - if (af == PJ_AF_INET6) - return PJ_EIPV6NOTSUP; - + return PJ_EIPV6NOTSUP; #endif - + // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); // Get resolver for the specified address family - RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (af); + RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(af); // Convert name to Unicode wchar_t name16[PJ_MAX_HOSTNAME]; - - pj_ansi_to_unicode (name->ptr, name->slen, name16, PJ_ARRAY_SIZE (name16)); - - TPtrC16 data ( (const TUint16*) name16); + pj_ansi_to_unicode(name->ptr, name->slen, name16, PJ_ARRAY_SIZE(name16)); + TPtrC16 data((const TUint16*)name16); // Resolve! TNameEntry nameEntry; - TRequestStatus reqStatus; - - resv.GetByName (data, nameEntry, reqStatus); - - User::WaitForRequest (reqStatus); - + + resv.GetByName(data, nameEntry, reqStatus); + User::WaitForRequest(reqStatus); + // Iterate each result i = 0; - while (reqStatus == KErrNone && i < *count) { - - // Get the resolved TInetAddr - TInetAddr inetAddr (nameEntry().iAddr); - int addrlen; + + // Get the resolved TInetAddr + TInetAddr inetAddr(nameEntry().iAddr); + int addrlen; #if TRACE_ME - - if (1) { - pj_sockaddr a; - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - int namelen; - - namelen = sizeof (pj_sockaddr); - - if (PjSymbianOS::Addr2pj (inetAddr, a, &namelen, - PJ_FALSE) == PJ_SUCCESS) { - PJ_LOG (5, (THIS_FILE, "resolve %.*s: %s", - (int) name->slen, name->ptr, - pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2))); - } - } - + if (1) { + pj_sockaddr a; + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + int namelen; + + namelen = sizeof(pj_sockaddr); + if (PjSymbianOS::Addr2pj(inetAddr, a, &namelen, + PJ_FALSE) == PJ_SUCCESS) + { + PJ_LOG(5,(THIS_FILE, "resolve %.*s: %s", + (int)name->slen, name->ptr, + pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2))); + } + } #endif - - // Ignore if this is not the same address family - // Not a good idea, as Symbian mapps IPv4 to IPv6. - //fam = inetAddr.Family(); - //if (fam != af) { - // resv.Next(nameEntry, reqStatus); - // User::WaitForRequest(reqStatus); - // continue; - //} - - // Convert IP address first to get IPv4 mapped address - addrlen = sizeof (ai[i].ai_addr); - - status = PjSymbianOS::Addr2pj (inetAddr, ai[i].ai_addr, - &addrlen, PJ_TRUE); - - if (status != PJ_SUCCESS) - return status; - - // Ignore if address family doesn't match - if (ai[i].ai_addr.addr.sa_family != af) { - resv.Next (nameEntry, reqStatus); - User::WaitForRequest (reqStatus); - continue; - } - - // Convert the official address to ANSI. - pj_unicode_to_ansi ( (const wchar_t*) nameEntry().iName.Ptr(), - nameEntry().iName.Length(), - ai[i].ai_canonname, sizeof (ai[i].ai_canonname)); - - // Next - ++i; - - resv.Next (nameEntry, reqStatus); - - User::WaitForRequest (reqStatus); + + // Ignore if this is not the same address family + // Not a good idea, as Symbian mapps IPv4 to IPv6. + //fam = inetAddr.Family(); + //if (fam != af) { + // resv.Next(nameEntry, reqStatus); + // User::WaitForRequest(reqStatus); + // continue; + //} + + // Convert IP address first to get IPv4 mapped address + addrlen = sizeof(ai[i].ai_addr); + status = PjSymbianOS::Addr2pj(inetAddr, ai[i].ai_addr, + &addrlen, PJ_TRUE); + if (status != PJ_SUCCESS) + return status; + + // Ignore if address family doesn't match + if (ai[i].ai_addr.addr.sa_family != af) { + resv.Next(nameEntry, reqStatus); + User::WaitForRequest(reqStatus); + continue; + } + + // Convert the official address to ANSI. + pj_unicode_to_ansi((const wchar_t*)nameEntry().iName.Ptr(), + nameEntry().iName.Length(), + ai[i].ai_canonname, sizeof(ai[i].ai_canonname)); + + // Next + ++i; + resv.Next(nameEntry, reqStatus); + User::WaitForRequest(reqStatus); } *count = i; - return PJ_SUCCESS; } /* Resolve IPv4/IPv6 address */ -PJ_DEF (pj_status_t) pj_getaddrinfo (int af, const pj_str_t *nodename, - unsigned *count, pj_addrinfo ai[]) +PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename, + unsigned *count, pj_addrinfo ai[]) { unsigned start; pj_status_t status = PJ_EAFNOTSUP; - - PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC, - PJ_EAFNOTSUP); - PJ_ASSERT_RETURN (nodename && count && *count && ai, PJ_EINVAL); - + + PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6 || af==PJ_AF_UNSPEC, + PJ_EAFNOTSUP); + PJ_ASSERT_RETURN(nodename && count && *count && ai, PJ_EINVAL); + start = 0; - + if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { unsigned max = *count; - status = getaddrinfo_by_af (PJ_AF_INET6, nodename, - &max, &ai[start]); - - if (status == PJ_SUCCESS) { - (*count) -= max; - start += max; - } + status = getaddrinfo_by_af(PJ_AF_INET6, nodename, + &max, &ai[start]); + if (status == PJ_SUCCESS) { + (*count) -= max; + start += max; + } } - + if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { unsigned max = *count; - status = getaddrinfo_by_af (PJ_AF_INET, nodename, - &max, &ai[start]); - - if (status == PJ_SUCCESS) { - (*count) -= max; - start += max; - } + status = getaddrinfo_by_af(PJ_AF_INET, nodename, + &max, &ai[start]); + if (status == PJ_SUCCESS) { + (*count) -= max; + start += max; + } } - + *count = start; - + if (*count) { - return PJ_SUCCESS; + return PJ_SUCCESS; } else { - return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND; + return status!=PJ_SUCCESS ? status : PJ_ENOTFOUND; } } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/config.c b/sflphone-common/libs/pjproject/pjlib/src/pj/config.c index 92079b5b46bfca969c314b255ab8f6c6f7e1edba..a8d3517444189380b90565a8b9e51a101a8907e6 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/config.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c 2900 2009-08-17 21:30:15Z bennylp $ */ +/* $Id: config.c 3054 2010-01-11 09:42:39Z ismangil $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -22,7 +22,7 @@ #include <pj/ioqueue.h> static const char *id = "config.c"; -PJ_DEF_DATA(const char*) PJ_VERSION = "1.4"; +PJ_DEF_DATA(const char*) PJ_VERSION = "1.5.5"; /* * Get PJLIB version string. diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c b/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c index 37a9cfb7ea1949aed359ddce744eefdcbc2b6650..3d44f6e378e10a2952069bb8c75868c96de155e3 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/errno.c @@ -1,4 +1,4 @@ -/* $Id: errno.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: errno.c 2992 2009-11-09 04:09:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -18,8 +18,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/errno.h> +#include <pj/log.h> #include <pj/string.h> #include <pj/compat/string.h> +#include <pj/compat/stdarg.h> #include <pj/assert.h> /* Prototype for platform specific error message, which will be defined @@ -196,3 +198,113 @@ PJ_DEF(pj_str_t) pj_strerror( pj_status_t statcode, return errstr; } +#if PJ_LOG_MAX_LEVEL >= 1 +static void invoke_log(const char *sender, int level, const char *format, ...) +{ + va_list arg; + va_start(arg, format); + pj_log(sender, level, format, arg); + va_end(arg); +} + +static void pj_perror_imp(int log_level, const char *sender, + pj_status_t status, + const char *title_fmt, va_list marker) +{ + char titlebuf[PJ_PERROR_TITLE_BUF_SIZE]; + char errmsg[PJ_ERR_MSG_SIZE]; + int len; + + /* Build the title */ + len = pj_ansi_vsnprintf(titlebuf, sizeof(titlebuf), title_fmt, marker); + if (len < 0 || len >= sizeof(titlebuf)) + pj_ansi_strcpy(titlebuf, "Error"); + + /* Get the error */ + pj_strerror(status, errmsg, sizeof(errmsg)); + + /* Send to log */ + invoke_log(sender, log_level, "%s: %s", titlebuf, errmsg); +} + +PJ_DEF(void) pj_perror(int log_level, const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(log_level, sender, status, title_fmt, marker); + va_end(marker); +} + +PJ_DEF(void) pj_perror_1(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(1, sender, status, title_fmt, marker); + va_end(marker); +} + +#else /* #if PJ_LOG_MAX_LEVEL >= 1 */ +PJ_DEF(void) pj_perror(int log_level, const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ +} +#endif /* #if PJ_LOG_MAX_LEVEL >= 1 */ + + +#if PJ_LOG_MAX_LEVEL >= 2 +PJ_DEF(void) pj_perror_2(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(2, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 3 +PJ_DEF(void) pj_perror_3(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(3, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 4 +PJ_DEF(void) pj_perror_4(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(4, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 5 +PJ_DEF(void) pj_perror_5(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(5, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + +#if PJ_LOG_MAX_LEVEL >= 6 +PJ_DEF(void) pj_perror_6(const char *sender, pj_status_t status, + const char *title_fmt, ...) +{ + va_list marker; + va_start(marker, title_fmt); + pj_perror_imp(6, sender, status, title_fmt, marker); + va_end(marker); +} +#endif + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp index 14ded02ed9c7f93154068aef65904015728dc4b1..e54cebddf940cd73896ee81e1f59afad48d16d74 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/exception_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: exception_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/except.h> #include <pj/os.h> @@ -25,19 +25,19 @@ #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0 -static const char *exception_id_names[PJ_MAX_EXCEPTION_ID]; + static const char *exception_id_names[PJ_MAX_EXCEPTION_ID]; #else -/* - * Start from 1 (not 0)!!! - * Exception 0 is reserved for normal path of setjmp()!!! - */ -static int last_exception_id = 1; + /* + * Start from 1 (not 0)!!! + * Exception 0 is reserved for normal path of setjmp()!!! + */ + static int last_exception_id = 1; #endif /* PJ_HAS_EXCEPTION_NAMES */ #if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0 -PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, - pj_exception_id_t *id) +PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, + pj_exception_id_t *id) { unsigned i; @@ -47,7 +47,6 @@ PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - for (i=1; i<PJ_MAX_EXCEPTION_ID; ++i) { if (exception_id_names[i] == NULL) { exception_id_names[i] = name; @@ -58,18 +57,17 @@ PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, } pj_leave_critical_section(); - return PJ_ETOOMANY; } -PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) +PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) { /* * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL); - + PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, PJ_EINVAL); + pj_enter_critical_section(); exception_id_names[id] = NULL; pj_leave_critical_section(); @@ -78,13 +76,13 @@ PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) } -PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) +PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) { /* * Start from 1 (not 0)!!! * Exception 0 is reserved for normal path of setjmp()!!! */ - PJ_ASSERT_RETURN (id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>"); + PJ_ASSERT_RETURN(id>0 && id<PJ_MAX_EXCEPTION_ID, "<Invalid ID>"); if (exception_id_names[id] == NULL) return "<Unallocated ID>"; @@ -93,21 +91,21 @@ PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) } #else /* PJ_HAS_EXCEPTION_NAMES */ -PJ_DEF (pj_status_t) pj_exception_id_alloc (const char *name, - pj_exception_id_t *id) +PJ_DEF(pj_status_t) pj_exception_id_alloc( const char *name, + pj_exception_id_t *id) { - PJ_ASSERT_RETURN (last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY); + PJ_ASSERT_RETURN(last_exception_id < PJ_MAX_EXCEPTION_ID-1, PJ_ETOOMANY); *id = last_exception_id++; return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_exception_id_free (pj_exception_id_t id) +PJ_DEF(pj_status_t) pj_exception_id_free( pj_exception_id_t id ) { return PJ_SUCCESS; } -PJ_DEF (const char*) pj_exception_id_name (pj_exception_id_t id) +PJ_DEF(const char*) pj_exception_id_name(pj_exception_id_t id) { return ""; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp index 4acbd9619b6c0e66565af39076dfe987b65090a3..c436d4c45836f7c21e5b7bd6930eba005942d01d 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: ioqueue_symbian.cpp 2771 2009-06-17 13:31:13Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/ioqueue.h> #include <pj/assert.h> @@ -32,8 +32,8 @@ class CIoqueueCallback; /* * IO Queue structure. */ - -struct pj_ioqueue_t { +struct pj_ioqueue_t +{ int eventCount; }; @@ -41,144 +41,148 @@ struct pj_ioqueue_t { ///////////////////////////////////////////////////////////////////////////// // Class to encapsulate asynchronous socket operation. // - class CIoqueueCallback : public CActive { +public: + static CIoqueueCallback* NewL(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_sock_t sock, + const pj_ioqueue_callback *cb, + void *user_data); + + // + // Start asynchronous recv() operation + // + pj_status_t StartRead(pj_ioqueue_op_key_t *op_key, + void *buf, pj_ssize_t *size, unsigned flags, + pj_sockaddr_t *addr, int *addrlen); + + // + // Start asynchronous accept() operation. + // + pj_status_t StartAccept(pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen ); + + // + // Completion callback. + // + void RunL(); + + // + // CActive's DoCancel() + // + void DoCancel(); + + // + // Cancel operation and call callback. + // + void CancelOperation(pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status); + + // + // Accessors + // + void* get_user_data() const + { + return user_data_; + } + void set_user_data(void *user_data) + { + user_data_ = user_data; + } + pj_ioqueue_op_key_t *get_op_key() const + { + return pending_data_.common_.op_key_; + } + CPjSocket* get_pj_socket() + { + return sock_; + } + +private: + // Type of pending operation. + enum Type { + TYPE_NONE, + TYPE_READ, + TYPE_ACCEPT, + }; + + // Static data. + pj_ioqueue_t *ioqueue_; + pj_ioqueue_key_t *key_; + CPjSocket *sock_; + pj_ioqueue_callback cb_; + void *user_data_; + + // Symbian data. + TPtr8 aBufferPtr_; + TInetAddr aAddress_; + + // Application data. + Type type_; + + union Pending_Data + { + struct Common + { + pj_ioqueue_op_key_t *op_key_; + } common_; + + struct Pending_Read + { + pj_ioqueue_op_key_t *op_key_; + pj_sockaddr_t *addr_; + int *addrlen_; + } read_; + + struct Pending_Accept + { + pj_ioqueue_op_key_t *op_key_; + pj_sock_t *new_sock_; + pj_sockaddr_t *local_; + pj_sockaddr_t *remote_; + int *addrlen_; + } accept_; + }; + + union Pending_Data pending_data_; + RSocket blank_sock_; + + CIoqueueCallback(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, pj_sock_t sock, + const pj_ioqueue_callback *cb, void *user_data) + : CActive(CActive::EPriorityStandard), + ioqueue_(ioqueue), key_(key), sock_((CPjSocket*)sock), + user_data_(user_data), aBufferPtr_(NULL, 0), type_(TYPE_NONE) + { + pj_memcpy(&cb_, cb, sizeof(*cb)); + } - public: - static CIoqueueCallback* NewL (pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, - pj_sock_t sock, - const pj_ioqueue_callback *cb, - void *user_data); - - // - // Start asynchronous recv() operation - // - pj_status_t StartRead (pj_ioqueue_op_key_t *op_key, - void *buf, pj_ssize_t *size, unsigned flags, - pj_sockaddr_t *addr, int *addrlen); - - // - // Start asynchronous accept() operation. - // - pj_status_t StartAccept (pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen); - - // - // Completion callback. - // - void RunL(); - - // - // CActive's DoCancel() - // - void DoCancel(); - - // - // Cancel operation and call callback. - // - void CancelOperation (pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status); - - // - // Accessors - // - void* get_user_data() const { - return user_data_; - } - - void set_user_data (void *user_data) { - user_data_ = user_data; - } - - pj_ioqueue_op_key_t *get_op_key() const { - return pending_data_.common_.op_key_; - } - - CPjSocket* get_pj_socket() { - return sock_; - } - - private: - // Type of pending operation. - enum Type { - TYPE_NONE, - TYPE_READ, - TYPE_ACCEPT, - }; - - // Static data. - pj_ioqueue_t *ioqueue_; - pj_ioqueue_key_t *key_; - CPjSocket *sock_; - pj_ioqueue_callback cb_; - void *user_data_; - - // Symbian data. - TPtr8 aBufferPtr_; - TInetAddr aAddress_; - - // Application data. - Type type_; - - union Pending_Data { - - struct Common { - pj_ioqueue_op_key_t *op_key_; - } common_; - - struct Pending_Read { - pj_ioqueue_op_key_t *op_key_; - pj_sockaddr_t *addr_; - int *addrlen_; - } read_; - - struct Pending_Accept { - pj_ioqueue_op_key_t *op_key_; - pj_sock_t *new_sock_; - pj_sockaddr_t *local_; - pj_sockaddr_t *remote_; - int *addrlen_; - } accept_; - }; - - union Pending_Data pending_data_; - RSocket blank_sock_; - - CIoqueueCallback (pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, pj_sock_t sock, - const pj_ioqueue_callback *cb, void *user_data) - : CActive (CActive::EPriorityStandard), - ioqueue_ (ioqueue), key_ (key), sock_ ( (CPjSocket*) sock), - user_data_ (user_data), aBufferPtr_ (NULL, 0), type_ (TYPE_NONE) { - pj_memcpy (&cb_, cb, sizeof (*cb)); - } - - - void ConstructL() { - CActiveScheduler::Add (this); - } - - void HandleReadCompletion(); - CPjSocket *HandleAcceptCompletion(); + + void ConstructL() + { + CActiveScheduler::Add(this); + } + + void HandleReadCompletion(); + CPjSocket *HandleAcceptCompletion(); }; -CIoqueueCallback* CIoqueueCallback::NewL (pj_ioqueue_t *ioqueue, - pj_ioqueue_key_t *key, - pj_sock_t sock, - const pj_ioqueue_callback *cb, - void *user_data) +CIoqueueCallback* CIoqueueCallback::NewL(pj_ioqueue_t *ioqueue, + pj_ioqueue_key_t *key, + pj_sock_t sock, + const pj_ioqueue_callback *cb, + void *user_data) { - CIoqueueCallback *self = new CIoqueueCallback (ioqueue, key, sock, - cb, user_data); - CleanupStack::PushL (self); + CIoqueueCallback *self = new CIoqueueCallback(ioqueue, key, sock, + cb, user_data); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } @@ -187,13 +191,13 @@ CIoqueueCallback* CIoqueueCallback::NewL (pj_ioqueue_t *ioqueue, // // Start asynchronous recv() operation // -pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, - void *buf, pj_ssize_t *size, - unsigned flags, - pj_sockaddr_t *addr, int *addrlen) +pj_status_t CIoqueueCallback::StartRead(pj_ioqueue_op_key_t *op_key, + void *buf, pj_ssize_t *size, + unsigned flags, + pj_sockaddr_t *addr, int *addrlen) { - PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY); - PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY); + PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); + PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; @@ -201,29 +205,27 @@ pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, pending_data_.read_.addr_ = addr; pending_data_.read_.addrlen_ = addrlen; - aBufferPtr_.Set ( (TUint8*) buf, 0, (TInt) *size); + aBufferPtr_.Set((TUint8*)buf, 0, (TInt)*size); type_ = TYPE_READ; - if (addr && addrlen) { - sock_->Socket().RecvFrom (aBufferPtr_, aAddress_, flags, iStatus); + sock_->Socket().RecvFrom(aBufferPtr_, aAddress_, flags, iStatus); } else { - aAddress_.SetAddress (0); - aAddress_.SetPort (0); - - if (sock_->IsDatagram()) { - sock_->Socket().Recv (aBufferPtr_, flags, iStatus); - } else { - // Using static like this is not pretty, but we don't need to use - // the value anyway, hence doing it like this is probably most - // optimal. - static TSockXfrLength len; - sock_->Socket().RecvOneOrMore (aBufferPtr_, flags, iStatus, len); - } + aAddress_.SetAddress(0); + aAddress_.SetPort(0); + + if (sock_->IsDatagram()) { + sock_->Socket().Recv(aBufferPtr_, flags, iStatus); + } else { + // Using static like this is not pretty, but we don't need to use + // the value anyway, hence doing it like this is probably most + // optimal. + static TSockXfrLength len; + sock_->Socket().RecvOneOrMore(aBufferPtr_, flags, iStatus, len); + } } SetActive(); - return PJ_EPENDING; } @@ -231,19 +233,19 @@ pj_status_t CIoqueueCallback::StartRead (pj_ioqueue_op_key_t *op_key, // // Start asynchronous accept() operation. // -pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen) +pj_status_t CIoqueueCallback::StartAccept(pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen ) { - PJ_ASSERT_RETURN (IsActive() ==false, PJ_EBUSY); - PJ_ASSERT_RETURN (pending_data_.common_.op_key_==NULL, PJ_EBUSY); + PJ_ASSERT_RETURN(IsActive()==false, PJ_EBUSY); + PJ_ASSERT_RETURN(pending_data_.common_.op_key_==NULL, PJ_EBUSY); // addrlen must be specified if local or remote is specified - PJ_ASSERT_RETURN ( (!local && !remote) || - (addrlen && *addrlen), PJ_EINVAL); - + PJ_ASSERT_RETURN((!local && !remote) || + (addrlen && *addrlen), PJ_EINVAL); + pending_data_.accept_.op_key_ = op_key; pending_data_.accept_.new_sock_ = new_sock; pending_data_.accept_.local_ = local; @@ -251,10 +253,10 @@ pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, pending_data_.accept_.addrlen_ = addrlen; // Create blank socket - blank_sock_.Open (PjSymbianOS::Instance()->SocketServ()); + blank_sock_.Open(PjSymbianOS::Instance()->SocketServ()); type_ = TYPE_ACCEPT; - sock_->Socket().Accept (blank_sock_, iStatus); + sock_->Socket().Accept(blank_sock_, iStatus); SetActive(); return PJ_EPENDING; @@ -264,16 +266,16 @@ pj_status_t CIoqueueCallback::StartAccept (pj_ioqueue_op_key_t *op_key, // // Handle asynchronous RecvFrom() completion // -void CIoqueueCallback::HandleReadCompletion() +void CIoqueueCallback::HandleReadCompletion() { if (pending_data_.read_.addr_ && pending_data_.read_.addrlen_) { - PjSymbianOS::Addr2pj (aAddress_, - * (pj_sockaddr*) pending_data_.read_.addr_, - pending_data_.read_.addrlen_); - pending_data_.read_.addr_ = NULL; - pending_data_.read_.addrlen_ = NULL; + PjSymbianOS::Addr2pj(aAddress_, + *(pj_sockaddr*)pending_data_.read_.addr_, + pending_data_.read_.addrlen_); + pending_data_.read_.addr_ = NULL; + pending_data_.read_.addrlen_ = NULL; } - + pending_data_.read_.op_key_ = NULL; } @@ -281,57 +283,55 @@ void CIoqueueCallback::HandleReadCompletion() // // Handle asynchronous Accept() completion. // -CPjSocket *CIoqueueCallback::HandleAcceptCompletion() +CPjSocket *CIoqueueCallback::HandleAcceptCompletion() { - CPjSocket *pjNewSock = new CPjSocket (get_pj_socket()->GetAf(), - get_pj_socket()->GetSockType(), - blank_sock_); - int addrlen = 0; - - if (pending_data_.accept_.new_sock_) { - *pending_data_.accept_.new_sock_ = (pj_sock_t) pjNewSock; - pending_data_.accept_.new_sock_ = NULL; - } - - if (pending_data_.accept_.local_) { - TInetAddr aAddr; - pj_sockaddr *ptr_sockaddr; - - blank_sock_.LocalName (aAddr); - ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.local_; - addrlen = *pending_data_.accept_.addrlen_; - PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen); - pending_data_.accept_.local_ = NULL; - } - - if (pending_data_.accept_.remote_) { - TInetAddr aAddr; - pj_sockaddr *ptr_sockaddr; - - blank_sock_.RemoteName (aAddr); - ptr_sockaddr = (pj_sockaddr*) pending_data_.accept_.remote_; - addrlen = *pending_data_.accept_.addrlen_; - PjSymbianOS::Addr2pj (aAddr, *ptr_sockaddr, &addrlen); - pending_data_.accept_.remote_ = NULL; - } - - if (pending_data_.accept_.addrlen_) { - if (addrlen == 0) { - if (pjNewSock->GetAf() == PJ_AF_INET) - addrlen = sizeof (pj_sockaddr_in); - else if (pjNewSock->GetAf() == PJ_AF_INET6) - addrlen = sizeof (pj_sockaddr_in6); - else { - pj_assert (!"Unsupported address family"); - } - } - - *pending_data_.accept_.addrlen_ = addrlen; - - pending_data_.accept_.addrlen_ = NULL; - } - - return pjNewSock; + CPjSocket *pjNewSock = new CPjSocket(get_pj_socket()->GetAf(), + get_pj_socket()->GetSockType(), + blank_sock_); + int addrlen = 0; + + if (pending_data_.accept_.new_sock_) { + *pending_data_.accept_.new_sock_ = (pj_sock_t)pjNewSock; + pending_data_.accept_.new_sock_ = NULL; + } + + if (pending_data_.accept_.local_) { + TInetAddr aAddr; + pj_sockaddr *ptr_sockaddr; + + blank_sock_.LocalName(aAddr); + ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.local_; + addrlen = *pending_data_.accept_.addrlen_; + PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen); + pending_data_.accept_.local_ = NULL; + } + + if (pending_data_.accept_.remote_) { + TInetAddr aAddr; + pj_sockaddr *ptr_sockaddr; + + blank_sock_.RemoteName(aAddr); + ptr_sockaddr = (pj_sockaddr*)pending_data_.accept_.remote_; + addrlen = *pending_data_.accept_.addrlen_; + PjSymbianOS::Addr2pj(aAddr, *ptr_sockaddr, &addrlen); + pending_data_.accept_.remote_ = NULL; + } + + if (pending_data_.accept_.addrlen_) { + if (addrlen == 0) { + if (pjNewSock->GetAf() == PJ_AF_INET) + addrlen = sizeof(pj_sockaddr_in); + else if (pjNewSock->GetAf() == PJ_AF_INET6) + addrlen = sizeof(pj_sockaddr_in6); + else { + pj_assert(!"Unsupported address family"); + } + } + *pending_data_.accept_.addrlen_ = addrlen; + pending_data_.accept_.addrlen_ = NULL; + } + + return pjNewSock; } @@ -345,64 +345,58 @@ void CIoqueueCallback::RunL() type_ = TYPE_NONE; if (cur_type == TYPE_READ) { - // - // Completion of asynchronous RecvFrom() - // - - /* Clear op_key (save it to temp variable first!) */ - pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; - pending_data_.read_.op_key_ = NULL; - - // Handle failure condition - - if (iStatus != KErrNone) { - if (cb_.on_read_complete) { - cb_.on_read_complete (key_, op_key, - -PJ_RETURN_OS_ERROR (iStatus.Int())); - } - - return; - } - - HandleReadCompletion(); - - /* Call callback */ - - if (cb_.on_read_complete) { - cb_.on_read_complete (key_, op_key, aBufferPtr_.Length()); - } + // + // Completion of asynchronous RecvFrom() + // + + /* Clear op_key (save it to temp variable first!) */ + pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; + pending_data_.read_.op_key_ = NULL; + + // Handle failure condition + if (iStatus != KErrNone) { + if (cb_.on_read_complete) { + cb_.on_read_complete( key_, op_key, + -PJ_RETURN_OS_ERROR(iStatus.Int())); + } + return; + } + + HandleReadCompletion(); + + /* Call callback */ + if (cb_.on_read_complete) { + cb_.on_read_complete(key_, op_key, aBufferPtr_.Length()); + } } else if (cur_type == TYPE_ACCEPT) { - // - // Completion of asynchronous Accept() - // - - /* Clear op_key (save it to temp variable first!) */ - pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; - pending_data_.read_.op_key_ = NULL; - - // Handle failure condition - - if (iStatus != KErrNone) { - if (pending_data_.accept_.new_sock_) - *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; - - if (cb_.on_accept_complete) { - cb_.on_accept_complete (key_, op_key, PJ_INVALID_SOCKET, - -PJ_RETURN_OS_ERROR (iStatus.Int())); - } - - return; - } - - CPjSocket *pjNewSock = HandleAcceptCompletion(); - - // Call callback. - - if (cb_.on_accept_complete) { - cb_.on_accept_complete (key_, op_key, (pj_sock_t) pjNewSock, - PJ_SUCCESS); - } + // + // Completion of asynchronous Accept() + // + + /* Clear op_key (save it to temp variable first!) */ + pj_ioqueue_op_key_t *op_key = pending_data_.read_.op_key_; + pending_data_.read_.op_key_ = NULL; + + // Handle failure condition + if (iStatus != KErrNone) { + if (pending_data_.accept_.new_sock_) + *pending_data_.accept_.new_sock_ = PJ_INVALID_SOCKET; + + if (cb_.on_accept_complete) { + cb_.on_accept_complete( key_, op_key, PJ_INVALID_SOCKET, + -PJ_RETURN_OS_ERROR(iStatus.Int())); + } + return; + } + + CPjSocket *pjNewSock = HandleAcceptCompletion(); + + // Call callback. + if (cb_.on_accept_complete) { + cb_.on_accept_complete( key_, op_key, (pj_sock_t)pjNewSock, + PJ_SUCCESS); + } } ioqueue_->eventCount++; @@ -414,32 +408,31 @@ void CIoqueueCallback::RunL() void CIoqueueCallback::DoCancel() { if (type_ == TYPE_READ) - sock_->Socket().CancelRecv(); + sock_->Socket().CancelRecv(); else if (type_ == TYPE_ACCEPT) - sock_->Socket().CancelAccept(); + sock_->Socket().CancelAccept(); type_ = TYPE_NONE; - pending_data_.common_.op_key_ = NULL; } // // Cancel operation and call callback. // -void CIoqueueCallback::CancelOperation (pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status) +void CIoqueueCallback::CancelOperation(pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status) { Type cur_type = type_; - pj_assert (op_key == pending_data_.common_.op_key_); + pj_assert(op_key == pending_data_.common_.op_key_); Cancel(); if (cur_type == TYPE_READ) { - if (cb_.on_read_complete) - cb_.on_read_complete (key_, op_key, bytes_status); + if (cb_.on_read_complete) + cb_.on_read_complete(key_, op_key, bytes_status); } else if (cur_type == TYPE_ACCEPT) - ; + ; } @@ -447,8 +440,8 @@ void CIoqueueCallback::CancelOperation (pj_ioqueue_op_key_t *op_key, /* * IO Queue key structure. */ - -struct pj_ioqueue_key_t { +struct pj_ioqueue_key_t +{ CIoqueueCallback *cbObj; }; @@ -456,7 +449,7 @@ struct pj_ioqueue_key_t { /* * Return the name of the ioqueue implementation. */ -PJ_DEF (const char*) pj_ioqueue_name (void) +PJ_DEF(const char*) pj_ioqueue_name(void) { return "ioqueue-symbian"; } @@ -465,15 +458,15 @@ PJ_DEF (const char*) pj_ioqueue_name (void) /* * Create a new I/O Queue framework. */ -PJ_DEF (pj_status_t) pj_ioqueue_create (pj_pool_t *pool, - pj_size_t max_fd, - pj_ioqueue_t **p_ioqueue) +PJ_DEF(pj_status_t) pj_ioqueue_create( pj_pool_t *pool, + pj_size_t max_fd, + pj_ioqueue_t **p_ioqueue) { pj_ioqueue_t *ioq; - PJ_UNUSED_ARG (max_fd); + PJ_UNUSED_ARG(max_fd); - ioq = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_t); + ioq = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_t); *p_ioqueue = ioq; return PJ_SUCCESS; } @@ -482,80 +475,79 @@ PJ_DEF (pj_status_t) pj_ioqueue_create (pj_pool_t *pool, /* * Destroy the I/O queue. */ -PJ_DEF (pj_status_t) pj_ioqueue_destroy (pj_ioqueue_t *ioq) +PJ_DEF(pj_status_t) pj_ioqueue_destroy( pj_ioqueue_t *ioq ) { - PJ_UNUSED_ARG (ioq); + PJ_UNUSED_ARG(ioq); return PJ_SUCCESS; } /* - * Set the lock object to be used by the I/O Queue. + * Set the lock object to be used by the I/O Queue. */ -PJ_DEF (pj_status_t) pj_ioqueue_set_lock (pj_ioqueue_t *ioq, - pj_lock_t *lock, - pj_bool_t auto_delete) +PJ_DEF(pj_status_t) pj_ioqueue_set_lock( pj_ioqueue_t *ioq, + pj_lock_t *lock, + pj_bool_t auto_delete ) { /* Don't really need lock for now */ - PJ_UNUSED_ARG (ioq); - + PJ_UNUSED_ARG(ioq); + if (auto_delete) { - pj_lock_destroy (lock); + pj_lock_destroy(lock); } return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_set_default_concurrency (pj_ioqueue_t *ioqueue, - pj_bool_t allow) +PJ_DEF(pj_status_t) pj_ioqueue_set_default_concurrency(pj_ioqueue_t *ioqueue, + pj_bool_t allow) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (ioqueue); - PJ_UNUSED_ARG (allow); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(ioqueue); + PJ_UNUSED_ARG(allow); + return PJ_SUCCESS; } /* - * Register a socket to the I/O queue framework. + * Register a socket to the I/O queue framework. */ -PJ_DEF (pj_status_t) pj_ioqueue_register_sock (pj_pool_t *pool, - pj_ioqueue_t *ioq, - pj_sock_t sock, - void *user_data, - const pj_ioqueue_callback *cb, - pj_ioqueue_key_t **p_key) +PJ_DEF(pj_status_t) pj_ioqueue_register_sock( pj_pool_t *pool, + pj_ioqueue_t *ioq, + pj_sock_t sock, + void *user_data, + const pj_ioqueue_callback *cb, + pj_ioqueue_key_t **p_key ) { pj_ioqueue_key_t *key; - key = PJ_POOL_ZALLOC_T (pool, pj_ioqueue_key_t); - key->cbObj = CIoqueueCallback::NewL (ioq, key, sock, cb, user_data); + key = PJ_POOL_ZALLOC_T(pool, pj_ioqueue_key_t); + key->cbObj = CIoqueueCallback::NewL(ioq, key, sock, cb, user_data); *p_key = key; return PJ_SUCCESS; } /* - * Unregister from the I/O Queue framework. + * Unregister from the I/O Queue framework. */ -PJ_DEF (pj_status_t) pj_ioqueue_unregister (pj_ioqueue_key_t *key) +PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key ) { if (key == NULL || key->cbObj == NULL) - return PJ_SUCCESS; + return PJ_SUCCESS; // Cancel pending async object if (key->cbObj) { - key->cbObj->Cancel(); + key->cbObj->Cancel(); } // Close socket. key->cbObj->get_pj_socket()->Socket().Close(); - delete key->cbObj->get_pj_socket(); // Delete async object. if (key->cbObj) { - delete key->cbObj; - key->cbObj = NULL; + delete key->cbObj; + key->cbObj = NULL; } return PJ_SUCCESS; @@ -565,7 +557,7 @@ PJ_DEF (pj_status_t) pj_ioqueue_unregister (pj_ioqueue_key_t *key) /* * Get user data associated with an ioqueue key. */ -PJ_DEF (void*) pj_ioqueue_get_user_data (pj_ioqueue_key_t *key) +PJ_DEF(void*) pj_ioqueue_get_user_data( pj_ioqueue_key_t *key ) { return key->cbObj->get_user_data(); } @@ -575,14 +567,13 @@ PJ_DEF (void*) pj_ioqueue_get_user_data (pj_ioqueue_key_t *key) * Set or change the user data to be associated with the file descriptor or * handle or socket descriptor. */ -PJ_DEF (pj_status_t) pj_ioqueue_set_user_data (pj_ioqueue_key_t *key, - void *user_data, - void **old_data) +PJ_DEF(pj_status_t) pj_ioqueue_set_user_data( pj_ioqueue_key_t *key, + void *user_data, + void **old_data) { if (old_data) - *old_data = key->cbObj->get_user_data(); - - key->cbObj->set_user_data (user_data); + *old_data = key->cbObj->get_user_data(); + key->cbObj->set_user_data(user_data); return PJ_SUCCESS; } @@ -591,91 +582,88 @@ PJ_DEF (pj_status_t) pj_ioqueue_set_user_data (pj_ioqueue_key_t *key, /* * Initialize operation key. */ -PJ_DEF (void) pj_ioqueue_op_key_init (pj_ioqueue_op_key_t *op_key, - pj_size_t size) +PJ_DEF(void) pj_ioqueue_op_key_init( pj_ioqueue_op_key_t *op_key, + pj_size_t size ) { - pj_bzero (op_key, size); + pj_bzero(op_key, size); } /* * Check if operation is pending on the specified operation key. */ -PJ_DEF (pj_bool_t) pj_ioqueue_is_pending (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key) +PJ_DEF(pj_bool_t) pj_ioqueue_is_pending( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key ) { - return key->cbObj->get_op_key() ==op_key && - key->cbObj->IsActive(); + return key->cbObj->get_op_key()==op_key && + key->cbObj->IsActive(); } /* * Post completion status to the specified operation key and call the - * appropriate callback. + * appropriate callback. */ -PJ_DEF (pj_status_t) pj_ioqueue_post_completion (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - pj_ssize_t bytes_status) +PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_status ) { - if (pj_ioqueue_is_pending (key, op_key)) { - key->cbObj->CancelOperation (op_key, bytes_status); + if (pj_ioqueue_is_pending(key, op_key)) { + key->cbObj->CancelOperation(op_key, bytes_status); } - return PJ_SUCCESS; } #if defined(PJ_HAS_TCP) && PJ_HAS_TCP != 0 /** - * Instruct I/O Queue to accept incoming connection on the specified + * Instruct I/O Queue to accept incoming connection on the specified * listening socket. */ -PJ_DEF (pj_status_t) pj_ioqueue_accept (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - pj_sock_t *new_sock, - pj_sockaddr_t *local, - pj_sockaddr_t *remote, - int *addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + pj_sock_t *new_sock, + pj_sockaddr_t *local, + pj_sockaddr_t *remote, + int *addrlen ) { - - return key->cbObj->StartAccept (op_key, new_sock, local, remote, addrlen); + + return key->cbObj->StartAccept(op_key, new_sock, local, remote, addrlen); } /* * Initiate non-blocking socket connect. */ -PJ_DEF (pj_status_t) pj_ioqueue_connect (pj_ioqueue_key_t *key, - const pj_sockaddr_t *addr, - int addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key, + const pj_sockaddr_t *addr, + int addrlen ) { pj_status_t status; - + RSocket &rSock = key->cbObj->get_pj_socket()->Socket(); TInetAddr inetAddr; TRequestStatus reqStatus; // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - + // Convert address - status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen, - inetAddr); - + status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, + inetAddr); if (status != PJ_SUCCESS) - return status; - + return status; + // We don't support async connect for now. - PJ_TODO (IOQUEUE_SUPPORT_ASYNC_CONNECT); + PJ_TODO(IOQUEUE_SUPPORT_ASYNC_CONNECT); - rSock.Connect (inetAddr, reqStatus); - - User::WaitForRequest (reqStatus); + rSock.Connect(inetAddr, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) - return PJ_SUCCESS; + return PJ_SUCCESS; - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } @@ -684,14 +672,14 @@ PJ_DEF (pj_status_t) pj_ioqueue_connect (pj_ioqueue_key_t *key, /* * Poll the I/O Queue for completed events. */ -PJ_DEF (int) pj_ioqueue_poll (pj_ioqueue_t *ioq, - const pj_time_val *timeout) +PJ_DEF(int) pj_ioqueue_poll( pj_ioqueue_t *ioq, + const pj_time_val *timeout) { /* Polling is not necessary on Symbian, since all async activities * are registered to active scheduler. */ - PJ_UNUSED_ARG (ioq); - PJ_UNUSED_ARG (timeout); + PJ_UNUSED_ARG(ioq); + PJ_UNUSED_ARG(timeout); return 0; } @@ -699,20 +687,19 @@ PJ_DEF (int) pj_ioqueue_poll (pj_ioqueue_t *ioq, /* * Instruct the I/O Queue to read from the specified handle. */ -PJ_DEF (pj_status_t) pj_ioqueue_recv (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - void *buffer, - pj_ssize_t *length, - pj_uint32_t flags) +PJ_DEF(pj_status_t) pj_ioqueue_recv( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + void *buffer, + pj_ssize_t *length, + pj_uint32_t flags ) { // If socket has reader, delete it. if (key->cbObj->get_pj_socket()->Reader()) - key->cbObj->get_pj_socket()->DestroyReader(); - + key->cbObj->get_pj_socket()->DestroyReader(); + // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - return key->cbObj->StartRead (op_key, buffer, length, flags, NULL, NULL); + return key->cbObj->StartRead(op_key, buffer, length, flags, NULL, NULL); } @@ -721,60 +708,57 @@ PJ_DEF (pj_status_t) pj_ioqueue_recv (pj_ioqueue_key_t *key, * normally called for socket, and the remote address will also be returned * along with the data. */ -PJ_DEF (pj_status_t) pj_ioqueue_recvfrom (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - void *buffer, - pj_ssize_t *length, - pj_uint32_t flags, - pj_sockaddr_t *addr, - int *addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_recvfrom( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + void *buffer, + pj_ssize_t *length, + pj_uint32_t flags, + pj_sockaddr_t *addr, + int *addrlen) { CPjSocket *sock = key->cbObj->get_pj_socket(); - + // If address is specified, check that the length match the // address family - if (addr || addrlen) { - PJ_ASSERT_RETURN (addr && addrlen && *addrlen, PJ_EINVAL); - - if (sock->GetAf() == PJ_AF_INET) { - PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); - } else if (sock->GetAf() == PJ_AF_INET6) { - PJ_ASSERT_RETURN (*addrlen>= (int) sizeof (pj_sockaddr_in6), PJ_EINVAL); - } + PJ_ASSERT_RETURN(addr && addrlen && *addrlen, PJ_EINVAL); + if (sock->GetAf() == PJ_AF_INET) { + PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); + } else if (sock->GetAf() == PJ_AF_INET6) { + PJ_ASSERT_RETURN(*addrlen>=(int)sizeof(pj_sockaddr_in6), PJ_EINVAL); + } } - + // If socket has reader, delete it. if (sock->Reader()) - sock->DestroyReader(); - + sock->DestroyReader(); + if (key->cbObj->IsActive()) - return PJ_EBUSY; + return PJ_EBUSY; // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - - return key->cbObj->StartRead (op_key, buffer, length, flags, addr, addrlen); + return key->cbObj->StartRead(op_key, buffer, length, flags, addr, addrlen); } /* * Instruct the I/O Queue to write to the handle. */ -PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - const void *data, - pj_ssize_t *length, - pj_uint32_t flags) +PJ_DEF(pj_status_t) pj_ioqueue_send( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + const void *data, + pj_ssize_t *length, + pj_uint32_t flags ) { TRequestStatus reqStatus; - TPtrC8 aBuffer ( (const TUint8*) data, (TInt) *length); + TPtrC8 aBuffer((const TUint8*)data, (TInt)*length); TSockXfrLength aLen; - - PJ_UNUSED_ARG (op_key); + + PJ_UNUSED_ARG(op_key); // Forcing pending operation is not supported. - PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL); + PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); @@ -782,11 +766,11 @@ PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - key->cbObj->get_pj_socket()->Socket().Send (aBuffer, flags, reqStatus, aLen); - User::WaitForRequest (reqStatus); + key->cbObj->get_pj_socket()->Socket().Send(aBuffer, flags, reqStatus, aLen); + User::WaitForRequest(reqStatus); if (reqStatus.Int() != KErrNone) - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); //At least in UIQ Emulator, aLen.Length() reports incorrect length //for UDP (some newlc.com users seem to have reported this too). @@ -798,48 +782,45 @@ PJ_DEF (pj_status_t) pj_ioqueue_send (pj_ioqueue_key_t *key, /* * Instruct the I/O Queue to write to the handle. */ -PJ_DEF (pj_status_t) pj_ioqueue_sendto (pj_ioqueue_key_t *key, - pj_ioqueue_op_key_t *op_key, - const void *data, - pj_ssize_t *length, - pj_uint32_t flags, - const pj_sockaddr_t *addr, - int addrlen) +PJ_DEF(pj_status_t) pj_ioqueue_sendto( pj_ioqueue_key_t *key, + pj_ioqueue_op_key_t *op_key, + const void *data, + pj_ssize_t *length, + pj_uint32_t flags, + const pj_sockaddr_t *addr, + int addrlen) { TRequestStatus reqStatus; TPtrC8 aBuffer; TInetAddr inetAddr; TSockXfrLength aLen; pj_status_t status; - - PJ_UNUSED_ARG (op_key); + + PJ_UNUSED_ARG(op_key); // Forcing pending operation is not supported. - PJ_ASSERT_RETURN ( (flags & PJ_IOQUEUE_ALWAYS_ASYNC) ==0, PJ_EINVAL); + PJ_ASSERT_RETURN((flags & PJ_IOQUEUE_ALWAYS_ASYNC)==0, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); // Convert address - status = PjSymbianOS::pj2Addr (* (const pj_sockaddr*) addr, addrlen, - inetAddr); - + status = PjSymbianOS::pj2Addr(*(const pj_sockaddr*)addr, addrlen, + inetAddr); if (status != PJ_SUCCESS) - return status; - + return status; + // Clear flag flags &= ~PJ_IOQUEUE_ALWAYS_ASYNC; - aBuffer.Set ( (const TUint8*) data, (TInt) *length); - + aBuffer.Set((const TUint8*)data, (TInt)*length); CPjSocket *pjSock = key->cbObj->get_pj_socket(); - pjSock->Socket().SendTo (aBuffer, inetAddr, flags, reqStatus, aLen); - - User::WaitForRequest (reqStatus); + pjSock->Socket().SendTo(aBuffer, inetAddr, flags, reqStatus, aLen); + User::WaitForRequest(reqStatus); if (reqStatus.Int() != KErrNone) - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); //At least in UIQ Emulator, aLen.Length() reports incorrect length //for UDP (some newlc.com users seem to have reported this too). @@ -847,25 +828,25 @@ PJ_DEF (pj_status_t) pj_ioqueue_sendto (pj_ioqueue_key_t *key, return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_set_concurrency (pj_ioqueue_key_t *key, - pj_bool_t allow) +PJ_DEF(pj_status_t) pj_ioqueue_set_concurrency(pj_ioqueue_key_t *key, + pj_bool_t allow) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (key); - PJ_UNUSED_ARG (allow); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(key); + PJ_UNUSED_ARG(allow); + return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_lock_key (pj_ioqueue_key_t *key) +PJ_DEF(pj_status_t) pj_ioqueue_lock_key(pj_ioqueue_key_t *key) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (key); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(key); + return PJ_SUCCESS; } -PJ_DEF (pj_status_t) pj_ioqueue_unlock_key (pj_ioqueue_key_t *key) +PJ_DEF(pj_status_t) pj_ioqueue_unlock_key(pj_ioqueue_key_t *key) { - /* Not supported, just return PJ_SUCCESS silently */ - PJ_UNUSED_ARG (key); - return PJ_SUCCESS; + /* Not supported, just return PJ_SUCCESS silently */ + PJ_UNUSED_ARG(key); + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c index 1d0e7e06fd9a1aa5dd6b7180bf0ec4d42db31f6e..f9bd1a60dd0ccd4525c5a12cd8d1832d1eee342b 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ioqueue_winnt.c @@ -1,4 +1,4 @@ -/* $Id: ioqueue_winnt.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ioqueue_winnt.c 3051 2010-01-08 13:08:05Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -167,14 +167,27 @@ static void scan_closing_keys(pj_ioqueue_t *ioqueue); /* * Process the socket when the overlapped accept() completed. */ -static void ioqueue_on_accept_complete(ioqueue_accept_rec *accept_overlapped) +static void ioqueue_on_accept_complete(pj_ioqueue_key_t *key, + ioqueue_accept_rec *accept_overlapped) { struct sockaddr *local; struct sockaddr *remote; int locallen, remotelen; + pj_status_t status; PJ_CHECK_STACK(); + /* On WinXP or later, use SO_UPDATE_ACCEPT_CONTEXT so that socket + * addresses can be obtained with getsockname() and getpeername(). + */ + status = setsockopt(accept_overlapped->newsock, SOL_SOCKET, + SO_UPDATE_ACCEPT_CONTEXT, + (char*)&key->hnd, + sizeof(SOCKET)); + /* SO_UPDATE_ACCEPT_CONTEXT is for WinXP or later. + * So ignore the error status. + */ + /* Operation complete immediately. */ if (accept_overlapped->addrlen) { GetAcceptExSockaddrs( accept_overlapped->accept_buf, @@ -706,7 +719,7 @@ static pj_bool_t poll_iocp( HANDLE hIocp, DWORD dwTimeout, #if PJ_HAS_TCP case PJ_IOQUEUE_OP_ACCEPT: /* special case for accept. */ - ioqueue_on_accept_complete((ioqueue_accept_rec*)pOv); + ioqueue_on_accept_complete(key, (ioqueue_accept_rec*)pOv); if (key->cb.on_accept_complete) { ioqueue_accept_rec *accept_rec = (ioqueue_accept_rec*)pOv; pj_status_t status = PJ_SUCCESS; @@ -1208,14 +1221,25 @@ PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, sock = WSAAccept((SOCKET)key->hnd, remote, addrlen, NULL, 0); if (sock != INVALID_SOCKET) { /* Yes! New socket is available! */ - int status; - - status = getsockname(sock, local, addrlen); - if (status != 0) { - DWORD dwError = WSAGetLastError(); - closesocket(sock); - return PJ_RETURN_OS_ERROR(dwError); - } + if (local && addrlen) { + int status; + + /* On WinXP or later, use SO_UPDATE_ACCEPT_CONTEXT so that socket + * addresses can be obtained with getsockname() and getpeername(). + */ + status = setsockopt(sock, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, + (char*)&key->hnd, sizeof(SOCKET)); + /* SO_UPDATE_ACCEPT_CONTEXT is for WinXP or later. + * So ignore the error status. + */ + + status = getsockname(sock, local, addrlen); + if (status != 0) { + DWORD dwError = WSAGetLastError(); + closesocket(sock); + return PJ_RETURN_OS_ERROR(dwError); + } + } *new_sock = sock; return PJ_SUCCESS; @@ -1238,16 +1262,6 @@ PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, if (status != PJ_SUCCESS) return status; - /* On WinXP or later, use SO_UPDATE_ACCEPT_CONTEXT so that socket - * addresses can be obtained with getsockname() and getpeername(). - */ - status = setsockopt(op_key_rec->accept.newsock, SOL_SOCKET, - SO_UPDATE_ACCEPT_CONTEXT, - (char*)&key->hnd, sizeof(SOCKET)); - /* SO_UPDATE_ACCEPT_CONTEXT is for WinXP or later. - * So ignore the error status. - */ - op_key_rec->accept.operation = PJ_IOQUEUE_OP_ACCEPT; op_key_rec->accept.addrlen = addrlen; op_key_rec->accept.local = local; @@ -1263,7 +1277,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_accept( pj_ioqueue_key_t *key, &op_key_rec->accept.overlapped ); if (rc == TRUE) { - ioqueue_on_accept_complete(&op_key_rec->accept); + ioqueue_on_accept_complete(key, &op_key_rec->accept); return PJ_SUCCESS; } else { DWORD dwStatus = WSAGetLastError(); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c index ea67e5d9a0731fe9ce0eab45f5fdabfcfa59c0f0..d9f98694f73ee16b04d249724859aa62d8488da0 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_generic.c @@ -1,4 +1,4 @@ -/* $Id: ip_helper_generic.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ip_helper_generic.c 3044 2010-01-04 16:54:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -121,6 +121,7 @@ static pj_status_t if_enum_by_af(int af, pj_bzero(&ifs[*p_cnt], sizeof(ifs[0])); pj_memcpy(&ifs[*p_cnt], ad, pj_sockaddr_get_len(ad)); + PJ_SOCKADDR_RESET_LEN(&ifs[*p_cnt]); (*p_cnt)++; } @@ -215,6 +216,7 @@ static pj_status_t if_enum_by_af(int af, pj_bzero(&ifs[*p_cnt], sizeof(ifs[0])); pj_memcpy(&ifs[*p_cnt], ad, pj_sockaddr_get_len(ad)); + PJ_SOCKADDR_RESET_LEN(&ifs[*p_cnt]); (*p_cnt)++; } @@ -305,6 +307,7 @@ static pj_status_t if_enum_by_af(int af, unsigned *p_cnt, pj_sockaddr ifs[]) pj_bzero(&ifs[*p_cnt], sizeof(ifs[0])); pj_memcpy(&ifs[*p_cnt], ad, pj_sockaddr_get_len(ad)); + PJ_SOCKADDR_RESET_LEN(&ifs[*p_cnt]); (*p_cnt)++; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp index 3cf3845870b18cd5c36fc34521f947dad2721b60..9f634a0b8b152df42b2736a63ca1a612d8028edb 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: ip_helper_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/ip_helper.h> #include <pj/addr_resolv.h> @@ -31,123 +31,119 @@ #define THIS_FILE "ip_helper_symbian.cpp" #define TRACE_ME 0 -static pj_status_t rsock_enum_interface (int af, - unsigned *p_cnt, - pj_sockaddr ifs[]) +static pj_status_t rsock_enum_interface(int af, + unsigned *p_cnt, + pj_sockaddr ifs[]) { TInt rc; RSocket rSock; TPckgBuf<TSoInetInterfaceInfo> info; unsigned i; - + if (PjSymbianOS::Instance()->Connection()) { - - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, PJ_SOCK_DGRAM, KProtocolInetUdp, - *PjSymbianOS::Instance()->Connection()); + + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, PJ_SOCK_DGRAM, KProtocolInetUdp, + *PjSymbianOS::Instance()->Connection()); } else { - - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, PJ_SOCK_DGRAM, KProtocolInetUdp); - + + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, PJ_SOCK_DGRAM, KProtocolInetUdp); + } - + if (rc != KErrNone) - return PJ_RETURN_OS_ERROR (rc); - - rSock.SetOpt (KSoInetEnumInterfaces, KSolInetIfCtrl); - + return PJ_RETURN_OS_ERROR(rc); + + rSock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl); + for (i=0; i<*p_cnt && - rSock.GetOpt (KSoInetNextInterface, KSolInetIfCtrl, - info) == KErrNone;) { - TInetAddr &iAddress = info().iAddress; - int namelen; + rSock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, + info) == KErrNone; ) + { + TInetAddr &iAddress = info().iAddress; + int namelen; #if TRACE_ME - - if (1) { - pj_sockaddr a; - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - - namelen = sizeof (pj_sockaddr); - - if (PjSymbianOS::Addr2pj (iAddress, a, &namelen, - PJ_FALSE) == PJ_SUCCESS) { - PJ_LOG (5, (THIS_FILE, "Enum: found address %s", - pj_sockaddr_print (&a, ipaddr, sizeof (ipaddr), 2))); - } - } - + if (1) { + pj_sockaddr a; + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + + namelen = sizeof(pj_sockaddr); + if (PjSymbianOS::Addr2pj(iAddress, a, &namelen, + PJ_FALSE) == PJ_SUCCESS) + { + PJ_LOG(5,(THIS_FILE, "Enum: found address %s", + pj_sockaddr_print(&a, ipaddr, sizeof(ipaddr), 2))); + } + } #endif - - namelen = sizeof (ifs[i]); - - if (PjSymbianOS::Addr2pj (iAddress, ifs[i], &namelen, - PJ_TRUE) != PJ_SUCCESS) { - continue; - } - - if (ifs[i].addr.sa_family != af) - continue; - - ++i; + + namelen = sizeof(ifs[i]); + if (PjSymbianOS::Addr2pj(iAddress, ifs[i], &namelen, + PJ_TRUE) != PJ_SUCCESS) + { + continue; + } + + if (ifs[i].addr.sa_family != af) + continue; + + ++i; } - + rSock.Close(); - + // Done *p_cnt = i; - + return PJ_SUCCESS; } - + /* * Enumerate the local IP interface currently active in the host. */ -PJ_DEF (pj_status_t) pj_enum_ip_interface (int af, - unsigned *p_cnt, - pj_sockaddr ifs[]) +PJ_DEF(pj_status_t) pj_enum_ip_interface(int af, + unsigned *p_cnt, + pj_sockaddr ifs[]) { unsigned start; pj_status_t status = PJ_SUCCESS; start = 0; - + /* Get IPv6 interface first. */ - if (af==PJ_AF_INET6 || af==PJ_AF_UNSPEC) { - unsigned max = *p_cnt; - status = rsock_enum_interface (PJ_AF_INET6, &max, &ifs[start]); - - if (status == PJ_SUCCESS) { - (*p_cnt) -= max; - start += max; - } + unsigned max = *p_cnt; + status = rsock_enum_interface(PJ_AF_INET6, &max, &ifs[start]); + if (status == PJ_SUCCESS) { + (*p_cnt) -= max; + start += max; + } } - + /* Get IPv4 interface. */ if (af==PJ_AF_INET || af==PJ_AF_UNSPEC) { - unsigned max = *p_cnt; - status = rsock_enum_interface (PJ_AF_INET, &max, &ifs[start]); - - if (status == PJ_SUCCESS) { - (*p_cnt) -= max; - start += max; - } + unsigned max = *p_cnt; + status = rsock_enum_interface(PJ_AF_INET, &max, &ifs[start]); + if (status == PJ_SUCCESS) { + (*p_cnt) -= max; + start += max; + } } - + *p_cnt = start; - + return start ? PJ_SUCCESS : PJ_ENOTFOUND; } /* * Enumerate the IP routing table for this host. */ -PJ_DEF (pj_status_t) pj_enum_ip_route (unsigned *p_cnt, - pj_ip_route_entry routes[]) +PJ_DEF(pj_status_t) pj_enum_ip_route(unsigned *p_cnt, + pj_ip_route_entry routes[]) { - PJ_ASSERT_RETURN (p_cnt && *p_cnt > 0 && routes, PJ_EINVAL); + PJ_ASSERT_RETURN(p_cnt && *p_cnt > 0 && routes, PJ_EINVAL); *p_cnt = 0; return PJ_ENOTSUP; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c index e02b6027e9071af1094a821f74474c9c966539bc..67168791ef11bd0d9beba742274e203b83390c01 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ip_helper_win32.c @@ -1,4 +1,4 @@ -/* $Id: ip_helper_win32.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ip_helper_win32.c 3040 2009-12-30 08:39:14Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -41,16 +41,53 @@ #include <pj/errno.h> #include <pj/string.h> +/* Dealing with Unicode quirks: + + There seems to be a difference with GetProcAddress() API signature between + Windows (i.e. Win32) and Windows CE (e.g. Windows Mobile). On Windows, the + API is declared as: + + FARPROC GetProcAddress( + HMODULE hModule, + LPCSTR lpProcName); + + while on Windows CE: + + FARPROC GetProcAddress( + HMODULE hModule, + LPCWSTR lpProcName); + + Notice the difference with lpProcName argument type. This means that on + Windows, even on Unicode Windows, the lpProcName always takes ANSI format, + while on Windows CE, the argument follows the UNICODE setting. + + Because of this, we use a different Unicode treatment here than the usual + PJ_NATIVE_STRING_IS_UNICODE PJLIB setting (<pj/unicode.h>): + - GPA_TEXT macro: convert literal string to platform's native literal + string + - gpa_char: the platform native character type + + Note that "GPA" and "gpa" are abbreviations for GetProcAddress. +*/ +#if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 + /* on CE, follow the PJLIB Unicode setting */ +# define GPA_TEXT(x) PJ_T(x) +# define gpa_char pj_char_t +#else + /* on non-CE, always use ANSI format */ +# define GPA_TEXT(x) x +# define gpa_char char +#endif + + typedef DWORD (WINAPI *PFN_GetIpAddrTable)(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder); -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 typedef DWORD (WINAPI *PFN_GetAdapterAddresses)(ULONG Family, ULONG Flags, PVOID Reserved, PIP_ADAPTER_ADDRESSES AdapterAddresses, PULONG SizePointer); -#endif /* PJ_HAS_IPV6 */ typedef DWORD (WINAPI *PFN_GetIpForwardTable)(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder); @@ -58,9 +95,7 @@ typedef DWORD (WINAPI *PFN_GetIfEntry)(PMIB_IFROW pIfRow); static HANDLE s_hDLL; static PFN_GetIpAddrTable s_pfnGetIpAddrTable; -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; -#endif /* PJ_HAS_IPV6 */ +static PFN_GetAdapterAddresses s_pfnGetAdapterAddresses; static PFN_GetIpForwardTable s_pfnGetIpForwardTable; static PFN_GetIfEntry s_pfnGetIfEntry; @@ -72,12 +107,10 @@ static void unload_iphlp_module(void) s_pfnGetIpAddrTable = NULL; s_pfnGetIpForwardTable = NULL; s_pfnGetIfEntry = NULL; -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 s_pfnGetAdapterAddresses = NULL; -#endif } -static FARPROC GetIpHlpApiProc(pj_char_t *lpProcName) +static FARPROC GetIpHlpApiProc(gpa_char *lpProcName) { if(NULL == s_hDLL) { s_hDLL = LoadLibrary(PJ_T("IpHlpApi")); @@ -98,7 +131,7 @@ static DWORD MyGetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, { if(NULL == s_pfnGetIpAddrTable) { s_pfnGetIpAddrTable = (PFN_GetIpAddrTable) - GetIpHlpApiProc(PJ_T("GetIpAddrTable")); + GetIpHlpApiProc(GPA_TEXT("GetIpAddrTable")); } if(NULL != s_pfnGetIpAddrTable) { @@ -108,7 +141,6 @@ static DWORD MyGetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, return ERROR_NOT_SUPPORTED; } -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 static DWORD MyGetAdapterAddresses(ULONG Family, ULONG Flags, PVOID Reserved, @@ -117,7 +149,7 @@ static DWORD MyGetAdapterAddresses(ULONG Family, { if(NULL == s_pfnGetAdapterAddresses) { s_pfnGetAdapterAddresses = (PFN_GetAdapterAddresses) - GetIpHlpApiProc(PJ_T("GetAdapterAddresses")); + GetIpHlpApiProc(GPA_TEXT("GetAdaptersAddresses")); } if(NULL != s_pfnGetAdapterAddresses) { @@ -127,14 +159,13 @@ static DWORD MyGetAdapterAddresses(ULONG Family, return ERROR_NOT_SUPPORTED; } -#endif /* PJ_HAS_IPV6 */ #if PJ_IP_HELPER_IGNORE_LOOPBACK_IF static DWORD MyGetIfEntry(MIB_IFROW *pIfRow) { if(NULL == s_pfnGetIfEntry) { s_pfnGetIfEntry = (PFN_GetIfEntry) - GetIpHlpApiProc(PJ_T("GetIfEntry")); + GetIpHlpApiProc(GPA_TEXT("GetIfEntry")); } if(NULL != s_pfnGetIfEntry) { @@ -152,7 +183,7 @@ static DWORD MyGetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, { if(NULL == s_pfnGetIpForwardTable) { s_pfnGetIpForwardTable = (PFN_GetIpForwardTable) - GetIpHlpApiProc(PJ_T("GetIpForwardTable")); + GetIpHlpApiProc(GPA_TEXT("GetIpForwardTable")); } if(NULL != s_pfnGetIpForwardTable) { @@ -168,25 +199,30 @@ static DWORD MyGetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, static pj_status_t enum_ipv4_interface(unsigned *p_cnt, pj_sockaddr ifs[]) { - /* Provide enough buffer or otherwise it will fail with - * error 22 ("Not Enough Buffer") error. - */ - char ipTabBuff[1024]; - MIB_IPADDRTABLE *pTab; - ULONG tabSize; + char ipTabBuff[512]; + MIB_IPADDRTABLE *pTab = (MIB_IPADDRTABLE*)ipTabBuff; + ULONG tabSize = sizeof(ipTabBuff); unsigned i, count; DWORD rc = NO_ERROR; PJ_ASSERT_RETURN(p_cnt && ifs, PJ_EINVAL); - pTab = (MIB_IPADDRTABLE*)ipTabBuff; - /* Get IP address table */ - tabSize = sizeof(ipTabBuff); - rc = MyGetIpAddrTable(pTab, &tabSize, FALSE); - if (rc != NO_ERROR) - return PJ_RETURN_OS_ERROR(rc); + if (rc != NO_ERROR) { + if (rc == ERROR_INSUFFICIENT_BUFFER) { + /* Retry with larger buffer */ + pTab = (MIB_IPADDRTABLE*)malloc(tabSize); + if (pTab) + rc = MyGetIpAddrTable(pTab, &tabSize, FALSE); + } + + if (rc != NO_ERROR) { + if (pTab != (MIB_IPADDRTABLE*)ipTabBuff) + free(pTab); + return PJ_RETURN_OS_ERROR(rc); + } + } /* Reset result */ pj_bzero(ifs, sizeof(ifs[0]) * (*p_cnt)); @@ -223,37 +259,103 @@ static pj_status_t enum_ipv4_interface(unsigned *p_cnt, (*p_cnt)++; } + if (pTab != (MIB_IPADDRTABLE*)ipTabBuff) + free(pTab); + return (*p_cnt) ? PJ_SUCCESS : PJ_ENOTFOUND; } - /* Enumerate local IP interface using GetAdapterAddresses(), * which works for both IPv4 and IPv6. */ -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 static pj_status_t enum_ipv4_ipv6_interface(int af, unsigned *p_cnt, pj_sockaddr ifs[]) { - pj_uint8_t buffer[1024]; + pj_uint8_t buffer[600]; IP_ADAPTER_ADDRESSES *adapter = (IP_ADAPTER_ADDRESSES*)buffer; ULONG size = sizeof(buffer); + ULONG flags; unsigned i; DWORD rc; - rc = MyGetAdapterAddresses(af, 0, NULL, adapter, &size); - if (rc != ERROR_SUCCESS) - return PJ_RETURN_OS_ERROR(rc); + flags = GAA_FLAG_SKIP_FRIENDLY_NAME | + GAA_FLAG_SKIP_DNS_SERVER | + GAA_FLAG_SKIP_MULTICAST; + + rc = MyGetAdapterAddresses(af, flags, NULL, adapter, &size); + if (rc != ERROR_SUCCESS) { + if (rc == ERROR_BUFFER_OVERFLOW) { + /* Retry with larger memory size */ + adapter = (IP_ADAPTER_ADDRESSES*) malloc(size); + if (adapter != NULL) + rc = MyGetAdapterAddresses(af, flags, NULL, adapter, &size); + } + + if (rc != ERROR_SUCCESS) { + if (adapter != (IP_ADAPTER_ADDRESSES*)buffer) + free(adapter); + return PJ_RETURN_OS_ERROR(rc); + } + } + + /* Reset result */ + pj_bzero(ifs, sizeof(ifs[0]) * (*p_cnt)); + + /* Enumerate interface */ + for (i=0; i<*p_cnt && adapter; adapter = adapter->Next) { + if (adapter->FirstUnicastAddress) { + SOCKET_ADDRESS *pAddr = &adapter->FirstUnicastAddress->Address; + + /* Ignore address family which we didn't request, just in case */ + if (pAddr->lpSockaddr->sa_family != PJ_AF_INET && + pAddr->lpSockaddr->sa_family != PJ_AF_INET6) + { + continue; + } + + /* Apply some filtering to known IPv4 unusable addresses */ + if (pAddr->lpSockaddr->sa_family == PJ_AF_INET) { + const pj_sockaddr_in *addr_in = + (const pj_sockaddr_in*)pAddr->lpSockaddr; + + /* Ignore 0.0.0.0 address (interface is down?) */ + if (addr_in->sin_addr.s_addr == 0) + continue; + + /* Ignore 0.0.0.0/8 address. This is a special address + * which doesn't seem to have practical use. + */ + if ((pj_ntohl(addr_in->sin_addr.s_addr) >> 24) == 0) + continue; + } + +#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF + /* Ignore loopback interfaces */ + /* This should have been IF_TYPE_SOFTWARE_LOOPBACK according to + * MSDN, and this macro should have been declared in Ipifcons.h, + * but some SDK versions don't have it. + */ + if (adapter->IfType == MIB_IF_TYPE_LOOPBACK) + continue; +#endif + + /* Ignore down interface */ + if (adapter->OperStatus != IfOperStatusUp) + continue; - for (i=0; i<*p_cnt && adapter; ++i, adapter = adapter->Next) { - SOCKET_ADDRESS *pAddr = &adapter->FirstUnicastAddress->Address; - ifs[i].addr.sa_family = pAddr->lpSockaddr->sa_family; - pj_memcpy(&ifs[i], pAddr->lpSockaddr, pAddr->iSockaddrLength); + ifs[i].addr.sa_family = pAddr->lpSockaddr->sa_family; + pj_memcpy(&ifs[i], pAddr->lpSockaddr, pAddr->iSockaddrLength); + ++i; + } } - return PJ_SUCCESS; + if (adapter != (IP_ADAPTER_ADDRESSES*)buffer) + free(adapter); + + *p_cnt = i; + return (*p_cnt) ? PJ_SUCCESS : PJ_ENOTFOUND; } -#endif /* @@ -269,20 +371,10 @@ PJ_DEF(pj_status_t) pj_enum_ip_interface(int af, PJ_ASSERT_RETURN(af==PJ_AF_UNSPEC || af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EAFNOTSUP); -#if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 status = enum_ipv4_ipv6_interface(af, p_cnt, ifs); if (status != PJ_SUCCESS && (af==PJ_AF_INET || af==PJ_AF_UNSPEC)) status = enum_ipv4_interface(p_cnt, ifs); return status; -#else - if (af==PJ_AF_INET6) - return PJ_EIPV6NOTSUP; - else if (af != PJ_AF_INET && af != PJ_AF_UNSPEC) - return PJ_EAFNOTSUP; - - status = enum_ipv4_interface(p_cnt, ifs); - return status; -#endif } /* diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp index 34d4a40254363c3c1b25142accf7622a4040f1da..8f627cf149067127f7bf0402c0268f77f748361d 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/log_writer_symbian_console.cpp @@ -1,5 +1,5 @@ /* $Id: log_writer_symbian_console.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/log.h> #include <pj/os.h> @@ -24,21 +24,21 @@ #include "os_symbian.h" #include <e32cons.h> -PJ_DEF (void) pj_log_write (int level, const char *buffer, int len) +PJ_DEF(void) pj_log_write(int level, const char *buffer, int len) { #if 0 wchar_t wbuffer[PJ_LOG_MAX_SIZE]; CConsoleBase *cons = PjSymbianOS::Instance->Console(); - pj_ansi_to_unicode (buffer, len, wbuffer, PJ_ARRAY_SIZE (wbuffer)); + pj_ansi_to_unicode(buffer, len, wbuffer, PJ_ARRAY_SIZE(wbuffer)); - - TPtrC16 aPtr ( (TUint16*) wbuffer, len); - console->Write (aPtr); + + TPtrC16 aPtr((TUint16*)wbuffer, len); + console->Write(aPtr); #else - PJ_UNUSED_ARG (level); - PJ_UNUSED_ARG (buffer); - PJ_UNUSED_ARG (len); + PJ_UNUSED_ARG(level); + PJ_UNUSED_ARG(buffer); + PJ_UNUSED_ARG(len); #endif } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp index 96478ec4edfc5c87ecdd0a9e6ddf73bc9024c133..8b036152180cccc77692b806e202ce82b63dcf80 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: os_core_symbian.cpp 2853 2009-08-05 10:58:02Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/os.h> @@ -35,14 +35,15 @@ #define DUMMY_MUTEX ((pj_mutex_t*)101) #define DUMMY_SEMAPHORE ((pj_sem_t*)102) #define THIS_FILE "os_core_symbian.c" - + /* * Note: * * The Symbian implementation does not support threading! - */ + */ -struct pj_thread_t { +struct pj_thread_t +{ char obj_name[PJ_MAX_OBJ_NAME]; void *tls_values[PJ_MAX_TLS]; @@ -56,11 +57,13 @@ struct pj_thread_t { } main_thread; -struct pj_atomic_t { +struct pj_atomic_t +{ pj_atomic_value_t value; }; -struct pj_sem_t { +struct pj_sem_t +{ int value; int max; }; @@ -70,7 +73,7 @@ static int tls_vars[PJ_MAX_TLS]; /* atexit handlers */ static unsigned atexit_count; -static void (*atexit_func[32]) (void); +static void (*atexit_func[32])(void); @@ -81,7 +84,7 @@ static void (*atexit_func[32]) (void); // CPjTimeoutTimer::CPjTimeoutTimer() - : CActive (PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_ (PJ_FALSE) +: CActive(PJ_SYMBIAN_TIMER_PRIORITY), hasTimedOut_(PJ_FALSE) { } @@ -95,27 +98,27 @@ void CPjTimeoutTimer::ConstructL() { hasTimedOut_ = PJ_FALSE; timer_.CreateLocal(); - CActiveScheduler::Add (this); + CActiveScheduler::Add(this); } CPjTimeoutTimer *CPjTimeoutTimer::NewL() { CPjTimeoutTimer *self = new CPjTimeoutTimer; - CleanupStack::PushL (self); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } -void CPjTimeoutTimer::StartTimer (TUint miliSeconds) +void CPjTimeoutTimer::StartTimer(TUint miliSeconds) { Cancel(); hasTimedOut_ = PJ_FALSE; - timer_.After (iStatus, miliSeconds * 1000); + timer_.After(iStatus, miliSeconds * 1000); SetActive(); } @@ -134,9 +137,9 @@ void CPjTimeoutTimer::DoCancel() timer_.Cancel(); } -TInt CPjTimeoutTimer::RunError (TInt aError) +TInt CPjTimeoutTimer::RunError(TInt aError) { - PJ_UNUSED_ARG (aError); + PJ_UNUSED_ARG(aError); return KErrNone; } @@ -148,16 +151,16 @@ TInt CPjTimeoutTimer::RunError (TInt aError) // PjSymbianOS::PjSymbianOS() - : isConnectionUp_ (false), - isSocketServInitialized_ (false), isResolverInitialized_ (false), - console_ (NULL), selectTimeoutTimer_ (NULL), - appSocketServ_ (NULL), appConnection_ (NULL), appHostResolver_ (NULL), - appHostResolver6_ (NULL) +: isConnectionUp_(false), + isSocketServInitialized_(false), isResolverInitialized_(false), + console_(NULL), selectTimeoutTimer_(NULL), + appSocketServ_(NULL), appConnection_(NULL), appHostResolver_(NULL), + appHostResolver6_(NULL) { } // Set parameters -void PjSymbianOS::SetParameters (pj_symbianos_params *params) +void PjSymbianOS::SetParameters(pj_symbianos_params *params) { appSocketServ_ = (RSocketServ*) params->rsocketserv; appConnection_ = (RConnection*) params->rconnection; @@ -181,57 +184,54 @@ TInt PjSymbianOS::Initialize() selectTimeoutTimer_ = CPjTimeoutTimer::NewL(); #if 0 - pj_assert (console_ == NULL); - TRAPD (err, console_ = Console::NewL (_L ("PJLIB"), - TSize (KConsFullScreen,KConsFullScreen))); + pj_assert(console_ == NULL); + TRAPD(err, console_ = Console::NewL(_L("PJLIB"), + TSize(KConsFullScreen,KConsFullScreen))); return err; #endif /* Only create RSocketServ if application doesn't specify it * in the parameters */ - if (!isSocketServInitialized_ && appSocketServ_ == NULL) { - err = socketServ_.Connect(); - - if (err != KErrNone) - goto on_error; + err = socketServ_.Connect(); + if (err != KErrNone) + goto on_error; - isSocketServInitialized_ = true; + isSocketServInitialized_ = true; } if (!isResolverInitialized_) { - if (appHostResolver_ == NULL) { - if (Connection()) - err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream, - *Connection()); - else - err = hostResolver_.Open (SocketServ(), KAfInet, KSockStream); - - if (err != KErrNone) - goto on_error; - } - + if (appHostResolver_ == NULL) { + if (Connection()) + err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream, + *Connection()); + else + err = hostResolver_.Open(SocketServ(), KAfInet, KSockStream); + + if (err != KErrNone) + goto on_error; + } + #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - if (appHostResolver6_ == NULL) { - if (Connection()) - err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream, - *Connection()); - else - err = hostResolver6_.Open (SocketServ(), KAfInet6, KSockStream); - - if (err != KErrNone) - goto on_error; - } - + if (appHostResolver6_ == NULL) { + if (Connection()) + err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream, + *Connection()); + else + err = hostResolver6_.Open(SocketServ(), KAfInet6, KSockStream); + + if (err != KErrNone) + goto on_error; + } #endif - - - isResolverInitialized_ = true; + + + isResolverInitialized_ = true; } isConnectionUp_ = true; - + return KErrNone; on_error: @@ -243,27 +243,26 @@ on_error: void PjSymbianOS::Shutdown() { isConnectionUp_ = false; - + if (isResolverInitialized_) { - hostResolver_.Close(); + hostResolver_.Close(); #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 - hostResolver6_.Close(); + hostResolver6_.Close(); #endif - isResolverInitialized_ = false; + isResolverInitialized_ = false; } if (isSocketServInitialized_) { - socketServ_.Close(); - isSocketServInitialized_ = false; + socketServ_.Close(); + isSocketServInitialized_ = false; } delete console_; - console_ = NULL; delete selectTimeoutTimer_; selectTimeoutTimer_ = NULL; - + appSocketServ_ = NULL; appConnection_ = NULL; appHostResolver_ = NULL; @@ -271,24 +270,24 @@ void PjSymbianOS::Shutdown() } // Convert to Unicode -TInt PjSymbianOS::ConvertToUnicode (TDes16 &aUnicode, const TDesC8 &aForeign) +TInt PjSymbianOS::ConvertToUnicode(TDes16 &aUnicode, const TDesC8 &aForeign) { #if 0 - pj_assert (conv_ != NULL); - return conv_->ConvertToUnicode (aUnicode, aForeign, convToUnicodeState_); + pj_assert(conv_ != NULL); + return conv_->ConvertToUnicode(aUnicode, aForeign, convToUnicodeState_); #else - return CnvUtfConverter::ConvertToUnicodeFromUtf8 (aUnicode, aForeign); + return CnvUtfConverter::ConvertToUnicodeFromUtf8(aUnicode, aForeign); #endif } // Convert from Unicode -TInt PjSymbianOS::ConvertFromUnicode (TDes8 &aForeign, const TDesC16 &aUnicode) +TInt PjSymbianOS::ConvertFromUnicode(TDes8 &aForeign, const TDesC16 &aUnicode) { #if 0 - pj_assert (conv_ != NULL); - return conv_->ConvertFromUnicode (aForeign, aUnicode, convToAnsiState_); + pj_assert(conv_ != NULL); + return conv_->ConvertFromUnicode(aForeign, aUnicode, convToAnsiState_); #else - return CnvUtfConverter::ConvertFromUnicodeToUtf8 (aForeign, aUnicode); + return CnvUtfConverter::ConvertFromUnicodeToUtf8(aForeign, aUnicode); #endif } @@ -298,25 +297,25 @@ TInt PjSymbianOS::ConvertFromUnicode (TDes8 &aForeign, const TDesC16 &aUnicode) // PJLIB os.h implementation // -PJ_DEF (pj_uint32_t) pj_getpid (void) +PJ_DEF(pj_uint32_t) pj_getpid(void) { return 0; } /* Set Symbian specific parameters */ -PJ_DEF (pj_status_t) pj_symbianos_set_params (pj_symbianos_params *prm) +PJ_DEF(pj_status_t) pj_symbianos_set_params(pj_symbianos_params *prm) { - PJ_ASSERT_RETURN (prm != NULL, PJ_EINVAL); - PjSymbianOS::Instance()->SetParameters (prm); + PJ_ASSERT_RETURN(prm != NULL, PJ_EINVAL); + PjSymbianOS::Instance()->SetParameters(prm); return PJ_SUCCESS; } /* Set connection status */ -PJ_DEF (void) pj_symbianos_set_connection_status (pj_bool_t up) +PJ_DEF(void) pj_symbianos_set_connection_status(pj_bool_t up) { - PjSymbianOS::Instance()->SetConnectionStatus (up != 0); + PjSymbianOS::Instance()->SetConnectionStatus(up != 0); } @@ -324,180 +323,169 @@ PJ_DEF (void) pj_symbianos_set_connection_status (pj_bool_t up) * pj_init(void). * Init PJLIB! */ -PJ_DEF (pj_status_t) pj_init (void) +PJ_DEF(pj_status_t) pj_init(void) { - char stack_ptr; + char stack_ptr; pj_status_t status; - - pj_ansi_strcpy (main_thread.obj_name, "pjthread"); + + pj_ansi_strcpy(main_thread.obj_name, "pjthread"); // Init main thread - pj_memset (&main_thread, 0, sizeof (main_thread)); + pj_memset(&main_thread, 0, sizeof(main_thread)); // Initialize PjSymbianOS instance PjSymbianOS *os = PjSymbianOS::Instance(); - PJ_LOG (4, (THIS_FILE, "Initializing PJLIB for Symbian OS..")); + PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS..")); - TInt err; + TInt err; err = os->Initialize(); - if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); /* Init logging */ pj_log_init(); - /* Initialize exception ID for the pool. + /* Initialize exception ID for the pool. * Must do so after critical section is configured. - */ - status = pj_exception_id_alloc ("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); - + */ + status = pj_exception_id_alloc("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); if (status != PJ_SUCCESS) goto on_error; #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 main_thread.stk_start = &stack_ptr; - main_thread.stk_size = 0xFFFFFFFFUL; - main_thread.stk_max_usage = 0; - #else stack_ptr = '\0'; - #endif - PJ_LOG (5, (THIS_FILE, "PJLIB initialized.")); - + PJ_LOG(5,(THIS_FILE, "PJLIB initialized.")); return PJ_SUCCESS; on_error: pj_shutdown(); - - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); } -PJ_DEF (pj_status_t) pj_atexit (pj_exit_callback func) +PJ_DEF(pj_status_t) pj_atexit(pj_exit_callback func) { - if (atexit_count >= PJ_ARRAY_SIZE (atexit_func)) - return PJ_ETOOMANY; + if (atexit_count >= PJ_ARRAY_SIZE(atexit_func)) + return PJ_ETOOMANY; atexit_func[atexit_count++] = func; - return PJ_SUCCESS; } -PJ_DEF (void) pj_shutdown (void) +PJ_DEF(void) pj_shutdown(void) { /* Call atexit() functions */ while (atexit_count > 0) { - (*atexit_func[atexit_count-1]) (); - --atexit_count; + (*atexit_func[atexit_count-1])(); + --atexit_count; } /* Free exception ID */ if (PJ_NO_MEMORY_EXCEPTION != -1) { - pj_exception_id_free (PJ_NO_MEMORY_EXCEPTION); - PJ_NO_MEMORY_EXCEPTION = -1; + pj_exception_id_free(PJ_NO_MEMORY_EXCEPTION); + PJ_NO_MEMORY_EXCEPTION = -1; } /* Clear static variables */ pj_errno_clear_handlers(); PjSymbianOS *os = PjSymbianOS::Instance(); - os->Shutdown(); } ///////////////////////////////////////////////////////////////////////////// -class CPollTimeoutTimer : public CActive +class CPollTimeoutTimer : public CActive { +public: + static CPollTimeoutTimer* NewL(int msec, TInt prio); + ~CPollTimeoutTimer(); + + virtual void RunL(); + virtual void DoCancel(); - public: - static CPollTimeoutTimer* NewL (int msec, TInt prio); - ~CPollTimeoutTimer(); - - virtual void RunL(); - virtual void DoCancel(); - - private: - RTimer rtimer_; - - explicit CPollTimeoutTimer (TInt prio); - void ConstructL (int msec); +private: + RTimer rtimer_; + + explicit CPollTimeoutTimer(TInt prio); + void ConstructL(int msec); }; -CPollTimeoutTimer::CPollTimeoutTimer (TInt prio) - : CActive (prio) +CPollTimeoutTimer::CPollTimeoutTimer(TInt prio) +: CActive(prio) { } -CPollTimeoutTimer::~CPollTimeoutTimer() +CPollTimeoutTimer::~CPollTimeoutTimer() { rtimer_.Close(); } -void CPollTimeoutTimer::ConstructL (int msec) +void CPollTimeoutTimer::ConstructL(int msec) { rtimer_.CreateLocal(); - CActiveScheduler::Add (this); - rtimer_.After (iStatus, msec*1000); + CActiveScheduler::Add(this); + rtimer_.After(iStatus, msec*1000); SetActive(); } -CPollTimeoutTimer* CPollTimeoutTimer::NewL (int msec, TInt prio) +CPollTimeoutTimer* CPollTimeoutTimer::NewL(int msec, TInt prio) { - CPollTimeoutTimer *self = new CPollTimeoutTimer (prio); - CleanupStack::PushL (self); - self->ConstructL (msec); - CleanupStack::Pop (self); + CPollTimeoutTimer *self = new CPollTimeoutTimer(prio); + CleanupStack::PushL(self); + self->ConstructL(msec); + CleanupStack::Pop(self); return self; } -void CPollTimeoutTimer::RunL() +void CPollTimeoutTimer::RunL() { } -void CPollTimeoutTimer::DoCancel() +void CPollTimeoutTimer::DoCancel() { - rtimer_.Cancel(); + rtimer_.Cancel(); } /* - * Wait the completion of any Symbian active objects. + * Wait the completion of any Symbian active objects. */ -PJ_DEF (pj_bool_t) pj_symbianos_poll (int priority, int ms_timeout) +PJ_DEF(pj_bool_t) pj_symbianos_poll(int priority, int ms_timeout) { CPollTimeoutTimer *timer = NULL; - + if (priority==-1) - priority = EPriorityNull; - + priority = EPriorityNull; + if (ms_timeout >= 0) { - timer = CPollTimeoutTimer::NewL (ms_timeout, priority); + timer = CPollTimeoutTimer::NewL(ms_timeout, priority); } - - PjSymbianOS::Instance()->WaitForActiveObjects (priority); - + + PjSymbianOS::Instance()->WaitForActiveObjects(priority); + if (timer) { bool timer_is_active = timer->IsActive(); - - timer->Cancel(); - + + timer->Cancel(); + delete timer; - - return timer_is_active ? PJ_TRUE : PJ_FALSE; - + + return timer_is_active ? PJ_TRUE : PJ_FALSE; + } else { - return PJ_TRUE; + return PJ_TRUE; } } @@ -505,7 +493,7 @@ PJ_DEF (pj_bool_t) pj_symbianos_poll (int priority, int ms_timeout) /* * pj_thread_is_registered() */ -PJ_DEF (pj_bool_t) pj_thread_is_registered (void) +PJ_DEF(pj_bool_t) pj_thread_is_registered(void) { return PJ_FALSE; } @@ -514,9 +502,9 @@ PJ_DEF (pj_bool_t) pj_thread_is_registered (void) /* * Get thread priority value for the thread. */ -PJ_DEF (int) pj_thread_get_prio (pj_thread_t *thread) +PJ_DEF(int) pj_thread_get_prio(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return 1; } @@ -524,10 +512,10 @@ PJ_DEF (int) pj_thread_get_prio (pj_thread_t *thread) /* * Set the thread priority. */ -PJ_DEF (pj_status_t) pj_thread_set_prio (pj_thread_t *thread, int prio) +PJ_DEF(pj_status_t) pj_thread_set_prio(pj_thread_t *thread, int prio) { - PJ_UNUSED_ARG (thread); - PJ_UNUSED_ARG (prio); + PJ_UNUSED_ARG(thread); + PJ_UNUSED_ARG(prio); return PJ_SUCCESS; } @@ -535,9 +523,9 @@ PJ_DEF (pj_status_t) pj_thread_set_prio (pj_thread_t *thread, int prio) /* * Get the lowest priority value available on this system. */ -PJ_DEF (int) pj_thread_get_prio_min (pj_thread_t *thread) +PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return 1; } @@ -545,9 +533,9 @@ PJ_DEF (int) pj_thread_get_prio_min (pj_thread_t *thread) /* * Get the highest priority value available on this system. */ -PJ_DEF (int) pj_thread_get_prio_max (pj_thread_t *thread) +PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return 1; } @@ -555,22 +543,22 @@ PJ_DEF (int) pj_thread_get_prio_max (pj_thread_t *thread) /* * pj_thread_get_os_handle() */ -PJ_DEF (void*) pj_thread_get_os_handle (pj_thread_t *thread) +PJ_DEF(void*) pj_thread_get_os_handle(pj_thread_t *thread) { - PJ_UNUSED_ARG (thread); + PJ_UNUSED_ARG(thread); return NULL; } /* * pj_thread_register(..) */ -PJ_DEF (pj_status_t) pj_thread_register (const char *cstr_thread_name, - pj_thread_desc desc, - pj_thread_t **thread_ptr) +PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, + pj_thread_desc desc, + pj_thread_t **thread_ptr) { - PJ_UNUSED_ARG (cstr_thread_name); - PJ_UNUSED_ARG (desc); - PJ_UNUSED_ARG (thread_ptr); + PJ_UNUSED_ARG(cstr_thread_name); + PJ_UNUSED_ARG(desc); + PJ_UNUSED_ARG(thread_ptr); return PJ_EINVALIDOP; } @@ -578,21 +566,21 @@ PJ_DEF (pj_status_t) pj_thread_register (const char *cstr_thread_name, /* * pj_thread_create(...) */ -PJ_DEF (pj_status_t) pj_thread_create (pj_pool_t *pool, - const char *thread_name, - pj_thread_proc *proc, - void *arg, - pj_size_t stack_size, - unsigned flags, - pj_thread_t **ptr_thread) -{ - PJ_UNUSED_ARG (pool); - PJ_UNUSED_ARG (thread_name); - PJ_UNUSED_ARG (proc); - PJ_UNUSED_ARG (arg); - PJ_UNUSED_ARG (stack_size); - PJ_UNUSED_ARG (flags); - PJ_UNUSED_ARG (ptr_thread); +PJ_DEF(pj_status_t) pj_thread_create( pj_pool_t *pool, + const char *thread_name, + pj_thread_proc *proc, + void *arg, + pj_size_t stack_size, + unsigned flags, + pj_thread_t **ptr_thread) +{ + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(thread_name); + PJ_UNUSED_ARG(proc); + PJ_UNUSED_ARG(arg); + PJ_UNUSED_ARG(stack_size); + PJ_UNUSED_ARG(flags); + PJ_UNUSED_ARG(ptr_thread); /* Sorry mate, we don't support threading */ return PJ_ENOTSUP; @@ -601,25 +589,25 @@ PJ_DEF (pj_status_t) pj_thread_create (pj_pool_t *pool, /* * pj_thread-get_name() */ -PJ_DEF (const char*) pj_thread_get_name (pj_thread_t *p) +PJ_DEF(const char*) pj_thread_get_name(pj_thread_t *p) { - pj_assert (p == &main_thread); + pj_assert(p == &main_thread); return p->obj_name; } /* * pj_thread_resume() */ -PJ_DEF (pj_status_t) pj_thread_resume (pj_thread_t *p) +PJ_DEF(pj_status_t) pj_thread_resume(pj_thread_t *p) { - PJ_UNUSED_ARG (p); + PJ_UNUSED_ARG(p); return PJ_EINVALIDOP; } /* * pj_thread_this() */ -PJ_DEF (pj_thread_t*) pj_thread_this (void) +PJ_DEF(pj_thread_t*) pj_thread_this(void) { return &main_thread; } @@ -627,27 +615,27 @@ PJ_DEF (pj_thread_t*) pj_thread_this (void) /* * pj_thread_join() */ -PJ_DEF (pj_status_t) pj_thread_join (pj_thread_t *rec) +PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *rec) { - PJ_UNUSED_ARG (rec); + PJ_UNUSED_ARG(rec); return PJ_EINVALIDOP; } /* * pj_thread_destroy() */ -PJ_DEF (pj_status_t) pj_thread_destroy (pj_thread_t *rec) +PJ_DEF(pj_status_t) pj_thread_destroy(pj_thread_t *rec) { - PJ_UNUSED_ARG (rec); + PJ_UNUSED_ARG(rec); return PJ_EINVALIDOP; } /* * pj_thread_sleep() */ -PJ_DEF (pj_status_t) pj_thread_sleep (unsigned msec) +PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec) { - User::After (msec*1000); + User::After(msec*1000); return PJ_SUCCESS; } @@ -658,22 +646,20 @@ PJ_DEF (pj_status_t) pj_thread_sleep (unsigned msec) * pj_thread_local_alloc() */ -PJ_DEF (pj_status_t) pj_thread_local_alloc (long *index) +PJ_DEF(pj_status_t) pj_thread_local_alloc(long *index) { unsigned i; /* Find unused TLS variable */ - - for (i=0; i<PJ_ARRAY_SIZE (tls_vars); ++i) { - if (tls_vars[i] == 0) - break; + for (i=0; i<PJ_ARRAY_SIZE(tls_vars); ++i) { + if (tls_vars[i] == 0) + break; } - if (i == PJ_ARRAY_SIZE (tls_vars)) - return PJ_ETOOMANY; + if (i == PJ_ARRAY_SIZE(tls_vars)) + return PJ_ETOOMANY; tls_vars[i] = 1; - *index = i; return PJ_SUCCESS; @@ -682,10 +668,10 @@ PJ_DEF (pj_status_t) pj_thread_local_alloc (long *index) /* * pj_thread_local_free() */ -PJ_DEF (void) pj_thread_local_free (long index) +PJ_DEF(void) pj_thread_local_free(long index) { - PJ_ASSERT_ON_FAIL (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && - tls_vars[index] != 0, return); + PJ_ASSERT_ON_FAIL(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && + tls_vars[index] != 0, return); tls_vars[index] = 0; } @@ -694,12 +680,12 @@ PJ_DEF (void) pj_thread_local_free (long index) /* * pj_thread_local_set() */ -PJ_DEF (pj_status_t) pj_thread_local_set (long index, void *value) +PJ_DEF(pj_status_t) pj_thread_local_set(long index, void *value) { pj_thread_t *rec = pj_thread_this(); - PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && - tls_vars[index] != 0, PJ_EINVAL); + PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && + tls_vars[index] != 0, PJ_EINVAL); rec->tls_values[index] = value; return PJ_SUCCESS; @@ -708,12 +694,12 @@ PJ_DEF (pj_status_t) pj_thread_local_set (long index, void *value) /* * pj_thread_local_get() */ -PJ_DEF (void*) pj_thread_local_get (long index) +PJ_DEF(void*) pj_thread_local_get(long index) { pj_thread_t *rec = pj_thread_this(); - PJ_ASSERT_RETURN (index >= 0 && index < (int) PJ_ARRAY_SIZE (tls_vars) && - tls_vars[index] != 0, NULL); + PJ_ASSERT_RETURN(index >= 0 && index < (int)PJ_ARRAY_SIZE(tls_vars) && + tls_vars[index] != 0, NULL); return rec->tls_values[index]; } @@ -723,11 +709,11 @@ PJ_DEF (void*) pj_thread_local_get (long index) /* * Create atomic variable. */ -PJ_DEF (pj_status_t) pj_atomic_create (pj_pool_t *pool, - pj_atomic_value_t initial, - pj_atomic_t **atomic) +PJ_DEF(pj_status_t) pj_atomic_create( pj_pool_t *pool, + pj_atomic_value_t initial, + pj_atomic_t **atomic ) { - *atomic = (pj_atomic_t*) pj_pool_alloc (pool, sizeof (struct pj_atomic_t)); + *atomic = (pj_atomic_t*)pj_pool_alloc(pool, sizeof(struct pj_atomic_t)); (*atomic)->value = initial; return PJ_SUCCESS; } @@ -736,9 +722,9 @@ PJ_DEF (pj_status_t) pj_atomic_create (pj_pool_t *pool, /* * Destroy atomic variable. */ -PJ_DEF (pj_status_t) pj_atomic_destroy (pj_atomic_t *atomic_var) +PJ_DEF(pj_status_t) pj_atomic_destroy( pj_atomic_t *atomic_var ) { - PJ_UNUSED_ARG (atomic_var); + PJ_UNUSED_ARG(atomic_var); return PJ_SUCCESS; } @@ -746,8 +732,8 @@ PJ_DEF (pj_status_t) pj_atomic_destroy (pj_atomic_t *atomic_var) /* * Set the value of an atomic type, and return the previous value. */ -PJ_DEF (void) pj_atomic_set (pj_atomic_t *atomic_var, - pj_atomic_value_t value) +PJ_DEF(void) pj_atomic_set( pj_atomic_t *atomic_var, + pj_atomic_value_t value) { atomic_var->value = value; } @@ -756,7 +742,7 @@ PJ_DEF (void) pj_atomic_set (pj_atomic_t *atomic_var, /* * Get the value of an atomic type. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_get (pj_atomic_t *atomic_var) +PJ_DEF(pj_atomic_value_t) pj_atomic_get(pj_atomic_t *atomic_var) { return atomic_var->value; } @@ -765,7 +751,7 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_get (pj_atomic_t *atomic_var) /* * Increment the value of an atomic type. */ -PJ_DEF (void) pj_atomic_inc (pj_atomic_t *atomic_var) +PJ_DEF(void) pj_atomic_inc(pj_atomic_t *atomic_var) { ++atomic_var->value; } @@ -774,7 +760,7 @@ PJ_DEF (void) pj_atomic_inc (pj_atomic_t *atomic_var) /* * Increment the value of an atomic type and get the result. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_inc_and_get (pj_atomic_t *atomic_var) +PJ_DEF(pj_atomic_value_t) pj_atomic_inc_and_get(pj_atomic_t *atomic_var) { return ++atomic_var->value; } @@ -783,16 +769,16 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_inc_and_get (pj_atomic_t *atomic_var) /* * Decrement the value of an atomic type. */ -PJ_DEF (void) pj_atomic_dec (pj_atomic_t *atomic_var) +PJ_DEF(void) pj_atomic_dec(pj_atomic_t *atomic_var) { --atomic_var->value; -} +} /* * Decrement the value of an atomic type and get the result. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_dec_and_get (pj_atomic_t *atomic_var) +PJ_DEF(pj_atomic_value_t) pj_atomic_dec_and_get(pj_atomic_t *atomic_var) { return --atomic_var->value; } @@ -801,8 +787,8 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_dec_and_get (pj_atomic_t *atomic_var) /* * Add a value to an atomic type. */ -PJ_DEF (void) pj_atomic_add (pj_atomic_t *atomic_var, - pj_atomic_value_t value) +PJ_DEF(void) pj_atomic_add( pj_atomic_t *atomic_var, + pj_atomic_value_t value) { atomic_var->value += value; } @@ -811,8 +797,8 @@ PJ_DEF (void) pj_atomic_add (pj_atomic_t *atomic_var, /* * Add a value to an atomic type and get the result. */ -PJ_DEF (pj_atomic_value_t) pj_atomic_add_and_get (pj_atomic_t *atomic_var, - pj_atomic_value_t value) +PJ_DEF(pj_atomic_value_t) pj_atomic_add_and_get( pj_atomic_t *atomic_var, + pj_atomic_value_t value) { atomic_var->value += value; return atomic_var->value; @@ -822,14 +808,14 @@ PJ_DEF (pj_atomic_value_t) pj_atomic_add_and_get (pj_atomic_t *atomic_var, ///////////////////////////////////////////////////////////////////////////// -PJ_DEF (pj_status_t) pj_mutex_create (pj_pool_t *pool, - const char *name, - int type, - pj_mutex_t **mutex) +PJ_DEF(pj_status_t) pj_mutex_create( pj_pool_t *pool, + const char *name, + int type, + pj_mutex_t **mutex) { - PJ_UNUSED_ARG (pool); - PJ_UNUSED_ARG (name); - PJ_UNUSED_ARG (type); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(name); + PJ_UNUSED_ARG(type); *mutex = DUMMY_MUTEX; return PJ_SUCCESS; @@ -838,55 +824,55 @@ PJ_DEF (pj_status_t) pj_mutex_create (pj_pool_t *pool, /* * pj_mutex_create_simple() */ -PJ_DEF (pj_status_t) pj_mutex_create_simple (pj_pool_t *pool, - const char *name, - pj_mutex_t **mutex) +PJ_DEF(pj_status_t) pj_mutex_create_simple( pj_pool_t *pool, + const char *name, + pj_mutex_t **mutex ) { - return pj_mutex_create (pool, name, PJ_MUTEX_SIMPLE, mutex); + return pj_mutex_create(pool, name, PJ_MUTEX_SIMPLE, mutex); } -PJ_DEF (pj_status_t) pj_mutex_create_recursive (pj_pool_t *pool, - const char *name, - pj_mutex_t **mutex) +PJ_DEF(pj_status_t) pj_mutex_create_recursive( pj_pool_t *pool, + const char *name, + pj_mutex_t **mutex ) { - return pj_mutex_create (pool, name, PJ_MUTEX_RECURSE, mutex); + return pj_mutex_create(pool, name, PJ_MUTEX_RECURSE, mutex); } /* * pj_mutex_lock() */ -PJ_DEF (pj_status_t) pj_mutex_lock (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_lock(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } /* * pj_mutex_trylock() */ -PJ_DEF (pj_status_t) pj_mutex_trylock (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_trylock(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } /* * pj_mutex_unlock() */ -PJ_DEF (pj_status_t) pj_mutex_unlock (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_unlock(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } /* * pj_mutex_destroy() */ -PJ_DEF (pj_status_t) pj_mutex_destroy (pj_mutex_t *mutex) +PJ_DEF(pj_status_t) pj_mutex_destroy(pj_mutex_t *mutex) { - pj_assert (mutex == DUMMY_MUTEX); + pj_assert(mutex == DUMMY_MUTEX); return PJ_SUCCESS; } @@ -903,7 +889,7 @@ PJ_DEF (pj_status_t) pj_mutex_destroy (pj_mutex_t *mutex) /* * Enter critical section. */ -PJ_DEF (void) pj_enter_critical_section (void) +PJ_DEF(void) pj_enter_critical_section(void) { /* Nothing to do */ } @@ -912,7 +898,7 @@ PJ_DEF (void) pj_enter_critical_section (void) /* * Leave critical section. */ -PJ_DEF (void) pj_leave_critical_section (void) +PJ_DEF(void) pj_leave_critical_section(void) { /* Nothing to do */ } @@ -923,17 +909,17 @@ PJ_DEF (void) pj_leave_critical_section (void) /* * Create semaphore. */ -PJ_DEF (pj_status_t) pj_sem_create (pj_pool_t *pool, - const char *name, - unsigned initial, - unsigned max, - pj_sem_t **p_sem) +PJ_DEF(pj_status_t) pj_sem_create( pj_pool_t *pool, + const char *name, + unsigned initial, + unsigned max, + pj_sem_t **p_sem) { pj_sem_t *sem; + + PJ_UNUSED_ARG(name); - PJ_UNUSED_ARG (name); - - sem = (pj_sem_t*) pj_pool_zalloc (pool, sizeof (pj_sem_t)); + sem = (pj_sem_t*) pj_pool_zalloc(pool, sizeof(pj_sem_t)); sem->value = initial; sem->max = max; @@ -946,14 +932,14 @@ PJ_DEF (pj_status_t) pj_sem_create (pj_pool_t *pool, /* * Wait for semaphore. */ -PJ_DEF (pj_status_t) pj_sem_wait (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_wait(pj_sem_t *sem) { if (sem->value > 0) { - sem->value--; - return PJ_SUCCESS; + sem->value--; + return PJ_SUCCESS; } else { - pj_assert (!"Unexpected!"); - return PJ_EINVALIDOP; + pj_assert(!"Unexpected!"); + return PJ_EINVALIDOP; } } @@ -961,14 +947,14 @@ PJ_DEF (pj_status_t) pj_sem_wait (pj_sem_t *sem) /* * Try wait for semaphore. */ -PJ_DEF (pj_status_t) pj_sem_trywait (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_trywait(pj_sem_t *sem) { if (sem->value > 0) { - sem->value--; - return PJ_SUCCESS; + sem->value--; + return PJ_SUCCESS; } else { - pj_assert (!"Unexpected!"); - return PJ_EINVALIDOP; + pj_assert(!"Unexpected!"); + return PJ_EINVALIDOP; } } @@ -976,7 +962,7 @@ PJ_DEF (pj_status_t) pj_sem_trywait (pj_sem_t *sem) /* * Release semaphore. */ -PJ_DEF (pj_status_t) pj_sem_post (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_post(pj_sem_t *sem) { sem->value++; return PJ_SUCCESS; @@ -986,57 +972,56 @@ PJ_DEF (pj_status_t) pj_sem_post (pj_sem_t *sem) /* * Destroy semaphore. */ -PJ_DEF (pj_status_t) pj_sem_destroy (pj_sem_t *sem) +PJ_DEF(pj_status_t) pj_sem_destroy(pj_sem_t *sem) { - PJ_UNUSED_ARG (sem); + PJ_UNUSED_ARG(sem); return PJ_SUCCESS; } #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK != 0 /* - * The implementation of stack checking. + * The implementation of stack checking. */ -PJ_DEF (void) pj_thread_check_stack (const char *file, int line) +PJ_DEF(void) pj_thread_check_stack(const char *file, int line) { char stk_ptr; pj_uint32_t usage; pj_thread_t *thread = pj_thread_this(); - pj_assert (thread); + pj_assert(thread); /* Calculate current usage. */ usage = (&stk_ptr > thread->stk_start) ? &stk_ptr - thread->stk_start : - thread->stk_start - &stk_ptr; + thread->stk_start - &stk_ptr; /* Assert if stack usage is dangerously high. */ - pj_assert ("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); + pj_assert("STACK OVERFLOW!! " && (usage <= thread->stk_size - 128)); /* Keep statistic. */ - if (usage > thread->stk_max_usage) { - thread->stk_max_usage = usage; - thread->caller_file = file; - thread->caller_line = line; + thread->stk_max_usage = usage; + thread->caller_file = file; + thread->caller_line = line; } } /* - * Get maximum stack usage statistic. + * Get maximum stack usage statistic. */ -PJ_DEF (pj_uint32_t) pj_thread_get_stack_max_usage (pj_thread_t *thread) +PJ_DEF(pj_uint32_t) pj_thread_get_stack_max_usage(pj_thread_t *thread) { return thread->stk_max_usage; } /* - * Dump thread stack status. + * Dump thread stack status. */ -PJ_DEF (pj_status_t) pj_thread_get_stack_info (pj_thread_t *thread, - const char **file, - int *line) +PJ_DEF(pj_status_t) pj_thread_get_stack_info(pj_thread_t *thread, + const char **file, + int *line) { - pj_assert (thread); + pj_assert(thread); *file = thread->caller_file; *line = thread->caller_line; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c index 5dc3b394a19da7801eec86fe2384b767c0c233a0..51af335105f1ab196d63e1cec6fd50c44da65c97 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/os_core_win32.c @@ -1,4 +1,4 @@ -/* $Id: os_core_win32.c 2853 2009-08-05 10:58:02Z bennylp $ */ +/* $Id: os_core_win32.c 3023 2009-11-23 15:04:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1037,6 +1037,7 @@ PJ_DEF(pj_bool_t) pj_mutex_is_locked(pj_mutex_t *mutex) #if PJ_DEBUG return mutex->owner == pj_thread_this(); #else + PJ_UNUSED_ARG(mutex); pj_assert(!"PJ_DEBUG is not set!"); return 1; #endif diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp index bb57cd9663c507be0d5feb5c3368a99843db3bae..31707b97c377903df1c5561cdbcda4101e5b935c 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/errno.h> #include <pj/assert.h> @@ -28,70 +28,68 @@ #if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) - static const struct { pj_os_err_type code; const char *msg; } gaErrorList[] = { - /* * Generic error -1 to -46 */ - PJ_BUILD_ERR (KErrNotFound, "Unable to find the specified object"), - PJ_BUILD_ERR (KErrGeneral, "General (unspecified) error"), - PJ_BUILD_ERR (KErrCancel, "The operation was cancelled"), - PJ_BUILD_ERR (KErrNoMemory, "Not enough memory"), - PJ_BUILD_ERR (KErrNotSupported, "The operation requested is not supported"), - PJ_BUILD_ERR (KErrArgument, "Bad request"), - PJ_BUILD_ERR (KErrTotalLossOfPrecision, "Total loss of precision"), - PJ_BUILD_ERR (KErrBadHandle, "Bad object"), - PJ_BUILD_ERR (KErrOverflow, "Overflow"), - PJ_BUILD_ERR (KErrUnderflow, "Underflow"), - PJ_BUILD_ERR (KErrAlreadyExists,"Already exists"), - PJ_BUILD_ERR (KErrPathNotFound, "Unable to find the specified folder"), - PJ_BUILD_ERR (KErrDied, "Closed"), - PJ_BUILD_ERR (KErrInUse, "The specified object is currently in use by another program"), - PJ_BUILD_ERR (KErrServerTerminated, "Server has closed"), - PJ_BUILD_ERR (KErrServerBusy, "Server busy"), - PJ_BUILD_ERR (KErrCompletion, "Completion error"), - PJ_BUILD_ERR (KErrNotReady, "Not ready"), - PJ_BUILD_ERR (KErrUnknown, "Unknown error"), - PJ_BUILD_ERR (KErrCorrupt, "Corrupt"), - PJ_BUILD_ERR (KErrAccessDenied, "Access denied"), - PJ_BUILD_ERR (KErrLocked, "Locked"), - PJ_BUILD_ERR (KErrWrite, "Failed to write"), - PJ_BUILD_ERR (KErrDisMounted, "Wrong disk present"), - PJ_BUILD_ERR (KErrEof, "Unexpected end of file"), - PJ_BUILD_ERR (KErrDiskFull, "Disk full"), - PJ_BUILD_ERR (KErrBadDriver, "Bad device driver"), - PJ_BUILD_ERR (KErrBadName, "Bad name"), - PJ_BUILD_ERR (KErrCommsLineFail,"Comms line failed"), - PJ_BUILD_ERR (KErrCommsFrame, "Comms frame error"), - PJ_BUILD_ERR (KErrCommsOverrun, "Comms overrun error"), - PJ_BUILD_ERR (KErrCommsParity, "Comms parity error"), - PJ_BUILD_ERR (KErrTimedOut, "Timed out"), - PJ_BUILD_ERR (KErrCouldNotConnect, "Failed to connect"), - PJ_BUILD_ERR (KErrCouldNotDisconnect, "Failed to disconnect"), - PJ_BUILD_ERR (KErrDisconnected, "Disconnected"), - PJ_BUILD_ERR (KErrBadLibraryEntryPoint, "Bad library entry point"), - PJ_BUILD_ERR (KErrBadDescriptor,"Bad descriptor"), - PJ_BUILD_ERR (KErrAbort, "Interrupted"), - PJ_BUILD_ERR (KErrTooBig, "Too big"), - PJ_BUILD_ERR (KErrDivideByZero, "Divide by zero"), - PJ_BUILD_ERR (KErrBadPower, "Batteries too low"), - PJ_BUILD_ERR (KErrDirFull, "Folder full"), - PJ_BUILD_ERR (KErrHardwareNotAvailable, ""), - PJ_BUILD_ERR (KErrSessionClosed, ""), - PJ_BUILD_ERR (KErrPermissionDenied, ""), + PJ_BUILD_ERR( KErrNotFound, "Unable to find the specified object"), + PJ_BUILD_ERR( KErrGeneral, "General (unspecified) error"), + PJ_BUILD_ERR( KErrCancel, "The operation was cancelled"), + PJ_BUILD_ERR( KErrNoMemory, "Not enough memory"), + PJ_BUILD_ERR( KErrNotSupported, "The operation requested is not supported"), + PJ_BUILD_ERR( KErrArgument, "Bad request"), + PJ_BUILD_ERR( KErrTotalLossOfPrecision, "Total loss of precision"), + PJ_BUILD_ERR( KErrBadHandle, "Bad object"), + PJ_BUILD_ERR( KErrOverflow, "Overflow"), + PJ_BUILD_ERR( KErrUnderflow, "Underflow"), + PJ_BUILD_ERR( KErrAlreadyExists,"Already exists"), + PJ_BUILD_ERR( KErrPathNotFound, "Unable to find the specified folder"), + PJ_BUILD_ERR( KErrDied, "Closed"), + PJ_BUILD_ERR( KErrInUse, "The specified object is currently in use by another program"), + PJ_BUILD_ERR( KErrServerTerminated, "Server has closed"), + PJ_BUILD_ERR( KErrServerBusy, "Server busy"), + PJ_BUILD_ERR( KErrCompletion, "Completion error"), + PJ_BUILD_ERR( KErrNotReady, "Not ready"), + PJ_BUILD_ERR( KErrUnknown, "Unknown error"), + PJ_BUILD_ERR( KErrCorrupt, "Corrupt"), + PJ_BUILD_ERR( KErrAccessDenied, "Access denied"), + PJ_BUILD_ERR( KErrLocked, "Locked"), + PJ_BUILD_ERR( KErrWrite, "Failed to write"), + PJ_BUILD_ERR( KErrDisMounted, "Wrong disk present"), + PJ_BUILD_ERR( KErrEof, "Unexpected end of file"), + PJ_BUILD_ERR( KErrDiskFull, "Disk full"), + PJ_BUILD_ERR( KErrBadDriver, "Bad device driver"), + PJ_BUILD_ERR( KErrBadName, "Bad name"), + PJ_BUILD_ERR( KErrCommsLineFail,"Comms line failed"), + PJ_BUILD_ERR( KErrCommsFrame, "Comms frame error"), + PJ_BUILD_ERR( KErrCommsOverrun, "Comms overrun error"), + PJ_BUILD_ERR( KErrCommsParity, "Comms parity error"), + PJ_BUILD_ERR( KErrTimedOut, "Timed out"), + PJ_BUILD_ERR( KErrCouldNotConnect, "Failed to connect"), + PJ_BUILD_ERR( KErrCouldNotDisconnect, "Failed to disconnect"), + PJ_BUILD_ERR( KErrDisconnected, "Disconnected"), + PJ_BUILD_ERR( KErrBadLibraryEntryPoint, "Bad library entry point"), + PJ_BUILD_ERR( KErrBadDescriptor,"Bad descriptor"), + PJ_BUILD_ERR( KErrAbort, "Interrupted"), + PJ_BUILD_ERR( KErrTooBig, "Too big"), + PJ_BUILD_ERR( KErrDivideByZero, "Divide by zero"), + PJ_BUILD_ERR( KErrBadPower, "Batteries too low"), + PJ_BUILD_ERR( KErrDirFull, "Folder full"), + PJ_BUILD_ERR( KErrHardwareNotAvailable, ""), + PJ_BUILD_ERR( KErrSessionClosed, ""), + PJ_BUILD_ERR( KErrPermissionDenied, ""), /* * Socket errors (-190 - -1000) */ - PJ_BUILD_ERR (KErrNetUnreach, "Could not connect to the network. Currently unreachable"), - PJ_BUILD_ERR (KErrHostUnreach, "Could not connect to the specified server"), - PJ_BUILD_ERR (KErrNoProtocolOpt,"The specified server refuses the selected protocol"), - PJ_BUILD_ERR (KErrUrgentData, ""), - PJ_BUILD_ERR (KErrWouldBlock, "Conflicts with KErrExtended, but cannot occur in practice"), + PJ_BUILD_ERR( KErrNetUnreach, "Could not connect to the network. Currently unreachable"), + PJ_BUILD_ERR( KErrHostUnreach, "Could not connect to the specified server"), + PJ_BUILD_ERR( KErrNoProtocolOpt,"The specified server refuses the selected protocol"), + PJ_BUILD_ERR( KErrUrgentData, ""), + PJ_BUILD_ERR( KErrWouldBlock, "Conflicts with KErrExtended, but cannot occur in practice"), {0, NULL} }; @@ -99,45 +97,45 @@ static const struct { #endif /* PJ_HAS_ERROR_STRING */ -PJ_DEF (pj_status_t) pj_get_os_error (void) +PJ_DEF(pj_status_t) pj_get_os_error(void) { return -1; } -PJ_DEF (void) pj_set_os_error (pj_status_t code) +PJ_DEF(void) pj_set_os_error(pj_status_t code) { - PJ_UNUSED_ARG (code); + PJ_UNUSED_ARG(code); } -PJ_DEF (pj_status_t) pj_get_netos_error (void) +PJ_DEF(pj_status_t) pj_get_netos_error(void) { return -1; } -PJ_DEF (void) pj_set_netos_error (pj_status_t code) +PJ_DEF(void) pj_set_netos_error(pj_status_t code) { - PJ_UNUSED_ARG (code); + PJ_UNUSED_ARG(code); } PJ_BEGIN_DECL -PJ_DECL (int) platform_strerror (pj_os_err_type os_errcode, - char *buf, pj_size_t bufsize); + PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, + char *buf, pj_size_t bufsize); PJ_END_DECL -/* +/* * platform_strerror() * - * Platform specific error message. This file is called by pj_strerror() - * in errno.c + * Platform specific error message. This file is called by pj_strerror() + * in errno.c */ -PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode, - char *buf, pj_size_t bufsize) +PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, + char *buf, pj_size_t bufsize) { int len = 0; - pj_assert (buf != NULL); - pj_assert (bufsize >= 0); + pj_assert(buf != NULL); + pj_assert(bufsize >= 0); /* * MUST NOT check stack here. @@ -147,31 +145,26 @@ PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode, if (!len) { #if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0) - int i; - + int i; for (i = 0; gaErrorList[i].msg; ++i) { if (gaErrorList[i].code == os_errcode) { - len = strlen (gaErrorList[i].msg); - - if ( (pj_size_t) len >= bufsize) { - len = bufsize-1; - } - - pj_memcpy (buf, gaErrorList[i].msg, len); - - buf[len] = '\0'; + len = strlen(gaErrorList[i].msg); + if ((pj_size_t)len >= bufsize) { + len = bufsize-1; + } + pj_memcpy(buf, gaErrorList[i].msg, len); + buf[len] = '\0'; break; } } - #endif /* PJ_HAS_ERROR_STRING */ } if (!len) { - len = pj_ansi_snprintf (buf, bufsize, "Symbian native error %d", - os_errcode); - buf[len] = '\0'; + len = pj_ansi_snprintf( buf, bufsize, "Symbian native error %d", + os_errcode); + buf[len] = '\0'; } return len; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c b/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c index 7c1e5564b27660549dad71bee4110c1fac3df975..2ab100caad3a58cb57a92ae05cbba4f1656989af 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/pool.c @@ -1,4 +1,4 @@ -/* $Id: pool.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pool.c 2963 2009-10-24 02:06:40Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -66,10 +66,15 @@ static pj_pool_block *pj_pool_create_block( pj_pool_t *pool, pj_size_t size) /* Add capacity. */ pool->capacity += size; - /* Set block attribytes. */ - block->cur = block->buf = ((unsigned char*)block) + sizeof(pj_pool_block); + /* Set start and end of buffer. */ + block->buf = ((unsigned char*)block) + sizeof(pj_pool_block); block->end = ((unsigned char*)block) + size; + /* Set the start pointer, aligning it as needed */ + block->cur = (unsigned char*) + (((unsigned long)block->buf + PJ_POOL_ALIGNMENT - 1) & + ~(PJ_POOL_ALIGNMENT - 1)); + /* Insert in the front of the list. */ pj_list_insert_after(&pool->block_list, block); @@ -111,11 +116,15 @@ PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, unsigned size) /* If pool is configured to expand, but the increment size * is less than the required size, expand the pool by multiple - * increment size + * increment size. Also count the size wasted due to aligning + * the block. */ - if (pool->increment_size < size + sizeof(pj_pool_block)) { + if (pool->increment_size < + size + sizeof(pj_pool_block) + PJ_POOL_ALIGNMENT) + { unsigned count; - count = (size + pool->increment_size + sizeof(pj_pool_block)) / + count = (size + pool->increment_size + sizeof(pj_pool_block) + + PJ_POOL_ALIGNMENT) / pool->increment_size; block_size = count * pool->increment_size; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp index 6f99c068c3beede2da7c6348c89476cf1e20851b..e22040a2f42be5a2f401f2a8a9b3dffd6c305919 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/pool_policy_new.cpp @@ -1,5 +1,5 @@ /* $Id: pool_policy_new.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/pool.h> #include <pj/except.h> @@ -27,78 +27,76 @@ * This file contains pool default policy definition and implementation. */ #include "pool_signature.h" + - -static void *operator_new (pj_pool_factory *factory, pj_size_t size) +static void *operator_new(pj_pool_factory *factory, pj_size_t size) { void *mem; PJ_CHECK_STACK(); if (factory->on_block_alloc) { - int rc; - rc = factory->on_block_alloc (factory, size); - - if (!rc) - return NULL; + int rc; + rc = factory->on_block_alloc(factory, size); + if (!rc) + return NULL; } - - mem = (void*) new char[size+ (SIG_SIZE << 1) ]; - + + mem = (void*) new char[size+(SIG_SIZE << 1)]; + /* Exception for new operator may be disabled, so.. */ - if (mem) { - /* Apply signature when PJ_SAFE_POOL is set. It will move - * "mem" pointer forward. - */ - APPLY_SIG (mem, size); + /* Apply signature when PJ_SAFE_POOL is set. It will move + * "mem" pointer forward. + */ + APPLY_SIG(mem, size); } return mem; } -static void operator_delete (pj_pool_factory *factory, void *mem, pj_size_t size) +static void operator_delete(pj_pool_factory *factory, void *mem, pj_size_t size) { PJ_CHECK_STACK(); - if (factory->on_block_free) - factory->on_block_free (factory, size); - + if (factory->on_block_free) + factory->on_block_free(factory, size); + /* Check and remove signature when PJ_SAFE_POOL is set. It will * move "mem" pointer backward. */ - REMOVE_SIG (mem, size); + REMOVE_SIG(mem, size); /* Note that when PJ_SAFE_POOL is set, the actual size of the block * is size + SIG_SIZE*2. */ - char *p = (char*) mem; - + char *p = (char*)mem; delete [] p; } -static void default_pool_callback (pj_pool_t *pool, pj_size_t size) +static void default_pool_callback(pj_pool_t *pool, pj_size_t size) { PJ_CHECK_STACK(); - PJ_UNUSED_ARG (pool); - PJ_UNUSED_ARG (size); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(size); - PJ_THROW (PJ_NO_MEMORY_EXCEPTION); + PJ_THROW(PJ_NO_MEMORY_EXCEPTION); } -PJ_DEF_DATA (pj_pool_factory_policy) pj_pool_factory_default_policy = { +PJ_DEF_DATA(pj_pool_factory_policy) pj_pool_factory_default_policy = +{ &operator_new, &operator_delete, &default_pool_callback, 0 }; -PJ_DEF (const pj_pool_factory_policy*) pj_pool_factory_get_default_policy (void) +PJ_DEF(const pj_pool_factory_policy*) pj_pool_factory_get_default_policy(void) { return &pj_pool_factory_default_policy; } - + #endif /* PJ_HAS_POOL_ALT_API */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c index 93f2511a2acf07ef61eccf1e2f34bde9ba637557..f7d69a7f44fbaf5cce1943696af0fa57587e310f 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_bsd.c @@ -1,4 +1,4 @@ -/* $Id: sock_bsd.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sock_bsd.c 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -60,26 +60,43 @@ const pj_uint16_t PJ_SOCK_RDM = SOCK_RDM; const pj_uint16_t PJ_SOL_SOCKET = SOL_SOCKET; #ifdef SOL_IP const pj_uint16_t PJ_SOL_IP = SOL_IP; +#elif defined(PJ_WIN32) && PJ_WIN32 +const pj_uint16_t PJ_SOL_IP = IPPROTO_IP; #else -const pj_uint16_t PJ_SOL_IP = 0xFFFF; +const pj_uint16_t PJ_SOL_IP = 0; #endif /* SOL_IP */ + #if defined(SOL_TCP) const pj_uint16_t PJ_SOL_TCP = SOL_TCP; #elif defined(IPPROTO_TCP) const pj_uint16_t PJ_SOL_TCP = IPPROTO_TCP; +#elif defined(PJ_WIN32) && PJ_WIN32 +const pj_uint16_t PJ_SOL_TCP = IPPROTO_TCP; #else -const pj_uint16_t PJ_SOL_TCP = 0xFFFF; +const pj_uint16_t PJ_SOL_TCP = 6; #endif /* SOL_TCP */ + #ifdef SOL_UDP const pj_uint16_t PJ_SOL_UDP = SOL_UDP; +#elif defined(IPPROTO_UDP) +const pj_uint16_t PJ_SOL_UDP = IPPROTO_UDP; +#elif defined(PJ_WIN32) && PJ_WIN32 +const pj_uint16_t PJ_SOL_UDP = IPPROTO_UDP; #else -const pj_uint16_t PJ_SOL_UDP = 0xFFFF; -#endif +const pj_uint16_t PJ_SOL_UDP = 17; +#endif /* SOL_UDP */ + #ifdef SOL_IPV6 const pj_uint16_t PJ_SOL_IPV6 = SOL_IPV6; +#elif defined(PJ_WIN32) && PJ_WIN32 +# if defined(IPPROTO_IPV6) || (_WIN32_WINNT >= 0x0501) + const pj_uint16_t PJ_SOL_IPV6 = IPPROTO_IPV6; +# else + const pj_uint16_t PJ_SOL_IPV6 = 41; +# endif #else -const pj_uint16_t PJ_SOL_IPV6 = 0xFFFF; -#endif +const pj_uint16_t PJ_SOL_IPV6 = 41; +#endif /* SOL_IPV6 */ /* IP_TOS */ #ifdef IP_TOS @@ -116,6 +133,15 @@ const pj_uint16_t PJ_IPTOS_MINCOST = 0x02; const pj_uint16_t PJ_SO_TYPE = SO_TYPE; const pj_uint16_t PJ_SO_RCVBUF = SO_RCVBUF; const pj_uint16_t PJ_SO_SNDBUF = SO_SNDBUF; +const pj_uint16_t PJ_TCP_NODELAY= TCP_NODELAY; +const pj_uint16_t PJ_SO_REUSEADDR= SO_REUSEADDR; +#if defined(SO_PRIORITY) +const pj_uint16_t PJ_SO_PRIORITY = SO_PRIORITY; +#else +/* This is from Linux, YMMV */ +const pj_uint16_t PJ_SO_PRIORITY = 12; +#endif + /* Multicasting is not supported e.g. in PocketPC 2003 SDK */ #ifdef IP_MULTICAST_IF const pj_uint16_t PJ_IP_MULTICAST_IF = IP_MULTICAST_IF; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c index 84fdb71d00c127b0c2e7acb559b0dc7057828bca..f4442cfa161d72f6ec5cea0702645feaacb17b02 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_common.c @@ -1,4 +1,4 @@ -/* $Id: sock_common.c 2886 2009-08-17 10:10:31Z bennylp $ */ +/* $Id: sock_common.c 3037 2009-12-29 16:53:33Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -338,7 +338,7 @@ PJ_DEF(pj_bool_t) pj_sockaddr_has_addr(const pj_sockaddr_t *addr) * This may break some parts of upper layer libraries. */ //PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || - // a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); + // a->addr.sa_family == PJ_AF_INET6, PJ_FALSE); if (a->addr.sa_family!=PJ_AF_INET && a->addr.sa_family!=PJ_AF_INET6) { return PJ_FALSE; @@ -372,7 +372,7 @@ PJ_DEF(unsigned) pj_sockaddr_get_addr_len(const pj_sockaddr_t *addr) { const pj_sockaddr *a = (const pj_sockaddr*) addr; PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || - a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); + a->addr.sa_family == PJ_AF_INET6, 0); return a->addr.sa_family == PJ_AF_INET6 ? sizeof(pj_in6_addr) : sizeof(pj_in_addr); } @@ -384,7 +384,7 @@ PJ_DEF(unsigned) pj_sockaddr_get_len(const pj_sockaddr_t *addr) { const pj_sockaddr *a = (const pj_sockaddr*) addr; PJ_ASSERT_RETURN(a->addr.sa_family == PJ_AF_INET || - a->addr.sa_family == PJ_AF_INET6, PJ_EAFNOTSUP); + a->addr.sa_family == PJ_AF_INET6, 0); return a->addr.sa_family == PJ_AF_INET6 ? sizeof(pj_sockaddr_in6) : sizeof(pj_sockaddr_in); } @@ -1062,6 +1062,21 @@ PJ_DEF(pj_uint16_t) pj_SO_SNDBUF(void) return PJ_SO_SNDBUF; } +PJ_DEF(pj_uint16_t) pj_TCP_NODELAY(void) +{ + return PJ_TCP_NODELAY; +} + +PJ_DEF(pj_uint16_t) pj_SO_REUSEADDR(void) +{ + return PJ_SO_REUSEADDR; +} + +PJ_DEF(pj_uint16_t) pj_SO_PRIORITY(void) +{ + return PJ_SO_PRIORITY; +} + PJ_DEF(pj_uint16_t) pj_IP_MULTICAST_IF(void) { return PJ_IP_MULTICAST_IF; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_bsd.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_bsd.c new file mode 100644 index 0000000000000000000000000000000000000000..59bfc9faf60d8643608f4aeab2796c23ca53edf4 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_bsd.c @@ -0,0 +1,132 @@ +/* $Id: sock_qos_bsd.c 2967 2009-10-25 10:50:17Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/string.h> + +/* This is the implementation of QoS with BSD socket's setsockopt(), + * using IP_TOS and SO_PRIORITY + */ +#if !defined(PJ_QOS_IMPLEMENTATION) || PJ_QOS_IMPLEMENTATION==PJ_QOS_BSD + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + pj_status_t last_err = PJ_ENOTSUP; + pj_status_t status; + + /* No op? */ + if (!param->flags) + return PJ_SUCCESS; + + /* Clear WMM field since we don't support it */ + param->flags &= ~(PJ_QOS_PARAM_HAS_WMM); + + /* Set TOS/DSCP */ + if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { + /* Value is dscp_val << 2 */ + int val = (param->dscp_val << 2); + status = pj_sock_setsockopt(sock, pj_SOL_IP(), pj_IP_TOS(), + &val, sizeof(val)); + if (status != PJ_SUCCESS) { + param->flags &= ~(PJ_QOS_PARAM_HAS_DSCP); + last_err = status; + } + } + + /* Set SO_PRIORITY */ + if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { + int val = param->so_prio; + status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(), + &val, sizeof(val)); + if (status != PJ_SUCCESS) { + param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO); + last_err = status; + } + } + + return param->flags ? PJ_SUCCESS : last_err; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_qos_get_params(type, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_sock_set_qos_params(sock, ¶m); +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + pj_status_t last_err = PJ_ENOTSUP; + int val, optlen; + pj_status_t status; + + pj_bzero(p_param, sizeof(*p_param)); + + /* Get DSCP/TOS value */ + optlen = sizeof(val); + status = pj_sock_getsockopt(sock, pj_SOL_IP(), pj_IP_TOS(), + &val, &optlen); + if (status == PJ_SUCCESS) { + p_param->flags |= PJ_QOS_PARAM_HAS_DSCP; + p_param->dscp_val = (pj_uint8_t)(val >> 2); + } else { + last_err = status; + } + + /* Get SO_PRIORITY */ + optlen = sizeof(val); + status = pj_sock_getsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(), + &val, &optlen); + if (status == PJ_SUCCESS) { + p_param->flags |= PJ_QOS_PARAM_HAS_SO_PRIO; + p_param->so_prio = (pj_uint8_t)val; + } else { + last_err = status; + } + + /* WMM is not supported */ + + return p_param->flags ? PJ_SUCCESS : last_err; +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_sock_get_qos_params(sock, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_qos_get_type(¶m, p_type); +} + +#endif /* PJ_QOS_IMPLEMENTATION */ + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_common.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_common.c new file mode 100644 index 0000000000000000000000000000000000000000..80711c541304050ddd6e4bdadf15bbf82b459fe8 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_common.c @@ -0,0 +1,151 @@ +/* $Id: sock_qos_common.c 2993 2009-11-09 04:32:33Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/log.h> +#include <pj/string.h> + +#define THIS_FILE "sock_qos_common.c" +#define ALL_FLAGS (PJ_QOS_PARAM_HAS_DSCP | PJ_QOS_PARAM_HAS_SO_PRIO | \ + PJ_QOS_PARAM_HAS_WMM) + +/* "Standard" mapping between traffic type and QoS params */ +static const pj_qos_params qos_map[] = +{ + /* flags dscp prio wmm_prio */ + {ALL_FLAGS, 0x00, 0, PJ_QOS_WMM_PRIO_BULK_EFFORT}, /* BE */ + {ALL_FLAGS, 0x08, 2, PJ_QOS_WMM_PRIO_BULK}, /* BK */ + {ALL_FLAGS, 0x28, 5, PJ_QOS_WMM_PRIO_VIDEO}, /* VI */ + {ALL_FLAGS, 0x30, 6, PJ_QOS_WMM_PRIO_VOICE}, /* VO */ + {ALL_FLAGS, 0x38, 7, PJ_QOS_WMM_PRIO_VOICE} /* CO */ +}; + + +/* Retrieve the mapping for the specified type */ +PJ_DEF(pj_status_t) pj_qos_get_params(pj_qos_type type, + pj_qos_params *p_param) +{ + PJ_ASSERT_RETURN(type<=PJ_QOS_TYPE_CONTROL && p_param, PJ_EINVAL); + pj_memcpy(p_param, &qos_map[type], sizeof(*p_param)); + return PJ_SUCCESS; +} + +/* Get the matching traffic type */ +PJ_DEF(pj_status_t) pj_qos_get_type( const pj_qos_params *param, + pj_qos_type *p_type) +{ + unsigned dscp_type = PJ_QOS_TYPE_BEST_EFFORT, + prio_type = PJ_QOS_TYPE_BEST_EFFORT, + wmm_type = PJ_QOS_TYPE_BEST_EFFORT; + unsigned i, count=0; + + PJ_ASSERT_RETURN(param && p_type, PJ_EINVAL); + + if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { + for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { + if (param->dscp_val >= qos_map[i].dscp_val) + dscp_type = (pj_qos_type)i; + } + ++count; + } + + if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { + for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { + if (param->so_prio >= qos_map[i].so_prio) + prio_type = (pj_qos_type)i; + } + ++count; + } + + if (param->flags & PJ_QOS_PARAM_HAS_WMM) { + for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { + if (param->wmm_prio >= qos_map[i].wmm_prio) + wmm_type = (pj_qos_type)i; + } + ++count; + } + + if (count) + *p_type = (pj_qos_type)((dscp_type + prio_type + wmm_type) / count); + else + *p_type = PJ_QOS_TYPE_BEST_EFFORT; + + return PJ_SUCCESS; +} + +/* Apply QoS */ +PJ_DEF(pj_status_t) pj_sock_apply_qos( pj_sock_t sock, + pj_qos_type qos_type, + pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name) +{ + pj_status_t qos_type_rc = PJ_SUCCESS, + qos_params_rc = PJ_SUCCESS; + + if (!log_sender) + log_sender = THIS_FILE; + if (!sock_name) + sock_name = "socket"; + + if (qos_type != PJ_QOS_TYPE_BEST_EFFORT) { + qos_type_rc = pj_sock_set_qos_type(sock, qos_type); + + if (qos_type_rc != PJ_SUCCESS) { + pj_perror(log_level, log_sender, qos_type_rc, + "Error setting QoS type %d to %s", + qos_type, sock_name); + } + } + + if (qos_params && qos_params->flags) { + qos_params_rc = pj_sock_set_qos_params(sock, qos_params); + if (qos_params_rc != PJ_SUCCESS) { + pj_perror(log_level, log_sender, qos_params_rc, + "Error setting QoS params (flags=%d) to %s", + qos_params->flags, sock_name); + if (qos_type_rc != PJ_SUCCESS) + return qos_params_rc; + } + } else if (qos_type_rc != PJ_SUCCESS) + return qos_type_rc; + + return PJ_SUCCESS; +} + + +PJ_DEF(pj_status_t) pj_sock_apply_qos2( pj_sock_t sock, + pj_qos_type qos_type, + const pj_qos_params *qos_params, + unsigned log_level, + const char *log_sender, + const char *sock_name) +{ + pj_qos_params qos_params_buf, *qos_params_copy = NULL; + + if (qos_params) { + pj_memcpy(&qos_params_buf, qos_params, sizeof(*qos_params)); + qos_params_copy = &qos_params_buf; + } + + return pj_sock_apply_qos(sock, qos_type, qos_params_copy, + log_level, log_sender, sock_name); +} diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_dummy.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_dummy.c new file mode 100644 index 0000000000000000000000000000000000000000..200d53b9aed0dde87adfb305776ddf1a98cb690b --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_dummy.c @@ -0,0 +1,76 @@ +/* $Id: sock_qos_dummy.c 2966 2009-10-25 09:02:07Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/errno.h> +#include <pj/log.h> + +/* Dummy implementation of QoS API. + * (this is controlled by pjlib's config.h) + */ +#if defined(PJ_QOS_IMPLEMENTATION) && PJ_QOS_IMPLEMENTATION==PJ_QOS_DUMMY + +#define THIS_FILE "sock_qos_dummy.c" + + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_set_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(type); + + PJ_LOG(4,(THIS_FILE, "pj_sock_set_qos_type() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(p_param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_get_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(p_type); + + PJ_LOG(4,(THIS_FILE, "pj_sock_get_qos_type() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +#endif /* PJ_QOS_DUMMY */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..55a41097540a88ee0e5c173b84fe8bee061ab635 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_symbian.cpp @@ -0,0 +1,95 @@ +/* $Id: sock_qos_symbian.cpp 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include "os_symbian.h" + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL); + + CPjSocket *pjsock = (CPjSocket*)sock; + RSocket & rsock = pjsock->Socket(); + pj_status_t last_err = PJ_ENOTSUP; + + /* SO_PRIORITY and WMM are not supported */ + param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO | PJ_QOS_PARAM_HAS_WMM); + + if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { + TInt err; + + err = rsock.SetOpt(KSoIpTOS, KProtocolInetIp, + (param->dscp_val << 2)); + if (err != KErrNone) { + last_err = PJ_RETURN_OS_ERROR(err); + param->flags &= ~(PJ_QOS_PARAM_HAS_DSCP); + } + } + + return param->flags ? PJ_SUCCESS : last_err; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_qos_get_params(type, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_sock_set_qos_params(sock, ¶m); +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL); + + CPjSocket *pjsock = (CPjSocket*)sock; + RSocket & rsock = pjsock->Socket(); + TInt err, dscp; + + pj_bzero(p_param, sizeof(*p_param)); + + err = rsock.GetOpt(KSoIpTOS, KProtocolInetIp, dscp); + if (err == KErrNone) { + p_param->flags |= PJ_QOS_PARAM_HAS_DSCP; + p_param->dscp_val = (dscp >> 2); + return PJ_SUCCESS; + } else { + return PJ_RETURN_OS_ERROR(err); + } +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + pj_qos_params param; + pj_status_t status; + + status = pj_sock_get_qos_params(sock, ¶m); + if (status != PJ_SUCCESS) + return status; + + return pj_qos_get_type(¶m, p_type); +} + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_wm.c b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_wm.c new file mode 100644 index 0000000000000000000000000000000000000000..895d74f342bb13fd0667e221d992847853c1afbf --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_qos_wm.c @@ -0,0 +1,103 @@ +/* $Id: sock_qos_wm.c 2966 2009-10-25 09:02:07Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/sock_qos.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/log.h> + +#include <winsock.h> + +/* QoS implementation for Windows Mobile 6, must be enabled explicitly + * (this is controlled by pjlib's config.h) + */ +#if defined(PJ_QOS_IMPLEMENTATION) && PJ_QOS_IMPLEMENTATION==PJ_QOS_WM + +#define THIS_FILE "sock_qos_wm.c" + +/* Mapping between our traffic type and WM's DSCP traffic types */ +static const int dscp_map[] = +{ + DSCPBestEffort, + DSCPBackground, + DSCPVideo, + DSCPAudio, + DSCPControl +}; + +PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, + pj_qos_params *param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_set_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock, + pj_qos_type type) +{ + int value; + + PJ_ASSERT_RETURN(type < PJ_ARRAY_SIZE(dscp_map), PJ_EINVAL); + + value = dscp_map[type]; + return pj_sock_setsockopt(sock, IPPROTO_IP, IP_DSCP_TRAFFIC_TYPE, + &value, sizeof(value)); +} + + +PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, + pj_qos_params *p_param) +{ + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(p_param); + + PJ_LOG(4,(THIS_FILE, "pj_sock_get_qos_params() is not implemented " + "for this platform")); + return PJ_ENOTSUP; +} + +PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock, + pj_qos_type *p_type) +{ + pj_status_t status; + int value, optlen; + unsigned i; + + optlen = sizeof(value); + value = 0; + status = pj_sock_getsockopt(sock, IPPROTO_IP, IP_DSCP_TRAFFIC_TYPE, + &value, &optlen); + if (status != PJ_SUCCESS) + return status; + + *p_type = PJ_QOS_TYPE_BEST_EFFORT; + for (i=0; i<PJ_ARRAY_SIZE(dscp_map); ++i) { + if (value == dscp_map[i]) { + *p_type = (pj_qos_type)i; + break; + } + } + + return PJ_SUCCESS; +} + +#endif /* PJ_QOS_IMPLEMENTATION */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp index 48170ff6d014141c1914aa352a001d1e17eaf021..727bcfdf8b3783a3e984f2804c642d3ab86a37cb 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_select_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: sock_select_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/sock_select.h> #include <pj/array.h> @@ -23,143 +23,140 @@ #include <pj/os.h> #include "os_symbian.h" - -struct symbian_fd_set { + +struct symbian_fd_set +{ unsigned count; CPjSocket *sock[PJ_IOQUEUE_MAX_HANDLES]; }; -PJ_DEF (void) PJ_FD_ZERO (pj_fd_set_t *fdsetp) +PJ_DEF(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; fds->count = 0; } -PJ_DEF (void) PJ_FD_SET (pj_sock_t fd, pj_fd_set_t *fdsetp) +PJ_DEF(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; - PJ_ASSERT_ON_FAIL (fds->count < PJ_IOQUEUE_MAX_HANDLES, return); - fds->sock[fds->count++] = (CPjSocket*) fd; + PJ_ASSERT_ON_FAIL(fds->count < PJ_IOQUEUE_MAX_HANDLES, return); + fds->sock[fds->count++] = (CPjSocket*)fd; } -PJ_DEF (void) PJ_FD_CLR (pj_sock_t fd, pj_fd_set_t *fdsetp) +PJ_DEF(void) PJ_FD_CLR(pj_sock_t fd, pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; unsigned i; - + for (i=0; i<fds->count; ++i) { - if (fds->sock[i] == (CPjSocket*) fd) { - pj_array_erase (fds->sock, sizeof (fds->sock[0]), fds->count, i); - --fds->count; - return; - } + if (fds->sock[i] == (CPjSocket*)fd) { + pj_array_erase(fds->sock, sizeof(fds->sock[0]), fds->count, i); + --fds->count; + return; + } } } -PJ_DEF (pj_bool_t) PJ_FD_ISSET (pj_sock_t fd, const pj_fd_set_t *fdsetp) +PJ_DEF(pj_bool_t) PJ_FD_ISSET(pj_sock_t fd, const pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; unsigned i; - + for (i=0; i<fds->count; ++i) { - if (fds->sock[i] == (CPjSocket*) fd) { - return PJ_TRUE; - } + if (fds->sock[i] == (CPjSocket*)fd) { + return PJ_TRUE; + } } return PJ_FALSE; } -PJ_DEF (pj_size_t) PJ_FD_COUNT (const pj_fd_set_t *fdsetp) +PJ_DEF(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp) { - symbian_fd_set *fds = (symbian_fd_set *) fdsetp; + symbian_fd_set *fds = (symbian_fd_set *)fdsetp; return fds->count; } -PJ_DEF (int) pj_sock_select (int n, - pj_fd_set_t *readfds, - pj_fd_set_t *writefds, - pj_fd_set_t *exceptfds, - const pj_time_val *timeout) +PJ_DEF(int) pj_sock_select( int n, + pj_fd_set_t *readfds, + pj_fd_set_t *writefds, + pj_fd_set_t *exceptfds, + const pj_time_val *timeout) { CPjTimeoutTimer *pjTimer; unsigned i; - PJ_UNUSED_ARG (n); - PJ_UNUSED_ARG (writefds); - PJ_UNUSED_ARG (exceptfds); + PJ_UNUSED_ARG(n); + PJ_UNUSED_ARG(writefds); + PJ_UNUSED_ARG(exceptfds); if (timeout) { - pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); - pjTimer->StartTimer (timeout->sec*1000 + timeout->msec); + pjTimer = PjSymbianOS::Instance()->SelectTimeoutTimer(); + pjTimer->StartTimer(timeout->sec*1000 + timeout->msec); } else { - pjTimer = NULL; + pjTimer = NULL; } /* Scan for readable sockets */ if (readfds) { - symbian_fd_set *fds = (symbian_fd_set *) readfds; + symbian_fd_set *fds = (symbian_fd_set *)readfds; - do { - /* Scan sockets for readily available data */ - for (i=0; i<fds->count; ++i) { - CPjSocket *pjsock = fds->sock[i]; + do { + /* Scan sockets for readily available data */ + for (i=0; i<fds->count; ++i) { + CPjSocket *pjsock = fds->sock[i]; - if (pjsock->Reader()) { - if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { + if (pjsock->Reader()) { + if (pjsock->Reader()->HasData() && !pjsock->Reader()->IsActive()) { - /* Found socket with data ready */ - PJ_FD_ZERO (readfds); - PJ_FD_SET ( (pj_sock_t) pjsock, readfds); + /* Found socket with data ready */ + PJ_FD_ZERO(readfds); + PJ_FD_SET((pj_sock_t)pjsock, readfds); - /* Cancel timer, if any */ + /* Cancel timer, if any */ + if (pjTimer) { + pjTimer->Cancel(); + } - if (pjTimer) { - pjTimer->Cancel(); - } + /* Clear writable and exception fd_set */ + if (writefds) + PJ_FD_ZERO(writefds); + if (exceptfds) + PJ_FD_ZERO(exceptfds); - /* Clear writable and exception fd_set */ - if (writefds) - PJ_FD_ZERO (writefds); + return 1; - if (exceptfds) - PJ_FD_ZERO (exceptfds); + } else if (!pjsock->Reader()->IsActive()) + pjsock->Reader()->StartRecvFrom(); - return 1; + } else { + pjsock->CreateReader(); + pjsock->Reader()->StartRecvFrom(); + } + } - } else if (!pjsock->Reader()->IsActive()) - pjsock->Reader()->StartRecvFrom(); + PjSymbianOS::Instance()->WaitForActiveObjects(); - } else { - pjsock->CreateReader(); - pjsock->Reader()->StartRecvFrom(); - } - } - - PjSymbianOS::Instance()->WaitForActiveObjects(); - - } while (pjTimer==NULL || !pjTimer->HasTimedOut()); + } while (pjTimer==NULL || !pjTimer->HasTimedOut()); } /* Timeout */ if (readfds) - PJ_FD_ZERO (readfds); - + PJ_FD_ZERO(readfds); if (writefds) - PJ_FD_ZERO (writefds); - + PJ_FD_ZERO(writefds); if (exceptfds) - PJ_FD_ZERO (exceptfds); + PJ_FD_ZERO(exceptfds); return 0; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp index af174cc85551b6b23beba92981108042ef90a6eb..b1c725c1493a28b5b227ce06ca0fa35ded9d36ff 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/sock_symbian.cpp @@ -1,5 +1,5 @@ -/* $Id: sock_symbian.cpp 2771 2009-06-17 13:31:13Z bennylp $ */ -/* +/* $Id: sock_symbian.cpp 2966 2009-10-25 09:02:07Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/sock.h> #include <pj/addr_resolv.h> @@ -47,7 +47,7 @@ const pj_uint16_t PJ_SOCK_DGRAM = KSockDatagram; const pj_uint16_t PJ_SOCK_RAW = 0xFFFF; const pj_uint16_t PJ_SOCK_RDM = 0xFFFF; -/* setsockop() is not really supported. */ +/* we don't support setsockopt(), these are just dummy values */ const pj_uint16_t PJ_SOL_SOCKET = 0xFFFF; const pj_uint16_t PJ_SOL_IP = 0xFFFF; const pj_uint16_t PJ_SOL_TCP = 0xFFFF; @@ -61,6 +61,11 @@ const pj_uint16_t PJ_IPTOS_THROUGHPUT = 0; const pj_uint16_t PJ_IPTOS_RELIABILITY = 0; const pj_uint16_t PJ_IPTOS_MINCOST = 0; +/* Misc */ +const pj_uint16_t PJ_TCP_NODELAY = 0xFFFF; +const pj_uint16_t PJ_SO_REUSEADDR = 0xFFFF; +const pj_uint16_t PJ_SO_PRIORITY = 0xFFFF; + /* ioctl() is also not supported. */ const pj_uint16_t PJ_SO_TYPE = 0xFFFF; const pj_uint16_t PJ_SO_RCVBUF = 0xFFFF; @@ -92,19 +97,19 @@ CPjSocket::~CPjSocket() // Create socket reader. -CPjSocketReader *CPjSocket::CreateReader (unsigned max_len) +CPjSocketReader *CPjSocket::CreateReader(unsigned max_len) { - pj_assert (sockReader_ == NULL); - return sockReader_ = CPjSocketReader::NewL (*this, max_len); + pj_assert(sockReader_ == NULL); + return sockReader_ = CPjSocketReader::NewL(*this, max_len); } // Delete socket reader when it's not wanted. -void CPjSocket::DestroyReader() +void CPjSocket::DestroyReader() { if (sockReader_) { - sockReader_->Cancel(); - delete sockReader_; - sockReader_ = NULL; + sockReader_->Cancel(); + delete sockReader_; + sockReader_ = NULL; } } @@ -116,28 +121,28 @@ void CPjSocket::DestroyReader() // -CPjSocketReader::CPjSocketReader (CPjSocket &sock) - : CActive (EPriorityStandard), - sock_ (sock), buffer_ (NULL, 0), readCb_ (NULL), key_ (NULL) +CPjSocketReader::CPjSocketReader(CPjSocket &sock) +: CActive(EPriorityStandard), + sock_(sock), buffer_(NULL, 0), readCb_(NULL), key_(NULL) { } -void CPjSocketReader::ConstructL (unsigned max_len) +void CPjSocketReader::ConstructL(unsigned max_len) { isDatagram_ = sock_.IsDatagram(); TUint8 *ptr = new TUint8[max_len]; - buffer_.Set (ptr, 0, (TInt) max_len); - CActiveScheduler::Add (this); + buffer_.Set(ptr, 0, (TInt)max_len); + CActiveScheduler::Add(this); } -CPjSocketReader *CPjSocketReader::NewL (CPjSocket &sock, unsigned max_len) +CPjSocketReader *CPjSocketReader::NewL(CPjSocket &sock, unsigned max_len) { - CPjSocketReader *self = new (ELeave) CPjSocketReader (sock); - CleanupStack::PushL (self); - self->ConstructL (max_len); - CleanupStack::Pop (self); + CPjSocketReader *self = new (ELeave) CPjSocketReader(sock); + CleanupStack::PushL(self); + self->ConstructL(max_len); + CleanupStack::Pop(self); return self; } @@ -149,29 +154,27 @@ CPjSocketReader::~CPjSocketReader() delete [] data; } -void CPjSocketReader::StartRecv (void (*cb) (void *key), - void *key, - TDes8 *aDesc, - TUint flags) +void CPjSocketReader::StartRecv(void (*cb)(void *key), + void *key, + TDes8 *aDesc, + TUint flags) { - StartRecvFrom (cb, key, aDesc, flags, NULL); + StartRecvFrom(cb, key, aDesc, flags, NULL); } -void CPjSocketReader::StartRecvFrom (void (*cb) (void *key), - void *key, - TDes8 *aDesc, - TUint flags, - TSockAddr *fromAddr) +void CPjSocketReader::StartRecvFrom(void (*cb)(void *key), + void *key, + TDes8 *aDesc, + TUint flags, + TSockAddr *fromAddr) { readCb_ = cb; key_ = key; if (aDesc == NULL) aDesc = &buffer_; - if (fromAddr == NULL) fromAddr = &recvAddr_; - sock_.Socket().RecvFrom (*aDesc, *fromAddr, flags, iStatus); - + sock_.Socket().RecvFrom(*aDesc, *fromAddr, flags, iStatus); SetActive(); } @@ -182,41 +185,40 @@ void CPjSocketReader::DoCancel() void CPjSocketReader::RunL() { - void (*old_cb) (void *key) = readCb_; + void (*old_cb)(void *key) = readCb_; void *old_key = key_; readCb_ = NULL; key_ = NULL; if (old_cb) { - (*old_cb) (old_key); + (*old_cb)(old_key); } } // Append data to aDesc, up to aDesc's maximum size. // If socket is datagram based, buffer_ will be clared. -void CPjSocketReader::ReadData (TDes8 &aDesc, TInetAddr *addr) +void CPjSocketReader::ReadData(TDes8 &aDesc, TInetAddr *addr) { if (isDatagram_) - aDesc.Zero(); + aDesc.Zero(); if (buffer_.Length() == 0) - return; + return; TInt size_to_copy = aDesc.MaxLength() - aDesc.Length(); - if (size_to_copy > buffer_.Length()) - size_to_copy = buffer_.Length(); + size_to_copy = buffer_.Length(); - aDesc.Append (buffer_.Ptr(), size_to_copy); + aDesc.Append(buffer_.Ptr(), size_to_copy); if (isDatagram_) - buffer_.Zero(); + buffer_.Zero(); else - buffer_.Delete (0, size_to_copy); + buffer_.Delete(0, size_to_copy); if (addr) - *addr = recvAddr_; + *addr = recvAddr_; } @@ -229,10 +231,10 @@ void CPjSocketReader::ReadData (TDes8 &aDesc, TInetAddr *addr) /* * Convert 16-bit value from network byte order to host byte order. */ -PJ_DEF (pj_uint16_t) pj_ntohs (pj_uint16_t netshort) +PJ_DEF(pj_uint16_t) pj_ntohs(pj_uint16_t netshort) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap16 (netshort); + return pj_swap16(netshort); #else return netshort; #endif @@ -241,10 +243,10 @@ PJ_DEF (pj_uint16_t) pj_ntohs (pj_uint16_t netshort) /* * Convert 16-bit value from host byte order to network byte order. */ -PJ_DEF (pj_uint16_t) pj_htons (pj_uint16_t hostshort) +PJ_DEF(pj_uint16_t) pj_htons(pj_uint16_t hostshort) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap16 (hostshort); + return pj_swap16(hostshort); #else return hostshort; #endif @@ -253,10 +255,10 @@ PJ_DEF (pj_uint16_t) pj_htons (pj_uint16_t hostshort) /* * Convert 32-bit value from network byte order to host byte order. */ -PJ_DEF (pj_uint32_t) pj_ntohl (pj_uint32_t netlong) +PJ_DEF(pj_uint32_t) pj_ntohl(pj_uint32_t netlong) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap32 (netlong); + return pj_swap32(netlong); #else return netlong; #endif @@ -265,10 +267,10 @@ PJ_DEF (pj_uint32_t) pj_ntohl (pj_uint32_t netlong) /* * Convert 32-bit value from host byte order to network byte order. */ -PJ_DEF (pj_uint32_t) pj_htonl (pj_uint32_t hostlong) +PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong) { #if PJ_IS_LITTLE_ENDIAN - return pj_swap32 (hostlong); + return pj_swap32(hostlong); #else return netlong; #endif @@ -278,25 +280,25 @@ PJ_DEF (pj_uint32_t) pj_htonl (pj_uint32_t hostlong) * Convert an Internet host address given in network byte order * to string in standard numbers and dots notation. */ -PJ_DEF (char*) pj_inet_ntoa (pj_in_addr inaddr) +PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) { - static char str8[PJ_INET_ADDRSTRLEN]; - TBuf<PJ_INET_ADDRSTRLEN> str16 (0); + static char str8[PJ_INET_ADDRSTRLEN]; + TBuf<PJ_INET_ADDRSTRLEN> str16(0); /* (Symbian IP address is in host byte order) */ - TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0); - temp_addr.Output (str16); - - return pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), - str8, sizeof (str8)); + TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); + temp_addr.Output(str16); + + return pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), + str8, sizeof(str8)); } /* * This function converts the Internet host address cp from the standard * numbers-and-dots notation into binary data and stores it in the structure - * that inp points to. + * that inp points to. */ -PJ_DEF (int) pj_inet_aton (const pj_str_t *cp, struct pj_in_addr *inp) +PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp) { enum { MAXIPLEN = PJ_INET_ADDRSTRLEN }; @@ -310,52 +312,48 @@ PJ_DEF (int) pj_inet_aton (const pj_str_t *cp, struct pj_in_addr *inp) * this function might be called with cp->slen >= 16 * (i.e. when called with hostname to check if it's an IP addr). */ - PJ_ASSERT_RETURN (cp && cp->slen && inp, 0); - + PJ_ASSERT_RETURN(cp && cp->slen && inp, 0); if (cp->slen >= 16) { - return 0; + return 0; } char tempaddr8[MAXIPLEN]; - - pj_memcpy (tempaddr8, cp->ptr, cp->slen); + pj_memcpy(tempaddr8, cp->ptr, cp->slen); tempaddr8[cp->slen] = '\0'; wchar_t tempaddr16[MAXIPLEN]; - pj_ansi_to_unicode (tempaddr8, pj_ansi_strlen (tempaddr8), - tempaddr16, sizeof (tempaddr16)); + pj_ansi_to_unicode(tempaddr8, pj_ansi_strlen(tempaddr8), + tempaddr16, sizeof(tempaddr16)); - TBuf<MAXIPLEN> ip_addr ( (const TText*) tempaddr16); + TBuf<MAXIPLEN> ip_addr((const TText*)tempaddr16); TInetAddr addr; - addr.Init (KAfInet); - - if (addr.Input (ip_addr) == KErrNone) { - /* Success (Symbian IP address is in host byte order) */ - inp->s_addr = pj_htonl (addr.Address()); - return 1; + addr.Init(KAfInet); + if (addr.Input(ip_addr) == KErrNone) { + /* Success (Symbian IP address is in host byte order) */ + inp->s_addr = pj_htonl(addr.Address()); + return 1; } else { - /* Error */ - return 0; + /* Error */ + return 0; } } /* * Convert text to IPv4/IPv6 address. */ -PJ_DEF (pj_status_t) pj_inet_pton (int af, const pj_str_t *src, void *dst) +PJ_DEF(pj_status_t) pj_inet_pton(int af, const pj_str_t *src, void *dst) { char tempaddr[PJ_INET6_ADDRSTRLEN]; - PJ_ASSERT_RETURN (af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL); - PJ_ASSERT_RETURN (src && src->slen && dst, PJ_EINVAL); + PJ_ASSERT_RETURN(af==PJ_AF_INET || af==PJ_AF_INET6, PJ_EINVAL); + PJ_ASSERT_RETURN(src && src->slen && dst, PJ_EINVAL); - /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be + /* Initialize output with PJ_IN_ADDR_NONE for IPv4 (to be * compatible with pj_inet_aton() */ - if (af==PJ_AF_INET) { - ( (pj_in_addr*) dst)->s_addr = PJ_INADDR_NONE; + ((pj_in_addr*)dst)->s_addr = PJ_INADDR_NONE; } /* Caution: @@ -363,96 +361,88 @@ PJ_DEF (pj_status_t) pj_inet_pton (int af, const pj_str_t *src, void *dst) * (i.e. when called with hostname to check if it's an IP addr). */ if (src->slen >= PJ_INET6_ADDRSTRLEN) { - return PJ_ENAMETOOLONG; + return PJ_ENAMETOOLONG; } - pj_memcpy (tempaddr, src->ptr, src->slen); - + pj_memcpy(tempaddr, src->ptr, src->slen); tempaddr[src->slen] = '\0'; wchar_t tempaddr16[PJ_INET6_ADDRSTRLEN]; - pj_ansi_to_unicode (tempaddr, pj_ansi_strlen (tempaddr), - tempaddr16, sizeof (tempaddr16)); + pj_ansi_to_unicode(tempaddr, pj_ansi_strlen(tempaddr), + tempaddr16, sizeof(tempaddr16)); - TBuf<PJ_INET6_ADDRSTRLEN> ip_addr ( (const TText*) tempaddr16); + TBuf<PJ_INET6_ADDRSTRLEN> ip_addr((const TText*)tempaddr16); TInetAddr addr; - addr.Init (KAfInet6); - - if (addr.Input (ip_addr) == KErrNone) { - if (af==PJ_AF_INET) { - /* Success (Symbian IP address is in host byte order) */ - pj_uint32_t ip = pj_htonl (addr.Address()); - pj_memcpy (dst, &ip, 4); - } else if (af==PJ_AF_INET6) { - const TIp6Addr & ip6 = addr.Ip6Address(); - pj_memcpy (dst, ip6.u.iAddr8, 16); - } else { - pj_assert (!"Unexpected!"); - return PJ_EBUG; - } - - return PJ_SUCCESS; + addr.Init(KAfInet6); + if (addr.Input(ip_addr) == KErrNone) { + if (af==PJ_AF_INET) { + /* Success (Symbian IP address is in host byte order) */ + pj_uint32_t ip = pj_htonl(addr.Address()); + pj_memcpy(dst, &ip, 4); + } else if (af==PJ_AF_INET6) { + const TIp6Addr & ip6 = addr.Ip6Address(); + pj_memcpy(dst, ip6.u.iAddr8, 16); + } else { + pj_assert(!"Unexpected!"); + return PJ_EBUG; + } + return PJ_SUCCESS; } else { - /* Error */ - return PJ_EINVAL; + /* Error */ + return PJ_EINVAL; } } /* * Convert IPv4/IPv6 address to text. */ -PJ_DEF (pj_status_t) pj_inet_ntop (int af, const void *src, - char *dst, int size) +PJ_DEF(pj_status_t) pj_inet_ntop(int af, const void *src, + char *dst, int size) { - PJ_ASSERT_RETURN (src && dst && size, PJ_EINVAL); + PJ_ASSERT_RETURN(src && dst && size, PJ_EINVAL); *dst = '\0'; if (af==PJ_AF_INET) { - TBuf<PJ_INET_ADDRSTRLEN> str16; - pj_in_addr inaddr; - - if (size < PJ_INET_ADDRSTRLEN) - return PJ_ETOOSMALL; + TBuf<PJ_INET_ADDRSTRLEN> str16; + pj_in_addr inaddr; - pj_memcpy (&inaddr, src, 4); + if (size < PJ_INET_ADDRSTRLEN) + return PJ_ETOOSMALL; - /* Symbian IP address is in host byte order */ - TInetAddr temp_addr ( (TUint32) pj_ntohl (inaddr.s_addr), (TUint) 0); + pj_memcpy(&inaddr, src, 4); - temp_addr.Output (str16); - - pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), - dst, size); - - return PJ_SUCCESS; + /* Symbian IP address is in host byte order */ + TInetAddr temp_addr((TUint32)pj_ntohl(inaddr.s_addr), (TUint)0); + temp_addr.Output(str16); + + pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), + dst, size); + return PJ_SUCCESS; } else if (af==PJ_AF_INET6) { - TBuf<PJ_INET6_ADDRSTRLEN> str16; - - if (size < PJ_INET6_ADDRSTRLEN) - return PJ_ETOOSMALL; - - TIp6Addr ip6; - - pj_memcpy (ip6.u.iAddr8, src, 16); - - TInetAddr temp_addr (ip6, (TUint) 0); + TBuf<PJ_INET6_ADDRSTRLEN> str16; - temp_addr.Output (str16); + if (size < PJ_INET6_ADDRSTRLEN) + return PJ_ETOOSMALL; - pj_unicode_to_ansi ( (const wchar_t*) str16.PtrZ(), str16.Length(), - dst, size); + TIp6Addr ip6; + pj_memcpy(ip6.u.iAddr8, src, 16); - return PJ_SUCCESS; + TInetAddr temp_addr(ip6, (TUint)0); + temp_addr.Output(str16); + + pj_unicode_to_ansi((const wchar_t*)str16.PtrZ(), str16.Length(), + dst, size); + return PJ_SUCCESS; } else { - pj_assert (!"Unsupport address family"); - return PJ_EINVAL; + pj_assert(!"Unsupport address family"); + return PJ_EINVAL; } } @@ -460,7 +450,7 @@ PJ_DEF (pj_status_t) pj_inet_ntop (int af, const void *src, /* * Get hostname. */ -PJ_DEF (const pj_str_t*) pj_gethostname (void) +PJ_DEF(const pj_str_t*) pj_gethostname(void) { static char buf[PJ_MAX_HOSTNAME]; static pj_str_t hostname; @@ -468,70 +458,66 @@ PJ_DEF (const pj_str_t*) pj_gethostname (void) PJ_CHECK_STACK(); if (hostname.ptr == NULL) { - RHostResolver &resv = PjSymbianOS::Instance()->GetResolver (PJ_AF_INET); - TRequestStatus reqStatus; - THostName tmpName; + RHostResolver &resv = PjSymbianOS::Instance()->GetResolver(PJ_AF_INET); + TRequestStatus reqStatus; + THostName tmpName; - // Return empty hostname if access point is marked as down by app. - PJ_SYMBIAN_CHECK_CONNECTION2 (&hostname); + // Return empty hostname if access point is marked as down by app. + PJ_SYMBIAN_CHECK_CONNECTION2(&hostname); - resv.GetHostName (tmpName, reqStatus); - User::WaitForRequest (reqStatus); + resv.GetHostName(tmpName, reqStatus); + User::WaitForRequest(reqStatus); - hostname.ptr = pj_unicode_to_ansi ( (const wchar_t*) tmpName.Ptr(), tmpName.Length(), - buf, sizeof (buf)); - hostname.slen = tmpName.Length(); + hostname.ptr = pj_unicode_to_ansi((const wchar_t*)tmpName.Ptr(), tmpName.Length(), + buf, sizeof(buf)); + hostname.slen = tmpName.Length(); } - return &hostname; } /* * Create new socket/endpoint for communication and returns a descriptor. */ -PJ_DEF (pj_status_t) pj_sock_socket (int af, - int type, - int proto, - pj_sock_t *p_sock) +PJ_DEF(pj_status_t) pj_sock_socket(int af, + int type, + int proto, + pj_sock_t *p_sock) { TInt rc; PJ_CHECK_STACK(); /* Sanity checks. */ - PJ_ASSERT_RETURN (p_sock!=NULL, PJ_EINVAL); + PJ_ASSERT_RETURN(p_sock!=NULL, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - + /* Set proto if none is specified. */ - if (proto == 0) { - if (type == pj_SOCK_STREAM()) - proto = KProtocolInetTcp; - else if (type == pj_SOCK_DGRAM()) - proto = KProtocolInetUdp; + if (type == pj_SOCK_STREAM()) + proto = KProtocolInetTcp; + else if (type == pj_SOCK_DGRAM()) + proto = KProtocolInetUdp; } /* Create Symbian RSocket */ RSocket rSock; - if (PjSymbianOS::Instance()->Connection()) - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, type, proto, - *PjSymbianOS::Instance()->Connection()); + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, type, proto, + *PjSymbianOS::Instance()->Connection()); else - rc = rSock.Open (PjSymbianOS::Instance()->SocketServ(), - af, type, proto); - + rc = rSock.Open(PjSymbianOS::Instance()->SocketServ(), + af, type, proto); + if (rc != KErrNone) - return PJ_RETURN_OS_ERROR (rc); + return PJ_RETURN_OS_ERROR(rc); /* Wrap Symbian RSocket into PJLIB's CPjSocket, and return to caller */ - CPjSocket *pjSock = new CPjSocket (af, type, rSock); - - *p_sock = (pj_sock_t) pjSock; + CPjSocket *pjSock = new CPjSocket(af, type, rSock); + *p_sock = (pj_sock_t)pjSock; return PJ_SUCCESS; } @@ -540,65 +526,64 @@ PJ_DEF (pj_status_t) pj_sock_socket (int af, /* * Bind socket. */ -PJ_DEF (pj_status_t) pj_sock_bind (pj_sock_t sock, - const pj_sockaddr_t *addr, - int len) +PJ_DEF(pj_status_t) pj_sock_bind( pj_sock_t sock, + const pj_sockaddr_t *addr, + int len) { pj_status_t status; TInt rc; PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL); - PJ_ASSERT_RETURN (addr && len>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL); + PJ_ASSERT_RETURN(addr && len>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); // Convert PJLIB's pj_sockaddr into Symbian's TInetAddr TInetAddr inetAddr; - status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, len, inetAddr); - + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, len, inetAddr); if (status != PJ_SUCCESS) - return status; + return status; // Get the RSocket instance - RSocket &rSock = ( (CPjSocket*) sock)->Socket(); + RSocket &rSock = ((CPjSocket*)sock)->Socket(); // Bind - rc = rSock.Bind (inetAddr); + rc = rSock.Bind(inetAddr); - return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR (rc); + return (rc==KErrNone) ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(rc); } /* * Bind socket. */ -PJ_DEF (pj_status_t) pj_sock_bind_in (pj_sock_t sock, - pj_uint32_t addr32, - pj_uint16_t port) +PJ_DEF(pj_status_t) pj_sock_bind_in( pj_sock_t sock, + pj_uint32_t addr32, + pj_uint16_t port) { pj_sockaddr_in addr; PJ_CHECK_STACK(); - pj_bzero (&addr, sizeof (addr)); + pj_bzero(&addr, sizeof(addr)); addr.sin_family = PJ_AF_INET; - addr.sin_addr.s_addr = pj_htonl (addr32); - addr.sin_port = pj_htons (port); + addr.sin_addr.s_addr = pj_htonl(addr32); + addr.sin_port = pj_htons(port); - return pj_sock_bind (sock, &addr, sizeof (pj_sockaddr_in)); + return pj_sock_bind(sock, &addr, sizeof(pj_sockaddr_in)); } /* * Close socket. */ -PJ_DEF (pj_status_t) pj_sock_close (pj_sock_t sock) +PJ_DEF(pj_status_t) pj_sock_close(pj_sock_t sock) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock != 0, PJ_EINVAL); + PJ_ASSERT_RETURN(sock != 0, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; // This will close the socket. delete pjSock; @@ -609,334 +594,325 @@ PJ_DEF (pj_status_t) pj_sock_close (pj_sock_t sock) /* * Get remote's name. */ -PJ_DEF (pj_status_t) pj_sock_getpeername (pj_sock_t sock, - pj_sockaddr_t *addr, - int *namelen) +PJ_DEF(pj_status_t) pj_sock_getpeername( pj_sock_t sock, + pj_sockaddr_t *addr, + int *namelen) { PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN(sock && addr && namelen && + *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - PJ_ASSERT_RETURN (sock && addr && namelen && - *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); // Socket must be connected. - PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP); + PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP); TInetAddr inetAddr; - rSock.RemoteName (inetAddr); + rSock.RemoteName(inetAddr); - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen); + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen); } /* * Get socket name. */ -PJ_DEF (pj_status_t) pj_sock_getsockname (pj_sock_t sock, - pj_sockaddr_t *addr, - int *namelen) +PJ_DEF(pj_status_t) pj_sock_getsockname( pj_sock_t sock, + pj_sockaddr_t *addr, + int *namelen) { PJ_CHECK_STACK(); + + PJ_ASSERT_RETURN(sock && addr && namelen && + *namelen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); - PJ_ASSERT_RETURN (sock && addr && namelen && - *namelen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); - - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); TInetAddr inetAddr; - rSock.LocalName (inetAddr); + rSock.LocalName(inetAddr); - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) addr, namelen); + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)addr, namelen); } /* * Send data */ -PJ_DEF (pj_status_t) pj_sock_send (pj_sock_t sock, - const void *buf, - pj_ssize_t *len, - unsigned flags) +PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock, + const void *buf, + pj_ssize_t *len, + unsigned flags) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - - CPjSocket *pjSock = (CPjSocket*) sock; + + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); // send() should only be called to connected socket - PJ_ASSERT_RETURN (pjSock->IsConnected(), PJ_EINVALIDOP); + PJ_ASSERT_RETURN(pjSock->IsConnected(), PJ_EINVALIDOP); - TPtrC8 data ( (const TUint8*) buf, (TInt) *len); + TPtrC8 data((const TUint8*)buf, (TInt)*len); TRequestStatus reqStatus; TSockXfrLength sentLen; - rSock.Send (data, flags, reqStatus, sentLen); - User::WaitForRequest (reqStatus); + rSock.Send(data, flags, reqStatus, sentLen); + User::WaitForRequest(reqStatus); - if (reqStatus.Int() ==KErrNone) { - //*len = (TInt) sentLen.Length(); - return PJ_SUCCESS; + if (reqStatus.Int()==KErrNone) { + //*len = (TInt) sentLen.Length(); + return PJ_SUCCESS; } else - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } /* * Send data. */ -PJ_DEF (pj_status_t) pj_sock_sendto (pj_sock_t sock, - const void *buf, - pj_ssize_t *len, - unsigned flags, - const pj_sockaddr_t *to, - int tolen) +PJ_DEF(pj_status_t) pj_sock_sendto(pj_sock_t sock, + const void *buf, + pj_ssize_t *len, + unsigned flags, + const pj_sockaddr_t *to, + int tolen) { pj_status_t status; - + PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - - CPjSocket *pjSock = (CPjSocket*) sock; + + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); // Only supports AF_INET for now - PJ_ASSERT_RETURN (tolen>= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + PJ_ASSERT_RETURN(tolen>=(int)sizeof(pj_sockaddr_in), PJ_EINVAL); TInetAddr inetAddr; - status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) to, tolen, inetAddr); - + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)to, tolen, inetAddr); if (status != PJ_SUCCESS) - return status; - - TPtrC8 data ( (const TUint8*) buf, (TInt) *len); + return status; + TPtrC8 data((const TUint8*)buf, (TInt)*len); TRequestStatus reqStatus; - TSockXfrLength sentLen; - rSock.SendTo (data, inetAddr, flags, reqStatus, sentLen); - - User::WaitForRequest (reqStatus); + rSock.SendTo(data, inetAddr, flags, reqStatus, sentLen); + User::WaitForRequest(reqStatus); - if (reqStatus.Int() ==KErrNone) { - //For some reason TSockXfrLength is not returning correctly! - //*len = (TInt) sentLen.Length(); - return PJ_SUCCESS; - } else - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + if (reqStatus.Int()==KErrNone) { + //For some reason TSockXfrLength is not returning correctly! + //*len = (TInt) sentLen.Length(); + return PJ_SUCCESS; + } else + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } /* * Receive data. */ -PJ_DEF (pj_status_t) pj_sock_recv (pj_sock_t sock, - void *buf, - pj_ssize_t *len, - unsigned flags) +PJ_DEF(pj_status_t) pj_sock_recv(pj_sock_t sock, + void *buf, + pj_ssize_t *len, + unsigned flags) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len, PJ_EINVAL); - PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len, PJ_EINVAL); + PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; if (pjSock->Reader()) { - CPjSocketReader *reader = pjSock->Reader(); + CPjSocketReader *reader = pjSock->Reader(); - while (reader->IsActive() && !reader->HasData()) { - User::WaitForAnyRequest(); - } + while (reader->IsActive() && !reader->HasData()) { + User::WaitForAnyRequest(); + } - if (reader->HasData()) { - TPtr8 data ( (TUint8*) buf, (TInt) *len); - TInetAddr inetAddr; + if (reader->HasData()) { + TPtr8 data((TUint8*)buf, (TInt)*len); + TInetAddr inetAddr; - reader->ReadData (data, &inetAddr); + reader->ReadData(data, &inetAddr); - *len = data.Length(); - return PJ_SUCCESS; - } + *len = data.Length(); + return PJ_SUCCESS; + } } TRequestStatus reqStatus; - TSockXfrLength recvLen; - TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len); + TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); if (pjSock->IsDatagram()) { - pjSock->Socket().Recv (data, flags, reqStatus); + pjSock->Socket().Recv(data, flags, reqStatus); } else { - // Using static like this is not pretty, but we don't need to use - // the value anyway, hence doing it like this is probably most - // optimal. - static TSockXfrLength len; - pjSock->Socket().RecvOneOrMore (data, flags, reqStatus, len); + // Using static like this is not pretty, but we don't need to use + // the value anyway, hence doing it like this is probably most + // optimal. + static TSockXfrLength len; + pjSock->Socket().RecvOneOrMore(data, flags, reqStatus, len); } - - User::WaitForRequest (reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - //*len = (TInt)recvLen.Length(); - *len = data.Length(); - return PJ_SUCCESS; + //*len = (TInt)recvLen.Length(); + *len = data.Length(); + return PJ_SUCCESS; } else { - *len = -1; - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + *len = -1; + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } /* * Receive data. */ -PJ_DEF (pj_status_t) pj_sock_recvfrom (pj_sock_t sock, - void *buf, - pj_ssize_t *len, - unsigned flags, - pj_sockaddr_t *from, - int *fromlen) +PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock, + void *buf, + pj_ssize_t *len, + unsigned flags, + pj_sockaddr_t *from, + int *fromlen) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && buf && len && from && fromlen, PJ_EINVAL); - PJ_ASSERT_RETURN (*len > 0, PJ_EINVAL); - PJ_ASSERT_RETURN (*fromlen >= (int) sizeof (pj_sockaddr_in), PJ_EINVAL); + PJ_ASSERT_RETURN(sock && buf && len && from && fromlen, PJ_EINVAL); + PJ_ASSERT_RETURN(*len > 0, PJ_EINVAL); + PJ_ASSERT_RETURN(*fromlen >= (int)sizeof(pj_sockaddr_in), PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); if (pjSock->Reader()) { - CPjSocketReader *reader = pjSock->Reader(); + CPjSocketReader *reader = pjSock->Reader(); - while (reader->IsActive() && !reader->HasData()) { - User::WaitForAnyRequest(); - } + while (reader->IsActive() && !reader->HasData()) { + User::WaitForAnyRequest(); + } - if (reader->HasData()) { - TPtr8 data ( (TUint8*) buf, (TInt) *len); - TInetAddr inetAddr; + if (reader->HasData()) { + TPtr8 data((TUint8*)buf, (TInt)*len); + TInetAddr inetAddr; - reader->ReadData (data, &inetAddr); + reader->ReadData(data, &inetAddr); - *len = data.Length(); + *len = data.Length(); - if (from && fromlen) { - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, - fromlen); - } else { - return PJ_SUCCESS; - } - } + if (from && fromlen) { + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, + fromlen); + } else { + return PJ_SUCCESS; + } + } } TInetAddr inetAddr; - TRequestStatus reqStatus; TSockXfrLength recvLen; - TPtr8 data ( (TUint8*) buf, (TInt) *len, (TInt) *len); + TPtr8 data((TUint8*)buf, (TInt)*len, (TInt)*len); - rSock.RecvFrom (data, inetAddr, flags, reqStatus, recvLen); - User::WaitForRequest (reqStatus); + rSock.RecvFrom(data, inetAddr, flags, reqStatus, recvLen); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - //*len = (TInt)recvLen.Length(); - *len = data.Length(); - return PjSymbianOS::Addr2pj (inetAddr, * (pj_sockaddr*) from, fromlen); + //*len = (TInt)recvLen.Length(); + *len = data.Length(); + return PjSymbianOS::Addr2pj(inetAddr, *(pj_sockaddr*)from, fromlen); } else { - *len = -1; - *fromlen = -1; - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + *len = -1; + *fromlen = -1; + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } /* * Get socket option. */ -PJ_DEF (pj_status_t) pj_sock_getsockopt (pj_sock_t sock, - pj_uint16_t level, - pj_uint16_t optname, - void *optval, - int *optlen) +PJ_DEF(pj_status_t) pj_sock_getsockopt( pj_sock_t sock, + pj_uint16_t level, + pj_uint16_t optname, + void *optval, + int *optlen) { // Not supported for now. - PJ_UNUSED_ARG (sock); - PJ_UNUSED_ARG (level); - PJ_UNUSED_ARG (optname); - PJ_UNUSED_ARG (optval); - PJ_UNUSED_ARG (optlen); + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(level); + PJ_UNUSED_ARG(optname); + PJ_UNUSED_ARG(optval); + PJ_UNUSED_ARG(optlen); return PJ_EINVALIDOP; } /* * Set socket option. */ -PJ_DEF (pj_status_t) pj_sock_setsockopt (pj_sock_t sock, - pj_uint16_t level, - pj_uint16_t optname, - const void *optval, - int optlen) +PJ_DEF(pj_status_t) pj_sock_setsockopt( pj_sock_t sock, + pj_uint16_t level, + pj_uint16_t optname, + const void *optval, + int optlen) { // Not supported for now. - PJ_UNUSED_ARG (sock); - PJ_UNUSED_ARG (level); - PJ_UNUSED_ARG (optname); - PJ_UNUSED_ARG (optval); - PJ_UNUSED_ARG (optlen); + PJ_UNUSED_ARG(sock); + PJ_UNUSED_ARG(level); + PJ_UNUSED_ARG(optname); + PJ_UNUSED_ARG(optval); + PJ_UNUSED_ARG(optlen); return PJ_EINVALIDOP; } /* * Connect socket. */ -PJ_DEF (pj_status_t) pj_sock_connect (pj_sock_t sock, - const pj_sockaddr_t *addr, - int namelen) +PJ_DEF(pj_status_t) pj_sock_connect( pj_sock_t sock, + const pj_sockaddr_t *addr, + int namelen) { pj_status_t status; - + PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && addr && namelen, PJ_EINVAL); - PJ_ASSERT_RETURN ( ( (pj_sockaddr*) addr)->addr.sa_family == PJ_AF_INET, - PJ_EINVAL); + PJ_ASSERT_RETURN(sock && addr && namelen, PJ_EINVAL); + PJ_ASSERT_RETURN(((pj_sockaddr*)addr)->addr.sa_family == PJ_AF_INET, + PJ_EINVAL); // Return failure if access point is marked as down by app. PJ_SYMBIAN_CHECK_CONNECTION(); - - CPjSocket *pjSock = (CPjSocket*) sock; + + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); TInetAddr inetAddr; TRequestStatus reqStatus; - status = PjSymbianOS::pj2Addr (* (pj_sockaddr*) addr, namelen, inetAddr); - + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)addr, namelen, inetAddr); if (status != PJ_SUCCESS) - return status; + return status; - rSock.Connect (inetAddr, reqStatus); - - User::WaitForRequest (reqStatus); + rSock.Connect(inetAddr, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - pjSock->SetConnected (true); - return PJ_SUCCESS; + pjSock->SetConnected(true); + return PJ_SUCCESS; } else { - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } @@ -945,104 +921,100 @@ PJ_DEF (pj_status_t) pj_sock_connect (pj_sock_t sock, * Shutdown socket. */ #if PJ_HAS_TCP -PJ_DEF (pj_status_t) pj_sock_shutdown (pj_sock_t sock, - int how) +PJ_DEF(pj_status_t) pj_sock_shutdown( pj_sock_t sock, + int how) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock, PJ_EINVAL); + PJ_ASSERT_RETURN(sock, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); RSocket::TShutdown aHow; - if (how == PJ_SD_RECEIVE) - aHow = RSocket::EStopInput; + aHow = RSocket::EStopInput; else if (how == PJ_SHUT_WR) - aHow = RSocket::EStopOutput; + aHow = RSocket::EStopOutput; else - aHow = RSocket::ENormal; + aHow = RSocket::ENormal; TRequestStatus reqStatus; - rSock.Shutdown (aHow, reqStatus); - - User::WaitForRequest (reqStatus); + rSock.Shutdown(aHow, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus == KErrNone) { - return PJ_SUCCESS; + return PJ_SUCCESS; } else { - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } } /* * Start listening to incoming connections. */ -PJ_DEF (pj_status_t) pj_sock_listen (pj_sock_t sock, - int backlog) +PJ_DEF(pj_status_t) pj_sock_listen( pj_sock_t sock, + int backlog) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (sock && backlog, PJ_EINVAL); + PJ_ASSERT_RETURN(sock && backlog, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) sock; + CPjSocket *pjSock = (CPjSocket*)sock; RSocket &rSock = pjSock->Socket(); - TInt rc = rSock.Listen ( (TUint) backlog); + TInt rc = rSock.Listen((TUint)backlog); if (rc == KErrNone) { - return PJ_SUCCESS; + return PJ_SUCCESS; } else { - return PJ_RETURN_OS_ERROR (rc); + return PJ_RETURN_OS_ERROR(rc); } } /* * Accept incoming connections */ -PJ_DEF (pj_status_t) pj_sock_accept (pj_sock_t serverfd, - pj_sock_t *newsock, - pj_sockaddr_t *addr, - int *addrlen) +PJ_DEF(pj_status_t) pj_sock_accept( pj_sock_t serverfd, + pj_sock_t *newsock, + pj_sockaddr_t *addr, + int *addrlen) { PJ_CHECK_STACK(); - PJ_ASSERT_RETURN (serverfd && newsock, PJ_EINVAL); + PJ_ASSERT_RETURN(serverfd && newsock, PJ_EINVAL); - CPjSocket *pjSock = (CPjSocket*) serverfd; + CPjSocket *pjSock = (CPjSocket*)serverfd; RSocket &rSock = pjSock->Socket(); // Create a 'blank' socket RSocket newSock; - newSock.Open (PjSymbianOS::Instance()->SocketServ()); + newSock.Open(PjSymbianOS::Instance()->SocketServ()); // Call Accept() TRequestStatus reqStatus; - rSock.Accept (newSock, reqStatus); - User::WaitForRequest (reqStatus); + rSock.Accept(newSock, reqStatus); + User::WaitForRequest(reqStatus); if (reqStatus != KErrNone) { - return PJ_RETURN_OS_ERROR (reqStatus.Int()); + return PJ_RETURN_OS_ERROR(reqStatus.Int()); } // Create PJ socket - CPjSocket *newPjSock = new CPjSocket (pjSock->GetAf(), pjSock->GetSockType(), - newSock); - - newPjSock->SetConnected (true); + CPjSocket *newPjSock = new CPjSocket(pjSock->GetAf(), pjSock->GetSockType(), + newSock); + newPjSock->SetConnected(true); *newsock = (pj_sock_t) newPjSock; if (addr && addrlen) { - return pj_sock_getpeername (*newsock, addr, addrlen); + return pj_sock_getpeername(*newsock, addr, addrlen); } return PJ_SUCCESS; } - #endif /* PJ_HAS_TCP */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_common.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_common.c new file mode 100644 index 0000000000000000000000000000000000000000..8a983fc6f82b028d8efdfff5803c22071d1b7293 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_common.c @@ -0,0 +1,142 @@ +/* $Id: ssl_sock_common.c 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ssl_sock.h> +#include <pj/errno.h> +#include <pj/string.h> + +/* Cipher name structure */ +typedef struct cipher_name_t { + pj_ssl_cipher cipher; + const char *name; +} cipher_name_t; + +/* Cipher name constants */ +static cipher_name_t cipher_names[] = +{ + {TLS_NULL_WITH_NULL_NULL, "NULL"}, + + /* TLS/SSLv3 */ + {TLS_RSA_WITH_NULL_MD5, "TLS_RSA_WITH_NULL_MD5"}, + {TLS_RSA_WITH_NULL_SHA, "TLS_RSA_WITH_NULL_SHA"}, + {TLS_RSA_WITH_NULL_SHA256, "TLS_RSA_WITH_NULL_SHA256"}, + {TLS_RSA_WITH_RC4_128_MD5, "TLS_RSA_WITH_RC4_128_MD5"}, + {TLS_RSA_WITH_RC4_128_SHA, "TLS_RSA_WITH_RC4_128_SHA"}, + {TLS_RSA_WITH_3DES_EDE_CBC_SHA, "TLS_RSA_WITH_3DES_EDE_CBC_SHA"}, + {TLS_RSA_WITH_AES_128_CBC_SHA, "TLS_RSA_WITH_AES_128_CBC_SHA"}, + {TLS_RSA_WITH_AES_256_CBC_SHA, "TLS_RSA_WITH_AES_256_CBC_SHA"}, + {TLS_RSA_WITH_AES_128_CBC_SHA256, "TLS_RSA_WITH_AES_128_CBC_SHA256"}, + {TLS_RSA_WITH_AES_256_CBC_SHA256, "TLS_RSA_WITH_AES_256_CBC_SHA256"}, + {TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DH_DSS_WITH_AES_128_CBC_SHA, "TLS_DH_DSS_WITH_AES_128_CBC_SHA"}, + {TLS_DH_RSA_WITH_AES_128_CBC_SHA, "TLS_DH_RSA_WITH_AES_128_CBC_SHA"}, + {TLS_DHE_DSS_WITH_AES_128_CBC_SHA, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"}, + {TLS_DHE_RSA_WITH_AES_128_CBC_SHA, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA"}, + {TLS_DH_DSS_WITH_AES_256_CBC_SHA, "TLS_DH_DSS_WITH_AES_256_CBC_SHA"}, + {TLS_DH_RSA_WITH_AES_256_CBC_SHA, "TLS_DH_RSA_WITH_AES_256_CBC_SHA"}, + {TLS_DHE_DSS_WITH_AES_256_CBC_SHA, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA"}, + {TLS_DHE_RSA_WITH_AES_256_CBC_SHA, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA"}, + {TLS_DH_DSS_WITH_AES_128_CBC_SHA256, "TLS_DH_DSS_WITH_AES_128_CBC_SHA256"}, + {TLS_DH_RSA_WITH_AES_128_CBC_SHA256, "TLS_DH_RSA_WITH_AES_128_CBC_SHA256"}, + {TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256"}, + {TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256"}, + {TLS_DH_DSS_WITH_AES_256_CBC_SHA256, "TLS_DH_DSS_WITH_AES_256_CBC_SHA256"}, + {TLS_DH_RSA_WITH_AES_256_CBC_SHA256, "TLS_DH_RSA_WITH_AES_256_CBC_SHA256"}, + {TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256"}, + {TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256"}, + {TLS_DH_anon_WITH_RC4_128_MD5, "TLS_DH_anon_WITH_RC4_128_MD5"}, + {TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA"}, + {TLS_DH_anon_WITH_AES_128_CBC_SHA, "TLS_DH_anon_WITH_AES_128_CBC_SHA"}, + {TLS_DH_anon_WITH_AES_256_CBC_SHA, "TLS_DH_anon_WITH_AES_256_CBC_SHA"}, + {TLS_DH_anon_WITH_AES_128_CBC_SHA256, "TLS_DH_anon_WITH_AES_128_CBC_SHA256"}, + {TLS_DH_anon_WITH_AES_256_CBC_SHA256, "TLS_DH_anon_WITH_AES_256_CBC_SHA256"}, + + /* TLS (deprecated) */ + {TLS_RSA_EXPORT_WITH_RC4_40_MD5, "TLS_RSA_EXPORT_WITH_RC4_40_MD5"}, + {TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5"}, + {TLS_RSA_WITH_IDEA_CBC_SHA, "TLS_RSA_WITH_IDEA_CBC_SHA"}, + {TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_RSA_WITH_DES_CBC_SHA, "TLS_RSA_WITH_DES_CBC_SHA"}, + {TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DH_DSS_WITH_DES_CBC_SHA, "TLS_DH_DSS_WITH_DES_CBC_SHA"}, + {TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DH_RSA_WITH_DES_CBC_SHA, "TLS_DH_RSA_WITH_DES_CBC_SHA"}, + {TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DHE_DSS_WITH_DES_CBC_SHA, "TLS_DHE_DSS_WITH_DES_CBC_SHA"}, + {TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DHE_RSA_WITH_DES_CBC_SHA, "TLS_DHE_RSA_WITH_DES_CBC_SHA"}, + {TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5"}, + {TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA"}, + {TLS_DH_anon_WITH_DES_CBC_SHA, "TLS_DH_anon_WITH_DES_CBC_SHA"}, + + /* SSLv3 */ + {SSL_FORTEZZA_KEA_WITH_NULL_SHA, "SSL_FORTEZZA_KEA_WITH_NULL_SHA"}, + {SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA,"SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA"}, + {SSL_FORTEZZA_KEA_WITH_RC4_128_SHA, "SSL_FORTEZZA_KEA_WITH_RC4_128_SHA"}, + + /* SSLv2 */ + {SSL_CK_RC4_128_WITH_MD5, "SSL_CK_RC4_128_WITH_MD5"}, + {SSL_CK_RC4_128_EXPORT40_WITH_MD5, "SSL_CK_RC4_128_EXPORT40_WITH_MD5"}, + {SSL_CK_RC2_128_CBC_WITH_MD5, "SSL_CK_RC2_128_CBC_WITH_MD5"}, + {SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5, "SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5"}, + {SSL_CK_IDEA_128_CBC_WITH_MD5, "SSL_CK_IDEA_128_CBC_WITH_MD5"}, + {SSL_CK_DES_64_CBC_WITH_MD5, "SSL_CK_DES_64_CBC_WITH_MD5"}, + {SSL_CK_DES_192_EDE3_CBC_WITH_MD5, "SSL_CK_DES_192_EDE3_CBC_WITH_MD5"} +}; + + +/* + * Initialize the SSL socket configuration with the default values. + */ +PJ_DEF(void) pj_ssl_sock_param_default(pj_ssl_sock_param *param) +{ + pj_bzero(param, sizeof(*param)); + + /* Socket config */ + param->sock_af = PJ_AF_INET; + param->sock_type = pj_SOCK_STREAM(); + param->async_cnt = 1; + param->concurrency = -1; + param->whole_data = PJ_TRUE; + param->send_buffer_size = 8192; +#if !defined(PJ_SYMBIAN) || PJ_SYMBIAN==0 + param->read_buffer_size = 1500; +#endif + param->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + param->qos_ignore_error = PJ_TRUE; + + /* Security config */ + param->proto = PJ_SSL_SOCK_PROTO_DEFAULT; +} + + +PJ_DEF(const char*) pj_ssl_cipher_name(pj_ssl_cipher cipher) +{ + unsigned i, n; + + n = PJ_ARRAY_SIZE(cipher_names); + for (i = 0; i < n; ++i) { + if (cipher == cipher_names[i].cipher) + return cipher_names[i].name; + } + + return NULL; +} diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_ossl.c b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_ossl.c new file mode 100644 index 0000000000000000000000000000000000000000..d97305a20dc10640d112d05b0f127be57b0ff796 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_ossl.c @@ -0,0 +1,2137 @@ +/* $Id: ssl_sock_ossl.c 3020 2009-11-20 07:48:41Z nanang $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ssl_sock.h> +#include <pj/activesock.h> +#include <pj/compat/socket.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/list.h> +#include <pj/lock.h> +#include <pj/log.h> +#include <pj/math.h> +#include <pj/os.h> +#include <pj/pool.h> +#include <pj/string.h> +#include <pj/timer.h> + + +/* Only build when PJ_HAS_SSL_SOCK is enabled */ +#if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK!=0 + +#define THIS_FILE "ssl_sock_ossl.c" + +/* Workaround for ticket #985 */ +#define DELAYED_CLOSE_TIMEOUT 200 + +/* + * Include OpenSSL headers + */ +#include <openssl/bio.h> +#include <openssl/ssl.h> +#include <openssl/err.h> + + +#ifdef _MSC_VER +# ifdef _DEBUG +# pragma comment( lib, "libeay32MTd") +# pragma comment( lib, "ssleay32MTd") +#else +# pragma comment( lib, "libeay32MT") +# pragma comment( lib, "ssleay32MT") +# endif +#endif + + +/* + * SSL/TLS state enumeration. + */ +enum ssl_state { + SSL_STATE_NULL, + SSL_STATE_HANDSHAKING, + SSL_STATE_ESTABLISHED +}; + +/* + * Internal timer types. + */ +enum timer_id +{ + TIMER_NONE, + TIMER_HANDSHAKE_TIMEOUT, + TIMER_CLOSE +}; + +/* + * Structure of SSL socket read buffer. + */ +typedef struct read_data_t +{ + void *data; + pj_size_t len; +} read_data_t; + +/* + * Get the offset of pointer to read-buffer of SSL socket from read-buffer + * of active socket. Note that both SSL socket and active socket employ + * different but correlated read-buffers (as much as async_cnt for each), + * and to make it easier/faster to find corresponding SSL socket's read-buffer + * from known active socket's read-buffer, the pointer of corresponding + * SSL socket's read-buffer is stored right after the end of active socket's + * read-buffer. + */ +#define OFFSET_OF_READ_DATA_PTR(ssock, asock_rbuf) \ + (read_data_t**) \ + ((pj_int8_t*)(asock_rbuf) + \ + ssock->param.read_buffer_size) + +/* + * Structure of SSL socket write buffer. + */ +typedef struct write_data_t { + pj_ioqueue_op_key_t key; + pj_size_t record_len; + pj_ioqueue_op_key_t *app_key; + pj_size_t plain_data_len; + pj_size_t data_len; + union { + char content[1]; + const char *ptr; + } data; + unsigned flags; +} write_data_t; + +/* + * Structure of SSL socket write state. + */ +typedef struct write_state_t { + char *buf; + pj_size_t max_len; + char *start; + pj_size_t len; + write_data_t *last_data; +} write_state_t; + +/* + * Structure of write data pending. + */ +typedef struct write_pending_t { + PJ_DECL_LIST_MEMBER(struct write_pending_t); + write_data_t data; +} write_pending_t; + +/* + * Secure socket structure definition. + */ +struct pj_ssl_sock_t +{ + pj_pool_t *pool; + pj_ssl_sock_t *parent; + pj_ssl_sock_param param; + pj_ssl_cert_t *cert; + + pj_ssl_cert_info local_cert_info; + pj_ssl_cert_info remote_cert_info; + + pj_bool_t is_server; + enum ssl_state ssl_state; + pj_ioqueue_op_key_t handshake_op_key; + pj_timer_entry timer; + + pj_sock_t sock; + pj_activesock_t *asock; + + pj_sockaddr local_addr; + pj_sockaddr rem_addr; + int addr_len; + + pj_bool_t read_started; + pj_size_t read_size; + pj_uint32_t read_flags; + void **asock_rbuf; + read_data_t *ssock_rbuf; + + write_state_t write_state; + write_pending_t write_pending; + write_pending_t write_pending_empty; + pj_lock_t *write_mutex; /* protect write BIO and write_state */ + + SSL_CTX *ossl_ctx; + SSL *ossl_ssl; + BIO *ossl_rbio; + BIO *ossl_wbio; +}; + + +/* + * Certificate/credential structure definition. + */ +struct pj_ssl_cert_t +{ + pj_str_t CA_file; + pj_str_t cert_file; + pj_str_t privkey_file; + pj_str_t privkey_pass; +}; + + +static pj_status_t flush_delayed_send(pj_ssl_sock_t *ssock); + +/* + ******************************************************************* + * Static/internal functions. + ******************************************************************* + */ + +/** + * Mapping from OpenSSL error codes to pjlib error space. + */ + +#define PJ_SSL_ERRNO_START (PJ_ERRNO_START_USER + \ + PJ_ERRNO_SPACE_SIZE*6) + +#define PJ_SSL_ERRNO_SPACE_SIZE PJ_ERRNO_SPACE_SIZE + +#define GET_SSL_STATUS(status) { \ + unsigned long e = ERR_get_error();\ + status = ERR_GET_LIB(e)*300 + ERR_GET_REASON(e);\ + pj_assert(status < PJ_SSL_ERRNO_SPACE_SIZE);\ + if (status) status += PJ_SSL_ERRNO_START;\ +} + +/* + * Get error string of OpenSSL. + */ +static pj_str_t ssl_strerror(pj_status_t status, + char *buf, pj_size_t bufsize) +{ + pj_str_t errstr; + unsigned long ssl_err = status; + + if (ssl_err) { + unsigned long l, r; + ssl_err -= PJ_SSL_ERRNO_START; + l = ssl_err/300; + r = ssl_err%300; + ssl_err = ERR_PACK(l, 0, r); + } + +#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING != 0) + + { + const char *tmp = NULL; + tmp = ERR_reason_error_string(ssl_err); + + if (tmp) { + pj_ansi_strncpy(buf, tmp, bufsize); + errstr = pj_str(buf); + return errstr; + } + } + +#endif /* PJ_HAS_ERROR_STRING */ + + errstr.ptr = buf; + errstr.slen = pj_ansi_snprintf(buf, bufsize, + "Unknown OpenSSL error %lu", + ssl_err); + + return errstr; +} + + +/* OpenSSL library initialization counter */ +static int openssl_init_count; +static int openssl_reg_strerr; + +/* OpenSSL available ciphers */ +static pj_ssl_cipher openssl_ciphers[100]; +static unsigned openssl_cipher_num; + + +/* Initialize OpenSSL */ +static pj_status_t init_openssl(void) +{ + if (openssl_init_count) + return PJ_SUCCESS; + + openssl_init_count = 1; + + /* Register error subsystem */ + if (!openssl_reg_strerr) { + pj_status_t status; + + openssl_reg_strerr = 1; + status = pj_register_strerror(PJ_SSL_ERRNO_START, + PJ_SSL_ERRNO_SPACE_SIZE, + &ssl_strerror); + pj_assert(status == PJ_SUCCESS); + } + + /* Init OpenSSL lib */ + SSL_library_init(); + SSL_load_error_strings(); + OpenSSL_add_all_algorithms(); + + /* Init available ciphers */ + if (openssl_cipher_num == 0) { + SSL_METHOD *meth = NULL; + SSL_CTX *ctx; + SSL *ssl; + STACK_OF(SSL_CIPHER) *sk_cipher; + unsigned i, n; + + meth = (SSL_METHOD*)SSLv23_server_method(); + if (!meth) + meth = (SSL_METHOD*)TLSv1_server_method(); + if (!meth) + meth = (SSL_METHOD*)SSLv3_server_method(); + if (!meth) + meth = (SSL_METHOD*)SSLv2_server_method(); + pj_assert(meth); + + ctx=SSL_CTX_new(meth); + SSL_CTX_set_cipher_list(ctx, "ALL"); + + ssl = SSL_new(ctx); + sk_cipher = SSL_get_ciphers(ssl); + + n = sk_SSL_CIPHER_num(sk_cipher); + if (n > PJ_ARRAY_SIZE(openssl_ciphers)) + n = PJ_ARRAY_SIZE(openssl_ciphers); + + for (i = 0; i < n; ++i) { + SSL_CIPHER *c; + c = sk_SSL_CIPHER_value(sk_cipher,i); + openssl_ciphers[i] = (pj_ssl_cipher) + (pj_uint32_t)c->id & 0x00FFFFFF; + //printf("%3u: %08x=%s\n", i+1, c->id, SSL_CIPHER_get_name(c)); + } + + SSL_free(ssl); + SSL_CTX_free(ctx); + + openssl_cipher_num = n; + } + + return PJ_SUCCESS; +} + + +/* Shutdown OpenSSL */ +static void shutdown_openssl(void) +{ + PJ_UNUSED_ARG(openssl_init_count); +} + + +/* SSL password callback. */ +static int password_cb(char *buf, int num, int rwflag, void *user_data) +{ + pj_ssl_cert_t *cert = (pj_ssl_cert_t*) user_data; + + PJ_UNUSED_ARG(rwflag); + + if(num < cert->privkey_pass.slen) + return 0; + + pj_memcpy(buf, cert->privkey_pass.ptr, cert->privkey_pass.slen); + return cert->privkey_pass.slen; +} + + +/* Create and initialize new SSL context */ +static pj_status_t create_ssl_ctx(pj_ssl_sock_t *ssock, SSL_CTX **p_ctx) +{ + SSL_METHOD *ssl_method; + SSL_CTX *ctx; + pj_ssl_cert_t *cert; + int mode, rc; + pj_status_t status; + + pj_assert(ssock && p_ctx); + + cert = ssock->cert; + + /* Make sure OpenSSL library has been initialized */ + init_openssl(); + + /* Determine SSL method to use */ + switch (ssock->param.proto) { + case PJ_SSL_SOCK_PROTO_DEFAULT: + case PJ_SSL_SOCK_PROTO_TLS1: + ssl_method = (SSL_METHOD*)TLSv1_method(); + break; + case PJ_SSL_SOCK_PROTO_SSL2: + ssl_method = (SSL_METHOD*)SSLv2_method(); + break; + case PJ_SSL_SOCK_PROTO_SSL3: + ssl_method = (SSL_METHOD*)SSLv3_method(); + break; + case PJ_SSL_SOCK_PROTO_SSL23: + ssl_method = (SSL_METHOD*)SSLv23_method(); + break; + //case PJ_SSL_SOCK_PROTO_DTLS1: + //ssl_method = (SSL_METHOD*)DTLSv1_method(); + //break; + default: + return PJ_EINVAL; + } + + /* Create SSL context for the listener */ + ctx = SSL_CTX_new(ssl_method); + if (ctx == NULL) { + GET_SSL_STATUS(status); + return status; + } + + /* Apply credentials */ + if (cert) { + /* Load CA list if one is specified. */ + if (cert->CA_file.slen) { + + rc = SSL_CTX_load_verify_locations(ctx, cert->CA_file.ptr, NULL); + + if (rc != 1) { + GET_SSL_STATUS(status); + PJ_LOG(1,(ssock->pool->obj_name, "Error loading CA list file " + "'%s'", cert->CA_file.ptr)); + SSL_CTX_free(ctx); + return status; + } + } + + /* Set password callback */ + if (cert->privkey_pass.slen) { + SSL_CTX_set_default_passwd_cb(ctx, password_cb); + SSL_CTX_set_default_passwd_cb_userdata(ctx, cert); + } + + + /* Load certificate if one is specified */ + if (cert->cert_file.slen) { + + /* Load certificate chain from file into ctx */ + rc = SSL_CTX_use_certificate_chain_file(ctx, cert->cert_file.ptr); + + if(rc != 1) { + GET_SSL_STATUS(status); + PJ_LOG(1,(ssock->pool->obj_name, "Error loading certificate " + "chain file '%s'", cert->cert_file.ptr)); + SSL_CTX_free(ctx); + return status; + } + } + + + /* Load private key if one is specified */ + if (cert->privkey_file.slen) { + /* Adds the first private key found in file to ctx */ + rc = SSL_CTX_use_PrivateKey_file(ctx, cert->privkey_file.ptr, + SSL_FILETYPE_PEM); + + if(rc != 1) { + GET_SSL_STATUS(status); + PJ_LOG(1,(ssock->pool->obj_name, "Error adding private key " + "from '%s'", cert->privkey_file.ptr)); + SSL_CTX_free(ctx); + return status; + } + } + } + + + /* SSL verification options */ + if (ssock->param.verify_peer) { + mode = SSL_VERIFY_PEER; + } else { + mode = SSL_VERIFY_NONE; + } + + if (ssock->is_server && ssock->param.require_client_cert) + mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT | SSL_VERIFY_PEER; + + SSL_CTX_set_verify(ctx, mode, NULL); + + *p_ctx = ctx; + + return PJ_SUCCESS; +} + + +/* Destroy SSL context */ +static void destroy_ssl_ctx(SSL_CTX *ctx) +{ + SSL_CTX_free(ctx); + + /* Potentially shutdown OpenSSL library if this is the last + * context exists. + */ + shutdown_openssl(); +} + + +/* Reset SSL socket state */ +static void reset_ssl_sock_state(pj_ssl_sock_t *ssock) +{ + ssock->ssl_state = SSL_STATE_NULL; + + if (ssock->ossl_ssl) { + SSL_shutdown(ssock->ossl_ssl); + SSL_free(ssock->ossl_ssl); /* this will also close BIOs */ + ssock->ossl_ssl = NULL; + } + if (ssock->ossl_ctx) { + destroy_ssl_ctx(ssock->ossl_ctx); + ssock->ossl_ctx = NULL; + } + if (ssock->asock) { + pj_activesock_close(ssock->asock); + ssock->asock = NULL; + ssock->sock = PJ_INVALID_SOCKET; + } + if (ssock->sock != PJ_INVALID_SOCKET) { + pj_sock_close(ssock->sock); + ssock->sock = PJ_INVALID_SOCKET; + } + + /* Upon error, OpenSSL may leave any error description in the thread + * error queue, which sometime may cause next call to SSL API returning + * false error alarm, e.g: in Linux, SSL_CTX_use_certificate_chain_file() + * returning false error after a handshake error (in different SSL_CTX!). + * For now, just clear thread error queue here. + */ + ERR_clear_error(); +} + + +/* Generate cipher list with user preference order in OpenSSL format */ +static pj_status_t set_cipher_list(pj_ssl_sock_t *ssock) +{ + char buf[1024]; + pj_str_t cipher_list; + STACK_OF(SSL_CIPHER) *sk_cipher; + unsigned i; + int j, ret; + + if (ssock->param.ciphers_num == 0) + return PJ_SUCCESS; + + pj_strset(&cipher_list, buf, 0); + + /* Set SSL with ALL available ciphers */ + SSL_set_cipher_list(ssock->ossl_ssl, "ALL"); + + /* Generate user specified cipher list in OpenSSL format */ + sk_cipher = SSL_get_ciphers(ssock->ossl_ssl); + for (i = 0; i < ssock->param.ciphers_num; ++i) { + for (j = 0; j < sk_SSL_CIPHER_num(sk_cipher); ++j) { + SSL_CIPHER *c; + c = sk_SSL_CIPHER_value(sk_cipher, j); + if (ssock->param.ciphers[i] == (pj_ssl_cipher) + ((pj_uint32_t)c->id & 0x00FFFFFF)) + { + const char *c_name; + + c_name = SSL_CIPHER_get_name(c); + + /* Check buffer size */ + if (cipher_list.slen + pj_ansi_strlen(c_name) + 2 > sizeof(buf)) { + pj_assert(!"Insufficient temporary buffer for cipher"); + return PJ_ETOOMANY; + } + + /* Add colon separator */ + if (cipher_list.slen) + pj_strcat2(&cipher_list, ":"); + + /* Add the cipher */ + pj_strcat2(&cipher_list, c_name); + break; + } + } + } + + /* Put NULL termination in the generated cipher list */ + cipher_list.ptr[cipher_list.slen] = '\0'; + + /* Finally, set chosen cipher list */ + ret = SSL_set_cipher_list(ssock->ossl_ssl, buf); + if (ret < 1) { + pj_status_t status; + GET_SSL_STATUS(status); + return status; + } + + return PJ_SUCCESS; +} + + +/* Parse OpenSSL ASN1_TIME to pj_time_val and GMT info */ +static pj_bool_t parse_ossl_asn1_time(pj_time_val *tv, pj_bool_t *gmt, + const ASN1_TIME *tm) +{ + unsigned long parts[7] = {0}; + char *p, *end; + unsigned len; + pj_bool_t utc; + pj_parsed_time pt; + int i; + + utc = tm->type == V_ASN1_UTCTIME; + p = (char*)tm->data; + len = tm->length; + end = p + len - 1; + + /* GMT */ + *gmt = (*end == 'Z'); + + /* parse parts */ + for (i = 0; i < 7 && p < end; ++i) { + pj_str_t st; + + if (i==0 && !utc) { + /* 4 digits year part for non-UTC time format */ + st.slen = 4; + } else if (i==6) { + /* fraction of seconds */ + if (*p == '.') ++p; + st.slen = end - p + 1; + } else { + /* other parts always 2 digits length */ + st.slen = 2; + } + st.ptr = p; + + parts[i] = pj_strtoul(&st); + p += st.slen; + } + + /* encode parts to pj_time_val */ + pt.year = parts[0]; + if (utc) + pt.year += (pt.year < 50)? 2000:1900; + pt.mon = parts[1] - 1; + pt.day = parts[2]; + pt.hour = parts[3]; + pt.min = parts[4]; + pt.sec = parts[5]; + pt.msec = parts[6]; + + pj_time_encode(&pt, tv); + + return PJ_TRUE; +} + + +/* Get certificate info from OpenSSL X509 */ +static void get_cert_info(pj_pool_t *pool, pj_ssl_cert_info *ci, X509 *x) +{ + pj_ssl_cert_info info; + char buf1[256]; + char buf2[256]; + + pj_assert(pool && ci); + + if (!x) { + pj_bzero(ci, sizeof(pj_ssl_cert_info)); + return; + } + + pj_bzero(&info, sizeof(info)); + + /* Populate cert info */ + info.subject = pj_str(X509_NAME_oneline(X509_get_subject_name(x),buf1, + sizeof(buf1))); + info.issuer = pj_str(X509_NAME_oneline(X509_get_issuer_name(x), buf2, + sizeof(buf2))); + info.version = X509_get_version(x) + 1; + parse_ossl_asn1_time(&info.validity_start, &info.validity_use_gmt, + X509_get_notBefore(x)); + parse_ossl_asn1_time(&info.validity_end, &info.validity_use_gmt, + X509_get_notAfter(x)); + + /* Update certificate info */ + if (pj_strcmp(&ci->subject, &info.subject)) + pj_strdup(pool, &ci->subject, &info.subject); + if (pj_strcmp(&ci->issuer, &info.issuer)) + pj_strdup(pool, &ci->issuer, &info.issuer); + ci->version = info.version; + ci->validity_start = info.validity_start; + ci->validity_end = info.validity_end; + ci->validity_use_gmt = info.validity_use_gmt; +} + + +/* Update local & remote certificates info. This function should be + * called after handshake or renegotiation successfully completed. + */ +static void update_certs_info(pj_ssl_sock_t *ssock) +{ + X509 *x; + + pj_assert(ssock->ssl_state == SSL_STATE_ESTABLISHED); + + /* Active local certificate */ + x = SSL_get_certificate(ssock->ossl_ssl); + get_cert_info(ssock->pool, &ssock->local_cert_info, x); + /* Don't free local's X509! */ + + /* Active remote certificate */ + x = SSL_get_peer_certificate(ssock->ossl_ssl); + get_cert_info(ssock->pool, &ssock->remote_cert_info, x); + /* Free peer's X509 */ + X509_free(x); +} + + +/* When handshake completed: + * - notify application + * - if handshake failed, reset SSL state + * - return PJ_FALSE when SSL socket instance is destroyed by application. + */ +static pj_bool_t on_handshake_complete(pj_ssl_sock_t *ssock, + pj_status_t status) +{ + /* Cancel handshake timer */ + if (ssock->timer.id == TIMER_HANDSHAKE_TIMEOUT) { + pj_timer_heap_cancel(ssock->param.timer_heap, &ssock->timer); + ssock->timer.id = TIMER_NONE; + } + + /* Update certificates info on successful handshake */ + if (status == PJ_SUCCESS) + update_certs_info(ssock); + + /* Accepting */ + if (ssock->is_server) { + if (status != PJ_SUCCESS) { + /* Handshake failed in accepting, destroy our self silently. */ + + char errmsg[PJ_ERR_MSG_SIZE]; + char buf[PJ_INET6_ADDRSTRLEN+10]; + + pj_strerror(status, errmsg, sizeof(errmsg)); + PJ_LOG(3,(ssock->pool->obj_name, "Handshake failed in accepting " + "%s: %s", + pj_sockaddr_print(&ssock->rem_addr, buf, sizeof(buf), 3), + errmsg)); + + /* Workaround for ticket #985 */ +#if defined(PJ_WIN32) && PJ_WIN32!=0 + if (ssock->param.timer_heap) { + pj_time_val interval = {0, DELAYED_CLOSE_TIMEOUT}; + + reset_ssl_sock_state(ssock); + + ssock->timer.id = TIMER_CLOSE; + pj_time_val_normalize(&interval); + if (pj_timer_heap_schedule(ssock->param.timer_heap, + &ssock->timer, &interval) != 0) + { + ssock->timer.id = TIMER_NONE; + pj_ssl_sock_close(ssock); + } + } else +#endif /* PJ_WIN32 */ + { + pj_ssl_sock_close(ssock); + } + return PJ_FALSE; + } + /* Notify application the newly accepted SSL socket */ + if (ssock->param.cb.on_accept_complete) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_accept_complete) + (ssock->parent, ssock, (pj_sockaddr_t*)&ssock->rem_addr, + pj_sockaddr_get_len((pj_sockaddr_t*)&ssock->rem_addr)); + if (ret == PJ_FALSE) + return PJ_FALSE; + } + } + + /* Connecting */ + else { + /* On failure, reset SSL socket state first, as app may try to + * reconnect in the callback. + */ + if (status != PJ_SUCCESS) { + reset_ssl_sock_state(ssock); + } + if (ssock->param.cb.on_connect_complete) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_connect_complete)(ssock, status); + if (ret == PJ_FALSE) + return PJ_FALSE; + } + } + + return PJ_TRUE; +} + +/* Flush write BIO to network socket. Note that any access to write BIO + * MUST be serialized, so mutex protection must cover any call to OpenSSL + * API (that possibly generate data for write BIO) along with the call to + * this function (flushing all data in write BIO generated by above + * OpenSSL API call). + */ +static pj_status_t flush_write_bio(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + pj_size_t orig_len, + unsigned flags) +{ + char *data; + pj_ssize_t len; + + write_state_t *write_st = &ssock->write_state; + write_data_t *wdata; + pj_size_t avail_len, needed_len, skipped_len = 0; + pj_status_t status; + + /* Check if there is data in write BIO, flush it if any */ + if (!BIO_pending(ssock->ossl_wbio)) + return PJ_SUCCESS; + + /* Get data and its length */ + len = BIO_get_mem_data(ssock->ossl_wbio, &data); + if (len == 0) + return PJ_SUCCESS; + + /* Calculate buffer size needed, and align it to 8 */ + needed_len = len + sizeof(write_data_t); + needed_len = ((needed_len + 7) >> 3) << 3; + + /* Check buffer availability */ + avail_len = write_st->max_len - write_st->len; + if (avail_len < needed_len) + return PJ_ENOMEM; + + /* More buffer availability check, note that the write data must be in + * a contigue buffer. + */ + if (write_st->len == 0) { + + write_st->start = write_st->buf; + wdata = (write_data_t*)write_st->start; + + } else { + + char *reg1, *reg2; + pj_size_t reg1_len, reg2_len; + + /* Unused slots may be wrapped/splitted into two regions, so let's + * analyze them if any region can hold the write data. + */ + reg1 = write_st->start + write_st->len; + if (reg1 >= write_st->buf + write_st->max_len) + reg1 -= write_st->max_len; + reg1_len = write_st->max_len - write_st->len; + if (reg1 + reg1_len > write_st->buf + write_st->max_len) { + reg1_len = write_st->buf + write_st->max_len - reg1; + reg2 = write_st->buf; + reg2_len = write_st->start - write_st->buf; + } else { + reg2 = NULL; + reg2_len = 0; + } + avail_len = PJ_MAX(reg1_len, reg2_len); + if (avail_len < needed_len) + return PJ_ENOMEM; + + /* Get write data pointer and update buffer length */ + if (reg1_len >= needed_len) { + wdata = (write_data_t*)reg1; + } else { + wdata = (write_data_t*)reg2; + /* Unused slot in region 1 is skipped as current write data + * doesn't fit it. + */ + skipped_len = reg1_len; + } + } + + /* Copy the data and set its properties into the buffer */ + pj_bzero(wdata, sizeof(write_data_t)); + wdata->app_key = send_key; + wdata->record_len = needed_len; + wdata->data_len = len; + wdata->plain_data_len = orig_len; + wdata->flags = flags; + pj_memcpy(&wdata->data, data, len); + + /* Send it */ + if (ssock->param.sock_type == pj_SOCK_STREAM()) { + status = pj_activesock_send(ssock->asock, &wdata->key, + wdata->data.content, &len, + flags); + } else { + status = pj_activesock_sendto(ssock->asock, &wdata->key, + wdata->data.content, &len, + flags, + (pj_sockaddr_t*)&ssock->rem_addr, + ssock->addr_len); + } + + /* Oh no, EWOULDBLOCK! */ + if (status == PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK)) { + /* Just return PJ_SUCCESS here, the pending data will be sent in next + * call of this function since the data is still stored in write BIO. + */ + return PJ_SUCCESS; + } + + /* Reset write BIO after flushed */ + BIO_reset(ssock->ossl_wbio); + + if (status == PJ_EPENDING) { + /* Update write state */ + pj_assert(skipped_len==0 || write_st->last_data); + write_st->len += needed_len + skipped_len; + if (write_st->last_data) + write_st->last_data->record_len += skipped_len; + write_st->last_data = wdata; + } + + return status; +} + + +static void on_timer(pj_timer_heap_t *th, struct pj_timer_entry *te) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)te->user_data; + int timer_id = te->id; + + te->id = TIMER_NONE; + + PJ_UNUSED_ARG(th); + + switch (timer_id) { + case TIMER_HANDSHAKE_TIMEOUT: + PJ_LOG(1,(ssock->pool->obj_name, "SSL handshake timeout after %d.%ds", + ssock->param.timeout.sec, ssock->param.timeout.msec)); + + on_handshake_complete(ssock, PJ_ETIMEDOUT); + break; + case TIMER_CLOSE: + pj_ssl_sock_close(ssock); + break; + default: + pj_assert(!"Unknown timer"); + break; + } +} + + +/* Asynchronouse handshake */ +static pj_status_t do_handshake(pj_ssl_sock_t *ssock) +{ + pj_status_t status; + int err; + + pj_lock_acquire(ssock->write_mutex); + + /* Perform SSL handshake */ + err = SSL_do_handshake(ssock->ossl_ssl); + if (err < 0) { + err = SSL_get_error(ssock->ossl_ssl, err); + if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ) + { + /* Handshake fails */ + GET_SSL_STATUS(status); + pj_lock_release(ssock->write_mutex); + return status; + } + } + + /* SSL_do_handshake() may put some pending data into SSL write BIO, + * flush it if any. + */ + status = flush_write_bio(ssock, &ssock->handshake_op_key, 0, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + pj_lock_release(ssock->write_mutex); + return status; + } + + pj_lock_release(ssock->write_mutex); + + /* Check if handshake has been completed */ + if (SSL_is_init_finished(ssock->ossl_ssl)) { + ssock->ssl_state = SSL_STATE_ESTABLISHED; + return PJ_SUCCESS; + } + + return PJ_EPENDING; +} + + +/* + ******************************************************************* + * Active socket callbacks. + ******************************************************************* + */ + +static pj_bool_t asock_on_data_read (pj_activesock_t *asock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + pj_size_t nwritten; + + /* Socket error or closed */ + if (data && size > 0) { + /* Consume the whole data */ + nwritten = BIO_write(ssock->ossl_rbio, data, size); + if (nwritten < size) { + GET_SSL_STATUS(status); + goto on_error; + } + } + + /* Check if SSL handshake hasn't finished yet */ + if (ssock->ssl_state == SSL_STATE_HANDSHAKING) { + pj_bool_t ret = PJ_TRUE; + + if (status == PJ_SUCCESS) + status = do_handshake(ssock); + + /* Not pending is either success or failed */ + if (status != PJ_EPENDING) + ret = on_handshake_complete(ssock, status); + + return ret; + } + + /* See if there is any decrypted data for the application */ + if (ssock->read_started) { + do { + read_data_t *buf = *(OFFSET_OF_READ_DATA_PTR(ssock, data)); + void *data_ = (pj_int8_t*)buf->data + buf->len; + int size_ = ssock->read_size - buf->len; + + /* SSL_read() may write some data to BIO write when re-negotiation + * is on progress, so let's protect it with write mutex. + */ + pj_lock_acquire(ssock->write_mutex); + size_ = SSL_read(ssock->ossl_ssl, data_, size_); + pj_lock_release(ssock->write_mutex); + + if (size_ > 0 || status != PJ_SUCCESS) { + if (ssock->param.cb.on_data_read) { + pj_bool_t ret; + pj_size_t remainder_ = 0; + + if (size_ > 0) + buf->len += size_; + + ret = (*ssock->param.cb.on_data_read)(ssock, buf->data, + buf->len, status, + &remainder_); + if (!ret) { + /* We've been destroyed */ + return PJ_FALSE; + } + + /* Application may have left some data to be consumed + * later. + */ + buf->len = remainder_; + } + + /* Active socket signalled connection closed/error, this has + * been signalled to the application along with any remaining + * buffer. So, let's just reset SSL socket now. + */ + if (status != PJ_SUCCESS) { + reset_ssl_sock_state(ssock); + return PJ_FALSE; + } + + } else { + + int err = SSL_get_error(ssock->ossl_ssl, size); + + /* SSL might just return SSL_ERROR_WANT_READ in + * re-negotiation. + */ + if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ) + { + /* Reset SSL socket state, then return PJ_FALSE */ + GET_SSL_STATUS(status); + reset_ssl_sock_state(ssock); + goto on_error; + } + + status = do_handshake(ssock); + if (status == PJ_SUCCESS) { + /* Renegotiation completed */ + + /* Update certificates */ + update_certs_info(ssock); + + pj_lock_acquire(ssock->write_mutex); + status = flush_delayed_send(ssock); + pj_lock_release(ssock->write_mutex); + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + PJ_PERROR(1,(ssock->pool->obj_name, status, + "Failed to flush delayed send")); + goto on_error; + } + } else if (status != PJ_EPENDING) { + PJ_PERROR(1,(ssock->pool->obj_name, status, + "Renegotiation failed")); + goto on_error; + } + + break; + } + } while (1); + } + + return PJ_TRUE; + +on_error: + if (ssock->ssl_state == SSL_STATE_HANDSHAKING) + return on_handshake_complete(ssock, status); + + if (ssock->read_started && ssock->param.cb.on_data_read) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_data_read)(ssock, NULL, 0, status, + remainder); + if (!ret) { + /* We've been destroyed */ + return PJ_FALSE; + } + } + + reset_ssl_sock_state(ssock); + return PJ_FALSE; +} + + +static pj_bool_t asock_on_data_sent (pj_activesock_t *asock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + + PJ_UNUSED_ARG(send_key); + PJ_UNUSED_ARG(sent); + + if (ssock->ssl_state == SSL_STATE_HANDSHAKING) { + /* Initial handshaking */ + pj_status_t status; + + status = do_handshake(ssock); + /* Not pending is either success or failed */ + if (status != PJ_EPENDING) + return on_handshake_complete(ssock, status); + + } else if (send_key != &ssock->handshake_op_key) { + /* Some data has been sent, notify application */ + write_data_t *wdata = (write_data_t*)send_key; + if (ssock->param.cb.on_data_sent) { + pj_bool_t ret; + ret = (*ssock->param.cb.on_data_sent)(ssock, wdata->app_key, + wdata->plain_data_len); + if (!ret) { + /* We've been destroyed */ + return PJ_FALSE; + } + } + + /* Update write buffer state */ + pj_lock_acquire(ssock->write_mutex); + ssock->write_state.start += wdata->record_len; + ssock->write_state.len -= wdata->record_len; + if (ssock->write_state.last_data == wdata) { + pj_assert(ssock->write_state.len == 0); + ssock->write_state.last_data = NULL; + } + pj_lock_release(ssock->write_mutex); + + } else { + /* SSL re-negotiation is on-progress, just do nothing */ + } + + return PJ_TRUE; +} + + +static pj_bool_t asock_on_accept_complete (pj_activesock_t *asock, + pj_sock_t newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len) +{ + pj_ssl_sock_t *ssock_parent = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + pj_ssl_sock_t *ssock; + pj_activesock_cb asock_cb; + pj_activesock_cfg asock_cfg; + unsigned i; + pj_status_t status; + + PJ_UNUSED_ARG(src_addr_len); + + /* Create new SSL socket instance */ + status = pj_ssl_sock_create(ssock_parent->pool, &ssock_parent->param, + &ssock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Update new SSL socket attributes */ + ssock->sock = newsock; + ssock->parent = ssock_parent; + ssock->is_server = PJ_TRUE; + if (ssock_parent->cert) { + status = pj_ssl_sock_set_certificate(ssock, ssock->pool, + ssock_parent->cert); + if (status != PJ_SUCCESS) + goto on_return; + } + + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 1, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_return; + + /* Update local address */ + ssock->addr_len = src_addr_len; + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + if (status != PJ_SUCCESS) { + /* This fails on few envs, e.g: win IOCP, just tolerate this and + * use parent local address instead. + */ + pj_sockaddr_cp(&ssock->local_addr, &ssock_parent->local_addr); + } + + /* Set remote address */ + pj_sockaddr_cp(&ssock->rem_addr, src_addr); + + /* Create SSL context */ + status = create_ssl_ctx(ssock, &ssock->ossl_ctx); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create SSL instance */ + ssock->ossl_ssl = SSL_new(ssock->ossl_ctx); + if (ssock->ossl_ssl == NULL) { + GET_SSL_STATUS(status); + goto on_return; + } + + /* Set cipher list */ + status = set_cipher_list(ssock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Setup SSL BIOs */ + ssock->ossl_rbio = BIO_new(BIO_s_mem()); + ssock->ossl_wbio = BIO_new(BIO_s_mem()); + BIO_set_close(ssock->ossl_rbio, BIO_CLOSE); + BIO_set_close(ssock->ossl_wbio, BIO_CLOSE); + SSL_set_bio(ssock->ossl_ssl, ssock->ossl_rbio, ssock->ossl_wbio); + + /* Prepare read buffer */ + ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool, + ssock->param.async_cnt, + sizeof(void*)); + for (i = 0; i<ssock->param.async_cnt; ++i) { + ssock->asock_rbuf[i] = (void*) pj_pool_alloc( + ssock->pool, + ssock->param.read_buffer_size + + sizeof(read_data_t*)); + } + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_data_read = asock_on_data_read; + asock_cb.on_data_sent = asock_on_data_sent; + + status = pj_activesock_create(ssock->pool, + ssock->sock, + ssock->param.sock_type, + &asock_cfg, + ssock->param.ioqueue, + &asock_cb, + ssock, + &ssock->asock); + + if (status != PJ_SUCCESS) + goto on_return; + + /* Start read */ + status = pj_activesock_start_read2(ssock->asock, ssock->pool, + ssock->param.read_buffer_size, + ssock->asock_rbuf, + PJ_IOQUEUE_ALWAYS_ASYNC); + if (status != PJ_SUCCESS) + goto on_return; + + /* Prepare write/send state */ + pj_assert(ssock->write_state.max_len == 0); + ssock->write_state.buf = (char*) + pj_pool_alloc(ssock->pool, + ssock->param.send_buffer_size); + ssock->write_state.max_len = ssock->param.send_buffer_size; + ssock->write_state.start = ssock->write_state.buf; + ssock->write_state.len = 0; + + /* Start handshake timer */ + if (ssock->param.timer_heap && (ssock->param.timeout.sec != 0 || + ssock->param.timeout.msec != 0)) + { + pj_assert(ssock->timer.id == TIMER_NONE); + ssock->timer.id = TIMER_HANDSHAKE_TIMEOUT; + status = pj_timer_heap_schedule(ssock->param.timer_heap, + &ssock->timer, + &ssock->param.timeout); + if (status != PJ_SUCCESS) + ssock->timer.id = TIMER_NONE; + } + + /* Start SSL handshake */ + ssock->ssl_state = SSL_STATE_HANDSHAKING; + SSL_set_accept_state(ssock->ossl_ssl); + status = do_handshake(ssock); + +on_return: + if (ssock && status != PJ_EPENDING) + on_handshake_complete(ssock, status); + + /* Must return PJ_TRUE whatever happened, as active socket must + * continue listening. + */ + return PJ_TRUE; +} + + +static pj_bool_t asock_on_connect_complete (pj_activesock_t *asock, + pj_status_t status) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*) + pj_activesock_get_user_data(asock); + unsigned i; + + if (status != PJ_SUCCESS) + goto on_return; + + /* Update local address */ + ssock->addr_len = sizeof(pj_sockaddr); + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create SSL context */ + status = create_ssl_ctx(ssock, &ssock->ossl_ctx); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create SSL instance */ + ssock->ossl_ssl = SSL_new(ssock->ossl_ctx); + if (ssock->ossl_ssl == NULL) { + GET_SSL_STATUS(status); + goto on_return; + } + + /* Set cipher list */ + status = set_cipher_list(ssock); + if (status != PJ_SUCCESS) + goto on_return; + + /* Setup SSL BIOs */ + ssock->ossl_rbio = BIO_new(BIO_s_mem()); + ssock->ossl_wbio = BIO_new(BIO_s_mem()); + BIO_set_close(ssock->ossl_rbio, BIO_CLOSE); + BIO_set_close(ssock->ossl_wbio, BIO_CLOSE); + SSL_set_bio(ssock->ossl_ssl, ssock->ossl_rbio, ssock->ossl_wbio); + + /* Prepare read buffer */ + ssock->asock_rbuf = (void**)pj_pool_calloc(ssock->pool, + ssock->param.async_cnt, + sizeof(void*)); + for (i = 0; i<ssock->param.async_cnt; ++i) { + ssock->asock_rbuf[i] = (void*) pj_pool_alloc( + ssock->pool, + ssock->param.read_buffer_size + + sizeof(read_data_t*)); + } + + /* Start read */ + status = pj_activesock_start_read2(ssock->asock, ssock->pool, + ssock->param.read_buffer_size, + ssock->asock_rbuf, + PJ_IOQUEUE_ALWAYS_ASYNC); + if (status != PJ_SUCCESS) + goto on_return; + + /* Prepare write/send state */ + pj_assert(ssock->write_state.max_len == 0); + ssock->write_state.buf = (char*) + pj_pool_alloc(ssock->pool, + ssock->param.send_buffer_size); + ssock->write_state.max_len = ssock->param.send_buffer_size; + ssock->write_state.start = ssock->write_state.buf; + ssock->write_state.len = 0; + + /* Start handshake timer */ + if (ssock->param.timer_heap && (ssock->param.timeout.sec != 0 || + ssock->param.timeout.msec != 0)) + { + pj_assert(ssock->timer.id == TIMER_NONE); + ssock->timer.id = TIMER_HANDSHAKE_TIMEOUT; + status = pj_timer_heap_schedule(ssock->param.timer_heap, + &ssock->timer, + &ssock->param.timeout); + if (status != PJ_SUCCESS) + ssock->timer.id = TIMER_NONE; + } + +#ifdef SSL_set_tlsext_host_name + /* Set server name to connect */ + if (ssock->param.server_name.slen) { + /* Server name is null terminated already */ + if (!SSL_set_tlsext_host_name(ssock->ossl_ssl, + ssock->param.server_name.ptr)) + { + char err_str[PJ_ERR_MSG_SIZE]; + + ERR_error_string_n(ERR_get_error(), err_str, sizeof(err_str)); + PJ_LOG(3,(ssock->pool->obj_name, "SSL_set_tlsext_host_name() " + "failed: %s", err_str)); + } + } +#endif + + /* Start SSL handshake */ + ssock->ssl_state = SSL_STATE_HANDSHAKING; + SSL_set_connect_state(ssock->ossl_ssl); + + status = do_handshake(ssock); + if (status != PJ_EPENDING) + goto on_return; + + return PJ_TRUE; + +on_return: + return on_handshake_complete(ssock, status); +} + + + +/* + ******************************************************************* + * API + ******************************************************************* + */ + +/* Load credentials from files. */ +PJ_DEF(pj_status_t) pj_ssl_cert_load_from_files (pj_pool_t *pool, + const pj_str_t *CA_file, + const pj_str_t *cert_file, + const pj_str_t *privkey_file, + const pj_str_t *privkey_pass, + pj_ssl_cert_t **p_cert) +{ + pj_ssl_cert_t *cert; + + PJ_ASSERT_RETURN(pool && CA_file && cert_file && privkey_file, PJ_EINVAL); + + cert = PJ_POOL_ZALLOC_T(pool, pj_ssl_cert_t); + pj_strdup_with_null(pool, &cert->CA_file, CA_file); + pj_strdup_with_null(pool, &cert->cert_file, cert_file); + pj_strdup_with_null(pool, &cert->privkey_file, privkey_file); + pj_strdup_with_null(pool, &cert->privkey_pass, privkey_pass); + + *p_cert = cert; + + return PJ_SUCCESS; +} + + +/* Set SSL socket credentials. */ +PJ_DECL(pj_status_t) pj_ssl_sock_set_certificate( + pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_ssl_cert_t *cert) +{ + pj_ssl_cert_t *cert_; + + PJ_ASSERT_RETURN(ssock && pool && cert, PJ_EINVAL); + + cert_ = PJ_POOL_ZALLOC_T(pool, pj_ssl_cert_t); + pj_memcpy(cert_, cert, sizeof(cert)); + pj_strdup_with_null(pool, &cert_->CA_file, &cert->CA_file); + pj_strdup_with_null(pool, &cert_->cert_file, &cert->cert_file); + pj_strdup_with_null(pool, &cert_->privkey_file, &cert->privkey_file); + pj_strdup_with_null(pool, &cert_->privkey_pass, &cert->privkey_pass); + + ssock->cert = cert_; + + return PJ_SUCCESS; +} + + +/* Get available ciphers. */ +PJ_DEF(pj_status_t) pj_ssl_cipher_get_availables(pj_ssl_cipher ciphers[], + unsigned *cipher_num) +{ + unsigned i; + + PJ_ASSERT_RETURN(ciphers && cipher_num, PJ_EINVAL); + + if (openssl_cipher_num == 0) { + init_openssl(); + shutdown_openssl(); + } + + if (openssl_cipher_num == 0) + return PJ_ENOTFOUND; + + *cipher_num = PJ_MIN(*cipher_num, openssl_cipher_num); + + for (i = 0; i < *cipher_num; ++i) + ciphers[i] = openssl_ciphers[i]; + + return PJ_SUCCESS; +} + + +/* + * Create SSL socket instance. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_create (pj_pool_t *pool, + const pj_ssl_sock_param *param, + pj_ssl_sock_t **p_ssock) +{ + pj_ssl_sock_t *ssock; + pj_status_t status; + + PJ_ASSERT_RETURN(pool && param && p_ssock, PJ_EINVAL); + PJ_ASSERT_RETURN(param->sock_type == pj_SOCK_STREAM(), PJ_ENOTSUP); + + pool = pj_pool_create(pool->factory, "ssl%p", 512, 512, NULL); + + /* Create secure socket */ + ssock = PJ_POOL_ZALLOC_T(pool, pj_ssl_sock_t); + ssock->pool = pool; + ssock->sock = PJ_INVALID_SOCKET; + ssock->ssl_state = SSL_STATE_NULL; + pj_list_init(&ssock->write_pending); + pj_list_init(&ssock->write_pending_empty); + pj_timer_entry_init(&ssock->timer, 0, ssock, &on_timer); + + /* Create secure socket mutex */ + status = pj_lock_create_recursive_mutex(pool, pool->obj_name, + &ssock->write_mutex); + if (status != PJ_SUCCESS) + return status; + + /* Init secure socket param */ + ssock->param = *param; + ssock->param.read_buffer_size = ((ssock->param.read_buffer_size+7)>>3)<<3; + if (param->ciphers_num > 0) { + unsigned i; + ssock->param.ciphers = (pj_ssl_cipher*) + pj_pool_calloc(pool, param->ciphers_num, + sizeof(pj_ssl_cipher)); + for (i = 0; i < param->ciphers_num; ++i) + ssock->param.ciphers[i] = param->ciphers[i]; + } + + /* Server name must be null-terminated */ + pj_strdup_with_null(pool, &ssock->param.server_name, + ¶m->server_name); + + /* Finally */ + *p_ssock = ssock; + + return PJ_SUCCESS; +} + + +/* + * Close the secure socket. This will unregister the socket from the + * ioqueue and ultimately close the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock) +{ + pj_pool_t *pool; + + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + if (!ssock->pool) + return PJ_SUCCESS; + + if (ssock->timer.id != TIMER_NONE) { + pj_timer_heap_cancel(ssock->param.timer_heap, &ssock->timer); + ssock->timer.id = TIMER_NONE; + } + + reset_ssl_sock_state(ssock); + pj_lock_destroy(ssock->write_mutex); + + pool = ssock->pool; + ssock->pool = NULL; + if (pool) + pj_pool_release(pool); + + return PJ_SUCCESS; +} + + +/* + * Associate arbitrary data with the secure socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_set_user_data(pj_ssl_sock_t *ssock, + void *user_data) +{ + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + ssock->param.user_data = user_data; + return PJ_SUCCESS; +} + + +/* + * Retrieve the user data previously associated with this secure + * socket. + */ +PJ_DEF(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock) +{ + PJ_ASSERT_RETURN(ssock, NULL); + + return ssock->param.user_data; +} + + +/* + * Retrieve the local address and port used by specified SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_get_info (pj_ssl_sock_t *ssock, + pj_ssl_sock_info *info) +{ + pj_bzero(info, sizeof(*info)); + + /* Established flag */ + info->established = (ssock->ssl_state == SSL_STATE_ESTABLISHED); + + /* Protocol */ + info->proto = ssock->param.proto; + + /* Local address */ + pj_sockaddr_cp(&info->local_addr, &ssock->local_addr); + + if (info->established) { + /* Current cipher */ + const SSL_CIPHER *cipher; + + cipher = SSL_get_current_cipher(ssock->ossl_ssl); + info->cipher = (cipher->id & 0x00FFFFFF); + + /* Remote address */ + pj_sockaddr_cp(&info->remote_addr, &ssock->rem_addr); + + /* Certificates info */ + info->local_cert_info = ssock->local_cert_info; + info->remote_cert_info = ssock->remote_cert_info; + } + + return PJ_SUCCESS; +} + + +/* + * Starts read operation on this secure socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + void **readbuf; + unsigned i; + + PJ_ASSERT_RETURN(ssock && pool && buff_size, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->ssl_state==SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + readbuf = (void**) pj_pool_calloc(pool, ssock->param.async_cnt, + sizeof(void*)); + + for (i=0; i<ssock->param.async_cnt; ++i) { + readbuf[i] = pj_pool_alloc(pool, buff_size); + } + + return pj_ssl_sock_start_read2(ssock, pool, buff_size, + readbuf, flags); +} + + +/* + * Same as #pj_ssl_sock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + unsigned i; + + PJ_ASSERT_RETURN(ssock && pool && buff_size && readbuf, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->ssl_state==SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + /* Create SSL socket read buffer */ + ssock->ssock_rbuf = (read_data_t*)pj_pool_calloc(pool, + ssock->param.async_cnt, + sizeof(read_data_t)); + + /* Store SSL socket read buffer pointer in the activesock read buffer */ + for (i=0; i<ssock->param.async_cnt; ++i) { + read_data_t **p_ssock_rbuf = + OFFSET_OF_READ_DATA_PTR(ssock, ssock->asock_rbuf[i]); + + ssock->ssock_rbuf[i].data = readbuf[i]; + ssock->ssock_rbuf[i].len = 0; + + *p_ssock_rbuf = &ssock->ssock_rbuf[i]; + } + + ssock->read_size = buff_size; + ssock->read_started = PJ_TRUE; + ssock->read_flags = flags; + + return PJ_SUCCESS; +} + + +/* + * Same as pj_ssl_sock_start_read(), except that this function is used + * only for datagram sockets, and it will trigger \a on_data_recvfrom() + * callback instead. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(flags); + + return PJ_ENOTSUP; +} + + +/* + * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(readbuf); + PJ_UNUSED_ARG(flags); + + return PJ_ENOTSUP; +} + +/* Write plain data to SSL and flush write BIO. Note that accessing + * write BIO must be serialized, so a call to this function must be + * protected by write mutex of SSL socket. + */ +static pj_status_t ssl_write(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t size, + unsigned flags) +{ + pj_status_t status; + int nwritten; + + /* Write the plain data to SSL, after SSL encrypts it, write BIO will + * contain the secured data to be sent via socket. Note that re- + * negotitation may be on progress, so sending data should be delayed + * until re-negotiation is completed. + */ + nwritten = SSL_write(ssock->ossl_ssl, data, size); + + if (nwritten == size) { + /* All data written, flush write BIO to network socket */ + status = flush_write_bio(ssock, send_key, size, flags); + } else if (nwritten <= 0) { + /* SSL failed to process the data, it may just that re-negotiation + * is on progress. + */ + int err; + err = SSL_get_error(ssock->ossl_ssl, nwritten); + if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_NONE) { + /* Re-negotiation is on progress, flush re-negotiation data */ + status = flush_write_bio(ssock, &ssock->handshake_op_key, 0, 0); + if (status == PJ_SUCCESS || status == PJ_EPENDING) + /* Just return PJ_EBUSY when re-negotiation is on progress */ + status = PJ_EBUSY; + } else { + /* Some problem occured */ + GET_SSL_STATUS(status); + } + } else { + /* nwritten < *size, shouldn't happen, unless write BIO cannot hold + * the whole secured data, perhaps because of insufficient memory. + */ + status = PJ_ENOMEM; + } + + return status; +} + +/* Flush delayed data sending in the write pending list. Note that accessing + * write pending list must be serialized, so a call to this function must be + * protected by write mutex of SSL socket. + */ +static pj_status_t flush_delayed_send(pj_ssl_sock_t *ssock) +{ + while (!pj_list_empty(&ssock->write_pending)) { + write_pending_t *wp; + pj_status_t status; + + wp = ssock->write_pending.next; + + status = ssl_write(ssock, &wp->data.key, wp->data.data.ptr, + wp->data.plain_data_len, wp->data.flags); + if (status != PJ_SUCCESS) + return status; + + pj_list_erase(wp); + pj_list_push_back(&ssock->write_pending_empty, wp); + } + + return PJ_SUCCESS; +} + +/* Sending is delayed, push back the sending data into pending list. Note that + * accessing write pending list must be serialized, so a call to this function + * must be protected by write mutex of SSL socket. + */ +static pj_status_t delay_send (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t size, + unsigned flags) +{ + write_pending_t *wp; + + /* Init write pending instance */ + if (!pj_list_empty(&ssock->write_pending_empty)) { + wp = ssock->write_pending_empty.next; + pj_list_erase(wp); + } else { + wp = PJ_POOL_ZALLOC_T(ssock->pool, write_pending_t); + } + + wp->data.app_key = send_key; + wp->data.plain_data_len = size; + wp->data.data.ptr = data; + wp->data.flags = flags; + + pj_list_push_back(&ssock->write_pending, wp); + + /* Must return PJ_EPENDING */ + return PJ_EPENDING; +} + +/** + * Send data using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_send (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags) +{ + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && data && size && (*size>0), PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->ssl_state==SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + pj_lock_acquire(ssock->write_mutex); + + /* Flush delayed send first. Sending data might be delayed when + * re-negotiation is on-progress. + */ + status = flush_delayed_send(ssock); + if (status == PJ_EBUSY) { + /* Re-negotiation is on progress, delay sending */ + status = delay_send(ssock, send_key, data, *size, flags); + goto on_return; + } else if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Write data to SSL */ + status = ssl_write(ssock, send_key, data, *size, flags); + if (status == PJ_EBUSY) { + /* Re-negotiation is on progress, delay sending */ + status = delay_send(ssock, send_key, data, *size, flags); + } + +on_return: + pj_lock_release(ssock->write_mutex); + return status; +} + + +/** + * Send datagram using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_sendto (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags, + const pj_sockaddr_t *addr, + int addr_len) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(send_key); + PJ_UNUSED_ARG(data); + PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG(flags); + PJ_UNUSED_ARG(addr); + PJ_UNUSED_ARG(addr_len); + + return PJ_ENOTSUP; +} + + +/** + * Starts asynchronous socket accept() operations on this secure socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_accept (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + int addr_len) +{ + pj_activesock_cb asock_cb; + pj_activesock_cfg asock_cfg; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && addr_len, PJ_EINVAL); + + /* Create socket */ + status = pj_sock_socket(ssock->param.sock_af, ssock->param.sock_type, 0, + &ssock->sock); + if (status != PJ_SUCCESS) + goto on_error; + + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 2, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_error; + + /* Bind socket */ + status = pj_sock_bind(ssock->sock, localaddr, addr_len); + if (status != PJ_SUCCESS) + goto on_error; + + /* Start listening to the address */ + status = pj_sock_listen(ssock->sock, PJ_SOMAXCONN); + if (status != PJ_SUCCESS) + goto on_error; + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_accept_complete = asock_on_accept_complete; + + status = pj_activesock_create(pool, + ssock->sock, + ssock->param.sock_type, + &asock_cfg, + ssock->param.ioqueue, + &asock_cb, + ssock, + &ssock->asock); + + if (status != PJ_SUCCESS) + goto on_error; + + /* Start accepting */ + status = pj_activesock_start_accept(ssock->asock, pool); + if (status != PJ_SUCCESS) + goto on_error; + + /* Update local address */ + ssock->addr_len = addr_len; + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + if (status != PJ_SUCCESS) + pj_sockaddr_cp(&ssock->local_addr, localaddr); + + ssock->is_server = PJ_TRUE; + + return PJ_SUCCESS; + +on_error: + reset_ssl_sock_state(ssock); + return status; +} + + +/** + * Starts asynchronous socket connect() operation. + */ +PJ_DECL(pj_status_t) pj_ssl_sock_start_connect(pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + const pj_sockaddr_t *remaddr, + int addr_len) +{ + pj_activesock_cb asock_cb; + pj_activesock_cfg asock_cfg; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && remaddr && addr_len, + PJ_EINVAL); + + /* Create socket */ + status = pj_sock_socket(ssock->param.sock_af, ssock->param.sock_type, 0, + &ssock->sock); + if (status != PJ_SUCCESS) + goto on_error; + + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, + &ssock->param.qos_params, 2, + ssock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) + goto on_error; + + /* Bind socket */ + status = pj_sock_bind(ssock->sock, localaddr, addr_len); + if (status != PJ_SUCCESS) + goto on_error; + + /* Create active socket */ + pj_activesock_cfg_default(&asock_cfg); + asock_cfg.async_cnt = ssock->param.async_cnt; + asock_cfg.concurrency = ssock->param.concurrency; + asock_cfg.whole_data = PJ_TRUE; + + pj_bzero(&asock_cb, sizeof(asock_cb)); + asock_cb.on_connect_complete = asock_on_connect_complete; + asock_cb.on_data_read = asock_on_data_read; + asock_cb.on_data_sent = asock_on_data_sent; + + status = pj_activesock_create(pool, + ssock->sock, + ssock->param.sock_type, + &asock_cfg, + ssock->param.ioqueue, + &asock_cb, + ssock, + &ssock->asock); + + if (status != PJ_SUCCESS) + goto on_error; + + /* Save remote address */ + pj_sockaddr_cp(&ssock->rem_addr, remaddr); + + status = pj_activesock_start_connect(ssock->asock, pool, remaddr, + addr_len); + + if (status == PJ_SUCCESS) + asock_on_connect_complete(ssock->asock, PJ_SUCCESS); + else if (status != PJ_EPENDING) + goto on_error; + + /* Update local address */ + ssock->addr_len = addr_len; + status = pj_sock_getsockname(ssock->sock, &ssock->local_addr, + &ssock->addr_len); + /* Note that we may not get an IP address here. This can + * happen for example on Windows, where getsockname() + * would return 0.0.0.0 if socket has just started the + * async connect. In this case, just leave the local + * address with 0.0.0.0 for now; it will be updated + * once the socket is established. + */ + + /* Update SSL state */ + ssock->is_server = PJ_FALSE; + + return PJ_EPENDING; + +on_error: + reset_ssl_sock_state(ssock); + return status; +} + + +PJ_DEF(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock) +{ + int ret; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock->ssl_state == SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + if (SSL_renegotiate_pending(ssock->ossl_ssl)) + return PJ_EPENDING; + + ret = SSL_renegotiate(ssock->ossl_ssl); + if (ret <= 0) { + GET_SSL_STATUS(status); + } else { + status = do_handshake(ssock); + } + + return status; +} + +#endif /* PJ_HAS_SSL_SOCK */ + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_symbian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..684b2470cf5d39a9ba32c6f7ea8498c9e1781ab0 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/ssl_sock_symbian.cpp @@ -0,0 +1,1117 @@ +/* $Id: ssl_sock_symbian.cpp 2998 2009-11-09 08:51:34Z bennylp $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pj/ssl_sock.h> +#include <pj/compat/socket.h> +#include <pj/assert.h> +#include <pj/errno.h> +#include <pj/math.h> +#include <pj/pool.h> +#include <pj/sock.h> +#include <pj/string.h> + +#include "os_symbian.h" +#include <securesocket.h> +#include <x509cert.h> +#include <e32des8.h> + +#define THIS_FILE "ssl_sock_symbian.cpp" + +typedef void (*CPjSSLSocket_cb)(int err, void *key); + +class CPjSSLSocketReader : public CActive +{ +public: + static CPjSSLSocketReader *NewL(CSecureSocket &sock) + { + CPjSSLSocketReader *self = new (ELeave) + CPjSSLSocketReader(sock); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + ~CPjSSLSocketReader() { + Cancel(); + } + + /* Asynchronous read from the socket. */ + int Read(CPjSSLSocket_cb cb, void *key, TPtr8 &data, TUint flags) + { + PJ_ASSERT_RETURN(!IsActive(), PJ_EBUSY); + + cb_ = cb; + key_ = key; + sock_.RecvOneOrMore(data, iStatus, len_received_); + SetActive(); + + return PJ_EPENDING; + } + +private: + CSecureSocket &sock_; + CPjSSLSocket_cb cb_; + void *key_; + TSockXfrLength len_received_; /* not really useful? */ + + void DoCancel() { + sock_.CancelAll(); + } + + void RunL() { + (*cb_)(iStatus.Int(), key_); + } + + CPjSSLSocketReader(CSecureSocket &sock) : + CActive(0), sock_(sock), cb_(NULL), key_(NULL) + {} + + void ConstructL() { + CActiveScheduler::Add(this); + } +}; + +class CPjSSLSocket : public CActive +{ +public: + enum ssl_state { + SSL_STATE_NULL, + SSL_STATE_CONNECTING, + SSL_STATE_HANDSHAKING, + SSL_STATE_ESTABLISHED + }; + + static CPjSSLSocket *NewL(const TDesC8 &ssl_proto, + pj_qos_type qos_type, + const pj_qos_params &qos_params) + { + CPjSSLSocket *self = new (ELeave) CPjSSLSocket(qos_type, qos_params); + CleanupStack::PushL(self); + self->ConstructL(ssl_proto); + CleanupStack::Pop(self); + return self; + } + + ~CPjSSLSocket() { + Cancel(); + CleanupSubObjects(); + } + + int Connect(CPjSSLSocket_cb cb, void *key, const TInetAddr &local_addr, + const TInetAddr &rem_addr, + const TDesC8 &servername = TPtrC8(NULL,0)); + int Send(CPjSSLSocket_cb cb, void *key, const TDesC8 &aDesc, TUint flags); + int SendSync(const TDesC8 &aDesc, TUint flags); + + CPjSSLSocketReader* GetReader(); + enum ssl_state GetState() const { return state_; } + const TInetAddr* GetLocalAddr() const { return &local_addr_; } + int GetCipher(TDes8 &cipher) const { + if (securesock_) + return securesock_->CurrentCipherSuite(cipher); + return KErrNotFound; + } + +private: + enum ssl_state state_; + pj_sock_t sock_; + CSecureSocket *securesock_; + bool is_connected_; + + pj_qos_type qos_type_; + pj_qos_params qos_params_; + + CPjSSLSocketReader *reader_; + TBuf<32> ssl_proto_; + TInetAddr rem_addr_; + TPtrC8 servername_; + TInetAddr local_addr_; + TSockXfrLength sent_len_; + + CPjSSLSocket_cb cb_; + void *key_; + + void DoCancel(); + void RunL(); + + CPjSSLSocket(pj_qos_type qos_type, const pj_qos_params &qos_params) : + CActive(0), state_(SSL_STATE_NULL), sock_(PJ_INVALID_SOCKET), + securesock_(NULL), is_connected_(false), + qos_type_(qos_type), qos_params_(qos_params), + reader_(NULL), cb_(NULL), key_(NULL) + {} + + void ConstructL(const TDesC8 &ssl_proto) { + ssl_proto_.Copy(ssl_proto); + CActiveScheduler::Add(this); + } + + void CleanupSubObjects() { + delete reader_; + reader_ = NULL; + if (securesock_) { + securesock_->Close(); + delete securesock_; + securesock_ = NULL; + } + if (sock_ != PJ_INVALID_SOCKET) { + pj_sock_close(sock_); + sock_ = PJ_INVALID_SOCKET; + } + } +}; + +int CPjSSLSocket::Connect(CPjSSLSocket_cb cb, void *key, + const TInetAddr &local_addr, + const TInetAddr &rem_addr, + const TDesC8 &servername) +{ + pj_status_t status; + + PJ_ASSERT_RETURN(state_ == SSL_STATE_NULL, PJ_EINVALIDOP); + + status = pj_sock_socket(rem_addr.Family(), pj_SOCK_STREAM(), 0, &sock_); + if (status != PJ_SUCCESS) + return status; + + // Apply QoS + status = pj_sock_apply_qos2(sock_, qos_type_, &qos_params_, + 2, THIS_FILE, NULL); + + RSocket &rSock = ((CPjSocket*)sock_)->Socket(); + + local_addr_ = local_addr; + + if (!local_addr_.IsUnspecified()) { + TInt err = rSock.Bind(local_addr_); + if (err != KErrNone) + return PJ_RETURN_OS_ERROR(err); + } + + cb_ = cb; + key_ = key; + rem_addr_ = rem_addr; + servername_.Set(servername); + state_ = SSL_STATE_CONNECTING; + + rSock.Connect(rem_addr_, iStatus); + SetActive(); + + rSock.LocalName(local_addr_); + + return PJ_EPENDING; +} + +int CPjSSLSocket::Send(CPjSSLSocket_cb cb, void *key, const TDesC8 &aDesc, + TUint flags) +{ + PJ_UNUSED_ARG(flags); + + PJ_ASSERT_RETURN(state_ == SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + if (IsActive()) + return PJ_EBUSY; + + cb_ = cb; + key_ = key; + + securesock_->Send(aDesc, iStatus, sent_len_); + SetActive(); + + return PJ_EPENDING; +} + +int CPjSSLSocket::SendSync(const TDesC8 &aDesc, TUint flags) +{ + PJ_UNUSED_ARG(flags); + + PJ_ASSERT_RETURN(state_ == SSL_STATE_ESTABLISHED, PJ_EINVALIDOP); + + TRequestStatus reqStatus; + securesock_->Send(aDesc, reqStatus, sent_len_); + User::WaitForRequest(reqStatus); + + return PJ_RETURN_OS_ERROR(reqStatus.Int()); +} + +CPjSSLSocketReader* CPjSSLSocket::GetReader() +{ + PJ_ASSERT_RETURN(state_ == SSL_STATE_ESTABLISHED, NULL); + + if (reader_) + return reader_; + + TRAPD(err, reader_ = CPjSSLSocketReader::NewL(*securesock_)); + if (err != KErrNone) + return NULL; + + return reader_; +} + +void CPjSSLSocket::DoCancel() +{ + /* Operation to be cancelled depends on current state */ + switch (state_) { + case SSL_STATE_CONNECTING: + { + RSocket &rSock = ((CPjSocket*)sock_)->Socket(); + rSock.CancelConnect(); + + CleanupSubObjects(); + + state_ = SSL_STATE_NULL; + } + break; + case SSL_STATE_HANDSHAKING: + { + securesock_->CancelHandshake(); + securesock_->Close(); + + CleanupSubObjects(); + + state_ = SSL_STATE_NULL; + } + break; + case SSL_STATE_ESTABLISHED: + securesock_->CancelSend(); + break; + default: + break; + } +} + +void CPjSSLSocket::RunL() +{ + switch (state_) { + case SSL_STATE_CONNECTING: + if (iStatus != KErrNone) { + CleanupSubObjects(); + state_ = SSL_STATE_NULL; + /* Dispatch connect failure notification */ + if (cb_) (*cb_)(iStatus.Int(), key_); + } else { + RSocket &rSock = ((CPjSocket*)sock_)->Socket(); + + /* Get local addr */ + rSock.LocalName(local_addr_); + + /* Prepare and start handshake */ + securesock_ = CSecureSocket::NewL(rSock, ssl_proto_); + securesock_->SetDialogMode(EDialogModeAttended); + if (servername_.Length() > 0) + securesock_->SetOpt(KSoSSLDomainName, KSolInetSSL, + servername_); + securesock_->FlushSessionCache(); + securesock_->StartClientHandshake(iStatus); + SetActive(); + state_ = SSL_STATE_HANDSHAKING; + } + break; + case SSL_STATE_HANDSHAKING: + if (iStatus == KErrNone) { + state_ = SSL_STATE_ESTABLISHED; + } else { + state_ = SSL_STATE_NULL; + CleanupSubObjects(); + } + /* Dispatch connect status notification */ + if (cb_) (*cb_)(iStatus.Int(), key_); + break; + case SSL_STATE_ESTABLISHED: + /* Dispatch data sent notification */ + if (cb_) (*cb_)(iStatus.Int(), key_); + break; + default: + pj_assert(0); + break; + } +} + +typedef void (*CPjTimer_cb)(void *user_data); + +class CPjTimer : public CActive +{ +public: + CPjTimer(const pj_time_val *delay, CPjTimer_cb cb, void *user_data) : + CActive(0), cb_(cb), user_data_(user_data) + { + CActiveScheduler::Add(this); + + rtimer_.CreateLocal(); + pj_int32_t interval = PJ_TIME_VAL_MSEC(*delay) * 1000; + if (interval < 0) { + interval = 0; + } + rtimer_.After(iStatus, interval); + SetActive(); + } + + ~CPjTimer() { Cancel(); } + +private: + RTimer rtimer_; + CPjTimer_cb cb_; + void *user_data_; + + void RunL() { if (cb_) (*cb_)(user_data_); } + void DoCancel() { rtimer_.Cancel(); } +}; + +/* + * Structure of recv/read state. + */ +typedef struct read_state_t { + TPtr8 *read_buf; + TPtr8 *orig_buf; + pj_uint32_t flags; +} read_state_t; + +/* + * Structure of send/write data. + */ +typedef struct write_data_t { + pj_size_t len; + pj_ioqueue_op_key_t *key; + pj_size_t data_len; + char data[1]; +} write_data_t; + +/* + * Structure of send/write state. + */ +typedef struct write_state_t { + char *buf; + pj_size_t max_len; + char *start; + pj_size_t len; + write_data_t *current_data; + TPtrC8 send_ptr; +} write_state_t; + +/* + * Secure socket structure definition. + */ +struct pj_ssl_sock_t +{ + pj_ssl_sock_cb cb; + void *user_data; + + pj_bool_t established; + write_state_t write_state; + read_state_t read_state; + CPjTimer *connect_timer; + + CPjSSLSocket *sock; + int sock_af; + int sock_type; + pj_sockaddr local_addr; + pj_sockaddr rem_addr; + + /* QoS settings */ + pj_qos_type qos_type; + pj_qos_params qos_params; + pj_bool_t qos_ignore_error; + + + pj_ssl_sock_proto proto; + pj_time_val timeout; + unsigned ciphers_num; + pj_ssl_cipher *ciphers; + pj_str_t servername; +}; + + +/* + * Get cipher list supported by SSL/TLS backend. + */ +PJ_DEF(pj_status_t) pj_ssl_cipher_get_availables (pj_ssl_cipher ciphers[], + unsigned *cipher_num) +{ + /* Available ciphers */ + static pj_ssl_cipher ciphers_[64]; + static unsigned ciphers_num_ = 0; + unsigned i; + + PJ_ASSERT_RETURN(ciphers && cipher_num, PJ_EINVAL); + + if (ciphers_num_ == 0) { + RSocket sock; + CSecureSocket *secure_sock; + TPtrC16 proto(_L16("TLS1.0")); + + secure_sock = CSecureSocket::NewL(sock, proto); + if (secure_sock) { + TBuf8<128> ciphers_buf(0); + secure_sock->AvailableCipherSuites(ciphers_buf); + + ciphers_num_ = ciphers_buf.Length() / 2; + if (ciphers_num_ > PJ_ARRAY_SIZE(ciphers_)) + ciphers_num_ = PJ_ARRAY_SIZE(ciphers_); + for (i = 0; i < ciphers_num_; ++i) + ciphers_[i] = (pj_ssl_cipher)(ciphers_buf[i*2]*10 + + ciphers_buf[i*2+1]); + } + + delete secure_sock; + } + + if (ciphers_num_ == 0) { + return PJ_ENOTFOUND; + } + + *cipher_num = PJ_MIN(*cipher_num, ciphers_num_); + for (i = 0; i < *cipher_num; ++i) + ciphers[i] = ciphers_[i]; + + return PJ_SUCCESS; +} + +/* + * Create SSL socket instance. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_create (pj_pool_t *pool, + const pj_ssl_sock_param *param, + pj_ssl_sock_t **p_ssock) +{ + pj_ssl_sock_t *ssock; + + PJ_ASSERT_RETURN(param->async_cnt == 1, PJ_EINVAL); + PJ_ASSERT_RETURN(pool && param && p_ssock, PJ_EINVAL); + + /* Allocate secure socket */ + ssock = PJ_POOL_ZALLOC_T(pool, pj_ssl_sock_t); + + /* Allocate write buffer */ + ssock->write_state.buf = (char*)pj_pool_alloc(pool, + param->send_buffer_size); + ssock->write_state.max_len = param->send_buffer_size; + ssock->write_state.start = ssock->write_state.buf; + + /* Init secure socket */ + ssock->sock_af = param->sock_af; + ssock->sock_type = param->sock_type; + ssock->cb = param->cb; + ssock->user_data = param->user_data; + ssock->ciphers_num = param->ciphers_num; + if (param->ciphers_num > 0) { + unsigned i; + ssock->ciphers = (pj_ssl_cipher*) + pj_pool_calloc(pool, param->ciphers_num, + sizeof(pj_ssl_cipher)); + for (i = 0; i < param->ciphers_num; ++i) + ssock->ciphers[i] = param->ciphers[i]; + } + pj_strdup_with_null(pool, &ssock->servername, ¶m->server_name); + + ssock->qos_type = param->qos_type; + ssock->qos_ignore_error = param->qos_ignore_error; + pj_memcpy(&ssock->qos_params, ¶m->qos_params, + sizeof(param->qos_params)); + + /* Finally */ + *p_ssock = ssock; + + return PJ_SUCCESS; +} + + +PJ_DEF(pj_status_t) pj_ssl_cert_load_from_files(pj_pool_t *pool, + const pj_str_t *CA_file, + const pj_str_t *cert_file, + const pj_str_t *privkey_file, + const pj_str_t *privkey_pass, + pj_ssl_cert_t **p_cert) +{ + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(CA_file); + PJ_UNUSED_ARG(cert_file); + PJ_UNUSED_ARG(privkey_file); + PJ_UNUSED_ARG(privkey_pass); + PJ_UNUSED_ARG(p_cert); + return PJ_ENOTSUP; +} + +/* + * Set SSL socket credential. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_set_certificate( + pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_ssl_cert_t *cert) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(cert); + return PJ_ENOTSUP; +} + +/* + * Close the SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_close(pj_ssl_sock_t *ssock) +{ + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + delete ssock->connect_timer; + ssock->connect_timer = NULL; + + delete ssock->sock; + ssock->sock = NULL; + + delete ssock->read_state.read_buf; + delete ssock->read_state.orig_buf; + ssock->read_state.read_buf = NULL; + ssock->read_state.orig_buf = NULL; + + return PJ_SUCCESS; +} + + +/* + * Associate arbitrary data with the SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_set_user_data (pj_ssl_sock_t *ssock, + void *user_data) +{ + PJ_ASSERT_RETURN(ssock, PJ_EINVAL); + + ssock->user_data = user_data; + + return PJ_SUCCESS; +} + + +/* + * Retrieve the user data previously associated with this SSL + * socket. + */ +PJ_DEF(void*) pj_ssl_sock_get_user_data(pj_ssl_sock_t *ssock) +{ + PJ_ASSERT_RETURN(ssock, NULL); + + return ssock->user_data; +} + + +/* + * Retrieve the local address and port used by specified SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_get_info (pj_ssl_sock_t *ssock, + pj_ssl_sock_info *info) +{ + PJ_ASSERT_RETURN(ssock && info, PJ_EINVAL); + + pj_bzero(info, sizeof(*info)); + + info->established = ssock->established; + + /* Local address */ + if (ssock->sock) { + const TInetAddr* local_addr_ = ssock->sock->GetLocalAddr(); + int addrlen = sizeof(pj_sockaddr); + pj_status_t status; + + status = PjSymbianOS::Addr2pj(*local_addr_, info->local_addr, &addrlen); + if (status != PJ_SUCCESS) + return status; + } else { + pj_sockaddr_cp(&info->local_addr, &ssock->local_addr); + } + + if (info->established) { + /* Cipher suite */ + TBuf8<4> cipher; + if (ssock->sock->GetCipher(cipher) == KErrNone) { + info->cipher = (pj_ssl_cipher)cipher[1]; + } + + /* Remote address */ + pj_sockaddr_cp((pj_sockaddr_t*)&info->remote_addr, + (pj_sockaddr_t*)&ssock->rem_addr); + } + + /* Protocol */ + info->proto = ssock->proto; + + return PJ_SUCCESS; +} + + +/* + * Starts read operation on this SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + PJ_ASSERT_RETURN(ssock && pool && buff_size, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->established, PJ_EINVALIDOP); + + /* Reading is already started */ + if (ssock->read_state.orig_buf) { + return PJ_SUCCESS; + } + + void *readbuf[1]; + readbuf[0] = pj_pool_alloc(pool, buff_size); + return pj_ssl_sock_start_read2(ssock, pool, buff_size, readbuf, flags); +} + +static void read_cb(int err, void *key) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)key; + pj_status_t status; + + status = (err == KErrNone)? PJ_SUCCESS : PJ_RETURN_OS_ERROR(err); + + /* Check connection status */ + if (err == KErrEof || !PjSymbianOS::Instance()->IsConnectionUp() || + !ssock->established) + { + status = PJ_EEOF; + } + + /* Notify data arrival */ + if (ssock->cb.on_data_read) { + pj_size_t remainder = 0; + char *data = (char*)ssock->read_state.orig_buf->Ptr(); + pj_size_t data_len = ssock->read_state.read_buf->Length() + + ssock->read_state.read_buf->Ptr() - + ssock->read_state.orig_buf->Ptr(); + + if (data_len > 0) { + /* Notify received data */ + pj_bool_t ret = (*ssock->cb.on_data_read)(ssock, data, data_len, + status, &remainder); + if (!ret) { + /* We've been destroyed */ + return; + } + + /* Calculate available data for next READ operation */ + if (remainder > 0) { + pj_size_t data_maxlen = ssock->read_state.orig_buf->MaxLength(); + + /* There is some data left unconsumed by application, we give + * smaller buffer for next READ operation. + */ + ssock->read_state.read_buf->Set((TUint8*)data+remainder, 0, + data_maxlen - remainder); + } else { + /* Give all buffer for next READ operation. + */ + ssock->read_state.read_buf->Set(*ssock->read_state.orig_buf); + } + } + } + + if (status == PJ_SUCCESS) { + /* Perform the "next" READ operation */ + CPjSSLSocketReader *reader = ssock->sock->GetReader(); + ssock->read_state.read_buf->SetLength(0); + status = reader->Read(&read_cb, ssock, *ssock->read_state.read_buf, + ssock->read_state.flags); + if (status != PJ_EPENDING) { + /* Notify error */ + (*ssock->cb.on_data_read)(ssock, NULL, 0, status, NULL); + } + } + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + /* Connection closed or something goes wrong */ + delete ssock->read_state.read_buf; + delete ssock->read_state.orig_buf; + ssock->read_state.read_buf = NULL; + ssock->read_state.orig_buf = NULL; + ssock->established = PJ_FALSE; + } +} + +/* + * Same as #pj_ssl_sock_start_read(), except that the application + * supplies the buffers for the read operation so that the acive socket + * does not have to allocate the buffers. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_read2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + PJ_ASSERT_RETURN(ssock && buff_size && readbuf, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->established, PJ_EINVALIDOP); + + /* Return failure if access point is marked as down by app. */ + PJ_SYMBIAN_CHECK_CONNECTION(); + + /* Reading is already started */ + if (ssock->read_state.orig_buf) { + return PJ_SUCCESS; + } + + PJ_UNUSED_ARG(pool); + + /* Get reader instance */ + CPjSSLSocketReader *reader = ssock->sock->GetReader(); + if (!reader) + return PJ_ENOMEM; + + /* We manage two buffer pointers here: + * 1. orig_buf keeps the orginal buffer address (and its max length). + * 2. read_buf provides buffer for READ operation, mind that there may be + * some remainder data left by application. + */ + ssock->read_state.read_buf = new TPtr8((TUint8*)readbuf[0], 0, buff_size); + ssock->read_state.orig_buf = new TPtr8((TUint8*)readbuf[0], 0, buff_size); + ssock->read_state.flags = flags; + + pj_status_t status; + status = reader->Read(&read_cb, ssock, *ssock->read_state.read_buf, + ssock->read_state.flags); + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + delete ssock->read_state.read_buf; + delete ssock->read_state.orig_buf; + ssock->read_state.read_buf = NULL; + ssock->read_state.orig_buf = NULL; + + return status; + } + + return PJ_SUCCESS; +} + +/* + * Same as pj_ssl_sock_start_read(), except that this function is used + * only for datagram sockets, and it will trigger \a on_data_recvfrom() + * callback instead. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(flags); + return PJ_ENOTSUP; +} + +/* + * Same as #pj_ssl_sock_start_recvfrom() except that the recvfrom() + * operation takes the buffer from the argument rather than creating + * new ones. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_recvfrom2 (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + unsigned buff_size, + void *readbuf[], + pj_uint32_t flags) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(buff_size); + PJ_UNUSED_ARG(readbuf); + PJ_UNUSED_ARG(flags); + return PJ_ENOTSUP; +} + +static void send_cb(int err, void *key) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)key; + write_state_t *st = &ssock->write_state; + + /* Check connection status */ + if (err != KErrNone || !PjSymbianOS::Instance()->IsConnectionUp() || + !ssock->established) + { + ssock->established = PJ_FALSE; + return; + } + + /* Remove sent data from buffer */ + st->start += st->current_data->len; + st->len -= st->current_data->len; + + /* Reset current outstanding send */ + st->current_data = NULL; + + /* Let's check if there is pending data to send */ + if (st->len) { + write_data_t *wdata = (write_data_t*)st->start; + pj_status_t status; + + st->send_ptr.Set((TUint8*)wdata->data, (TInt)wdata->data_len); + st->current_data = wdata; + status = ssock->sock->Send(&send_cb, ssock, st->send_ptr, 0); + if (status != PJ_EPENDING) { + ssock->established = PJ_FALSE; + st->len = 0; + return; + } + } +} + +/* + * Send data using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_send (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags) +{ + PJ_CHECK_STACK(); + PJ_ASSERT_RETURN(ssock && data && size, PJ_EINVAL); + PJ_ASSERT_RETURN(ssock->write_state.max_len == 0 || + ssock->write_state.max_len >= (pj_size_t)*size, + PJ_ETOOSMALL); + + /* Check connection status */ + if (!PjSymbianOS::Instance()->IsConnectionUp() || !ssock->established) + { + ssock->established = PJ_FALSE; + return PJ_ECANCELLED; + } + + write_state_t *st = &ssock->write_state; + + /* Synchronous mode */ + if (st->max_len == 0) { + st->send_ptr.Set((TUint8*)data, (TInt)*size); + return ssock->sock->SendSync(st->send_ptr, flags); + } + + /* CSecureSocket only allows one outstanding send operation, so + * we use buffering mechanism to allow application to perform send + * operations at any time. + */ + + pj_size_t avail_len = st->max_len - st->len; + pj_size_t needed_len = *size + sizeof(write_data_t) - 1; + + /* Align needed_len to be multiplication of 4 */ + needed_len = ((needed_len + 3) >> 2) << 2; + + /* Block until there is buffer slot available! */ + while (needed_len >= avail_len) { + pj_symbianos_poll(-1, -1); + avail_len = st->max_len - st->len; + } + + /* Ok, make sure the new data will not get wrapped */ + if (st->start + st->len + needed_len > st->buf + st->max_len) { + /* Align buffer left */ + pj_memmove(st->buf, st->start, st->len); + st->start = st->buf; + } + + /* Push back the send data into the buffer */ + write_data_t *wdata = (write_data_t*)(st->start + st->len); + + wdata->len = needed_len; + wdata->key = send_key; + wdata->data_len = (pj_size_t)*size; + pj_memcpy(wdata->data, data, *size); + st->len += needed_len; + + /* If no outstanding send, send it */ + if (st->current_data == NULL) { + pj_status_t status; + + wdata = (write_data_t*)st->start; + st->current_data = wdata; + st->send_ptr.Set((TUint8*)wdata->data, (TInt)wdata->data_len); + status = ssock->sock->Send(&send_cb, ssock, st->send_ptr, flags); + + if (status != PJ_EPENDING) { + *size = -status; + return status; + } + } + + return PJ_SUCCESS; +} + +/* + * Send datagram using the socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_sendto (pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + const void *data, + pj_ssize_t *size, + unsigned flags, + const pj_sockaddr_t *addr, + int addr_len) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(send_key); + PJ_UNUSED_ARG(data); + PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG(flags); + PJ_UNUSED_ARG(addr); + PJ_UNUSED_ARG(addr_len); + return PJ_ENOTSUP; +} + +/* + * Starts asynchronous socket accept() operations on this SSL socket. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_accept (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *local_addr, + int addr_len) +{ + PJ_UNUSED_ARG(ssock); + PJ_UNUSED_ARG(pool); + PJ_UNUSED_ARG(local_addr); + PJ_UNUSED_ARG(addr_len); + + return PJ_ENOTSUP; +} + +static void connect_cb(int err, void *key) +{ + pj_ssl_sock_t *ssock = (pj_ssl_sock_t*)key; + pj_status_t status; + + if (ssock->connect_timer) { + delete ssock->connect_timer; + ssock->connect_timer = NULL; + } + + status = (err == KErrNone)? PJ_SUCCESS : PJ_RETURN_OS_ERROR(err); + if (status == PJ_SUCCESS) { + ssock->established = PJ_TRUE; + } else { + delete ssock->sock; + ssock->sock = NULL; + } + + if (ssock->cb.on_connect_complete) { + pj_bool_t ret = (*ssock->cb.on_connect_complete)(ssock, status); + if (!ret) { + /* We've been destroyed */ + return; + } + } +} + +static void connect_timer_cb(void *key) +{ + connect_cb(KErrTimedOut, key); +} + +/* + * Starts asynchronous socket connect() operation and SSL/TLS handshaking + * for this socket. Once the connection is done (either successfully or not), + * the \a on_connect_complete() callback will be called. + */ +PJ_DEF(pj_status_t) pj_ssl_sock_start_connect (pj_ssl_sock_t *ssock, + pj_pool_t *pool, + const pj_sockaddr_t *localaddr, + const pj_sockaddr_t *remaddr, + int addr_len) +{ + CPjSSLSocket *sock = NULL; + pj_status_t status; + + PJ_ASSERT_RETURN(ssock && pool && localaddr && remaddr && addr_len, + PJ_EINVAL); + + /* Check connection status */ + PJ_SYMBIAN_CHECK_CONNECTION(); + + if (ssock->sock != NULL) { + CPjSSLSocket::ssl_state state = ssock->sock->GetState(); + switch (state) { + case CPjSSLSocket::SSL_STATE_ESTABLISHED: + return PJ_SUCCESS; + default: + return PJ_EPENDING; + } + } + + /* Set SSL protocol */ + TPtrC8 proto; + + if (ssock->proto == PJ_SSL_SOCK_PROTO_DEFAULT) + ssock->proto = PJ_SSL_SOCK_PROTO_TLS1; + + /* CSecureSocket only support TLS1.0 and SSL3.0 */ + switch(ssock->proto) { + case PJ_SSL_SOCK_PROTO_TLS1: + proto.Set((const TUint8*)"TLS1.0", 6); + break; + case PJ_SSL_SOCK_PROTO_SSL3: + proto.Set((const TUint8*)"SSL3.0", 6); + break; + default: + return PJ_ENOTSUP; + } + + /* Prepare addresses */ + TInetAddr localaddr_, remaddr_; + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)localaddr, addr_len, + localaddr_); + if (status != PJ_SUCCESS) + return status; + + status = PjSymbianOS::pj2Addr(*(pj_sockaddr*)remaddr, addr_len, + remaddr_); + if (status != PJ_SUCCESS) + return status; + + pj_sockaddr_cp((pj_sockaddr_t*)&ssock->rem_addr, remaddr); + + /* Init SSL engine */ + TRAPD(err, sock = CPjSSLSocket::NewL(proto, ssock->qos_type, + ssock->qos_params)); + if (err != KErrNone) + return PJ_ENOMEM; + + if (ssock->timeout.sec != 0 || ssock->timeout.msec != 0) { + ssock->connect_timer = new CPjTimer(&ssock->timeout, + &connect_timer_cb, ssock); + } + + /* Convert server name to Symbian descriptor */ + TPtrC8 servername_((TUint8*)ssock->servername.ptr, + ssock->servername.slen); + + /* Try to connect */ + status = sock->Connect(&connect_cb, ssock, localaddr_, remaddr_, + servername_); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + delete sock; + return status; + } + + ssock->sock = sock; + return status; +} + + +PJ_DEF(pj_status_t) pj_ssl_sock_renegotiate(pj_ssl_sock_t *ssock) +{ + PJ_UNUSED_ARG(ssock); + return PJ_ENOTSUP; +} diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp index 4aff5f9564eed554d9d068ea04594cd4c5a7526d..9b1127761f5bf6fa6fc62e48d2e2d49f01b0319e 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/timer_symbian.cpp @@ -1,5 +1,5 @@ -/* $Id: timer_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* $Id: timer_symbian.cpp 3034 2009-12-16 13:30:34Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/timer.h> #include <pj/pool.h> @@ -28,103 +28,241 @@ #define DEFAULT_MAX_TIMED_OUT_PER_POLL (64) +// Maximum number of miliseconds that RTimer.At() supports +#define MAX_RTIMER_INTERVAL 2147 + +/* Absolute maximum number of timer entries */ +#ifndef PJ_SYMBIAN_TIMER_MAX_COUNT +# define PJ_SYMBIAN_TIMER_MAX_COUNT 65535 +#endif + +/* Get the number of free slots in the timer heap */ +#define FREECNT(th) (th->max_size - th->cur_size) + +// Forward declaration +class CPjTimerEntry; /** * The implementation of timer heap. */ - -struct pj_timer_heap_t { +struct pj_timer_heap_t +{ /** Maximum size of the heap. */ pj_size_t max_size; /** Current size of the heap. */ pj_size_t cur_size; - /** Max timed out entries to process per poll. */ - unsigned max_entries_per_poll; + /** Array of timer entries. A scheduled timer will occupy one slot, and + * the slot number will be saved in entry->_timer_id + */ + CPjTimerEntry **entries; + + /** Array of free slot indexes in the "entries" array */ + int *free_slots; }; - -////////////////////////////////////////////////////////////////////////////// /** * Active object for each timer entry. */ - -class CPjTimerEntry : public CActive +class CPjTimerEntry : public CActive { +public: + pj_timer_entry *entry_; + + static CPjTimerEntry* NewL( pj_timer_heap_t *timer_heap, + pj_timer_entry *entry, + const pj_time_val *delay); + + ~CPjTimerEntry(); + + virtual void RunL(); + virtual void DoCancel(); + +private: + pj_timer_heap_t *timer_heap_; + RTimer rtimer_; + pj_uint32_t interval_left_; + + CPjTimerEntry(pj_timer_heap_t *timer_heap, pj_timer_entry *entry); + void ConstructL(const pj_time_val *delay); + void Schedule(); +}; - public: - static CPjTimerEntry* NewL (pj_timer_heap_t *timer_heap, - pj_timer_entry *entry, - const pj_time_val *delay); +////////////////////////////////////////////////////////////////////////////// +/* + * Implementation. + */ - ~CPjTimerEntry(); +/* Grow timer heap to the specified size */ +static pj_status_t realloc_timer_heap(pj_timer_heap_t *th, pj_size_t new_size) +{ + typedef CPjTimerEntry *entry_ptr; + CPjTimerEntry **entries = NULL; + int *free_slots = NULL; + unsigned i, j; + + if (new_size > PJ_SYMBIAN_TIMER_MAX_COUNT) { + /* Just some sanity limit */ + new_size = PJ_SYMBIAN_TIMER_MAX_COUNT; + if (new_size <= th->max_size) { + /* We've grown large enough */ + pj_assert(!"Too many timer heap entries"); + return PJ_ETOOMANY; + } + } + + /* Allocate entries, move entries from the old array if there is one */ + entries = new entry_ptr[new_size]; + if (th->entries) { + pj_memcpy(entries, th->entries, th->max_size * sizeof(th->entries[0])); + } + /* Initialize the remaining new area */ + pj_bzero(&entries[th->max_size], + (new_size - th->max_size) * sizeof(th->entries[0])); + + /* Allocate free slots array */ + free_slots = new int[new_size]; + if (th->free_slots) { + pj_memcpy(free_slots, th->free_slots, + FREECNT(th) * sizeof(th->free_slots[0])); + } + /* Initialize the remaining new area */ + for (i=FREECNT(th), j=th->max_size; j<new_size; ++i, ++j) { + free_slots[i] = j; + } + for ( ; i<new_size; ++i) { + free_slots[i] = -1; + } + + /* Apply */ + delete [] th->entries; + th->entries = entries; + th->max_size = new_size; + delete [] th->free_slots; + th->free_slots = free_slots; - virtual void RunL(); - virtual void DoCancel(); + return PJ_SUCCESS; +} - private: - pj_timer_heap_t *timer_heap_; - pj_timer_entry *entry_; - RTimer rtimer_; +/* Allocate and register an entry to timer heap for newly scheduled entry */ +static pj_status_t add_entry(pj_timer_heap_t *th, CPjTimerEntry *entry) +{ + pj_status_t status; + int slot; + + /* Check that there's still capacity left in the timer heap */ + if (FREECNT(th) < 1) { + // Grow the timer heap twice the capacity + status = realloc_timer_heap(th, th->max_size * 2); + if (status != PJ_SUCCESS) + return status; + } + + /* Allocate one free slot. Use LIFO */ + slot = th->free_slots[FREECNT(th)-1]; + PJ_ASSERT_RETURN((slot >= 0) && (slot < (int)th->max_size) && + (th->entries[slot]==NULL), PJ_EBUG); + + th->free_slots[FREECNT(th)-1] = -1; + th->entries[slot] = entry; + entry->entry_->_timer_id = slot; + ++th->cur_size; + + return PJ_SUCCESS; +} - CPjTimerEntry (pj_timer_heap_t *timer_heap, pj_timer_entry *entry); - void ConstructL (const pj_time_val *delay); -}; +/* Free a slot when an entry's timer has elapsed or cancel */ +static pj_status_t remove_entry(pj_timer_heap_t *th, CPjTimerEntry *entry) +{ + int slot = entry->entry_->_timer_id; + + PJ_ASSERT_RETURN(slot >= 0 && slot < (int)th->max_size, PJ_EBUG); + PJ_ASSERT_RETURN(FREECNT(th) < th->max_size, PJ_EBUG); + PJ_ASSERT_RETURN(th->entries[slot]==entry, PJ_EBUG); + PJ_ASSERT_RETURN(th->free_slots[FREECNT(th)]==-1, PJ_EBUG); + + th->entries[slot] = NULL; + th->free_slots[FREECNT(th)] = slot; + entry->entry_->_timer_id = -1; + --th->cur_size; + + return PJ_SUCCESS; +} -CPjTimerEntry::CPjTimerEntry (pj_timer_heap_t *timer_heap, - pj_timer_entry *entry) - : CActive (PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_ (timer_heap), entry_ (entry) +CPjTimerEntry::CPjTimerEntry(pj_timer_heap_t *timer_heap, + pj_timer_entry *entry) +: CActive(PJ_SYMBIAN_TIMER_PRIORITY), entry_(entry), timer_heap_(timer_heap), + interval_left_(0) { } -CPjTimerEntry::~CPjTimerEntry() +CPjTimerEntry::~CPjTimerEntry() { Cancel(); rtimer_.Close(); } -void CPjTimerEntry::ConstructL (const pj_time_val *delay) +void CPjTimerEntry::Schedule() { - rtimer_.CreateLocal(); - CActiveScheduler::Add (this); - - pj_int32_t interval = PJ_TIME_VAL_MSEC (*delay) * 1000; - - if (interval < 0) { - interval = 0; + pj_int32_t interval; + + if (interval_left_ > MAX_RTIMER_INTERVAL) { + interval = MAX_RTIMER_INTERVAL; + } else { + interval = interval_left_; } - - rtimer_.After (iStatus, interval); - + + interval_left_ -= interval; + rtimer_.After(iStatus, interval * 1000); SetActive(); } -CPjTimerEntry* CPjTimerEntry::NewL (pj_timer_heap_t *timer_heap, - pj_timer_entry *entry, - const pj_time_val *delay) +void CPjTimerEntry::ConstructL(const pj_time_val *delay) { - CPjTimerEntry *self = new CPjTimerEntry (timer_heap, entry); - CleanupStack::PushL (self); - self->ConstructL (delay); - CleanupStack::Pop (self); + rtimer_.CreateLocal(); + CActiveScheduler::Add(this); + + interval_left_ = PJ_TIME_VAL_MSEC(*delay); + Schedule(); +} + +CPjTimerEntry* CPjTimerEntry::NewL(pj_timer_heap_t *timer_heap, + pj_timer_entry *entry, + const pj_time_val *delay) +{ + CPjTimerEntry *self = new CPjTimerEntry(timer_heap, entry); + CleanupStack::PushL(self); + self->ConstructL(delay); + CleanupStack::Pop(self); return self; } -void CPjTimerEntry::RunL() +void CPjTimerEntry::RunL() { - --timer_heap_->cur_size; - entry_->_timer_id = NULL; - entry_->cb (timer_heap_, entry_); - + if (interval_left_ > 0) { + Schedule(); + return; + } + + remove_entry(timer_heap_, this); + entry_->cb(timer_heap_, entry_); + // Finger's crossed! delete this; } -void CPjTimerEntry::DoCancel() +void CPjTimerEntry::DoCancel() { + /* It's possible that _timer_id is -1, see schedule(). In this case, + * the entry has not been added to the timer heap, so don't remove + * it. + */ + if (entry_ && entry_->_timer_id != -1) + remove_entry(timer_heap_, this); + rtimer_.Cancel(); } @@ -135,79 +273,91 @@ void CPjTimerEntry::DoCancel() /* * Calculate memory size required to create a timer heap. */ -PJ_DEF (pj_size_t) pj_timer_heap_mem_size (pj_size_t count) +PJ_DEF(pj_size_t) pj_timer_heap_mem_size(pj_size_t count) { return /* size of the timer heap itself: */ - sizeof (pj_timer_heap_t) + - /* size of each entry: */ - (count+2) * (sizeof (pj_timer_entry*) +sizeof (pj_timer_id_t)) + - /* lock, pool etc: */ - 132; + sizeof(pj_timer_heap_t) + + /* size of each entry: */ + (count+2) * (sizeof(void*)+sizeof(int)) + + /* lock, pool etc: */ + 132; } /* * Create a new timer heap. */ -PJ_DEF (pj_status_t) pj_timer_heap_create (pj_pool_t *pool, - pj_size_t size, - pj_timer_heap_t **p_heap) +PJ_DEF(pj_status_t) pj_timer_heap_create( pj_pool_t *pool, + pj_size_t size, + pj_timer_heap_t **p_heap) { pj_timer_heap_t *ht; + pj_status_t status; - PJ_ASSERT_RETURN (pool && p_heap, PJ_EINVAL); + PJ_ASSERT_RETURN(pool && p_heap, PJ_EINVAL); *p_heap = NULL; /* Allocate timer heap data structure from the pool */ - ht = PJ_POOL_ALLOC_T (pool, pj_timer_heap_t); - + ht = PJ_POOL_ZALLOC_T(pool, pj_timer_heap_t); if (!ht) return PJ_ENOMEM; - /* Initialize timer heap sizes */ - ht->max_size = size; - - ht->cur_size = 0; - - ht->max_entries_per_poll = DEFAULT_MAX_TIMED_OUT_PER_POLL; + /* Allocate slots */ + status = realloc_timer_heap(ht, size); + if (status != PJ_SUCCESS) + return status; *p_heap = ht; - return PJ_SUCCESS; } -PJ_DEF (void) pj_timer_heap_destroy (pj_timer_heap_t *ht) +PJ_DEF(void) pj_timer_heap_destroy( pj_timer_heap_t *ht ) { - PJ_UNUSED_ARG (ht); + /* Cancel and delete pending active objects */ + if (ht->entries) { + unsigned i; + for (i=0; i<ht->max_size; ++i) { + if (ht->entries[i]) { + ht->entries[i]->Cancel(); + delete ht->entries[i]; + ht->entries[i] = NULL; + } + } + } + + delete [] ht->entries; + delete [] ht->free_slots; + + ht->entries = NULL; + ht->free_slots = NULL; } -PJ_DEF (void) pj_timer_heap_set_lock (pj_timer_heap_t *ht, +PJ_DEF(void) pj_timer_heap_set_lock( pj_timer_heap_t *ht, pj_lock_t *lock, - pj_bool_t auto_del) + pj_bool_t auto_del ) { - PJ_UNUSED_ARG (ht); - + PJ_UNUSED_ARG(ht); if (auto_del) - pj_lock_destroy (lock); + pj_lock_destroy(lock); } -PJ_DEF (unsigned) pj_timer_heap_set_max_timed_out_per_poll (pj_timer_heap_t *ht, - unsigned count) +PJ_DEF(unsigned) pj_timer_heap_set_max_timed_out_per_poll(pj_timer_heap_t *ht, + unsigned count ) { - unsigned old_count = ht->max_entries_per_poll; - ht->max_entries_per_poll = count; - return old_count; + /* Not applicable */ + PJ_UNUSED_ARG(count); + return ht->max_size; } -PJ_DEF (pj_timer_entry*) pj_timer_entry_init (pj_timer_entry *entry, - int id, - void *user_data, - pj_timer_heap_callback *cb) +PJ_DEF(pj_timer_entry*) pj_timer_entry_init( pj_timer_entry *entry, + int id, + void *user_data, + pj_timer_heap_callback *cb ) { - pj_assert (entry && cb); + pj_assert(entry && cb); - entry->_timer_id = NULL; + entry->_timer_id = -1; entry->id = id; entry->user_data = user_data; entry->cb = cb; @@ -215,74 +365,81 @@ PJ_DEF (pj_timer_entry*) pj_timer_entry_init (pj_timer_entry *entry, return entry; } -PJ_DEF (pj_status_t) pj_timer_heap_schedule (pj_timer_heap_t *ht, - pj_timer_entry *entry, - const pj_time_val *delay) +PJ_DEF(pj_status_t) pj_timer_heap_schedule( pj_timer_heap_t *ht, + pj_timer_entry *entry, + const pj_time_val *delay) { CPjTimerEntry *timerObj; - - PJ_ASSERT_RETURN (ht && entry && delay, PJ_EINVAL); - PJ_ASSERT_RETURN (entry->cb != NULL, PJ_EINVAL); + pj_status_t status; + + PJ_ASSERT_RETURN(ht && entry && delay, PJ_EINVAL); + PJ_ASSERT_RETURN(entry->cb != NULL, PJ_EINVAL); /* Prevent same entry from being scheduled more than once */ - PJ_ASSERT_RETURN (entry->_timer_id == NULL, PJ_EINVALIDOP); - - timerObj = CPjTimerEntry::NewL (ht, entry, delay); - entry->_timer_id = (void*) timerObj; - - ++ht->cur_size; + PJ_ASSERT_RETURN(entry->_timer_id < 1, PJ_EINVALIDOP); + + entry->_timer_id = -1; + + timerObj = CPjTimerEntry::NewL(ht, entry, delay); + status = add_entry(ht, timerObj); + if (status != PJ_SUCCESS) { + timerObj->Cancel(); + delete timerObj; + return status; + } + return PJ_SUCCESS; } -PJ_DEF (int) pj_timer_heap_cancel (pj_timer_heap_t *ht, - pj_timer_entry *entry) +PJ_DEF(int) pj_timer_heap_cancel( pj_timer_heap_t *ht, + pj_timer_entry *entry) { - PJ_ASSERT_RETURN (ht && entry, PJ_EINVAL); - - if (entry->_timer_id != NULL) { - CPjTimerEntry *timerObj = (CPjTimerEntry*) entry->_timer_id; - timerObj->Cancel(); - delete timerObj; - entry->_timer_id = NULL; - --ht->cur_size; - return 1; + PJ_ASSERT_RETURN(ht && entry, PJ_EINVAL); + + if (entry->_timer_id >= 0 && entry->_timer_id < (int)ht->max_size) { + CPjTimerEntry *timerObj = ht->entries[entry->_timer_id]; + if (timerObj) { + timerObj->Cancel(); + delete timerObj; + return 1; + } else { + return 0; + } } else { - return 0; + return 0; } } -PJ_DEF (unsigned) pj_timer_heap_poll (pj_timer_heap_t *ht, - pj_time_val *next_delay) +PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht, + pj_time_val *next_delay ) { /* Polling is not necessary on Symbian, since all async activities * are registered to active scheduler. */ - PJ_UNUSED_ARG (ht); - + PJ_UNUSED_ARG(ht); if (next_delay) { - next_delay->sec = 1; - next_delay->msec = 0; + next_delay->sec = 1; + next_delay->msec = 0; } - return 0; } -PJ_DEF (pj_size_t) pj_timer_heap_count (pj_timer_heap_t *ht) +PJ_DEF(pj_size_t) pj_timer_heap_count( pj_timer_heap_t *ht ) { - PJ_ASSERT_RETURN (ht, 0); + PJ_ASSERT_RETURN(ht, 0); return ht->cur_size; } -PJ_DEF (pj_status_t) pj_timer_heap_earliest_time (pj_timer_heap_t * ht, - pj_time_val *timeval) +PJ_DEF(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t * ht, + pj_time_val *timeval) { /* We don't support this! */ - PJ_UNUSED_ARG (ht); - + PJ_UNUSED_ARG(ht); + timeval->sec = 1; timeval->msec = 0; - + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp index c1ce1e52e5a0f93886aa1ba60f22116695b8ce9b..b7404b4e9a74310bd20be0e00ae8fe098ee56f12 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_symbian.cpp @@ -1,5 +1,5 @@ -/* $Id: unicode_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */ -/* +/* $Id: unicode_symbian.cpp 3047 2010-01-06 14:35:13Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj/unicode.h> @@ -25,20 +25,23 @@ /* * Convert ANSI strings to Unicode strings. */ -PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len, - wchar_t *wbuf, pj_size_t wbuf_count) +PJ_DEF(wchar_t*) pj_ansi_to_unicode( const char *str, pj_size_t len, + wchar_t *wbuf, pj_size_t wbuf_count) { - TPtrC8 aForeign ( (const TUint8*) str, (TInt) len); - TPtr16 aUnicode ( (TUint16*) wbuf, (TInt) (wbuf_count-1)); + TPtrC8 aForeign((const TUint8*)str, (TInt)len); + TPtr16 aUnicode((TUint16*)wbuf, (TInt)(wbuf_count-1)); TInt left; - left = PjSymbianOS::Instance()->ConvertToUnicode (aUnicode, aForeign); + left = PjSymbianOS::Instance()->ConvertToUnicode(aUnicode, aForeign); if (left != 0) { - // Error, or there are unconvertable characters - *wbuf = 0; + // Error, or there are unconvertable characters + *wbuf = 0; } else { - wbuf[len] = 0; + if (len < wbuf_count) + wbuf[len] = 0; + else + wbuf[len-1] = 0; } return wbuf; @@ -48,20 +51,23 @@ PJ_DEF (wchar_t*) pj_ansi_to_unicode (const char *str, pj_size_t len, /* * Convert Unicode string to ANSI string. */ -PJ_DEF (char*) pj_unicode_to_ansi (const wchar_t *wstr, pj_size_t len, - char *buf, pj_size_t buf_size) +PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len, + char *buf, pj_size_t buf_size) { - TPtrC16 aUnicode ( (const TUint16*) wstr, (TInt) len); - TPtr8 aForeign ( (TUint8*) buf, (TInt) (buf_size-1)); + TPtrC16 aUnicode((const TUint16*)wstr, (TInt)len); + TPtr8 aForeign((TUint8*)buf, (TInt)(buf_size-1)); TInt left; - left = PjSymbianOS::Instance()->ConvertFromUnicode (aForeign, aUnicode); + left = PjSymbianOS::Instance()->ConvertFromUnicode(aForeign, aUnicode); if (left != 0) { - // Error, or there are unconvertable characters - buf[0] = '\0'; + // Error, or there are unconvertable characters + buf[0] = '\0'; } else { - buf[len] = '\0'; + if (len < buf_size) + buf[len] = '\0'; + else + buf[len-1] = '\0'; } return buf; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c index 3153a09bf6724e5454095872beb6c90ca961a956..47fa8c83fee0f84508bc5b7ae7f8d1465f4f2fa3 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pj/unicode_win32.c @@ -1,4 +1,4 @@ -/* $Id: unicode_win32.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: unicode_win32.c 3047 2010-01-06 14:35:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -30,7 +30,13 @@ PJ_DEF(wchar_t*) pj_ansi_to_unicode(const char *s, pj_size_t len, len = MultiByteToWideChar(CP_ACP, 0, s, len, buf, buf_count); - buf[len] = 0; + if (buf_count) { + if (len < buf_count) + buf[len] = 0; + else + buf[len-1] = 0; + } + return buf; } @@ -41,7 +47,13 @@ PJ_DEF(char*) pj_unicode_to_ansi( const wchar_t *wstr, pj_size_t len, PJ_ASSERT_RETURN(wstr && buf, NULL); len = WideCharToMultiByte(CP_ACP, 0, wstr, len, buf, buf_size, NULL, NULL); - buf[len] = '\0'; + if (buf_size) { + if (len < buf_size) + buf[len] = '\0'; + else + buf[len-1] = '\0'; + } + return buf; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp index f69f4cc75a4bf3bcc3c7d2b753200a1e0d199257..6b749ad62dfba137f30cd89cc30c0d60113ab5e4 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib++-test/main.cpp @@ -1,5 +1,5 @@ /* $Id */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pj++/file.hpp> #include <pj++/list.hpp> @@ -42,20 +42,20 @@ int main() Pj_Caching_Pool mem; Pj_Pool the_pool; Pj_Pool *pool = &the_pool; + + the_pool.attach(mem.create_pool(4000,4000)); - the_pool.attach (mem.create_pool (4000,4000)); - - Pj_Semaphore_Lock lsem (pool); + Pj_Semaphore_Lock lsem(pool); Pj_Semaphore_Lock *plsem; - plsem = new (pool) Pj_Semaphore_Lock (pool); + plsem = new(pool) Pj_Semaphore_Lock(pool); delete plsem; - Pj_Proactor proactor (pool, 100, 100); + Pj_Proactor proactor(pool, 100, 100); - My_Event_Handler *event_handler = new (the_pool) My_Event_Handler; - proactor.register_socket_handler (pool, event_handler); - proactor.unregister_handler (event_handler); + My_Event_Handler *event_handler = new(the_pool) My_Event_Handler; + proactor.register_socket_handler(pool, event_handler); + proactor.unregister_handler(event_handler); return 0; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c index 2b7320411348a46fc75fcc0cdb2e34860fee4837..42c5900666bb347e63efd2e196e394d346b9e9f0 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/activesock.c @@ -1,4 +1,4 @@ -/* $Id: activesock.c 2771 2009-06-17 13:31:13Z bennylp $ */ +/* $Id: activesock.c 3048 2010-01-08 09:53:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -490,8 +490,6 @@ int activesock_test(void) { int ret; - ret = (int)&udp_ping_pong_test; - PJ_LOG(3,("", "..udp ping/pong test")); ret = udp_ping_pong_test(); if (ret != 0) diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c index c0c5865f1aa78e9565beb39c38693718d46bfc1f..b6445f2952ef84408f51fb24ce2edd7a7bd3f7a2 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/errno.c @@ -1,4 +1,4 @@ -/* $Id: errno.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: errno.c 2992 2009-11-09 04:09:13Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -158,6 +158,10 @@ int errno_test(void) PJ_LOG(3,(THIS_FILE, "...msg for rc=PJ_EBUG, cut at %d chars: '%s'", CUT, errbuf)); + /* Perror */ + pj_perror(3, THIS_FILE, PJ_SUCCESS, "...testing %s", "pj_perror"); + PJ_PERROR(3,(THIS_FILE, PJ_SUCCESS, "...testing %s", "PJ_PERROR")); + return 0; } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp index d9e4b682e4a6b8441f08cf32af704dff42c401b4..ecc542e79b7a882260bead57d95e5aba1fa0802e 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/exception_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: exception_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c index bf7f7f5b73ee10af79b0e456d0886014c4ac26d1..a699f54bdf18c405bcdc2745cbdf078f10436db0 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ioq_tcp.c @@ -1,4 +1,4 @@ -/* $Id: ioq_tcp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: ioq_tcp.c 3051 2010-01-08 13:08:05Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -97,6 +97,15 @@ static void on_ioqueue_accept(pj_ioqueue_key_t *key, "invalid socket and status is %d", status)); } } else { + pj_sockaddr addr; + int client_addr_len; + + client_addr_len = sizeof(addr); + status = pj_sock_getsockname(sock, &addr, &client_addr_len); + if (status != PJ_SUCCESS) { + app_perror("...ERROR in pj_sock_getsockname()", status); + } + callback_accept_key = key; callback_accept_op = op_key; callback_accept_status = status; @@ -757,30 +766,28 @@ static int compliance_test_2(pj_bool_t allow_concur) ++pending_op; } - } - - - // Poll until all connected - while (pending_op) { - pj_time_val timeout = {1, 0}; + // Poll until connection of this pair established + while (pending_op) { + pj_time_val timeout = {1, 0}; #ifdef PJ_SYMBIAN - status = pj_symbianos_poll(-1, 1000); + status = pj_symbianos_poll(-1, 1000); #else - status = pj_ioqueue_poll(ioque, &timeout); + status = pj_ioqueue_poll(ioque, &timeout); #endif - if (status > 0) { - if (status > pending_op) { - PJ_LOG(3,(THIS_FILE, - "...error: pj_ioqueue_poll() returned %d " - "(only expecting %d)", - status, pending_op)); - return -110; - } - pending_op -= status; - - if (pending_op == 0) { - status = 0; + if (status > 0) { + if (status > pending_op) { + PJ_LOG(3,(THIS_FILE, + "...error: pj_ioqueue_poll() returned %d " + "(only expecting %d)", + status, pending_op)); + return -110; + } + pending_op -= status; + + if (pending_op == 0) { + status = 0; + } } } } diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp index a0b2ec7d1986c83b8ba8b90335b15a2123c4a8fd..a91b671f2cb11adf3d02369bb100a42dfa5e79fe 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/main_symbian.cpp @@ -25,10 +25,8 @@ int main() //err = test_main(); if (err) - return err; - + return err; return exp; - //return 0; } @@ -48,31 +46,31 @@ LOCAL_D CConsoleBase* console; // write all messages to this class MyScheduler : public CActiveScheduler { +public: + MyScheduler() + {} - public: - MyScheduler() {} - - void Error (TInt aError) const; + void Error(TInt aError) const; }; -void MyScheduler::Error (TInt aError) const +void MyScheduler::Error(TInt aError) const { - PJ_UNUSED_ARG (aError); + PJ_UNUSED_ARG(aError); } LOCAL_C void DoStartL() -{ + { // Create active scheduler (to run active objects) CActiveScheduler* scheduler = new (ELeave) MyScheduler; - CleanupStack::PushL (scheduler); - CActiveScheduler::Install (scheduler); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); test_main(); - CActiveScheduler::Install (NULL); - CleanupStack::Pop (scheduler); + CActiveScheduler::Install(NULL); + CleanupStack::Pop(scheduler); delete scheduler; -} + } #define WRITE_TO_DEBUG_CONSOLE @@ -81,59 +79,55 @@ LOCAL_C void DoStartL() #endif // Global Functions -static void log_writer (int level, const char *buf, int len) +static void log_writer(int level, const char *buf, int len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); - - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + PJ_UNUSED_ARG(level); + + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); buf16[len] = 0; buf16[len+1] = 0; - - TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); - console->Write (aBuf); - + + TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); + console->Write(aBuf); + #ifdef WRITE_TO_DEBUG_CONSOLE - RDebug::Print (aBuf); + RDebug::Print(aBuf); #endif } GLDEF_C TInt E32Main() -{ + { // Create cleanup stack __UHEAP_MARK; CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); - + TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); if (createError) return createError; - pj_log_set_log_func (&log_writer); + pj_log_set_log_func(&log_writer); // Run application code inside TRAP harness, wait keypress when terminated - TRAPD (mainError, DoStartL()); - + TRAPD(mainError, DoStartL()); if (mainError) - console->Printf (_L (" failed, leave code = %d"), mainError); - - console->Printf (_L (" [press any key]\n")); - + console->Printf(_L(" failed, leave code = %d"), mainError); + + console->Printf(_L(" [press any key]\n")); console->Getch(); - + delete console; - delete cleanup; - - CloseSTDLIB(); - + + CloseSTDLIB(); + __UHEAP_MARKEND; - + return KErrNone; -} + } #endif /* if 0 */ diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp index 93d64af92e08988cb64ad15063b1ea38c40caf60..381e42aee345d4da3a9025e6f150e30df638c6dc 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/pool_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: pool_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c index 19ecd74a54b71317a199dddf4c67598c46830acb..ac5cc3333e7fada77f56db55e45143ab0a25ab4b 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/sock.c @@ -1,4 +1,4 @@ -/* $Id: sock.c 2863 2009-08-12 10:56:06Z bennylp $ */ +/* $Id: sock.c 3044 2010-01-04 16:54:50Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -72,6 +72,18 @@ static char bigdata[BIG_DATA_LEN]; static char bigbuffer[BIG_DATA_LEN]; +/* Macro for checking the value of "sin_len" member of sockaddr + * (it must always be zero). + */ +#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 +# define CHECK_SA_ZERO_LEN(addr, ret) \ + if (((pj_addr_hdr*)(addr))->sa_zero_len != 0) \ + return ret +#else +# define CHECK_SA_ZERO_LEN(addr, ret) +#endif + + static int format_test(void) { pj_str_t s = pj_str(ADDRESS); @@ -167,6 +179,28 @@ static int format_test(void) /* pj_gethostaddr() */ + /* Various constants */ +#if !defined(PJ_SYMBIAN) || PJ_SYMBIAN==0 + if (PJ_AF_INET==0xFFFF) return -5500; + if (PJ_AF_INET6==0xFFFF) return -5501; + + /* 0xFFFF could be a valid SOL_SOCKET (e.g: on some Win or Mac) */ + //if (PJ_SOL_SOCKET==0xFFFF) return -5503; + + if (PJ_SOL_IP==0xFFFF) return -5502; + if (PJ_SOL_TCP==0xFFFF) return -5510; + if (PJ_SOL_UDP==0xFFFF) return -5520; + if (PJ_SOL_IPV6==0xFFFF) return -5530; + + if (PJ_SO_TYPE==0xFFFF) return -5540; + if (PJ_SO_RCVBUF==0xFFFF) return -5550; + if (PJ_SO_SNDBUF==0xFFFF) return -5560; + if (PJ_TCP_NODELAY==0xFFFF) return -5570; + if (PJ_SO_REUSEADDR==0xFFFF) return -5580; + + if (PJ_MSG_OOB==0xFFFF) return -5590; + if (PJ_MSG_PEEK==0xFFFF) return -5600; +#endif return 0; } @@ -262,6 +296,9 @@ static int parse_test(void) return -10; } + /* Check "sin_len" member of parse result */ + CHECK_SA_ZERO_LEN(&addr, -20); + /* Build the correct result */ status = pj_sockaddr_init(valid_tests[i].result_af, &result, @@ -290,6 +327,9 @@ static int parse_test(void) return -50; } + /* Check "sin_len" member of parse result */ + CHECK_SA_ZERO_LEN(&addr, -55); + /* Compare the result again */ if (pj_sockaddr_cmp(&addr, &result) != 0) { PJ_LOG(1,("test", ".... parsed result mismatched for %s", @@ -329,6 +369,68 @@ static int parse_test(void) return 0; } +static int purity_test(void) +{ + PJ_LOG(3,("test", "...purity_test()")); + +#if defined(PJ_SOCKADDR_HAS_LEN) && PJ_SOCKADDR_HAS_LEN!=0 + /* Check on "sin_len" member of sockaddr */ + { + const pj_str_t str_ip = {"1.1.1.1", 7}; + pj_sockaddr addr[16]; + pj_addrinfo ai[16]; + unsigned cnt; + pj_status_t rc; + + /* pj_enum_ip_interface() */ + cnt = PJ_ARRAY_SIZE(addr); + rc = pj_enum_ip_interface(pj_AF_UNSPEC(), &cnt, addr); + if (rc == PJ_SUCCESS) { + while (cnt--) + CHECK_SA_ZERO_LEN(&addr[cnt], -10); + } + + /* pj_gethostip() on IPv4 */ + rc = pj_gethostip(pj_AF_INET(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -20); + + /* pj_gethostip() on IPv6 */ + rc = pj_gethostip(pj_AF_INET6(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -30); + + /* pj_getdefaultipinterface() on IPv4 */ + rc = pj_getdefaultipinterface(pj_AF_INET(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -40); + + /* pj_getdefaultipinterface() on IPv6 */ + rc = pj_getdefaultipinterface(pj_AF_INET6(), &addr[0]); + if (rc == PJ_SUCCESS) + CHECK_SA_ZERO_LEN(&addr[0], -50); + + /* pj_getaddrinfo() on a host name */ + cnt = PJ_ARRAY_SIZE(ai); + rc = pj_getaddrinfo(pj_AF_UNSPEC(), pj_gethostname(), &cnt, ai); + if (rc == PJ_SUCCESS) { + while (cnt--) + CHECK_SA_ZERO_LEN(&ai[cnt].ai_addr, -60); + } + + /* pj_getaddrinfo() on an IP address */ + cnt = PJ_ARRAY_SIZE(ai); + rc = pj_getaddrinfo(pj_AF_UNSPEC(), &str_ip, &cnt, ai); + if (rc == PJ_SUCCESS) { + pj_assert(cnt == 1); + CHECK_SA_ZERO_LEN(&ai[0].ai_addr, -70); + } + } +#endif + + return 0; +} + static int simple_sock_test(void) { int types[2]; @@ -738,6 +840,10 @@ int sock_test() if (rc != 0) return rc; + rc = purity_test(); + if (rc != 0) + return rc; + rc = gethostbyname_test(); if (rc != 0) return rc; diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ssl_sock.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ssl_sock.c new file mode 100644 index 0000000000000000000000000000000000000000..691e48bfebe357e9fa5b4a892b2658fcd797f243 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/ssl_sock.c @@ -0,0 +1,1196 @@ +/* $Id: ssl_sock.c 3018 2009-11-11 07:14:28Z nanang $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "test.h" +#include <pjlib.h> + + +#define CERT_DIR "../build/" +#define CERT_CA_FILE NULL +#define CERT_FILE CERT_DIR "cacert.pem" +#define CERT_PRIVKEY_FILE CERT_DIR "privkey.pem" +#define CERT_PRIVKEY_PASS "" + + +#if INCLUDE_SSLSOCK_TEST + +/* Global vars */ +static int clients_num; + +struct send_key { + pj_ioqueue_op_key_t op_key; +}; + + +static int get_cipher_list(void) { + pj_status_t status; + pj_ssl_cipher ciphers[100]; + unsigned cipher_num; + unsigned i; + + cipher_num = PJ_ARRAY_SIZE(ciphers); + status = pj_ssl_cipher_get_availables(ciphers, &cipher_num); + if (status != PJ_SUCCESS) { + app_perror("...FAILED to get available ciphers", status); + return status; + } + + PJ_LOG(3, ("", "...Found %u ciphers:", cipher_num)); + for (i = 0; i < cipher_num; ++i) { + const char* st; + st = pj_ssl_cipher_name(ciphers[i]); + if (st == NULL) + st = "[Unknown]"; + + PJ_LOG(3, ("", "...%3u: 0x%08x=%s", i+1, ciphers[i], st)); + } + + return PJ_SUCCESS; +} + + +struct test_state +{ + pj_pool_t *pool; /* pool */ + pj_bool_t is_server; /* server role flag */ + pj_bool_t is_verbose; /* verbose flag, e.g: cert info */ + pj_bool_t echo; /* echo received data */ + pj_status_t err; /* error flag */ + unsigned sent; /* bytes sent */ + unsigned recv; /* bytes received */ + pj_uint8_t read_buf[256]; /* read buffer */ + pj_bool_t done; /* test done flag */ + char *send_str; /* data to send once connected */ + unsigned send_str_len; /* send data length */ + pj_bool_t check_echo; /* flag to compare sent & echoed data */ + const char *check_echo_ptr; /* pointer/cursor for comparing data */ + struct send_key send_key; /* send op key */ +}; + +static void dump_cert_info(const char *prefix, const pj_ssl_cert_info *ci) +{ + const char *wdays[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; + pj_parsed_time pt1; + pj_parsed_time pt2; + + pj_time_decode(&ci->validity_start, &pt1); + pj_time_decode(&ci->validity_end, &pt2); + + PJ_LOG(3, ("", "%sSubject : %.*s", prefix, ci->subject.slen, ci->subject.ptr)); + PJ_LOG(3, ("", "%sIssuer : %.*s", prefix, ci->issuer.slen, ci->issuer.ptr)); + PJ_LOG(3, ("", "%sVersion : v%d", prefix, ci->version)); + PJ_LOG(3, ("", "%sValid from : %s %4d-%02d-%02d %02d:%02d:%02d.%03d %s", + prefix, wdays[pt1.wday], pt1.year, pt1.mon+1, pt1.day, + pt1.hour, pt1.min, pt1.sec, pt1.msec, + (ci->validity_use_gmt? "GMT":""))); + PJ_LOG(3, ("", "%sValid to : %s %4d-%02d-%02d %02d:%02d:%02d.%03d %s", + prefix, wdays[pt2.wday], pt2.year, pt2.mon+1, pt2.day, + pt2.hour, pt2.min, pt2.sec, pt2.msec, + (ci->validity_use_gmt? "GMT":""))); +} + + +static pj_bool_t ssl_on_connect_complete(pj_ssl_sock_t *ssock, + pj_status_t status) +{ + struct test_state *st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + void *read_buf[1]; + pj_ssl_sock_info info; + char buf1[64], buf2[64]; + + if (status != PJ_SUCCESS) { + app_perror("...ERROR ssl_on_connect_complete()", status); + goto on_return; + } + + status = pj_ssl_sock_get_info(ssock, &info); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_get_info()", status); + goto on_return; + } + + pj_sockaddr_print((pj_sockaddr_t*)&info.local_addr, buf1, sizeof(buf1), 1); + pj_sockaddr_print((pj_sockaddr_t*)&info.remote_addr, buf2, sizeof(buf2), 1); + PJ_LOG(3, ("", "...Connected %s -> %s!", buf1, buf2)); + + if (st->is_verbose) { + const char *tmp_st; + + /* Print cipher name */ + tmp_st = pj_ssl_cipher_name(info.cipher); + if (tmp_st == NULL) + tmp_st = "[Unknown]"; + PJ_LOG(3, ("", ".....Cipher: %s", tmp_st)); + + /* Print certificates info */ + if (info.local_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Local certificate info:")); + dump_cert_info(".......", &info.local_cert_info); + } + if (info.remote_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Remote certificate info:")); + dump_cert_info(".......", &info.remote_cert_info); + } + } + + /* Start reading data */ + read_buf[0] = st->read_buf; + status = pj_ssl_sock_start_read2(ssock, st->pool, sizeof(st->read_buf), (void**)read_buf, 0); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_start_read2()", status); + goto on_return; + } + + /* Start sending data */ + while (st->sent < st->send_str_len) { + pj_ssize_t size; + + size = st->send_str_len - st->sent; + status = pj_ssl_sock_send(ssock, (pj_ioqueue_op_key_t*)&st->send_key, + st->send_str + st->sent, &size, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + goto on_return; + } + + if (status == PJ_SUCCESS) + st->sent += size; + else + break; + } + +on_return: + st->err = status; + + if (st->err != PJ_SUCCESS) { + pj_ssl_sock_close(ssock); + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +static pj_bool_t ssl_on_accept_complete(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *newsock, + const pj_sockaddr_t *src_addr, + int src_addr_len) +{ + struct test_state *parent_st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + struct test_state *st; + void *read_buf[1]; + pj_status_t status; + + PJ_UNUSED_ARG(src_addr_len); + + /* Duplicate parent test state to newly accepted test state */ + st = pj_pool_zalloc(parent_st->pool, sizeof(struct test_state)); + *st = *parent_st; + pj_ssl_sock_set_user_data(newsock, st); + + if (st->is_verbose) { + pj_ssl_sock_info info; + char buf[64]; + const char *tmp_st; + + status = pj_ssl_sock_get_info(newsock, &info); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_get_info()", status); + goto on_return; + } + + pj_sockaddr_print(src_addr, buf, sizeof(buf), 1); + PJ_LOG(3, ("", "...Accepted connection from %s", buf)); + + /* Print cipher name */ + tmp_st = pj_ssl_cipher_name(info.cipher); + if (tmp_st == NULL) + tmp_st = "[Unknown]"; + PJ_LOG(3, ("", ".....Cipher: %s", tmp_st)); + + /* Print certificates info */ + if (info.local_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Local certificate info:")); + dump_cert_info(".......", &info.local_cert_info); + } + if (info.remote_cert_info.subject.slen) { + PJ_LOG(3, ("", ".....Remote certificate info:")); + dump_cert_info(".......", &info.remote_cert_info); + } + } + + /* Start reading data */ + read_buf[0] = st->read_buf; + status = pj_ssl_sock_start_read2(newsock, st->pool, sizeof(st->read_buf), (void**)read_buf, 0); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_start_read2()", status); + goto on_return; + } + + /* Start sending data */ + while (st->sent < st->send_str_len) { + pj_ssize_t size; + + size = st->send_str_len - st->sent; + status = pj_ssl_sock_send(newsock, (pj_ioqueue_op_key_t*)&st->send_key, + st->send_str + st->sent, &size, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + goto on_return; + } + + if (status == PJ_SUCCESS) + st->sent += size; + else + break; + } + +on_return: + st->err = status; + + if (st->err != PJ_SUCCESS) { + pj_ssl_sock_close(newsock); + return PJ_FALSE; + } + + return PJ_TRUE; +} + +static pj_bool_t ssl_on_data_read(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + struct test_state *st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + + PJ_UNUSED_ARG(remainder); + PJ_UNUSED_ARG(data); + + if (size > 0) { + pj_size_t consumed; + + /* Set random remainder */ + *remainder = pj_rand() % 100; + + /* Apply zero remainder if: + * - remainder is less than size, or + * - connection closed/error + * - echo/check_eco set + */ + if (*remainder > size || status != PJ_SUCCESS || st->echo || st->check_echo) + *remainder = 0; + + consumed = size - *remainder; + st->recv += consumed; + + //printf("%.*s", consumed, (char*)data); + + pj_memmove(data, (char*)data + consumed, *remainder); + + /* Echo data when specified to */ + if (st->echo) { + pj_ssize_t size_ = consumed; + status = pj_ssl_sock_send(ssock, (pj_ioqueue_op_key_t*)&st->send_key, data, &size_, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + goto on_return; + } + + if (status == PJ_SUCCESS) + st->sent += size_; + } + + /* Verify echoed data when specified to */ + if (st->check_echo) { + if (!st->check_echo_ptr) + st->check_echo_ptr = st->send_str; + + if (pj_memcmp(st->check_echo_ptr, data, consumed)) { + status = PJ_EINVAL; + app_perror("...ERROR echoed data not exact", status); + goto on_return; + } + st->check_echo_ptr += consumed; + + /* Echo received completely */ + if (st->send_str_len == st->recv) { + pj_ssl_sock_info info; + char buf[64]; + + status = pj_ssl_sock_get_info(ssock, &info); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_get_info()", status); + goto on_return; + } + + pj_sockaddr_print((pj_sockaddr_t*)&info.local_addr, buf, sizeof(buf), 1); + PJ_LOG(3, ("", "...%s successfully recv %d bytes echo", buf, st->recv)); + st->done = PJ_TRUE; + } + } + } + + if (status != PJ_SUCCESS) { + if (status == PJ_EEOF) { + status = PJ_SUCCESS; + st->done = PJ_TRUE; + } else { + app_perror("...ERROR ssl_on_data_read()", status); + } + } + +on_return: + st->err = status; + + if (st->err != PJ_SUCCESS || st->done) { + pj_ssl_sock_close(ssock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + +static pj_bool_t ssl_on_data_sent(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t sent) +{ + struct test_state *st = (struct test_state*) + pj_ssl_sock_get_user_data(ssock); + PJ_UNUSED_ARG(op_key); + + if (sent < 0) { + st->err = -sent; + } else { + st->sent += sent; + + /* Send more if any */ + while (st->sent < st->send_str_len) { + pj_ssize_t size; + pj_status_t status; + + size = st->send_str_len - st->sent; + status = pj_ssl_sock_send(ssock, (pj_ioqueue_op_key_t*)&st->send_key, + st->send_str + st->sent, &size, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + app_perror("...ERROR pj_ssl_sock_send()", status); + st->err = status; + break; + } + + if (status == PJ_SUCCESS) + st->sent += size; + else + break; + } + } + + if (st->err != PJ_SUCCESS) { + pj_ssl_sock_close(ssock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + +#define HTTP_REQ "GET / HTTP/1.0\r\n\r\n"; +#define HTTP_SERVER_ADDR "trac.pjsip.org" +#define HTTP_SERVER_PORT 443 + +static int https_client_test(unsigned ms_timeout) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; + pj_ssl_sock_t *ssock = NULL; + pj_ssl_sock_param param; + pj_status_t status; + struct test_state state = {0}; + pj_sockaddr local_addr, rem_addr; + pj_str_t tmp_st; + + pool = pj_pool_create(mem, "https_get", 256, 256, NULL); + + status = pj_ioqueue_create(pool, 4, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_timer_heap_create(pool, 4, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + + state.pool = pool; + state.send_str = HTTP_REQ; + state.send_str_len = pj_ansi_strlen(state.send_str); + state.is_verbose = PJ_TRUE; + + pj_ssl_sock_param_default(¶m); + param.cb.on_connect_complete = &ssl_on_connect_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.user_data = &state; + param.server_name = pj_str((char*)HTTP_SERVER_ADDR); + param.timer_heap = timer; + param.timeout.sec = 0; + param.timeout.msec = ms_timeout; + pj_time_val_normalize(¶m.timeout); + + status = pj_ssl_sock_create(pool, ¶m, &ssock); + if (status != PJ_SUCCESS) { + goto on_return; + } + + pj_sockaddr_init(PJ_AF_INET, &local_addr, pj_strset2(&tmp_st, "0.0.0.0"), 0); + pj_sockaddr_init(PJ_AF_INET, &rem_addr, pj_strset2(&tmp_st, HTTP_SERVER_ADDR), HTTP_SERVER_PORT); + status = pj_ssl_sock_start_connect(ssock, pool, &local_addr, &rem_addr, sizeof(rem_addr)); + if (status == PJ_SUCCESS) { + ssl_on_connect_complete(ssock, PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + goto on_return; + } + + /* Wait until everything has been sent/received */ + while (state.err == PJ_SUCCESS && !state.done) { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); + pj_timer_heap_poll(timer, &delay); +#endif + } + + if (state.err) { + status = state.err; + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + PJ_LOG(3, ("", ".....Sent/recv: %d/%d bytes", state.sent, state.recv)); + +on_return: + if (ssock && !state.err && !state.done) + pj_ssl_sock_close(ssock); + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (timer) + pj_timer_heap_destroy(timer); + if (pool) + pj_pool_release(pool); + + return status; +} + + +static int echo_test(pj_ssl_sock_proto srv_proto, pj_ssl_sock_proto cli_proto, + pj_ssl_cipher srv_cipher, pj_ssl_cipher cli_cipher) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_ssl_sock_t *ssock_serv = NULL; + pj_ssl_sock_t *ssock_cli = NULL; + pj_ssl_sock_param param; + struct test_state state_serv = { 0 }; + struct test_state state_cli = { 0 }; + pj_sockaddr addr, listen_addr; + pj_ssl_cipher ciphers[1]; + pj_ssl_cert_t *cert = NULL; + pj_status_t status; + + pool = pj_pool_create(mem, "ssl_echo", 256, 256, NULL); + + status = pj_ioqueue_create(pool, 4, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Set cert */ + { + pj_str_t tmp1, tmp2, tmp3, tmp4; + + status = pj_ssl_cert_load_from_files(pool, + pj_strset2(&tmp1, (char*)CERT_CA_FILE), + pj_strset2(&tmp2, (char*)CERT_FILE), + pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), + pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), + &cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + } + + pj_ssl_sock_param_default(¶m); + param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_connect_complete = &ssl_on_connect_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.ciphers = ciphers; + + /* Init default bind address */ + { + pj_str_t tmp_st; + pj_sockaddr_init(PJ_AF_INET, &addr, pj_strset2(&tmp_st, "127.0.0.1"), 0); + } + + /* SERVER */ + param.proto = srv_proto; + param.user_data = &state_serv; + param.ciphers_num = (srv_cipher == -1)? 0 : 1; + ciphers[0] = srv_cipher; + + state_serv.pool = pool; + state_serv.echo = PJ_TRUE; + state_serv.is_server = PJ_TRUE; + state_serv.is_verbose = PJ_TRUE; + + status = pj_ssl_sock_create(pool, ¶m, &ssock_serv); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_set_certificate(ssock_serv, pool, cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_start_accept(ssock_serv, pool, &addr, pj_sockaddr_get_len(&addr)); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Get listener address */ + { + pj_ssl_sock_info info; + + pj_ssl_sock_get_info(ssock_serv, &info); + pj_sockaddr_cp(&listen_addr, &info.local_addr); + } + + /* CLIENT */ + param.proto = cli_proto; + param.user_data = &state_cli; + param.ciphers_num = (cli_cipher == -1)? 0 : 1; + ciphers[0] = cli_cipher; + + state_cli.pool = pool; + state_cli.check_echo = PJ_TRUE; + state_cli.is_verbose = PJ_TRUE; + + { + pj_time_val now; + + pj_gettimeofday(&now); + pj_srand((unsigned)now.sec); + state_cli.send_str_len = (pj_rand() % 5 + 1) * 1024 + pj_rand() % 1024; + } + state_cli.send_str = pj_pool_alloc(pool, state_cli.send_str_len); + { + unsigned i; + for (i = 0; i < state_cli.send_str_len; ++i) + state_cli.send_str[i] = (char)(pj_rand() % 256); + } + + status = pj_ssl_sock_create(pool, ¶m, &ssock_cli); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_start_connect(ssock_cli, pool, &addr, &listen_addr, pj_sockaddr_get_len(&addr)); + if (status == PJ_SUCCESS) { + ssl_on_connect_complete(ssock_cli, PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + goto on_return; + } + + /* Wait until everything has been sent/received or error */ + while (!state_serv.err && !state_cli.err && !state_serv.done && !state_cli.done) + { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); +#endif + } + + /* Clean up sockets */ + { + pj_time_val delay = {0, 100}; + while (pj_ioqueue_poll(ioqueue, &delay) > 0); + } + + if (state_serv.err || state_cli.err) { + if (state_serv.err != PJ_SUCCESS) + status = state_serv.err; + else + status = state_cli.err; + + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + PJ_LOG(3, ("", ".....Sent/recv: %d/%d bytes", state_cli.sent, state_cli.recv)); + +on_return: + if (ssock_serv) + pj_ssl_sock_close(ssock_serv); + if (ssock_cli && !state_cli.err && !state_cli.done) + pj_ssl_sock_close(ssock_cli); + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (pool) + pj_pool_release(pool); + + return status; +} + + +static pj_bool_t asock_on_data_read(pj_activesock_t *asock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + struct test_state *st = (struct test_state*) + pj_activesock_get_user_data(asock); + + PJ_UNUSED_ARG(data); + PJ_UNUSED_ARG(size); + PJ_UNUSED_ARG(remainder); + + if (status != PJ_SUCCESS) { + if (status == PJ_EEOF) { + status = PJ_SUCCESS; + st->done = PJ_TRUE; + } else { + app_perror("...ERROR asock_on_data_read()", status); + } + } + + st->err = status; + + if (st->err != PJ_SUCCESS || st->done) { + pj_activesock_close(asock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +static pj_bool_t asock_on_connect_complete(pj_activesock_t *asock, + pj_status_t status) +{ + struct test_state *st = (struct test_state*) + pj_activesock_get_user_data(asock); + + if (status == PJ_SUCCESS) { + void *read_buf[1]; + + /* Start reading data */ + read_buf[0] = st->read_buf; + status = pj_activesock_start_read2(asock, st->pool, sizeof(st->read_buf), (void**)read_buf, 0); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_start_read2()", status); + } + } + + st->err = status; + + if (st->err != PJ_SUCCESS) { + pj_activesock_close(asock); + if (!st->is_server) + clients_num--; + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +/* Raw TCP socket try to connect to SSL socket server, once + * connection established, it will just do nothing, SSL socket + * server should be able to close the connection after specified + * timeout period (set ms_timeout to 0 to disable timer). + */ +static int client_non_ssl(unsigned ms_timeout) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; + pj_ssl_sock_t *ssock_serv = NULL; + pj_activesock_t *asock_cli = NULL; + pj_activesock_cb asock_cb = { 0 }; + pj_sock_t sock = PJ_INVALID_SOCKET; + pj_ssl_sock_param param; + struct test_state state_serv = { 0 }; + struct test_state state_cli = { 0 }; + pj_sockaddr listen_addr; + pj_ssl_cert_t *cert = NULL; + pj_status_t status; + + pool = pj_pool_create(mem, "ssl_accept_raw_tcp", 256, 256, NULL); + + status = pj_ioqueue_create(pool, 4, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_timer_heap_create(pool, 4, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Set cert */ + { + pj_str_t tmp1, tmp2, tmp3, tmp4; + status = pj_ssl_cert_load_from_files(pool, + pj_strset2(&tmp1, (char*)CERT_CA_FILE), + pj_strset2(&tmp2, (char*)CERT_FILE), + pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), + pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), + &cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + } + + pj_ssl_sock_param_default(¶m); + param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.timer_heap = timer; + param.timeout.sec = 0; + param.timeout.msec = ms_timeout; + pj_time_val_normalize(¶m.timeout); + + /* SERVER */ + param.user_data = &state_serv; + state_serv.pool = pool; + state_serv.is_server = PJ_TRUE; + state_serv.is_verbose = PJ_TRUE; + + status = pj_ssl_sock_create(pool, ¶m, &ssock_serv); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_set_certificate(ssock_serv, pool, cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Init bind address */ + { + pj_str_t tmp_st; + pj_sockaddr_init(PJ_AF_INET, &listen_addr, pj_strset2(&tmp_st, "127.0.0.1"), 0); + } + + status = pj_ssl_sock_start_accept(ssock_serv, pool, &listen_addr, pj_sockaddr_get_len(&listen_addr)); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Update listener address */ + { + pj_ssl_sock_info info; + + pj_ssl_sock_get_info(ssock_serv, &info); + pj_sockaddr_cp(&listen_addr, &info.local_addr); + } + + /* CLIENT */ + state_cli.pool = pool; + status = pj_sock_socket(pj_AF_INET(), pj_SOCK_STREAM(), 0, &sock); + if (status != PJ_SUCCESS) { + goto on_return; + } + + asock_cb.on_connect_complete = &asock_on_connect_complete; + asock_cb.on_data_read = &asock_on_data_read; + status = pj_activesock_create(pool, sock, pj_SOCK_STREAM(), NULL, + ioqueue, &asock_cb, &state_cli, &asock_cli); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_activesock_start_connect(asock_cli, pool, (pj_sockaddr_t*)&listen_addr, + pj_sockaddr_get_len(&listen_addr)); + if (status == PJ_SUCCESS) { + asock_on_connect_complete(asock_cli, PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + goto on_return; + } + + /* Wait until everything has been sent/received or error */ + while (!state_serv.err && !state_cli.err && !state_serv.done && !state_cli.done) + { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); + pj_timer_heap_poll(timer, &delay); +#endif + } + + if (state_serv.err || state_cli.err) { + if (state_serv.err != PJ_SUCCESS) + status = state_serv.err; + else + status = state_cli.err; + + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + +on_return: + if (ssock_serv) + pj_ssl_sock_close(ssock_serv); + if (asock_cli && !state_cli.err && !state_cli.done) + pj_activesock_close(asock_cli); + if (timer) + pj_timer_heap_destroy(timer); + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (pool) + pj_pool_release(pool); + + return status; +} + + +/* Test will perform multiple clients trying to connect to single server. + * Once SSL connection established, echo test will be performed. + */ +static int perf_test(unsigned clients, unsigned ms_handshake_timeout) +{ + pj_pool_t *pool = NULL; + pj_ioqueue_t *ioqueue = NULL; + pj_timer_heap_t *timer = NULL; + pj_ssl_sock_t *ssock_serv = NULL; + pj_ssl_sock_t **ssock_cli = NULL; + pj_ssl_sock_param param; + struct test_state state_serv = { 0 }; + struct test_state *state_cli = NULL; + pj_sockaddr addr, listen_addr; + pj_ssl_cert_t *cert = NULL; + pj_status_t status; + unsigned i, cli_err = 0, tot_sent = 0, tot_recv = 0; + pj_time_val start; + + pool = pj_pool_create(mem, "ssl_perf", 256, 256, NULL); + + status = pj_ioqueue_create(pool, PJ_IOQUEUE_MAX_HANDLES, &ioqueue); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_timer_heap_create(pool, PJ_IOQUEUE_MAX_HANDLES, &timer); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Set cert */ + { + pj_str_t tmp1, tmp2, tmp3, tmp4; + + status = pj_ssl_cert_load_from_files(pool, + pj_strset2(&tmp1, (char*)CERT_CA_FILE), + pj_strset2(&tmp2, (char*)CERT_FILE), + pj_strset2(&tmp3, (char*)CERT_PRIVKEY_FILE), + pj_strset2(&tmp4, (char*)CERT_PRIVKEY_PASS), + &cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + } + + pj_ssl_sock_param_default(¶m); + param.cb.on_accept_complete = &ssl_on_accept_complete; + param.cb.on_connect_complete = &ssl_on_connect_complete; + param.cb.on_data_read = &ssl_on_data_read; + param.cb.on_data_sent = &ssl_on_data_sent; + param.ioqueue = ioqueue; + param.timer_heap = timer; + param.timeout.sec = 0; + param.timeout.msec = ms_handshake_timeout; + pj_time_val_normalize(¶m.timeout); + + /* Init default bind address */ + { + pj_str_t tmp_st; + pj_sockaddr_init(PJ_AF_INET, &addr, pj_strset2(&tmp_st, "127.0.0.1"), 0); + } + + /* SERVER */ + param.user_data = &state_serv; + + state_serv.pool = pool; + state_serv.echo = PJ_TRUE; + state_serv.is_server = PJ_TRUE; + + status = pj_ssl_sock_create(pool, ¶m, &ssock_serv); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_set_certificate(ssock_serv, pool, cert); + if (status != PJ_SUCCESS) { + goto on_return; + } + + status = pj_ssl_sock_start_accept(ssock_serv, pool, &addr, pj_sockaddr_get_len(&addr)); + if (status != PJ_SUCCESS) { + goto on_return; + } + + /* Get listening address for clients to connect to */ + { + pj_ssl_sock_info info; + char buf[64]; + + pj_ssl_sock_get_info(ssock_serv, &info); + pj_sockaddr_cp(&listen_addr, &info.local_addr); + + pj_sockaddr_print((pj_sockaddr_t*)&listen_addr, buf, sizeof(buf), 1); + PJ_LOG(3, ("", "...Listener ready at %s", buf)); + } + + + /* CLIENTS */ + clients_num = clients; + param.timeout.sec = 0; + param.timeout.msec = 0; + + /* Init random seed */ + { + pj_time_val now; + + pj_gettimeofday(&now); + pj_srand((unsigned)now.sec); + } + + /* Allocate SSL socket pointers and test state */ + ssock_cli = pj_pool_calloc(pool, clients, sizeof(pj_ssl_sock_t*)); + state_cli = pj_pool_calloc(pool, clients, sizeof(struct test_state)); + + /* Setup clients */ + for (i = 0; i < clients; ++i) { + param.user_data = &state_cli[i]; + + state_cli[i].pool = pool; + state_cli[i].check_echo = PJ_TRUE; + state_cli[i].send_str_len = (pj_rand() % 5 + 1) * 1024 + pj_rand() % 1024; + state_cli[i].send_str = pj_pool_alloc(pool, state_cli[i].send_str_len); + { + unsigned j; + for (j = 0; j < state_cli[i].send_str_len; ++j) + state_cli[i].send_str[j] = (char)(pj_rand() % 256); + } + + status = pj_ssl_sock_create(pool, ¶m, &ssock_cli[i]); + if (status != PJ_SUCCESS) { + app_perror("...ERROR pj_ssl_sock_create()", status); + cli_err++; + clients_num--; + continue; + } + + status = pj_ssl_sock_start_connect(ssock_cli[i], pool, &addr, &listen_addr, pj_sockaddr_get_len(&addr)); + if (status == PJ_SUCCESS) { + ssl_on_connect_complete(ssock_cli[i], PJ_SUCCESS); + } else if (status == PJ_EPENDING) { + status = PJ_SUCCESS; + } else { + app_perror("...ERROR pj_ssl_sock_create()", status); + pj_ssl_sock_close(ssock_cli[i]); + ssock_cli[i] = NULL; + clients_num--; + cli_err++; + continue; + } + + /* Give chance to server to accept this client */ + { + unsigned n = 5; + +#ifdef PJ_SYMBIAN + while(n && pj_symbianos_poll(-1, 1000)) + n--; +#else + pj_time_val delay = {0, 100}; + while(n && pj_ioqueue_poll(ioqueue, &delay) > 0) + n--; +#endif + } + } + + /* Get start timestamp */ + pj_gettimeofday(&start); + + /* Wait until everything has been sent/received or error */ + while (clients_num) + { +#ifdef PJ_SYMBIAN + pj_symbianos_poll(-1, 1000); +#else + pj_time_val delay = {0, 100}; + pj_ioqueue_poll(ioqueue, &delay); + pj_timer_heap_poll(timer, &delay); +#endif + } + + /* Clean up sockets */ + { + pj_time_val delay = {0, 500}; + while (pj_ioqueue_poll(ioqueue, &delay) > 0); + } + + if (state_serv.err != PJ_SUCCESS) { + status = state_serv.err; + goto on_return; + } + + PJ_LOG(3, ("", "...Done!")); + + /* SSL setup and data transfer duration */ + { + pj_time_val stop; + + pj_gettimeofday(&stop); + PJ_TIME_VAL_SUB(stop, start); + + PJ_LOG(3, ("", ".....Setup & data transfer duration: %d.%03ds", stop.sec, stop.msec)); + } + + /* Check clients status */ + for (i = 0; i < clients; ++i) { + if (state_cli[i].err != PJ_SUCCESS) + cli_err++; + + tot_sent += state_cli[1].sent; + tot_recv += state_cli[1].recv; + } + + PJ_LOG(3, ("", ".....Clients: %d (%d errors)", clients, cli_err)); + PJ_LOG(3, ("", ".....Total sent/recv: %d/%d bytes", tot_sent, tot_recv)); + +on_return: + if (ssock_serv) + pj_ssl_sock_close(ssock_serv); + + for (i = 0; i < clients; ++i) { + if (ssock_cli[i] && !state_cli[i].err && !state_cli[i].done) + pj_ssl_sock_close(ssock_cli[i]); + } + if (ioqueue) + pj_ioqueue_destroy(ioqueue); + if (pool) + pj_pool_release(pool); + + return status; +} + + +int ssl_sock_test(void) +{ + int ret; + + PJ_LOG(3,("", "..get cipher list test")); + ret = get_cipher_list(); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..https client test")); + ret = https_client_test(30000); + // Ignore test result as internet connection may not be available. + //if (ret != 0) + //return ret; + +#ifndef PJ_SYMBIAN + + PJ_LOG(3,("", "..echo test w/ TLSv1 and TLS_RSA_WITH_DES_CBC_SHA cipher")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_TLS1, + TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..echo test w/ SSLv23 and TLS_RSA_WITH_AES_256_CBC_SHA cipher")); + ret = echo_test(PJ_SSL_SOCK_PROTO_SSL23, PJ_SSL_SOCK_PROTO_SSL23, + TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..echo test w/ incompatible proto")); + ret = echo_test(PJ_SSL_SOCK_PROTO_TLS1, PJ_SSL_SOCK_PROTO_SSL3, + TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_DES_CBC_SHA); + if (ret == 0) + return PJ_EBUG; + + PJ_LOG(3,("", "..echo test w/ incompatible ciphers")); + ret = echo_test(PJ_SSL_SOCK_PROTO_DEFAULT, PJ_SSL_SOCK_PROTO_DEFAULT, + TLS_RSA_WITH_DES_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA); + if (ret == 0) + return PJ_EBUG; + + PJ_LOG(3,("", "..client non-SSL (handshake timeout 5 secs)")); + ret = client_non_ssl(5000); + if (ret != 0) + return ret; + + PJ_LOG(3,("", "..performance test")); + ret = perf_test(PJ_IOQUEUE_MAX_HANDLES/2 - 1, 0); + if (ret != 0) + return ret; + +#endif + + return 0; +} + +#else /* INCLUDE_SSLSOCK_TEST */ +/* To prevent warning about "translation unit is empty" + * when this test is disabled. + */ +int dummy_ssl_sock_test; +#endif /* INCLUDE_SSLSOCK_TEST */ + diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c index cf41eeac0e44abd9ade4956d17f728d42172f77a..5db7346d910cbc0c2989ccff828140ab673f2f9f 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.c @@ -1,4 +1,4 @@ -/* $Id: test.c 2769 2009-06-17 12:36:36Z bennylp $ */ +/* $Id: test.c 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -167,6 +167,10 @@ int test_inner(void) DO_TEST( file_test() ); #endif +#if INCLUDE_SSLSOCK_TEST + DO_TEST( ssl_sock_test() ); +#endif + #if INCLUDE_ECHO_SERVER //echo_server(); //echo_srv_sync(); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h index 796ba6d07fde0c32f17e6c31117a471e6c6626b1..a35da79d3011db65c786098efbaa817408f5e085 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test.h @@ -1,4 +1,4 @@ -/* $Id: test.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: test.h 2970 2009-10-26 15:47:52Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -54,6 +54,7 @@ #define INCLUDE_UDP_IOQUEUE_TEST GROUP_NETWORK #define INCLUDE_TCP_IOQUEUE_TEST GROUP_NETWORK #define INCLUDE_ACTIVESOCK_TEST GROUP_NETWORK +#define INCLUDE_SSLSOCK_TEST (PJ_HAS_SSL_SOCK && GROUP_NETWORK) #define INCLUDE_IOQUEUE_PERF_TEST (PJ_HAS_THREADS && GROUP_NETWORK) #define INCLUDE_IOQUEUE_UNREG_TEST (PJ_HAS_THREADS && GROUP_NETWORK) #define INCLUDE_FILE_TEST GROUP_FILE @@ -96,6 +97,7 @@ extern int tcp_ioqueue_test(void); extern int ioqueue_perf_test(void); extern int activesock_test(void); extern int file_test(void); +extern int ssl_sock_test(void); extern int echo_server(void); extern int echo_client(int sock_type, const char *server, int port); @@ -104,6 +106,7 @@ extern int echo_srv_sync(void); extern int udp_echo_srv_ioqueue(void); extern int echo_srv_common_loop(pj_atomic_t *bytes_counter); + extern pj_pool_factory *mem; extern int test_main(void); diff --git a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp index 1f0cbc8316beaa7badb32983cda2516ea5e88f0b..788bd153b4ed6e8bcaee0e7bc5dd2c456319a3c5 100644 --- a/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjlib/src/pjlib-test/test_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: test_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjmedia/build/Makefile b/sflphone-common/libs/pjproject/pjmedia/build/Makefile index b3a960c400fbf121d5beb2921585cb4023a55497..6a73fdefc52bc22d11a04bee2b95b30bf10a7ba5 100644 --- a/sflphone-common/libs/pjproject/pjmedia/build/Makefile +++ b/sflphone-common/libs/pjproject/pjmedia/build/Makefile @@ -11,14 +11,14 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=$(PJDIR)/pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -PJNATH_LIB:=$(PJDIR)/pjnath/lib/libpjnath-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=$(PJDIR)/pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=$(PJDIR)/pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +PJNATH_LIB:=$(PJDIR)/pjnath/lib/libpjnath-$(TARGET_NAME)$(LIBEXT) -export PJMEDIA_LIB:=../lib/libpjmedia-sfl-$(TARGET_NAME)$(LIBEXT) -export PJMEDIA_CODEC_LIB:=../lib/libpjmedia-codec-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSDP_LIB:=../lib/libpjsdp-sfl-$(TARGET_NAME)$(LIBEXT) -export PJMEDIA_AUDIODEV_LIB:=../lib/libpjmedia-audiodev-sfl-$(TARGET_NAME)$(LIBEXT) +export PJMEDIA_LIB:=../lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) +export PJMEDIA_CODEC_LIB:=../lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) +export PJSDP_LIB:=../lib/libpjsdp-$(TARGET_NAME)$(LIBEXT) +export PJMEDIA_AUDIODEV_LIB:=../lib/libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) ############################################################################### @@ -49,7 +49,7 @@ export _LDFLAGS := $(subst /,$(HOST_PSEP),$(PJMEDIA_LIB)) \ # export PJMEDIA_SRCDIR = ../src/pjmedia export PJMEDIA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ - alaw_ulaw.o alaw_ulaw_table.o clock_thread.o codec.o \ + alaw_ulaw.o alaw_ulaw_table.o bidirectional.o clock_thread.o codec.o \ conference.o conf_switch.o delaybuf.o echo_common.o \ echo_port.o echo_suppress.o endpoint.o errno.o \ g711.o jbuf.o master_port.o mem_capture.o mem_player.o \ @@ -177,14 +177,14 @@ realclean: $(subst @@,$(subst /,$(HOST_PSEP),.pjsdp-$(TARGET_NAME).depend),$(HOST_RMR)) $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ - $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia-audiodev $@ + $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ $(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $@ depend: $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ - $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia-audiodev $@ + $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ $(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $@ diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h index 713f252af9d469dc09db1e95669a631840586664..2ab01f2718c457e9a0f955d670aa53d2ea2201d6 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-audiodev/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2833 2009-07-14 14:33:39Z nanang $ */ -/* +/* $Id: config.h 2977 2009-10-29 09:39:17Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_AUDIODEV_CONFIG_H__ #define __PJMEDIA_AUDIODEV_CONFIG_H__ @@ -44,9 +44,17 @@ PJ_BEGIN_DECL /** * This setting controls whether PortAudio support should be included. + * + * By default it is enabled except on Windows platforms (including + * Windows Mobile) and Symbian. */ #ifndef PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO -# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 1 +# if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ + (defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0) +# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0 +# else +# define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 1 +# endif #endif @@ -85,7 +93,7 @@ PJ_BEGIN_DECL /** - * This setting controls whether Symbian audio (using built-in multimedia + * This setting controls whether Symbian audio (using built-in multimedia * framework) support should be included. */ #ifndef PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA @@ -96,7 +104,7 @@ PJ_BEGIN_DECL /** * This setting controls whether the Audio Device API should support * device implementation that is based on the old sound device API - * (sound.h). + * (sound.h). * * Enable this API if: * - you have implemented your own sound device using the old sound @@ -130,7 +138,7 @@ PJ_END_DECL * @{ PJMEDIA Audio Device API is a cross-platform audio API appropriate for use with -VoIP applications and many other types of audio streaming applications. +VoIP applications and many other types of audio streaming applications. The API abstracts many different audio API's on various platforms, such as: - PortAudio back-end for Win32, Windows Mobile, Linux, Unix, dan MacOS X. @@ -140,45 +148,45 @@ The API abstracts many different audio API's on various platforms, such as: - null-audio implementation - and more to be implemented in the future -The Audio Device API/library is an evolution from PJMEDIA @ref PJMED_SND and +The Audio Device API/library is an evolution from PJMEDIA @ref PJMED_SND and contains many enhancements: - Forward compatibility: \n - The new API has been designed to be extensible, it will support new API's as - well as new features that may be introduced in the future without breaking - compatibility with applications that use this API as well as compatibility - with existing device implementations. + The new API has been designed to be extensible, it will support new API's as + well as new features that may be introduced in the future without breaking + compatibility with applications that use this API as well as compatibility + with existing device implementations. - Device capabilities: \n At the heart of the API is device capabilities management, where all possible audio capabilities of audio devices should be able to be handled in a generic - manner. With this framework, new capabilities that may be discovered in the - future can be handled in manner without breaking existing applications. + manner. With this framework, new capabilities that may be discovered in the + future can be handled in manner without breaking existing applications. - Built-in features: \n - The device capabilities framework enables applications to use and control + The device capabilities framework enables applications to use and control audio features built-in in the device, such as: - - echo cancellation, - - built-in codecs, + - echo cancellation, + - built-in codecs, - audio routing (e.g. to earpiece or loudspeaker), - volume control, - etc. - Codec support: \n - Some audio devices such as Nokia/Symbian Audio Proxy Server (APS) and Nokia + Some audio devices such as Nokia/Symbian Audio Proxy Server (APS) and Nokia VoIP Audio Services (VAS) support built-in hardware audio codecs (e.g. G.729, iLBC, and AMR), and application can use the sound device in encoded mode to - make use of these hardware codecs. + make use of these hardware codecs. - Multiple backends: \n - The new API supports multiple audio backends (called factories or drivers in - the code) to be active simultaneously, and audio backends may be added or - removed during run-time. + The new API supports multiple audio backends (called factories or drivers in + the code) to be active simultaneously, and audio backends may be added or + removed during run-time. @section using Overview on using the API @@ -186,11 +194,11 @@ contains many enhancements: @subsection getting_started Getting started -# <b>Configure the application's project settings</b>.\n - Add the following + Add the following include: \code #include <pjmedia_audiodev.h>\endcode\n - And add <b>pjmedia-audiodev</b> library to your application link + And add <b>pjmedia-audiodev</b> library to your application link specifications.\n -# <b>Compile time settings</b>.\n Use the compile time settings to enable or @@ -221,7 +229,7 @@ contains many enhancements: status = pjmedia_aud_dev_get_info(dev_idx, &info); printf("%d. %s (in=%d, out=%d)\n", - dev_idx, info.name, + dev_idx, info.name, info.input_count, info.output_count); } \endcode\n @@ -266,7 +274,7 @@ Capabilities are encoded as #pjmedia_aud_dev_cap enumeration. Please see -# Info: You can set the device settings when opening audio stream by setting the flags and the appropriate setting in #pjmedia_aud_param when calling #pjmedia_aud_stream_create()\n - -# Info: Once the audio stream is running, you can retrieve or change the stream + -# Info: Once the audio stream is running, you can retrieve or change the stream setting by specifying the capability in #pjmedia_aud_stream_get_cap() and #pjmedia_aud_stream_set_cap() respectively. @@ -321,12 +329,12 @@ or both. param.ext_fmt.vad = PJ_FALSE; \endcode\n -# Note that if non-PCM format is configured on the audio stream, the - capture and/or playback functions (#pjmedia_aud_rec_cb and + capture and/or playback functions (#pjmedia_aud_rec_cb and #pjmedia_aud_play_cb respectively) will report the audio frame as #pjmedia_frame_ext structure instead of the #pjmedia_frame. -# Optionally configure other device's capabilities. The following snippet shows how to enable echo cancellation on the device (note that this - snippet may not be necessary since the setting may have been enabled + snippet may not be necessary since the setting may have been enabled when calling #pjmedia_aud_dev_default_param() above): \code if (info.caps & PJMEDIA_AUD_DEV_CAP_EC) { @@ -339,7 +347,7 @@ or both. \code pjmedia_aud_stream *stream; - status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, + status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, user_data, &stream); \endcode @@ -362,7 +370,7 @@ or both. \code // Volume setting is an unsigned integer showing the level in percent. unsigned vol; - status = pjmedia_aud_stream_get_cap(stream, + status = pjmedia_aud_stream_get_cap(stream, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); \endcode @@ -371,7 +379,7 @@ or both. \code // Volume setting is an unsigned integer showing the level in percent. unsigned vol = 50; - status = pjmedia_aud_stream_set_cap(stream, + status = pjmedia_aud_stream_set_cap(stream, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); \endcode diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h index fa47a23e79a6efdbc1ee863e5dd5d116563b7288..627f58882322304fdccdb033f8a75f89b83d17aa 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia-codec/config.h @@ -1,5 +1,5 @@ /* $Id: config.h 2875 2009-08-13 15:57:26Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_CODEC_CONFIG_H__ #define __PJMEDIA_CODEC_CONFIG_H__ @@ -131,7 +131,7 @@ /** * Enable Intel IPP AMR codec. This also needs to be enabled when AMR WB - * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP + * codec is enabled. This option is only used when PJMEDIA_HAS_INTEL_IPP * is enabled. * * Default: 1 @@ -143,7 +143,7 @@ /** * Enable Intel IPP AMR wideband codec. The PJMEDIA_HAS_INTEL_IPP_CODEC_AMR - * option must also be enabled to use this codec. This option is only used + * option must also be enabled to use this codec. This option is only used * when PJMEDIA_HAS_INTEL_IPP is enabled. * * Default: 1 @@ -279,8 +279,8 @@ #endif /** - * Default G.722.1 codec encoder and decoder level adjustment. - * If the value is non-zero, then PCM input samples to the encoder will + * Default G.722.1 codec encoder and decoder level adjustment. + * If the value is non-zero, then PCM input samples to the encoder will * be shifted right by this value, and similarly PCM output samples from * the decoder will be shifted left by this value. * @@ -294,7 +294,7 @@ /** * Enabling both G.722.1 codec implementations, internal PJMEDIA and IPP, - * may cause problem in SDP, i.e: payload types duplications. So, let's + * may cause problem in SDP, i.e: payload types duplications. So, let's * just trap such case here at compile time. * * Application can control which implementation to be used by manipulating diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h index 0ddaa6d294038aa870c00155f328194c68cc81cd..d1c6e0364c80ba08f2c6eeaceb24345cdcd88167 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2850 2009-08-01 09:20:59Z bennylp $ */ -/* +/* $Id: config.h 2977 2009-10-29 09:39:17Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJMEDIA_CONFIG_H__ #define __PJMEDIA_CONFIG_H__ @@ -45,11 +45,11 @@ #endif /** - * Specify whether we prefer to use audio switch board rather than + * Specify whether we prefer to use audio switch board rather than * conference bridge. * - * Audio switch board is a kind of simplified version of conference - * bridge, but not really the subset of conference bridge. It has + * Audio switch board is a kind of simplified version of conference + * bridge, but not really the subset of conference bridge. It has * stricter rules on audio routing among the pjmedia ports and has * no audio mixing capability. The power of it is it could work with * encoded audio frames where conference brigde couldn't. @@ -103,10 +103,16 @@ #endif /** - * Specify default sound device latency, in milisecond. + * Specify default sound device latency, in milisecond. + * + * Default is 160ms for Windows Mobile and 140ms for other platforms. */ #ifndef PJMEDIA_SND_DEFAULT_PLAY_LATENCY -# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 100 +# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 +# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 160 +# else +# define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 140 +# endif #endif @@ -127,21 +133,21 @@ /** * This denotes implementation of WSOLA using fixed or floating point WSOLA * algorithm. This implementation provides the best quality of the result, - * at the expense of one frame delay and intensive processing power + * at the expense of one frame delay and intensive processing power * requirement. */ #define PJMEDIA_WSOLA_IMP_WSOLA 1 /** - * This denotes implementation of WSOLA algorithm with faster waveform - * similarity calculation. This implementation provides fair quality of + * This denotes implementation of WSOLA algorithm with faster waveform + * similarity calculation. This implementation provides fair quality of * the result with the main advantage of low processing power requirement. */ #define PJMEDIA_WSOLA_IMP_WSOLA_LITE 2 /** * Specify type of Waveform based Similarity Overlap and Add (WSOLA) backend - * implementation to be used. WSOLA is an algorithm to expand and/or compress + * implementation to be used. WSOLA is an algorithm to expand and/or compress * audio frames without changing the pitch, and used by the delaybuf and as PLC * backend algorithm. * @@ -154,8 +160,8 @@ /** * Specify the default maximum duration of synthetic audio that is generated - * by WSOLA. This value should be long enough to cover burst of packet losses. - * but not too long, because as the duration increases the quality would + * by WSOLA. This value should be long enough to cover burst of packet losses. + * but not too long, because as the duration increases the quality would * degrade considerably. * * Note that this limit is only applied when fading is enabled in the WSOLA @@ -184,7 +190,7 @@ /** * Specify WSOLA algorithm delay, in milliseconds. The algorithm delay is * used to merge synthetic samples with real samples in the transition - * between real to synthetic and vice versa. The longer the delay, the + * between real to synthetic and vice versa. The longer the delay, the * smoother signal to be generated, at the expense of longer latency and * a slighty more computation. * @@ -213,17 +219,17 @@ /** * Specify number of sound buffers. Larger number is better for sound * stability and to accommodate sound devices that are unable to send frames - * in timely manner, however it would probably cause more audio delay (and + * in timely manner, however it would probably cause more audio delay (and * definitely will take more memory). One individual buffer is normally 10ms * or 20 ms long, depending on ptime settings (samples_per_frame value). * * The setting here currently is used by the conference bridge, the splitter * combiner port, and dsound.c. * - * Default: 6 + * Default: (PJMEDIA_SND_DEFAULT_PLAY_LATENCY+20)/20 */ #ifndef PJMEDIA_SOUND_BUFFER_COUNT -# define PJMEDIA_SOUND_BUFFER_COUNT 6 +# define PJMEDIA_SOUND_BUFFER_COUNT ((PJMEDIA_SND_DEFAULT_PLAY_LATENCY+20)/20) #endif @@ -296,13 +302,13 @@ */ #define PJMEDIA_RESAMPLE_NONE 1 /**< No resampling. */ #define PJMEDIA_RESAMPLE_LIBRESAMPLE 2 /**< Sample rate conversion -using libresample. */ + using libresample. */ #define PJMEDIA_RESAMPLE_SPEEX 3 /**< Sample rate conversion -using Speex. */ + using Speex. */ #define PJMEDIA_RESAMPLE_LIBSAMPLERATE 4 /**< Sample rate conversion -using libsamplerate -(a.k.a Secret Rabbit Code) -*/ + using libsamplerate + (a.k.a Secret Rabbit Code) + */ /** * Select which resample implementation to use. Currently pjmedia supports: @@ -342,7 +348,7 @@ using libsamplerate * This (among other thing) will affect the size of buffers to be allocated * for outgoing packets. */ -#ifndef PJMEDIA_MAX_FRAME_DURATION_MS +#ifndef PJMEDIA_MAX_FRAME_DURATION_MS # define PJMEDIA_MAX_FRAME_DURATION_MS 200 #endif @@ -350,7 +356,7 @@ using libsamplerate /** * Max packet size to support. */ -#ifndef PJMEDIA_MAX_MTU +#ifndef PJMEDIA_MAX_MTU # define PJMEDIA_MAX_MTU 1500 #endif @@ -358,7 +364,7 @@ using libsamplerate /** * DTMF/telephone-event duration, in timestamp. */ -#ifndef PJMEDIA_DTMF_DURATION +#ifndef PJMEDIA_DTMF_DURATION # define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */ #endif @@ -368,7 +374,7 @@ using libsamplerate * remote address required to make the stream switch transmission * to the source address. */ -#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT +#ifndef PJMEDIA_RTP_NAT_PROBATION_CNT # define PJMEDIA_RTP_NAT_PROBATION_CNT 10 #endif @@ -409,9 +415,9 @@ using libsamplerate /** * Specify whether RTCP XR support should be built into PJMEDIA. Disabling - * this feature will reduce footprint slightly. Note that even when this - * setting is enabled, RTCP XR processing will only be performed in stream - * if it is enabled on run-time on per stream basis. See + * this feature will reduce footprint slightly. Note that even when this + * setting is enabled, RTCP XR processing will only be performed in stream + * if it is enabled on run-time on per stream basis. See * PJMEDIA_STREAM_ENABLE_XR setting for more info. * * Default: 1 (yes). @@ -423,7 +429,7 @@ using libsamplerate /** * The RTCP XR feature is activated and used by stream if \a enable_rtcp_xr - * field of \a pjmedia_stream_info structure is non-zero. This setting + * field of \a pjmedia_stream_info structure is non-zero. This setting * controls the default value of this field. * * Default: 0 (disabled) @@ -442,7 +448,7 @@ using libsamplerate * * Specify zero to disable this feature. * - * Default: 600 msec (which gives good probability that some RTP + * Default: 600 msec (which gives good probability that some RTP * packets will reach the destination, but without * filling up the jitter buffer on the remote end). */ @@ -452,13 +458,13 @@ using libsamplerate /** - * Specify the maximum duration of silence period in the codec, in msec. + * Specify the maximum duration of silence period in the codec, in msec. * This is useful for example to keep NAT binding open in the firewall - * and to prevent server from disconnecting the call because no + * and to prevent server from disconnecting the call because no * RTP packet is received. * * This only applies to codecs that use PJMEDIA's VAD (pretty much - * everything including iLBC, except Speex, which has its own DTX + * everything including iLBC, except Speex, which has its own DTX * mechanism). * * Use (-1) to disable this feature. @@ -510,7 +516,7 @@ using libsamplerate * remote, or should it rather use the codec preference as specified by * local endpoint. * - * For example, suppose incoming call has codec order "8 0 3", while + * For example, suppose incoming call has codec order "8 0 3", while * local codec order is "3 0 8". If remote codec order is preferable, * the selected codec will be 8, while if local codec order is preferable, * the selected codec will be 3. @@ -538,7 +544,7 @@ using libsamplerate /** - * This macro controls whether pjmedia should include SDP rtpmap + * This macro controls whether pjmedia should include SDP rtpmap * attribute for static payload types. SDP rtpmap for static * payload types are optional, although they are normally included * for interoperability reason. @@ -592,12 +598,12 @@ using libsamplerate #endif -/* +/* * Below specifies the various tone generator backend algorithm. */ -/** - * The math's sine(), floating point. This has very good precision +/** + * The math's sine(), floating point. This has very good precision * but it's the slowest and requires floating point support and * linking with the math library. */ @@ -613,7 +619,7 @@ using libsamplerate /** * Fixed point using sine signal generated by Cordic algorithm. This * algorithm can be tuned to provide balance between precision and - * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP + * performance by tuning the PJMEDIA_TONEGEN_FIXED_POINT_CORDIC_LOOP * setting, and may be suitable for platforms that lack floating-point * support. */ @@ -628,7 +634,7 @@ using libsamplerate /** - * Specify the tone generator algorithm to be used. Please see + * Specify the tone generator algorithm to be used. Please see * http://trac.pjsip.org/repos/wiki/Tone_Generator for the performance * analysis results of the various tone generator algorithms. * @@ -648,7 +654,7 @@ using libsamplerate /** * Specify the number of calculation loops to generate the tone, when * PJMEDIA_TONEGEN_FIXED_POINT_CORDIC algorithm is used. With more calculation - * loops, the tone signal gets more precise, but this will add more + * loops, the tone signal gets more precise, but this will add more * processing. * * Valid values are 1 to 28. @@ -736,8 +742,8 @@ using libsamplerate /** * Transport info (pjmedia_transport_info) contains a socket info and list - * of transport specific info, since transports can be chained together - * (for example, SRTP transport uses UDP transport as the underlying + * of transport specific info, since transports can be chained together + * (for example, SRTP transport uses UDP transport as the underlying * transport). This constant specifies maximum number of transport specific * infos that can be held in a transport info. */ @@ -780,22 +786,22 @@ using libsamplerate #endif /** - * Specify another type of keep-alive and NAT hole punching + * Specify another type of keep-alive and NAT hole punching * mechanism (the other type is PJMEDIA_STREAM_VAD_SUSPEND_MSEC - * and PJMEDIA_CODEC_MAX_SILENCE_PERIOD) to be used by stream. - * When this feature is enabled, the stream will initially + * and PJMEDIA_CODEC_MAX_SILENCE_PERIOD) to be used by stream. + * When this feature is enabled, the stream will initially * transmit one packet to punch a hole in NAT, and periodically * transmit keep-alive packets. * * When this alternative keep-alive mechanism is used, application - * may disable the other keep-alive mechanisms, i.e: by setting - * PJMEDIA_STREAM_VAD_SUSPEND_MSEC to zero and + * may disable the other keep-alive mechanisms, i.e: by setting + * PJMEDIA_STREAM_VAD_SUSPEND_MSEC to zero and * PJMEDIA_CODEC_MAX_SILENCE_PERIOD to -1. * * The value of this macro specifies the type of packet used * for the keep-alive mechanism. Valid values are * PJMEDIA_STREAM_KA_EMPTY_RTP and PJMEDIA_STREAM_KA_USER. - * + * * The duration of the keep-alive interval further can be set * with PJMEDIA_STREAM_KA_INTERVAL setting. * diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config_auto.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config_auto.h deleted file mode 100644 index 2f544be76e523e4b73a9b67434d3a65660a77fff..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/config_auto.h +++ /dev/null @@ -1,44 +0,0 @@ -/* pjmedia/include/pjmedia/config_auto.h. Generated from config_auto.h.in by configure. */ -/* $Id: config_auto.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PJMEDIA_CONFIG_AUTO_H_ -#define __PJMEDIA_CONFIG_AUTO_H_ - -/** - * @file config_auto.h - * @brief PJMEDIA configuration as set by autoconf script - */ - -/* - * Note: - * The configuration in config_site.h overrides any other settings, - * including the setting as detected by autoconf. - */ - -/* G711 codec */ -#ifndef PJMEDIA_HAS_G711_CODEC -/* #undef PJMEDIA_HAS_G711_CODEC */ -#endif - - -#endif /* __PJMEDIA_CONFIG_AUTO_H_ */ - - - diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h index 8abfb125d0dbc7aaaf2b1d899f7a0dce8f12ea92..eaa40c885176154a20794856844221674e5d6ba8 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/sdp.h @@ -1,4 +1,4 @@ -/* $Id: sdp.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sdp.h 2995 2009-11-09 05:18:12Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -652,6 +652,18 @@ PJ_DECL(pj_status_t) pjmedia_sdp_session_cmp(const pjmedia_sdp_session *sd1, unsigned option); +/** + * Add new attribute to the session descriptor. + * + * @param s The SDP session description. + * @param attr Attribute to add. + * + * @return PJ_SUCCESS or the appropriate error code. + */ +PJ_DECL(pj_status_t) pjmedia_sdp_session_add_attr(pjmedia_sdp_session *m, + pjmedia_sdp_attr *attr); + + PJ_END_DECL /** diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h index 0536f51d59f9fbddeb6aa698fe10b26e6eb101d0..c7f693f2ad41f3b2bcfffd39b14d1b2d8064aa3e 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport.h @@ -1,4 +1,4 @@ -/* $Id: transport.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: transport.h 2945 2009-10-14 13:13:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -503,7 +503,7 @@ struct pjmedia_transport_info /** * Specifies number of transport specific info included. */ - int specific_info_cnt; + unsigned specific_info_cnt; /** * Buffer storage of transport specific info. diff --git a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h index 1c19b377bd5d29c0ebf74557fd785385478ff567..507d86db5b226c26a1302b4e1bff947cd46d119a 100644 --- a/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h +++ b/sflphone-common/libs/pjproject/pjmedia/include/pjmedia/transport_ice.h @@ -1,4 +1,4 @@ -/* $Id: transport_ice.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: transport_ice.h 2945 2009-10-14 13:13:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -62,6 +62,52 @@ typedef struct pjmedia_ice_cb } pjmedia_ice_cb; +/** + * This structure specifies ICE transport specific info. This structure + * will be filled in media transport specific info. + */ +typedef struct pjmedia_ice_transport_info +{ + /** + * ICE sesion state. + */ + pj_ice_strans_state sess_state; + + /** + * Session role. + */ + pj_ice_sess_role role; + + /** + * Number of components in the component array. Before ICE negotiation + * is complete, the number represents the number of components of the + * local agent. After ICE negotiation has been completed successfully, + * the number represents the number of common components between local + * and remote agents. + */ + unsigned comp_cnt; + + /** + * Array of ICE components. Typically the first element denotes RTP and + * second element denotes RTCP. + */ + struct + { + /** + * Local candidate type. + */ + pj_ice_cand_type lcand_type; + + /** + * Remote candidate type. + */ + pj_ice_cand_type rcand_type; + + } comp[2]; + +} pjmedia_ice_transport_info; + + /** * Options that can be specified when creating ICE transport. */ diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp index 5b237e4c4d23f9f214f818ab34ddd360688501f1..a7587a3968473e569a285e5bfc09c853011b81b1 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp @@ -1,5 +1,5 @@ -/* $Id: symb_aps_dev.cpp 2677 2009-05-06 15:44:12Z nanang $ */ -/* +/* $Id: symb_aps_dev.cpp 2958 2009-10-20 14:54:57Z nanang $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev_imp.h> #include <pjmedia-audiodev/errno.h> @@ -35,7 +35,7 @@ #include <APSClientSession.h> #include <pjmedia-codec/amr_helper.h> -/* Pack/unpack G.729 frame of S60 DSP codec, taken from: +/* Pack/unpack G.729 frame of S60 DSP codec, taken from: * http://wiki.forum.nokia.com/index.php/TSS000776_-_Payload_conversion_for_G.729_audio_format */ #include "s60_g729_bitstream.h" @@ -59,8 +59,8 @@ static pj_uint8_t aps_g711_frame_len; /* APS factory */ - -struct aps_factory { +struct aps_factory +{ pjmedia_aud_dev_factory base; pj_pool_t *pool; pj_pool_factory *pf; @@ -69,16 +69,15 @@ struct aps_factory { /* Forward declaration of CPjAudioEngine */ - class CPjAudioEngine; /* APS stream. */ - -struct aps_stream { +struct aps_stream +{ // Base pjmedia_aud_stream base; /**< Base class. */ - + // Pool pj_pool_t *pool; /**< Memory pool. */ @@ -101,7 +100,7 @@ struct aps_stream { pj_uint16_t rec_buf_len; /**< Record buffer length. */ void *strm_data; /**< Stream data. */ - /* Resampling is needed, in case audio device is opened with clock rate + /* Resampling is needed, in case audio device is opened with clock rate * other than 8kHz (only for PCM format). */ pjmedia_resample *play_resample; /**< Resampler for playback. */ @@ -118,37 +117,38 @@ struct aps_stream { /* Prototypes */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f); -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f); -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f); -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info); -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param); -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm); - -static pj_status_t stream_get_param (pjmedia_aud_stream *strm, - pjmedia_aud_param *param); -static pj_status_t stream_get_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - void *value); -static pj_status_t stream_set_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - const void *value); -static pj_status_t stream_start (pjmedia_aud_stream *strm); -static pj_status_t stream_stop (pjmedia_aud_stream *strm); -static pj_status_t stream_destroy (pjmedia_aud_stream *strm); +static pj_status_t factory_init(pjmedia_aud_dev_factory *f); +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f); +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +static pj_status_t stream_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t stream_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t stream_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t stream_start(pjmedia_aud_stream *strm); +static pj_status_t stream_stop(pjmedia_aud_stream *strm); +static pj_status_t stream_destroy(pjmedia_aud_stream *strm); /* Operations */ -static pjmedia_aud_dev_factory_op factory_op = { +static pjmedia_aud_dev_factory_op factory_op = +{ &factory_init, &factory_destroy, &factory_get_dev_count, @@ -157,7 +157,8 @@ static pjmedia_aud_dev_factory_op factory_op = { &factory_create_stream }; -static pjmedia_aud_stream_op stream_op = { +static pjmedia_aud_stream_op stream_op = +{ &stream_get_param, &stream_get_cap, &stream_set_cap, @@ -174,344 +175,297 @@ static pjmedia_aud_stream_op stream_op = { /* * Utility: print sound device error */ -static void snd_perror (const char *title, TInt rc) +static void snd_perror(const char *title, TInt rc) { - PJ_LOG (1, (THIS_FILE, "%s (error code=%d)", title, rc)); + PJ_LOG(1,(THIS_FILE, "%s (error code=%d)", title, rc)); } -typedef void (*PjAudioCallback) (TAPSCommBuffer &buf, void *user_data); +typedef void(*PjAudioCallback)(TAPSCommBuffer &buf, void *user_data); /** * Abstract class for handler of callbacks from APS client. */ - class MQueueHandlerObserver { - - public: - MQueueHandlerObserver (PjAudioCallback RecCb_, PjAudioCallback PlayCb_, - void *UserData_) - : RecCb (RecCb_), PlayCb (PlayCb_), UserData (UserData_) {} - - virtual void InputStreamInitialized (const TInt aStatus) = 0; - virtual void OutputStreamInitialized (const TInt aStatus) = 0; - virtual void NotifyError (const TInt aError) = 0; - - public: - PjAudioCallback RecCb; - PjAudioCallback PlayCb; - void *UserData; +public: + MQueueHandlerObserver(PjAudioCallback RecCb_, PjAudioCallback PlayCb_, + void *UserData_) + : RecCb(RecCb_), PlayCb(PlayCb_), UserData(UserData_) + {} + + virtual void InputStreamInitialized(const TInt aStatus) = 0; + virtual void OutputStreamInitialized(const TInt aStatus) = 0; + virtual void NotifyError(const TInt aError) = 0; + +public: + PjAudioCallback RecCb; + PjAudioCallback PlayCb; + void *UserData; }; /** * Handler for communication and data queue. */ - class CQueueHandler : public CActive { +public: + // Types of queue handler + enum TQueueHandlerType { + ERecordCommQueue, + EPlayCommQueue, + ERecordQueue, + EPlayQueue + }; + + // The order corresponds to the APS Server state, do not change! + enum TState { + EAPSPlayerInitialize = 1, + EAPSRecorderInitialize = 2, + EAPSPlayData = 3, + EAPSRecordData = 4, + EAPSPlayerInitComplete = 5, + EAPSRecorderInitComplete = 6 + }; + + static CQueueHandler* NewL(MQueueHandlerObserver* aObserver, + RMsgQueue<TAPSCommBuffer>* aQ, + RMsgQueue<TAPSCommBuffer>* aWriteQ, + TQueueHandlerType aType) + { + CQueueHandler* self = new (ELeave) CQueueHandler(aObserver, aQ, aWriteQ, + aType); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } - public: - // Types of queue handler - enum TQueueHandlerType { - ERecordCommQueue, - EPlayCommQueue, - ERecordQueue, - EPlayQueue - }; - - // The order corresponds to the APS Server state, do not change! - enum TState { - EAPSPlayerInitialize = 1, - EAPSRecorderInitialize = 2, - EAPSPlayData = 3, - EAPSRecordData = 4, - EAPSPlayerInitComplete = 5, - EAPSRecorderInitComplete = 6 - }; - - static CQueueHandler* NewL (MQueueHandlerObserver* aObserver, - RMsgQueue<TAPSCommBuffer>* aQ, - RMsgQueue<TAPSCommBuffer>* aWriteQ, - TQueueHandlerType aType) { - CQueueHandler* self = new (ELeave) CQueueHandler (aObserver, aQ, aWriteQ, - aType); - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop (self); - return self; - } + // Destructor + ~CQueueHandler() { Cancel(); } - // Destructor - ~CQueueHandler() { - Cancel(); - } + // Start listening queue event + void Start() { + iQ->NotifyDataAvailable(iStatus); + SetActive(); + } - // Start listening queue event - void Start() { - iQ->NotifyDataAvailable (iStatus); - SetActive(); - } +private: + // Constructor + CQueueHandler(MQueueHandlerObserver* aObserver, + RMsgQueue<TAPSCommBuffer>* aQ, + RMsgQueue<TAPSCommBuffer>* aWriteQ, + TQueueHandlerType aType) + : CActive(CActive::EPriorityHigh), + iQ(aQ), iWriteQ(aWriteQ), iObserver(aObserver), iType(aType) + { + CActiveScheduler::Add(this); + + // use lower priority for comm queues + if ((iType == ERecordCommQueue) || (iType == EPlayCommQueue)) + SetPriority(CActive::EPriorityStandard); + } - private: - // Constructor - CQueueHandler (MQueueHandlerObserver* aObserver, - RMsgQueue<TAPSCommBuffer>* aQ, - RMsgQueue<TAPSCommBuffer>* aWriteQ, - TQueueHandlerType aType) - : CActive (CActive::EPriorityHigh), - iQ (aQ), iWriteQ (aWriteQ), iObserver (aObserver), iType (aType) { - CActiveScheduler::Add (this); + // Second phase constructor + void ConstructL() {} - // use lower priority for comm queues + // Inherited from CActive + void DoCancel() { iQ->CancelDataAvailable(); } - if ( (iType == ERecordCommQueue) || (iType == EPlayCommQueue)) - SetPriority (CActive::EPriorityStandard); + void RunL() { + if (iStatus != KErrNone) { + iObserver->NotifyError(iStatus.Int()); + return; } - // Second phase constructor - void ConstructL() {} - - // Inherited from CActive - void DoCancel() { - iQ->CancelDataAvailable(); + TAPSCommBuffer buffer; + TInt ret = iQ->Receive(buffer); + + if (ret != KErrNone) { + iObserver->NotifyError(ret); + return; + } + + switch (iType) { + case ERecordQueue: + if (buffer.iCommand == EAPSRecordData) { + iObserver->RecCb(buffer, iObserver->UserData); + } else { + iObserver->NotifyError(buffer.iStatus); + } + break; + + // Callbacks from the APS main thread + case EPlayCommQueue: + switch (buffer.iCommand) { + case EAPSPlayData: + if (buffer.iStatus == KErrUnderflow) { + iObserver->PlayCb(buffer, iObserver->UserData); + iWriteQ->Send(buffer); + } + break; + case EAPSPlayerInitialize: + iObserver->NotifyError(buffer.iStatus); + break; + case EAPSPlayerInitComplete: + iObserver->OutputStreamInitialized(buffer.iStatus); + break; + case EAPSRecorderInitComplete: + iObserver->InputStreamInitialized(buffer.iStatus); + break; + default: + iObserver->NotifyError(buffer.iStatus); + break; + } + break; + + // Callbacks from the APS recorder thread + case ERecordCommQueue: + switch (buffer.iCommand) { + // The APS recorder thread will only report errors + // through this handler. All other callbacks will be + // sent from the APS main thread through EPlayCommQueue + case EAPSRecorderInitialize: + case EAPSRecordData: + default: + iObserver->NotifyError(buffer.iStatus); + break; + } + break; + + default: + break; } - void RunL() { - if (iStatus != KErrNone) { - iObserver->NotifyError (iStatus.Int()); - return; - } - - TAPSCommBuffer buffer; - - TInt ret = iQ->Receive (buffer); - - if (ret != KErrNone) { - iObserver->NotifyError (ret); - return; - } - - switch (iType) { - - case ERecordQueue: - - if (buffer.iCommand == EAPSRecordData) { - iObserver->RecCb (buffer, iObserver->UserData); - } else { - iObserver->NotifyError (buffer.iStatus); - } - - break; - - // Callbacks from the APS main thread - - case EPlayCommQueue: - - switch (buffer.iCommand) { - - case EAPSPlayData: - - if (buffer.iStatus == KErrUnderflow) { - iObserver->PlayCb (buffer, iObserver->UserData); - iWriteQ->Send (buffer); - } - - break; - - case EAPSPlayerInitialize: - iObserver->NotifyError (buffer.iStatus); - break; - - case EAPSPlayerInitComplete: - iObserver->OutputStreamInitialized (buffer.iStatus); - break; - - case EAPSRecorderInitComplete: - iObserver->InputStreamInitialized (buffer.iStatus); - break; - - default: - iObserver->NotifyError (buffer.iStatus); - break; - } - - break; - - // Callbacks from the APS recorder thread - - case ERecordCommQueue: - - switch (buffer.iCommand) { - // The APS recorder thread will only report errors - // through this handler. All other callbacks will be - // sent from the APS main thread through EPlayCommQueue - - case EAPSRecorderInitialize: - - case EAPSRecordData: - - default: - iObserver->NotifyError (buffer.iStatus); - break; - } - - break; - - default: - break; - } - - // issue next request - iQ->NotifyDataAvailable (iStatus); - - SetActive(); - } + // issue next request + iQ->NotifyDataAvailable(iStatus); + SetActive(); + } - TInt RunError (TInt) { - return 0; - } + TInt RunError(TInt) { + return 0; + } - // Data - RMsgQueue<TAPSCommBuffer> *iQ; // (not owned) - RMsgQueue<TAPSCommBuffer> *iWriteQ; // (not owned) - MQueueHandlerObserver *iObserver; // (not owned) - TQueueHandlerType iType; + // Data + RMsgQueue<TAPSCommBuffer> *iQ; // (not owned) + RMsgQueue<TAPSCommBuffer> *iWriteQ; // (not owned) + MQueueHandlerObserver *iObserver; // (not owned) + TQueueHandlerType iType; }; /* * Audio setting for CPjAudioEngine. */ - class CPjAudioSetting { - - public: - TFourCC fourcc; - TAPSCodecMode mode; - TBool plc; - TBool vad; - TBool cng; - TBool loudspk; +public: + TFourCC fourcc; + TAPSCodecMode mode; + TBool plc; + TBool vad; + TBool cng; + TBool loudspk; }; /* * Implementation: Symbian Input & Output Stream. */ - class CPjAudioEngine : public CBase, MQueueHandlerObserver { - - public: - enum State { - STATE_NULL, - STATE_INITIALIZING, - STATE_READY, - STATE_STREAMING, - STATE_PENDING_STOP - }; - - ~CPjAudioEngine(); - - static CPjAudioEngine *NewL (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - - TInt StartL(); - void Stop(); - - TInt ActivateSpeaker (TBool active); - - TInt SetVolume (TInt vol) { - return iSession.SetVolume (vol); - } - - TInt GetVolume() { - return iSession.Volume(); - } - - TInt GetMaxVolume() { - return iSession.MaxVolume(); - } - - TInt SetGain (TInt gain) { - return iSession.SetGain (gain); - } - - TInt GetGain() { - return iSession.Gain(); - } - - TInt GetMaxGain() { - return iSession.MaxGain(); - } - - private: - CPjAudioEngine (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - void ConstructL(); - - TInt InitPlayL(); - TInt InitRecL(); - TInt StartStreamL(); - - // Inherited from MQueueHandlerObserver - virtual void InputStreamInitialized (const TInt aStatus); - virtual void OutputStreamInitialized (const TInt aStatus); - virtual void NotifyError (const TInt aError); - - State state_; - - struct aps_stream *parentStrm_; - CPjAudioSetting setting_; - - RAPSSession iSession; - TAPSInitSettings iPlaySettings; - TAPSInitSettings iRecSettings; - - RMsgQueue<TAPSCommBuffer> iReadQ; - RMsgQueue<TAPSCommBuffer> iReadCommQ; - RMsgQueue<TAPSCommBuffer> iWriteQ; - RMsgQueue<TAPSCommBuffer> iWriteCommQ; - - CQueueHandler *iPlayCommHandler; - CQueueHandler *iRecCommHandler; - CQueueHandler *iRecHandler; +public: + enum State + { + STATE_NULL, + STATE_INITIALIZING, + STATE_READY, + STATE_STREAMING, + STATE_PENDING_STOP + }; + + ~CPjAudioEngine(); + + static CPjAudioEngine *NewL(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + + TInt StartL(); + void Stop(); + + TInt ActivateSpeaker(TBool active); + + TInt SetVolume(TInt vol) { return iSession.SetVolume(vol); } + TInt GetVolume() { return iSession.Volume(); } + TInt GetMaxVolume() { return iSession.MaxVolume(); } + + TInt SetGain(TInt gain) { return iSession.SetGain(gain); } + TInt GetGain() { return iSession.Gain(); } + TInt GetMaxGain() { return iSession.MaxGain(); } + +private: + CPjAudioEngine(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + void ConstructL(); + + TInt InitPlayL(); + TInt InitRecL(); + TInt StartStreamL(); + + // Inherited from MQueueHandlerObserver + virtual void InputStreamInitialized(const TInt aStatus); + virtual void OutputStreamInitialized(const TInt aStatus); + virtual void NotifyError(const TInt aError); + + State state_; + struct aps_stream *parentStrm_; + CPjAudioSetting setting_; + + RAPSSession iSession; + TAPSInitSettings iPlaySettings; + TAPSInitSettings iRecSettings; + + RMsgQueue<TAPSCommBuffer> iReadQ; + RMsgQueue<TAPSCommBuffer> iReadCommQ; + RMsgQueue<TAPSCommBuffer> iWriteQ; + RMsgQueue<TAPSCommBuffer> iWriteCommQ; + + CQueueHandler *iPlayCommHandler; + CQueueHandler *iRecCommHandler; + CQueueHandler *iRecHandler; }; -CPjAudioEngine* CPjAudioEngine::NewL (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) +CPjAudioEngine* CPjAudioEngine::NewL(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) { - CPjAudioEngine* self = new (ELeave) CPjAudioEngine (parent_strm, - rec_cb, play_cb, - user_data, - setting); - CleanupStack::PushL (self); + CPjAudioEngine* self = new (ELeave) CPjAudioEngine(parent_strm, + rec_cb, play_cb, + user_data, + setting); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } -CPjAudioEngine::CPjAudioEngine (struct aps_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) - : MQueueHandlerObserver (rec_cb, play_cb, user_data), - state_ (STATE_NULL), - parentStrm_ (parent_strm), - setting_ (setting), - iPlayCommHandler (0), - iRecCommHandler (0), - iRecHandler (0) +CPjAudioEngine::CPjAudioEngine(struct aps_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) + : MQueueHandlerObserver(rec_cb, play_cb, user_data), + state_(STATE_NULL), + parentStrm_(parent_strm), + setting_(setting), + iPlayCommHandler(0), + iRecCommHandler(0), + iRecHandler(0) { } @@ -528,57 +482,49 @@ CPjAudioEngine::~CPjAudioEngine() // the client session. TTime start, now; enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */ - + start.UniversalTime(); - do { - pj_symbianos_poll (-1, APS_CLOSE_WAIT_TIME); - now.UniversalTime(); - } while (now.MicroSecondsFrom (start) < APS_CLOSE_WAIT_TIME * 1000); + pj_symbianos_poll(-1, APS_CLOSE_WAIT_TIME); + now.UniversalTime(); + } while (now.MicroSecondsFrom(start) < APS_CLOSE_WAIT_TIME * 1000); iSession.Close(); if (state_ == STATE_READY) { - if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { - iReadQ.Close(); - iReadCommQ.Close(); - } - - iWriteQ.Close(); - - iWriteCommQ.Close(); + if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { + iReadQ.Close(); + iReadCommQ.Close(); + } + iWriteQ.Close(); + iWriteCommQ.Close(); } - - TRACE_ ( (THIS_FILE, "Sound device destroyed")); + + TRACE_((THIS_FILE, "Sound device destroyed")); } TInt CPjAudioEngine::InitPlayL() { - TInt err = iSession.InitializePlayer (iPlaySettings); - + TInt err = iSession.InitializePlayer(iPlaySettings); if (err != KErrNone) { - snd_perror ("Failed to initialize player", err); - return err; + snd_perror("Failed to initialize player", err); + return err; } // Open message queues for the output stream TBuf<128> buf2 = iPlaySettings.iGlobal; - - buf2.Append (_L ("PlayQueue")); - + buf2.Append(_L("PlayQueue")); TBuf<128> buf3 = iPlaySettings.iGlobal; + buf3.Append(_L("PlayCommQueue")); - buf3.Append (_L ("PlayCommQueue")); - - while (iWriteQ.OpenGlobal (buf2)) - User::After (10); - - while (iWriteCommQ.OpenGlobal (buf3)) - User::After (10); + while (iWriteQ.OpenGlobal(buf2)) + User::After(10); + while (iWriteCommQ.OpenGlobal(buf3)) + User::After(10); // Construct message queue handler - iPlayCommHandler = CQueueHandler::NewL (this, &iWriteCommQ, &iWriteQ, - CQueueHandler::EPlayCommQueue); + iPlayCommHandler = CQueueHandler::NewL(this, &iWriteCommQ, &iWriteQ, + CQueueHandler::EPlayCommQueue); // Start observing APS callbacks on output stream message queue iPlayCommHandler->Start(); @@ -589,38 +535,32 @@ TInt CPjAudioEngine::InitPlayL() TInt CPjAudioEngine::InitRecL() { // Initialize input stream device - TInt err = iSession.InitializeRecorder (iRecSettings); - + TInt err = iSession.InitializeRecorder(iRecSettings); if (err != KErrNone && err != KErrAlreadyExists) { - snd_perror ("Failed to initialize recorder", err); - return err; + snd_perror("Failed to initialize recorder", err); + return err; } TBuf<128> buf1 = iRecSettings.iGlobal; - - buf1.Append (_L ("RecordQueue")); + buf1.Append(_L("RecordQueue")); TBuf<128> buf4 = iRecSettings.iGlobal; - buf4.Append (_L ("RecordCommQueue")); + buf4.Append(_L("RecordCommQueue")); // Must wait for APS thread to finish creating message queues // before we can open and use them. - - while (iReadQ.OpenGlobal (buf1)) - User::After (10); - - while (iReadCommQ.OpenGlobal (buf4)) - User::After (10); + while (iReadQ.OpenGlobal(buf1)) + User::After(10); + while (iReadCommQ.OpenGlobal(buf4)) + User::After(10); // Construct message queue handlers - iRecHandler = CQueueHandler::NewL (this, &iReadQ, NULL, - CQueueHandler::ERecordQueue); - - iRecCommHandler = CQueueHandler::NewL (this, &iReadCommQ, NULL, - CQueueHandler::ERecordCommQueue); + iRecHandler = CQueueHandler::NewL(this, &iReadQ, NULL, + CQueueHandler::ERecordQueue); + iRecCommHandler = CQueueHandler::NewL(this, &iReadCommQ, NULL, + CQueueHandler::ERecordCommQueue); // Start observing APS callbacks from on input stream message queue iRecHandler->Start(); - iRecCommHandler->Start(); return 0; @@ -629,10 +569,10 @@ TInt CPjAudioEngine::InitRecL() TInt CPjAudioEngine::StartL() { if (state_ == STATE_READY) - return StartStreamL(); - - PJ_ASSERT_RETURN (state_ == STATE_NULL, PJMEDIA_EAUD_INVOP); + return StartStreamL(); + PJ_ASSERT_RETURN(state_ == STATE_NULL, PJMEDIA_EAUD_INVOP); + // Even if only capturer are opened, playback thread of APS Server need // to be run(?). Since some messages will be delivered via play comm queue. state_ = STATE_INITIALIZING; @@ -643,18 +583,17 @@ TInt CPjAudioEngine::StartL() void CPjAudioEngine::Stop() { if (state_ == STATE_STREAMING) { - iSession.Stop(); - state_ = STATE_READY; - TRACE_ ( (THIS_FILE, "Sound device stopped")); + iSession.Stop(); + state_ = STATE_READY; + TRACE_((THIS_FILE, "Sound device stopped")); } else if (state_ == STATE_INITIALIZING) { - // Initialization is on progress, so let's set the state to - // STATE_PENDING_STOP to prevent it starting the stream. - state_ = STATE_PENDING_STOP; - - // Then wait until initialization done. - - while (state_ != STATE_READY) - pj_symbianos_poll (-1, 100); + // Initialization is on progress, so let's set the state to + // STATE_PENDING_STOP to prevent it starting the stream. + state_ = STATE_PENDING_STOP; + + // Then wait until initialization done. + while (state_ != STATE_READY) + pj_symbianos_poll(-1, 100); } } @@ -663,96 +602,94 @@ void CPjAudioEngine::ConstructL() // Recorder settings iRecSettings.iFourCC = setting_.fourcc; iRecSettings.iGlobal = APP_UID; - iRecSettings.iPriority = TMdaPriority (100); - iRecSettings.iPreference = TMdaPriorityPreference (0x05210001); + iRecSettings.iPriority = TMdaPriority(100); + iRecSettings.iPreference = TMdaPriorityPreference(0x05210001); iRecSettings.iSettings.iChannels = EMMFMono; iRecSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; // Player settings iPlaySettings.iFourCC = setting_.fourcc; iPlaySettings.iGlobal = APP_UID; - iPlaySettings.iPriority = TMdaPriority (100); - iPlaySettings.iPreference = TMdaPriorityPreference (0x05220001); + iPlaySettings.iPriority = TMdaPriority(100); + iPlaySettings.iPreference = TMdaPriorityPreference(0x05220001); iPlaySettings.iSettings.iChannels = EMMFMono; iPlaySettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; iPlaySettings.iSettings.iVolume = 0; - User::LeaveIfError (iSession.Connect()); + User::LeaveIfError(iSession.Connect()); } TInt CPjAudioEngine::StartStreamL() { - pj_assert (state_==STATE_READY || state_==STATE_INITIALIZING); - - iSession.SetCng (setting_.cng); - iSession.SetVadMode (setting_.vad); - iSession.SetPlc (setting_.plc); - iSession.SetEncoderMode (setting_.mode); - iSession.SetDecoderMode (setting_.mode); - iSession.ActivateLoudspeaker (setting_.loudspk); + pj_assert(state_==STATE_READY || state_==STATE_INITIALIZING); + + iSession.SetCng(setting_.cng); + iSession.SetVadMode(setting_.vad); + iSession.SetPlc(setting_.plc); + iSession.SetEncoderMode(setting_.mode); + iSession.SetDecoderMode(setting_.mode); + iSession.ActivateLoudspeaker(setting_.loudspk); // Not only capture - if (parentStrm_->param.dir != PJMEDIA_DIR_CAPTURE) { - iSession.Write(); - TRACE_ ( (THIS_FILE, "Player started")); + iSession.Write(); + TRACE_((THIS_FILE, "Player started")); } // Not only playback if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { - iSession.Read(); - TRACE_ ( (THIS_FILE, "Recorder started")); + iSession.Read(); + TRACE_((THIS_FILE, "Recorder started")); } state_ = STATE_STREAMING; - + return 0; } -void CPjAudioEngine::InputStreamInitialized (const TInt aStatus) +void CPjAudioEngine::InputStreamInitialized(const TInt aStatus) { - TRACE_ ( (THIS_FILE, "Recorder initialized, err=%d", aStatus)); + TRACE_((THIS_FILE, "Recorder initialized, err=%d", aStatus)); if (aStatus == KErrNone) { - // Don't start the stream since Stop() has been requested. - if (state_ != STATE_PENDING_STOP) { - StartStreamL(); - } else { - state_ = STATE_READY; - } + // Don't start the stream since Stop() has been requested. + if (state_ != STATE_PENDING_STOP) { + StartStreamL(); + } else { + state_ = STATE_READY; + } } } -void CPjAudioEngine::OutputStreamInitialized (const TInt aStatus) +void CPjAudioEngine::OutputStreamInitialized(const TInt aStatus) { - TRACE_ ( (THIS_FILE, "Player initialized, err=%d", aStatus)); + TRACE_((THIS_FILE, "Player initialized, err=%d", aStatus)); if (aStatus == KErrNone) { - if (parentStrm_->param.dir == PJMEDIA_DIR_PLAYBACK) { - // Don't start the stream since Stop() has been requested. - if (state_ != STATE_PENDING_STOP) { - StartStreamL(); - } else { - state_ = STATE_READY; - } - } else - InitRecL(); + if (parentStrm_->param.dir == PJMEDIA_DIR_PLAYBACK) { + // Don't start the stream since Stop() has been requested. + if (state_ != STATE_PENDING_STOP) { + StartStreamL(); + } else { + state_ = STATE_READY; + } + } else + InitRecL(); } } -void CPjAudioEngine::NotifyError (const TInt aError) +void CPjAudioEngine::NotifyError(const TInt aError) { - snd_perror ("Error from CQueueHandler", aError); + snd_perror("Error from CQueueHandler", aError); } -TInt CPjAudioEngine::ActivateSpeaker (TBool active) +TInt CPjAudioEngine::ActivateSpeaker(TBool active) { if (state_ == STATE_READY || state_ == STATE_STREAMING) { - iSession.ActivateLoudspeaker (active); - TRACE_ ( (THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); - return KErrNone; + iSession.ActivateLoudspeaker(active); + TRACE_((THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); + return KErrNone; } - return KErrNotReady; } @@ -760,22 +697,20 @@ TInt CPjAudioEngine::ActivateSpeaker (TBool active) * Internal APS callbacks for PCM format */ -static void RecCbPcm (TAPSCommBuffer &buf, void *user_data) +static void RecCbPcm(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; /* Buffer has to contain normal speech. */ - pj_assert (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); + pj_assert(buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); /* Detect the recorder G.711 frame size, player frame size will follow * this recorder frame size. */ - if (aps_g711_frame_len == 0) { - aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected APS G.711 frame size = %u samples", - aps_g711_frame_len)); + aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected APS G.711 frame size = %u samples", + aps_g711_frame_len)); } /* Decode APS buffer (coded in G.711) and put the PCM result into rec_buf. @@ -784,75 +719,68 @@ static void RecCbPcm (TAPSCommBuffer &buf, void *user_data) unsigned samples_processed = 0; while (samples_processed < aps_g711_frame_len) { - unsigned samples_to_process; - unsigned samples_req; - - samples_to_process = aps_g711_frame_len - samples_processed; - samples_req = (strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) - - strm->rec_buf_len; - - if (samples_to_process > samples_req) - samples_to_process = samples_req; - - pjmedia_ulaw_decode (&strm->rec_buf[strm->rec_buf_len], - buf.iBuffer.Ptr() + 2 + samples_processed, - samples_to_process); - - strm->rec_buf_len += samples_to_process; - - samples_processed += samples_to_process; - - /* Buffer is full, time to call parent callback */ - if (strm->rec_buf_len == strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) { - pjmedia_frame f; - - /* Need to resample clock rate? */ - - if (strm->rec_resample) { - unsigned resampled = 0; - - while (resampled < strm->rec_buf_len) { - pjmedia_resample_run (strm->rec_resample, - &strm->rec_buf[resampled], - strm->pcm_buf + - resampled * strm->resample_factor); - resampled += 80; - } - - f.buf = strm->pcm_buf; - } else { - f.buf = strm->rec_buf; - } - - /* Need to convert channel count? */ - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_1ton ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame / - strm->param.channel_count, - 0); - } - - /* Call parent callback */ - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - - f.size = strm->param.samples_per_frame << 1; - - strm->rec_cb (strm->user_data, &f); - - strm->rec_buf_len = 0; - } + unsigned samples_to_process; + unsigned samples_req; + + samples_to_process = aps_g711_frame_len - samples_processed; + samples_req = (strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) - + strm->rec_buf_len; + if (samples_to_process > samples_req) + samples_to_process = samples_req; + + pjmedia_ulaw_decode(&strm->rec_buf[strm->rec_buf_len], + buf.iBuffer.Ptr() + 2 + samples_processed, + samples_to_process); + + strm->rec_buf_len += samples_to_process; + samples_processed += samples_to_process; + + /* Buffer is full, time to call parent callback */ + if (strm->rec_buf_len == strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) + { + pjmedia_frame f; + + /* Need to resample clock rate? */ + if (strm->rec_resample) { + unsigned resampled = 0; + + while (resampled < strm->rec_buf_len) { + pjmedia_resample_run(strm->rec_resample, + &strm->rec_buf[resampled], + strm->pcm_buf + + resampled * strm->resample_factor); + resampled += 80; + } + f.buf = strm->pcm_buf; + } else { + f.buf = strm->rec_buf; + } + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_1ton((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame / + strm->param.channel_count, + 0); + } + + /* Call parent callback */ + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.size = strm->param.samples_per_frame << 1; + strm->rec_cb(strm->user_data, &f); + strm->rec_buf_len = 0; + } } } -static void PlayCbPcm (TAPSCommBuffer &buf, void *user_data) +static void PlayCbPcm(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; unsigned g711_frame_len = aps_g711_frame_len; @@ -860,84 +788,79 @@ static void PlayCbPcm (TAPSCommBuffer &buf, void *user_data) buf.iCommand = CQueueHandler::EAPSPlayData; buf.iStatus = 0; buf.iBuffer.Zero(); - buf.iBuffer.Append (1); - buf.iBuffer.Append (0); + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); /* Assume frame size is 10ms if frame size hasn't been known. */ - if (g711_frame_len == 0) - g711_frame_len = 80; + g711_frame_len = 80; /* Call parent stream callback to get PCM samples to play, * encode the PCM samples into G.711 and put it into APS buffer. */ unsigned samples_processed = 0; - + while (samples_processed < g711_frame_len) { - /* Need more samples to play, time to call parent callback */ - if (strm->play_buf_len == 0) { - pjmedia_frame f; - unsigned samples_got; - - f.size = strm->param.samples_per_frame << 1; - - if (strm->play_resample || strm->param.channel_count != 1) - f.buf = strm->pcm_buf; - else - f.buf = strm->play_buf; - - /* Call parent callback */ - strm->play_cb (strm->user_data, &f); - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { - pjmedia_zero_samples ( (pj_int16_t*) f.buf, - strm->param.samples_per_frame); - } - - samples_got = strm->param.samples_per_frame / - - strm->param.channel_count / - strm->resample_factor; - - /* Need to convert channel count? */ - - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_nto1 ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame, - PJ_FALSE, - 0); - } - - /* Need to resample clock rate? */ - if (strm->play_resample) { - unsigned resampled = 0; - - while (resampled < samples_got) { - pjmedia_resample_run (strm->play_resample, - strm->pcm_buf + - resampled * strm->resample_factor, - &strm->play_buf[resampled]); - resampled += 80; - } - } - - strm->play_buf_len = samples_got; - - strm->play_buf_start = 0; - } - - unsigned tmp; - - tmp = PJ_MIN (strm->play_buf_len, g711_frame_len - samples_processed); - pjmedia_ulaw_encode ( (pj_uint8_t*) &strm->play_buf[strm->play_buf_start], - &strm->play_buf[strm->play_buf_start], - tmp); - buf.iBuffer.Append ( (TUint8*) &strm->play_buf[strm->play_buf_start], tmp); - samples_processed += tmp; - strm->play_buf_len -= tmp; - strm->play_buf_start += tmp; + /* Need more samples to play, time to call parent callback */ + if (strm->play_buf_len == 0) { + pjmedia_frame f; + unsigned samples_got; + + f.size = strm->param.samples_per_frame << 1; + if (strm->play_resample || strm->param.channel_count != 1) + f.buf = strm->pcm_buf; + else + f.buf = strm->play_buf; + + /* Call parent callback */ + strm->play_cb(strm->user_data, &f); + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { + pjmedia_zero_samples((pj_int16_t*)f.buf, + strm->param.samples_per_frame); + } + + samples_got = strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor; + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_nto1((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame, + PJ_FALSE, + 0); + } + + /* Need to resample clock rate? */ + if (strm->play_resample) { + unsigned resampled = 0; + + while (resampled < samples_got) + { + pjmedia_resample_run(strm->play_resample, + strm->pcm_buf + + resampled * strm->resample_factor, + &strm->play_buf[resampled]); + resampled += 80; + } + } + + strm->play_buf_len = samples_got; + strm->play_buf_start = 0; + } + + unsigned tmp; + + tmp = PJ_MIN(strm->play_buf_len, g711_frame_len - samples_processed); + pjmedia_ulaw_encode((pj_uint8_t*)&strm->play_buf[strm->play_buf_start], + &strm->play_buf[strm->play_buf_start], + tmp); + buf.iBuffer.Append((TUint8*)&strm->play_buf[strm->play_buf_start], tmp); + samples_processed += tmp; + strm->play_buf_len -= tmp; + strm->play_buf_start += tmp; } } @@ -945,138 +868,131 @@ static void PlayCbPcm (TAPSCommBuffer &buf, void *user_data) * Internal APS callbacks for non-PCM format */ -static void RecCb (TAPSCommBuffer &buf, void *user_data) +static void RecCb(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->rec_buf; - - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - const pj_uint8_t *p = (const pj_uint8_t*) buf.iBuffer.Ptr() + 1; - unsigned len = buf.iBuffer.Length() - 1; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, 160); - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - /* Check if we got a normal or SID frame. */ - if (buf.iBuffer[0] != 0 || buf.iBuffer[1] != 0) { - enum { NORMAL_LEN = 22, SID_LEN = 8 }; - TBitStream *bitstream = (TBitStream*) strm->strm_data; - unsigned src_len = buf.iBuffer.Length()- 2; - - pj_assert (src_len == NORMAL_LEN || src_len == SID_LEN); - - const TDesC8& p = bitstream->CompressG729Frame ( - buf.iBuffer.Right (src_len), - src_len == SID_LEN); - - pjmedia_frame_ext_append_subframe (frame, p.Ptr(), - p.Length() << 3, 80); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, 80); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - unsigned samples_got; - - samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; - - /* Check if we got a normal frame. */ - - if (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0) { - const pj_uint8_t *p = (const pj_uint8_t*) buf.iBuffer.Ptr() + 2; - unsigned len = buf.iBuffer.Length() - 2; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, - samples_got); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, samples_got); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_processed = 0; - - /* Make sure it is normal frame. */ - pj_assert (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); - - /* Detect the recorder G.711 frame size, player frame size will - * follow this recorder frame size. - */ - - if (aps_g711_frame_len == 0) { - aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected APS G.711 frame size = %u samples", - aps_g711_frame_len)); - } - - /* Convert APS buffer format into pjmedia_frame_ext. Whenever - * samples count in the frame is equal to stream's samples per - * frame, call parent stream callback. - */ - while (samples_processed < aps_g711_frame_len) { - unsigned tmp; - const pj_uint8_t *pb = (const pj_uint8_t*) buf.iBuffer.Ptr() + - 2 + samples_processed; - - tmp = PJ_MIN (strm->param.samples_per_frame - frame->samples_cnt, - aps_g711_frame_len - samples_processed); - - pjmedia_frame_ext_append_subframe (frame, pb, tmp << 3, tmp); - samples_processed += tmp; - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + const pj_uint8_t *p = (const pj_uint8_t*)buf.iBuffer.Ptr() + 1; + unsigned len = buf.iBuffer.Length() - 1; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, 160); + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + /* Check if we got a normal or SID frame. */ + if (buf.iBuffer[0] != 0 || buf.iBuffer[1] != 0) { + enum { NORMAL_LEN = 22, SID_LEN = 8 }; + TBitStream *bitstream = (TBitStream*)strm->strm_data; + unsigned src_len = buf.iBuffer.Length()- 2; + + pj_assert(src_len == NORMAL_LEN || src_len == SID_LEN); + + const TDesC8& p = bitstream->CompressG729Frame( + buf.iBuffer.Right(src_len), + src_len == SID_LEN); + + pjmedia_frame_ext_append_subframe(frame, p.Ptr(), + p.Length() << 3, 80); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, 80); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + unsigned samples_got; + + samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; + + /* Check if we got a normal frame. */ + if (buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0) { + const pj_uint8_t *p = (const pj_uint8_t*)buf.iBuffer.Ptr() + 2; + unsigned len = buf.iBuffer.Length() - 2; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, + samples_got); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, samples_got); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_processed = 0; + + /* Make sure it is normal frame. */ + pj_assert(buf.iBuffer[0] == 1 && buf.iBuffer[1] == 0); + + /* Detect the recorder G.711 frame size, player frame size will + * follow this recorder frame size. + */ + if (aps_g711_frame_len == 0) { + aps_g711_frame_len = buf.iBuffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected APS G.711 frame size = %u samples", + aps_g711_frame_len)); + } + + /* Convert APS buffer format into pjmedia_frame_ext. Whenever + * samples count in the frame is equal to stream's samples per + * frame, call parent stream callback. + */ + while (samples_processed < aps_g711_frame_len) { + unsigned tmp; + const pj_uint8_t *pb = (const pj_uint8_t*)buf.iBuffer.Ptr() + + 2 + samples_processed; + + tmp = PJ_MIN(strm->param.samples_per_frame - frame->samples_cnt, + aps_g711_frame_len - samples_processed); + + pjmedia_frame_ext_append_subframe(frame, pb, tmp << 3, tmp); + samples_processed += tmp; + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } } -static void PlayCb (TAPSCommBuffer &buf, void *user_data) +static void PlayCb(TAPSCommBuffer &buf, void *user_data) { - struct aps_stream *strm = (struct aps_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->play_buf; @@ -1085,209 +1001,202 @@ static void PlayCb (TAPSCommBuffer &buf, void *user_data) buf.iStatus = 0; buf.iBuffer.Zero(); - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - /* AMR header for APS is one byte, the format (may be!): - * 0xxxxy00, where xxxx:frame type, y:not sure. - */ - unsigned len = (sf->bitlen+7) >>3; - enum {SID_FT = 8 }; - pj_uint8_t amr_header = 4, ft = SID_FT; - - if (len >= pjmedia_codec_amrnb_framelen[0]) - ft = pjmedia_codec_amr_get_mode2 (PJ_TRUE, len); - - amr_header |= ft << 3; - - buf.iBuffer.Append (amr_header); - - buf.iBuffer.Append ( (TUint8*) sf->data, len); - } else { - buf.iBuffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buf.iBuffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - enum { NORMAL_LEN = 10, SID_LEN = 2 }; - pj_bool_t sid_frame = ( (sf->bitlen >> 3) == SID_LEN); - TBitStream *bitstream = (TBitStream*) strm->strm_data; - const TPtrC8 src (sf->data, sf->bitlen>>3); - const TDesC8 &dst = bitstream->ExpandG729Frame (src, - sid_frame); - - if (sid_frame) { - buf.iBuffer.Append (0); - buf.iBuffer.Append (1); - } else { - buf.iBuffer.Append (1); - buf.iBuffer.Append (0); - } - - buf.iBuffer.Append (dst); - } else { - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - pj_assert ( (strm->param.ext_fmt.bitrate == 15200 && - samples_cnt == 160) || - (strm->param.ext_fmt.bitrate != 15200 && - samples_cnt == 240)); - - if (sf->data && sf->bitlen) { - buf.iBuffer.Append (1); - buf.iBuffer.Append (0); - buf.iBuffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buf.iBuffer.Append (0); - buf.iBuffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_ready = 0; - unsigned samples_req = aps_g711_frame_len; - - /* Assume frame size is 10ms if frame size hasn't been known. */ - - if (samples_req == 0) - samples_req = 80; - - buf.iBuffer.Append (1); - - buf.iBuffer.Append (0); - - /* Call parent stream callback to get samples to play. */ - while (samples_ready < samples_req) { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - buf.iBuffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - pj_uint8_t silc; - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buf.iBuffer.AppendFill (silc, samples_cnt); - } - - samples_ready += samples_cnt; - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - pj_uint8_t silc; - - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buf.iBuffer.AppendFill (silc, samples_req - samples_ready); - - samples_ready = samples_req; - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + /* AMR header for APS is one byte, the format (may be!): + * 0xxxxy00, where xxxx:frame type, y:not sure. + */ + unsigned len = (sf->bitlen+7)>>3; + enum {SID_FT = 8 }; + pj_uint8_t amr_header = 4, ft = SID_FT; + + if (len >= pjmedia_codec_amrnb_framelen[0]) + ft = pjmedia_codec_amr_get_mode2(PJ_TRUE, len); + + amr_header |= ft << 3; + buf.iBuffer.Append(amr_header); + + buf.iBuffer.Append((TUint8*)sf->data, len); + } else { + buf.iBuffer.Append(0); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buf.iBuffer.Append(0); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + enum { NORMAL_LEN = 10, SID_LEN = 2 }; + pj_bool_t sid_frame = ((sf->bitlen >> 3) == SID_LEN); + TBitStream *bitstream = (TBitStream*)strm->strm_data; + const TPtrC8 src(sf->data, sf->bitlen>>3); + const TDesC8 &dst = bitstream->ExpandG729Frame(src, + sid_frame); + if (sid_frame) { + buf.iBuffer.Append(2); + buf.iBuffer.Append(0); + } else { + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); + } + buf.iBuffer.Append(dst); + } else { + buf.iBuffer.Append(2); + buf.iBuffer.Append(0); + buf.iBuffer.AppendFill(0, 22); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buf.iBuffer.Append(2); + buf.iBuffer.Append(0); + buf.iBuffer.AppendFill(0, 22); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + pj_assert((strm->param.ext_fmt.bitrate == 15200 && + samples_cnt == 160) || + (strm->param.ext_fmt.bitrate != 15200 && + samples_cnt == 240)); + + if (sf->data && sf->bitlen) { + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); + buf.iBuffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + buf.iBuffer.Append(0); + buf.iBuffer.Append(0); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buf.iBuffer.Append(0); + buf.iBuffer.Append(0); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_ready = 0; + unsigned samples_req = aps_g711_frame_len; + + /* Assume frame size is 10ms if frame size hasn't been known. */ + if (samples_req == 0) + samples_req = 80; + + buf.iBuffer.Append(1); + buf.iBuffer.Append(0); + + /* Call parent stream callback to get samples to play. */ + while (samples_ready < samples_req) { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + if (sf->data && sf->bitlen) { + buf.iBuffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + pj_uint8_t silc; + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buf.iBuffer.AppendFill(silc, samples_cnt); + } + samples_ready += samples_cnt; + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + pj_uint8_t silc; + + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buf.iBuffer.AppendFill(silc, samples_req - samples_ready); + + samples_ready = samples_req; + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } } @@ -1300,20 +1209,19 @@ static void PlayCb (TAPSCommBuffer &buf, void *user_data) * C compatible declaration of APS factory. */ PJ_BEGIN_DECL -PJ_DECL (pjmedia_aud_dev_factory*) pjmedia_aps_factory (pj_pool_factory *pf); +PJ_DECL(pjmedia_aud_dev_factory*) pjmedia_aps_factory(pj_pool_factory *pf); PJ_END_DECL /* * Init APS audio driver. */ -PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_aps_factory (pj_pool_factory *pf) +PJ_DEF(pjmedia_aud_dev_factory*) pjmedia_aps_factory(pj_pool_factory *pf) { - struct aps_factory *f; pj_pool_t *pool; - pool = pj_pool_create (pf, "APS", 1000, 1000, NULL); - f = PJ_POOL_ZALLOC_T (pool, struct aps_factory); + pool = pj_pool_create(pf, "APS", 1000, 1000, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct aps_factory); f->pf = pf; f->pool = pool; f->base.op = &factory_op; @@ -1322,21 +1230,20 @@ PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_aps_factory (pj_pool_factory *pf) } /* API: init factory */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f) +static pj_status_t factory_init(pjmedia_aud_dev_factory *f) { + struct aps_factory *af = (struct aps_factory*)f; - struct aps_factory *af = (struct aps_factory*) f; - - pj_ansi_strcpy (af->dev_info.name, "S60 APS"); + pj_ansi_strcpy(af->dev_info.name, "S60 APS"); af->dev_info.default_samples_per_sec = 8000; af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_EXT_FORMAT | - //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | - PJMEDIA_AUD_DEV_CAP_VAD | - PJMEDIA_AUD_DEV_CAP_CNG; - af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | - PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | + PJMEDIA_AUD_DEV_CAP_VAD | + PJMEDIA_AUD_DEV_CAP_CNG; + af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | + PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; af->dev_info.input_count = 1; af->dev_info.output_count = 1; @@ -1361,60 +1268,57 @@ static pj_status_t factory_init (pjmedia_aud_dev_factory *f) af->dev_info.ext_fmt[4].id = PJMEDIA_FORMAT_PCMA; af->dev_info.ext_fmt[4].bitrate = 64000; af->dev_info.ext_fmt[4].vad = PJ_FALSE; - - PJ_LOG (4, (THIS_FILE, "APS initialized")); + + PJ_LOG(4, (THIS_FILE, "APS initialized")); return PJ_SUCCESS; } /* API: destroy factory */ -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f) +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f) { - - struct aps_factory *af = (struct aps_factory*) f; + struct aps_factory *af = (struct aps_factory*)f; pj_pool_t *pool = af->pool; af->pool = NULL; - pj_pool_release (pool); - - PJ_LOG (4, (THIS_FILE, "APS destroyed")); + pj_pool_release(pool); + PJ_LOG(4, (THIS_FILE, "APS destroyed")); + return PJ_SUCCESS; } /* API: get number of devices */ -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f) +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f) { - PJ_UNUSED_ARG (f); + PJ_UNUSED_ARG(f); return 1; } /* API: get device info */ -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info) +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info) { + struct aps_factory *af = (struct aps_factory*)f; - struct aps_factory *af = (struct aps_factory*) f; + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); - - pj_memcpy (info, &af->dev_info, sizeof (*info)); + pj_memcpy(info, &af->dev_info, sizeof(*info)); return PJ_SUCCESS; } /* API: create default device parameter */ -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param) +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param) { + struct aps_factory *af = (struct aps_factory*)f; - struct aps_factory *af = (struct aps_factory*) f; - - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - pj_bzero (param, sizeof (*param)); + pj_bzero(param, sizeof(*param)); param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; param->rec_id = index; param->play_id = index; @@ -1430,17 +1334,15 @@ static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, /* API: create stream */ -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm) +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) { - - struct aps_factory *af = (struct aps_factory*) f; + struct aps_factory *af = (struct aps_factory*)f; pj_pool_t *pool; - struct aps_stream *strm; CPjAudioSetting aps_setting; @@ -1448,413 +1350,382 @@ static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, PjAudioCallback aps_play_cb; /* Can only support 16bits per sample */ - PJ_ASSERT_RETURN (param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); + PJ_ASSERT_RETURN(param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); /* Supported clock rates: - * - for non-PCM format: 8kHz - * - for PCM format: 8kHz and 16kHz + * - for non-PCM format: 8kHz + * - for PCM format: 8kHz and 16kHz */ - PJ_ASSERT_RETURN (param->clock_rate == 8000 || - (param->clock_rate == 16000 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->clock_rate == 8000 || + (param->clock_rate == 16000 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Supported channels number: * - for non-PCM format: mono - * - for PCM format: mono and stereo + * - for PCM format: mono and stereo */ - PJ_ASSERT_RETURN (param->channel_count == 1 || - (param->channel_count == 2 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->channel_count == 1 || + (param->channel_count == 2 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Create and Initialize stream descriptor */ - pool = pj_pool_create (af->pf, "aps-dev", 1000, 1000, NULL); - PJ_ASSERT_RETURN (pool, PJ_ENOMEM); + pool = pj_pool_create(af->pf, "aps-dev", 1000, 1000, NULL); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); - strm = PJ_POOL_ZALLOC_T (pool, struct aps_stream); + strm = PJ_POOL_ZALLOC_T(pool, struct aps_stream); strm->pool = pool; strm->param = *param; if (strm->param.flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT == 0) - strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; - + strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; + /* Set audio engine fourcc. */ - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_L16: - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: - aps_setting.fourcc = TFourCC (KMCPFourCCIdG711); - break; - - case PJMEDIA_FORMAT_AMR: - aps_setting.fourcc = TFourCC (KMCPFourCCIdAMRNB); - break; - - case PJMEDIA_FORMAT_G729: - aps_setting.fourcc = TFourCC (KMCPFourCCIdG729); - break; - - case PJMEDIA_FORMAT_ILBC: - aps_setting.fourcc = TFourCC (KMCPFourCCIdILBC); - break; - - default: - aps_setting.fourcc = 0; - break; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_L16: + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + aps_setting.fourcc = TFourCC(KMCPFourCCIdG711); + break; + case PJMEDIA_FORMAT_AMR: + aps_setting.fourcc = TFourCC(KMCPFourCCIdAMRNB); + break; + case PJMEDIA_FORMAT_G729: + aps_setting.fourcc = TFourCC(KMCPFourCCIdG729); + break; + case PJMEDIA_FORMAT_ILBC: + aps_setting.fourcc = TFourCC(KMCPFourCCIdILBC); + break; + default: + aps_setting.fourcc = 0; + break; } /* Set audio engine mode. */ - if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) { - aps_setting.mode = (TAPSCodecMode) strm->param.ext_fmt.bitrate; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || - (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && - strm->param.ext_fmt.bitrate != 15200)) { - aps_setting.mode = EULawOr30ms; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || - (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && - strm->param.ext_fmt.bitrate == 15200)) { - aps_setting.mode = EALawOr20ms; + if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) + { + aps_setting.mode = (TAPSCodecMode)strm->param.ext_fmt.bitrate; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || + (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && + strm->param.ext_fmt.bitrate != 15200)) + { + aps_setting.mode = EULawOr30ms; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || + (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC && + strm->param.ext_fmt.bitrate == 15200)) + { + aps_setting.mode = EALawOr20ms; } - /* Disable VAD on L16, G711, and also G729 (G729's VAD potentially + /* Disable VAD on L16, G711, and also G729 (G729's VAD potentially * causes noise?). */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - aps_setting.vad = EFalse; + strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) + { + aps_setting.vad = EFalse; } else { - aps_setting.vad = strm->param.ext_fmt.vad; + aps_setting.vad = strm->param.ext_fmt.vad; } - + /* Set other audio engine attributes. */ aps_setting.plc = strm->param.plc_enabled; - aps_setting.cng = aps_setting.vad; - - aps_setting.loudspk = - strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + aps_setting.loudspk = + strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; /* Set audio engine callbacks. */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { - aps_play_cb = &PlayCbPcm; - aps_rec_cb = &RecCbPcm; + aps_play_cb = &PlayCbPcm; + aps_rec_cb = &RecCbPcm; } else { - aps_play_cb = &PlayCb; - aps_rec_cb = &RecCb; + aps_play_cb = &PlayCb; + aps_rec_cb = &RecCb; } strm->rec_cb = rec_cb; - strm->play_cb = play_cb; strm->user_data = user_data; strm->resample_factor = strm->param.clock_rate / 8000; /* play_buf size is samples per frame scaled in to 8kHz mono. */ - strm->play_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->play_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->play_buf_len = 0; strm->play_buf_start = 0; /* rec_buf size is samples per frame scaled in to 8kHz mono. */ - strm->rec_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->rec_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->rec_buf_len = 0; if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = new TBitStream; - - PJ_ASSERT_RETURN (g729_bitstream, PJ_ENOMEM); - strm->strm_data = (void*) g729_bitstream; + TBitStream *g729_bitstream = new TBitStream; + + PJ_ASSERT_RETURN(g729_bitstream, PJ_ENOMEM); + strm->strm_data = (void*)g729_bitstream; } - + /* Init resampler when format is PCM and clock rate is not 8kHz */ - if (strm->param.clock_rate != 8000 && - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { - pj_status_t status; - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - /* Create resample for recorder */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - 8000, - strm->param.clock_rate, - 80, - &strm->rec_resample); - - if (status != PJ_SUCCESS) - return status; - } - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - /* Create resample for player */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - strm->param.clock_rate, - 8000, - 80 * strm->resample_factor, - &strm->play_resample); - - if (status != PJ_SUCCESS) - return status; - } + if (strm->param.clock_rate != 8000 && + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) + { + pj_status_t status; + + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + /* Create resample for recorder */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + 8000, + strm->param.clock_rate, + 80, + &strm->rec_resample); + if (status != PJ_SUCCESS) + return status; + } + + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + /* Create resample for player */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + strm->param.clock_rate, + 8000, + 80 * strm->resample_factor, + &strm->play_resample); + if (status != PJ_SUCCESS) + return status; + } } /* Create PCM buffer, when the clock rate is not 8kHz or not mono */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 && - (strm->resample_factor > 1 || strm->param.channel_count != 1)) { - strm->pcm_buf = (pj_int16_t*) pj_pool_zalloc (pool, - strm->param.samples_per_frame << 1); + (strm->resample_factor > 1 || strm->param.channel_count != 1)) + { + strm->pcm_buf = (pj_int16_t*)pj_pool_zalloc(pool, + strm->param.samples_per_frame << 1); } - + /* Create the audio engine. */ - TRAPD (err, strm->engine = CPjAudioEngine::NewL (strm, - aps_rec_cb, aps_play_cb, - strm, aps_setting)); - + TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, + aps_rec_cb, aps_play_cb, + strm, aps_setting)); if (err != KErrNone) { - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); } /* Apply output volume setting if specified */ if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) { - stream_set_cap (&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - ¶m->output_vol); + stream_set_cap(&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + ¶m->output_vol); } /* Done */ strm->base.op = &stream_op; - *p_aud_strm = &strm->base; return PJ_SUCCESS; } /* API: Get stream info. */ -static pj_status_t stream_get_param (pjmedia_aud_stream *s, - pjmedia_aud_param *pi) +static pj_status_t stream_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) { + struct aps_stream *strm = (struct aps_stream*)s; - struct aps_stream *strm = (struct aps_stream*) s; - - PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); - pj_memcpy (pi, &strm->param, sizeof (*pi)); + pj_memcpy(pi, &strm->param, sizeof(*pi)); /* Update the output volume setting */ - - if (stream_get_cap (s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - &pi->output_vol) == PJ_SUCCESS) { - pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + &pi->output_vol) == PJ_SUCCESS) + { + pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; } - + return PJ_SUCCESS; } /* API: get capability */ -static pj_status_t stream_get_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - void *pval) +static pj_status_t stream_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) { - - struct aps_stream *strm = (struct aps_stream*) s; + struct aps_stream *strm = (struct aps_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - * (pjmedia_aud_dev_route*) pval = strm->param.output_route; - status = PJ_SUCCESS; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - TInt gain = strm->engine->GetGain(); - - if (max_gain > 0 && gain >= 0) { - *(unsigned*)pval = gain * 100 / max_gain; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - TInt vol = strm->engine->GetVolume(); - - if (max_vol > 0 && vol >= 0) { - * (unsigned*) pval = vol * 100 / max_vol; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + *(pjmedia_aud_dev_route*)pval = strm->param.output_route; + status = PJ_SUCCESS; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + TInt gain = strm->engine->GetGain(); + + if (max_gain > 0 && gain >= 0) { + *(unsigned*)pval = gain * 100 / max_gain; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + TInt vol = strm->engine->GetVolume(); + + if (max_vol > 0 && vol >= 0) { + *(unsigned*)pval = vol * 100 / max_vol; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: set capability */ -static pj_status_t stream_set_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - const void *pval) +static pj_status_t stream_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *pval) { - - struct aps_stream *strm = (struct aps_stream*) s; + struct aps_stream *strm = (struct aps_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - pjmedia_aud_dev_route r = * (const pjmedia_aud_dev_route*) pval; - TInt err; - - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - switch (r) { - - case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: - - case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: - err = strm->engine->ActivateSpeaker (EFalse); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: - err = strm->engine->ActivateSpeaker (ETrue); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - default: - status = PJ_EINVAL; - break; - } - - if (status == PJ_SUCCESS) - strm->param.output_route = r; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - if (max_gain > 0) { - TInt gain, err; - - gain = *(unsigned*)pval * max_gain / 100; - err = strm->engine->SetGain(gain); - status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - if (status == PJ_SUCCESS) - strm->param.input_vol = *(unsigned*)pval; - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - - if (max_vol > 0) { - TInt vol, err; - - vol = * (unsigned*) pval * max_vol / 100; - err = strm->engine->SetVolume (vol); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - - if (status == PJ_SUCCESS) - strm->param.output_vol = * (unsigned*) pval; - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + pjmedia_aud_dev_route r = *(const pjmedia_aud_dev_route*)pval; + TInt err; + + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + switch (r) { + case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: + case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: + err = strm->engine->ActivateSpeaker(EFalse); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: + err = strm->engine->ActivateSpeaker(ETrue); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + default: + status = PJ_EINVAL; + break; + } + if (status == PJ_SUCCESS) + strm->param.output_route = r; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + if (max_gain > 0) { + TInt gain, err; + + gain = *(unsigned*)pval * max_gain / 100; + err = strm->engine->SetGain(gain); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.input_vol = *(unsigned*)pval; + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + if (max_vol > 0) { + TInt vol, err; + + vol = *(unsigned*)pval * max_vol / 100; + err = strm->engine->SetVolume(vol); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.output_vol = *(unsigned*)pval; + } + break; + default: + break; } - + return status; } /* API: Start stream. */ -static pj_status_t stream_start (pjmedia_aud_stream *strm) +static pj_status_t stream_start(pjmedia_aud_stream *strm) { + struct aps_stream *stream = (struct aps_stream*)strm; - struct aps_stream *stream = (struct aps_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - TInt err = stream->engine->StartL(); - - if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); + TInt err = stream->engine->StartL(); + if (err != KErrNone) + return PJ_RETURN_OS_ERROR(err); } return PJ_SUCCESS; } /* API: Stop stream. */ -static pj_status_t stream_stop (pjmedia_aud_stream *strm) +static pj_status_t stream_stop(pjmedia_aud_stream *strm) { + struct aps_stream *stream = (struct aps_stream*)strm; - struct aps_stream *stream = (struct aps_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - stream->engine->Stop(); + stream->engine->Stop(); } return PJ_SUCCESS; @@ -1862,31 +1733,28 @@ static pj_status_t stream_stop (pjmedia_aud_stream *strm) /* API: Destroy stream. */ -static pj_status_t stream_destroy (pjmedia_aud_stream *strm) +static pj_status_t stream_destroy(pjmedia_aud_stream *strm) { + struct aps_stream *stream = (struct aps_stream*)strm; - struct aps_stream *stream = (struct aps_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); - stream_stop (strm); + stream_stop(strm); delete stream->engine; stream->engine = NULL; if (stream->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = (TBitStream*) stream->strm_data; - stream->strm_data = NULL; - delete g729_bitstream; + TBitStream *g729_bitstream = (TBitStream*)stream->strm_data; + stream->strm_data = NULL; + delete g729_bitstream; } pj_pool_t *pool; - pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release (pool); + stream->pool = NULL; + pj_pool_release(pool); } return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp index 44ba2f893edea6f7e70b438d4798e531b8eb6e05..d943f2bd25aa7c289c34e664a9aa6ff072e39a21 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_mda_dev.cpp @@ -1,5 +1,5 @@ /* $Id: symb_mda_dev.cpp 2777 2009-06-19 09:15:59Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev_imp.h> #include <pjmedia-audiodev/errno.h> @@ -32,7 +32,7 @@ * This file provides sound implementation for Symbian Audio Streaming * device. Application using this sound abstraction must link with: * - mediaclientaudiostream.lib, and - * - mediaclientaudioinputstream.lib + * - mediaclientaudioinputstream.lib */ #include <mda/common/audio.h> #include <mdaaudiooutputstream.h> @@ -52,8 +52,8 @@ /* MDA factory */ - -struct mda_factory { +struct mda_factory +{ pjmedia_aud_dev_factory base; pj_pool_t *pool; pj_pool_factory *pf; @@ -61,17 +61,15 @@ struct mda_factory { }; /* Forward declaration of internal engine. */ - class CPjAudioInputEngine; - class CPjAudioOutputEngine; /* MDA stream. */ - -struct mda_stream { +struct mda_stream +{ // Base pjmedia_aud_stream base; /**< Base class. */ - + // Pool pj_pool_t *pool; /**< Memory pool. */ @@ -85,37 +83,38 @@ struct mda_stream { /* Prototypes */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f); -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f); -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f); -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info); -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param); -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm); - -static pj_status_t stream_get_param (pjmedia_aud_stream *strm, - pjmedia_aud_param *param); -static pj_status_t stream_get_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - void *value); -static pj_status_t stream_set_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - const void *value); -static pj_status_t stream_start (pjmedia_aud_stream *strm); -static pj_status_t stream_stop (pjmedia_aud_stream *strm); -static pj_status_t stream_destroy (pjmedia_aud_stream *strm); +static pj_status_t factory_init(pjmedia_aud_dev_factory *f); +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f); +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +static pj_status_t stream_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t stream_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t stream_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t stream_start(pjmedia_aud_stream *strm); +static pj_status_t stream_stop(pjmedia_aud_stream *strm); +static pj_status_t stream_destroy(pjmedia_aud_stream *strm); /* Operations */ -static pjmedia_aud_dev_factory_op factory_op = { +static pjmedia_aud_dev_factory_op factory_op = +{ &factory_init, &factory_destroy, &factory_get_dev_count, @@ -124,7 +123,8 @@ static pjmedia_aud_dev_factory_op factory_op = { &factory_create_stream }; -static pjmedia_aud_stream_op stream_op = { +static pjmedia_aud_stream_op stream_op = +{ &stream_get_param, &stream_get_cap, &stream_set_cap, @@ -137,171 +137,141 @@ static pjmedia_aud_stream_op stream_op = { /* * Convert clock rate to Symbian's TMdaAudioDataSettings capability. */ -static TInt get_clock_rate_cap (unsigned clock_rate) +static TInt get_clock_rate_cap(unsigned clock_rate) { switch (clock_rate) { - - case 8000: - return TMdaAudioDataSettings::ESampleRate8000Hz; - - case 11025: - return TMdaAudioDataSettings::ESampleRate11025Hz; - - case 12000: - return TMdaAudioDataSettings::ESampleRate12000Hz; - - case 16000: - return TMdaAudioDataSettings::ESampleRate16000Hz; - - case 22050: - return TMdaAudioDataSettings::ESampleRate22050Hz; - - case 24000: - return TMdaAudioDataSettings::ESampleRate24000Hz; - - case 32000: - return TMdaAudioDataSettings::ESampleRate32000Hz; - - case 44100: - return TMdaAudioDataSettings::ESampleRate44100Hz; - - case 48000: - return TMdaAudioDataSettings::ESampleRate48000Hz; - - case 64000: - return TMdaAudioDataSettings::ESampleRate64000Hz; - - case 96000: - return TMdaAudioDataSettings::ESampleRate96000Hz; - - default: - return 0; + case 8000: return TMdaAudioDataSettings::ESampleRate8000Hz; + case 11025: return TMdaAudioDataSettings::ESampleRate11025Hz; + case 12000: return TMdaAudioDataSettings::ESampleRate12000Hz; + case 16000: return TMdaAudioDataSettings::ESampleRate16000Hz; + case 22050: return TMdaAudioDataSettings::ESampleRate22050Hz; + case 24000: return TMdaAudioDataSettings::ESampleRate24000Hz; + case 32000: return TMdaAudioDataSettings::ESampleRate32000Hz; + case 44100: return TMdaAudioDataSettings::ESampleRate44100Hz; + case 48000: return TMdaAudioDataSettings::ESampleRate48000Hz; + case 64000: return TMdaAudioDataSettings::ESampleRate64000Hz; + case 96000: return TMdaAudioDataSettings::ESampleRate96000Hz; + default: + return 0; } } /* * Convert number of channels into Symbian's TMdaAudioDataSettings capability. */ -static TInt get_channel_cap (unsigned channel_count) +static TInt get_channel_cap(unsigned channel_count) { switch (channel_count) { - - case 1: - return TMdaAudioDataSettings::EChannelsMono; - - case 2: - return TMdaAudioDataSettings::EChannelsStereo; - - default: - return 0; + case 1: return TMdaAudioDataSettings::EChannelsMono; + case 2: return TMdaAudioDataSettings::EChannelsStereo; + default: + return 0; } } /* * Utility: print sound device error */ -static void snd_perror (const char *title, TInt rc) +static void snd_perror(const char *title, TInt rc) { - PJ_LOG (1, (THIS_FILE, "%s: error code %d", title, rc)); + PJ_LOG(1,(THIS_FILE, "%s: error code %d", title, rc)); } - + ////////////////////////////////////////////////////////////////////////////// // /* * Implementation: Symbian Input Stream. */ - class CPjAudioInputEngine : public CBase, MMdaAudioInputStreamCallback { +public: + enum State + { + STATE_INACTIVE, + STATE_ACTIVE, + }; + + ~CPjAudioInputEngine(); + + static CPjAudioInputEngine *NewL(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data); + + static CPjAudioInputEngine *NewLC(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data); + + pj_status_t StartRecord(); + void Stop(); + + pj_status_t SetGain(TInt gain) { + if (iInputStream_) { + iInputStream_->SetGain(gain); + return PJ_SUCCESS; + } else + return PJ_EINVALIDOP; + } + + TInt GetGain() { + if (iInputStream_) { + return iInputStream_->Gain(); + } else + return PJ_EINVALIDOP; + } - public: - enum State { - STATE_INACTIVE, - STATE_ACTIVE, - }; - - ~CPjAudioInputEngine(); - - static CPjAudioInputEngine *NewL (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data); - - static CPjAudioInputEngine *NewLC (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data); - - pj_status_t StartRecord(); - void Stop(); - - pj_status_t SetGain (TInt gain) { - if (iInputStream_) { - iInputStream_->SetGain (gain); - return PJ_SUCCESS; - } else - return PJ_EINVALIDOP; - } - - TInt GetGain() { - if (iInputStream_) { - return iInputStream_->Gain(); - } else - return PJ_EINVALIDOP; - } - - TInt GetMaxGain() { - if (iInputStream_) { - return iInputStream_->MaxGain(); - } else - return PJ_EINVALIDOP; - } - - private: - State state_; - - struct mda_stream *parentStrm_; - pjmedia_aud_rec_cb recCb_; - void *userData_; - CMdaAudioInputStream *iInputStream_; - HBufC8 *iStreamBuffer_; - TPtr8 iFramePtr_; - TInt lastError_; - pj_uint32_t timeStamp_; - - // cache variable - // to avoid calculating frame length repeatedly - TInt frameLen_; - - // sometimes recorded size != requested framesize, so let's - // provide a buffer to make sure the rec callback returning - // framesize as requested. - TUint8 *frameRecBuf_; - TInt frameRecBufLen_; - - CPjAudioInputEngine (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data); - void ConstructL(); - TPtr8 & GetFrame(); - - public: - virtual void MaiscOpenComplete (TInt aError); - virtual void MaiscBufferCopied (TInt aError, const TDesC8 &aBuffer); - virtual void MaiscRecordComplete (TInt aError); + TInt GetMaxGain() { + if (iInputStream_) { + return iInputStream_->MaxGain(); + } else + return PJ_EINVALIDOP; + } + +private: + State state_; + struct mda_stream *parentStrm_; + pjmedia_aud_rec_cb recCb_; + void *userData_; + CMdaAudioInputStream *iInputStream_; + HBufC8 *iStreamBuffer_; + TPtr8 iFramePtr_; + TInt lastError_; + pj_uint32_t timeStamp_; + + // cache variable + // to avoid calculating frame length repeatedly + TInt frameLen_; + + // sometimes recorded size != requested framesize, so let's + // provide a buffer to make sure the rec callback returning + // framesize as requested. + TUint8 *frameRecBuf_; + TInt frameRecBufLen_; + + CPjAudioInputEngine(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data); + void ConstructL(); + TPtr8 & GetFrame(); + +public: + virtual void MaiscOpenComplete(TInt aError); + virtual void MaiscBufferCopied(TInt aError, const TDesC8 &aBuffer); + virtual void MaiscRecordComplete(TInt aError); }; -CPjAudioInputEngine::CPjAudioInputEngine (struct mda_stream *parent_strm, - pjmedia_aud_rec_cb rec_cb, - void *user_data) - : state_ (STATE_INACTIVE), parentStrm_ (parent_strm), - recCb_ (rec_cb), userData_ (user_data), - iInputStream_ (NULL), iStreamBuffer_ (NULL), iFramePtr_ (0, 0), - lastError_ (KErrNone), timeStamp_ (0), - frameLen_ (parent_strm->param.samples_per_frame * - BYTES_PER_SAMPLE), - frameRecBuf_ (NULL), frameRecBufLen_ (0) +CPjAudioInputEngine::CPjAudioInputEngine(struct mda_stream *parent_strm, + pjmedia_aud_rec_cb rec_cb, + void *user_data) + : state_(STATE_INACTIVE), parentStrm_(parent_strm), + recCb_(rec_cb), userData_(user_data), + iInputStream_(NULL), iStreamBuffer_(NULL), iFramePtr_(0, 0), + lastError_(KErrNone), timeStamp_(0), + frameLen_(parent_strm->param.samples_per_frame * + BYTES_PER_SAMPLE), + frameRecBuf_(NULL), frameRecBufLen_(0) { } @@ -311,7 +281,7 @@ CPjAudioInputEngine::~CPjAudioInputEngine() delete iStreamBuffer_; iStreamBuffer_ = NULL; - + delete [] frameRecBuf_; frameRecBuf_ = NULL; frameRecBufLen_ = 0; @@ -319,33 +289,33 @@ CPjAudioInputEngine::~CPjAudioInputEngine() void CPjAudioInputEngine::ConstructL() { - iStreamBuffer_ = HBufC8::NewL (frameLen_); - CleanupStack::PushL (iStreamBuffer_); + iStreamBuffer_ = HBufC8::NewL(frameLen_); + CleanupStack::PushL(iStreamBuffer_); frameRecBuf_ = new TUint8[frameLen_*2]; - CleanupStack::PushL (frameRecBuf_); + CleanupStack::PushL(frameRecBuf_); } -CPjAudioInputEngine *CPjAudioInputEngine::NewLC (struct mda_stream *parent, - pjmedia_aud_rec_cb rec_cb, - void *user_data) +CPjAudioInputEngine *CPjAudioInputEngine::NewLC(struct mda_stream *parent, + pjmedia_aud_rec_cb rec_cb, + void *user_data) { - CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine (parent, - rec_cb, - user_data); - CleanupStack::PushL (self); + CPjAudioInputEngine* self = new (ELeave) CPjAudioInputEngine(parent, + rec_cb, + user_data); + CleanupStack::PushL(self); self->ConstructL(); return self; } -CPjAudioInputEngine *CPjAudioInputEngine::NewL (struct mda_stream *parent, - pjmedia_aud_rec_cb rec_cb, - void *user_data) +CPjAudioInputEngine *CPjAudioInputEngine::NewL(struct mda_stream *parent, + pjmedia_aud_rec_cb rec_cb, + void *user_data) { - CPjAudioInputEngine *self = NewLC (parent, rec_cb, user_data); - CleanupStack::Pop (self->frameRecBuf_); - CleanupStack::Pop (self->iStreamBuffer_); - CleanupStack::Pop (self); + CPjAudioInputEngine *self = NewLC(parent, rec_cb, user_data); + CleanupStack::Pop(self->frameRecBuf_); + CleanupStack::Pop(self->iStreamBuffer_); + CleanupStack::Pop(self); return self; } @@ -355,50 +325,44 @@ pj_status_t CPjAudioInputEngine::StartRecord() // Ignore command if recording is in progress. if (state_ == STATE_ACTIVE) - return PJ_SUCCESS; + return PJ_SUCCESS; // According to Nokia's AudioStream example, some 2nd Edition, FP2 devices - // (such as Nokia 6630) require the stream to be reconstructed each time + // (such as Nokia 6630) require the stream to be reconstructed each time // before calling Open() - otherwise the callback never gets called. // For uniform behavior, lets just delete/re-create the stream for all // devices. // Destroy existing stream. if (iInputStream_) delete iInputStream_; - iInputStream_ = NULL; // Create the stream. - TRAPD (err, iInputStream_ = CMdaAudioInputStream::NewL (*this)); - + TRAPD(err, iInputStream_ = CMdaAudioInputStream::NewL(*this)); if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); // Initialize settings. TMdaAudioDataSettings iStreamSettings; - - iStreamSettings.iChannels = - get_channel_cap (parentStrm_->param.channel_count); - - iStreamSettings.iSampleRate = - get_clock_rate_cap (parentStrm_->param.clock_rate); - - pj_assert (iStreamSettings.iChannels != 0 && - iStreamSettings.iSampleRate != 0); - - PJ_LOG (4, (THIS_FILE, "Opening sound device for capture, " - "clock rate=%d, channel count=%d..", - parentStrm_->param.clock_rate, - parentStrm_->param.channel_count)); - + iStreamSettings.iChannels = + get_channel_cap(parentStrm_->param.channel_count); + iStreamSettings.iSampleRate = + get_clock_rate_cap(parentStrm_->param.clock_rate); + + pj_assert(iStreamSettings.iChannels != 0 && + iStreamSettings.iSampleRate != 0); + + PJ_LOG(4,(THIS_FILE, "Opening sound device for capture, " + "clock rate=%d, channel count=%d..", + parentStrm_->param.clock_rate, + parentStrm_->param.channel_count)); + // Open stream. lastError_ = KRequestPending; - - iInputStream_->Open (&iStreamSettings); - + iInputStream_->Open(&iStreamSettings); + // Success - PJ_LOG (4, (THIS_FILE, "Sound capture started.")); - + PJ_LOG(4,(THIS_FILE, "Sound capture started.")); return PJ_SUCCESS; } @@ -407,121 +371,113 @@ void CPjAudioInputEngine::Stop() { // If capture is in progress, stop it. if (iInputStream_ && state_ == STATE_ACTIVE) { - lastError_ = KRequestPending; - iInputStream_->Stop(); + lastError_ = KRequestPending; + iInputStream_->Stop(); - // Wait until it's actually stopped - - while (lastError_ == KRequestPending) - pj_symbianos_poll (-1, 100); + // Wait until it's actually stopped + while (lastError_ == KRequestPending) + pj_symbianos_poll(-1, 100); } if (iInputStream_) { - delete iInputStream_; - iInputStream_ = NULL; + delete iInputStream_; + iInputStream_ = NULL; } - + state_ = STATE_INACTIVE; } -TPtr8 & CPjAudioInputEngine::GetFrame() +TPtr8 & CPjAudioInputEngine::GetFrame() { //iStreamBuffer_->Des().FillZ(frameLen_); - iFramePtr_.Set ( (TUint8*) (iStreamBuffer_->Ptr()), frameLen_, frameLen_); + iFramePtr_.Set((TUint8*)(iStreamBuffer_->Ptr()), frameLen_, frameLen_); return iFramePtr_; } -void CPjAudioInputEngine::MaiscOpenComplete (TInt aError) +void CPjAudioInputEngine::MaiscOpenComplete(TInt aError) { lastError_ = aError; - if (aError != KErrNone) { - snd_perror ("Error in MaiscOpenComplete()", aError); - return; + snd_perror("Error in MaiscOpenComplete()", aError); + return; } // set stream priority to normal and time sensitive - iInputStream_->SetPriority (EPriorityNormal, - EMdaPriorityPreferenceTime); + iInputStream_->SetPriority(EPriorityNormal, + EMdaPriorityPreferenceTime); // Read the first frame. TPtr8 & frm = GetFrame(); - - TRAPD (err2, iInputStream_->ReadL (frm)); - + TRAPD(err2, iInputStream_->ReadL(frm)); if (err2) { - PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()")); + PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); } } -void CPjAudioInputEngine::MaiscBufferCopied (TInt aError, - const TDesC8 &aBuffer) +void CPjAudioInputEngine::MaiscBufferCopied(TInt aError, + const TDesC8 &aBuffer) { lastError_ = aError; - if (aError != KErrNone) { - snd_perror ("Error in MaiscBufferCopied()", aError); - return; + snd_perror("Error in MaiscBufferCopied()", aError); + return; } if (frameRecBufLen_ || aBuffer.Length() < frameLen_) { - pj_memcpy (frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Length()); - frameRecBufLen_ += aBuffer.Length(); + pj_memcpy(frameRecBuf_ + frameRecBufLen_, (void*) aBuffer.Ptr(), aBuffer.Length()); + frameRecBufLen_ += aBuffer.Length(); } if (frameRecBufLen_) { - while (frameRecBufLen_ >= frameLen_) { - pjmedia_frame f; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = frameRecBuf_; - f.size = frameLen_; - f.timestamp.u32.lo = timeStamp_; - f.bit_info = 0; - - // Call the callback. - recCb_ (userData_, &f); - // Increment timestamp. - timeStamp_ += parentStrm_->param.samples_per_frame; - - frameRecBufLen_ -= frameLen_; - pj_memmove (frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_); - } + while (frameRecBufLen_ >= frameLen_) { + pjmedia_frame f; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = frameRecBuf_; + f.size = frameLen_; + f.timestamp.u32.lo = timeStamp_; + f.bit_info = 0; + + // Call the callback. + recCb_(userData_, &f); + // Increment timestamp. + timeStamp_ += parentStrm_->param.samples_per_frame; + + frameRecBufLen_ -= frameLen_; + pj_memmove(frameRecBuf_, frameRecBuf_+frameLen_, frameRecBufLen_); + } } else { - pjmedia_frame f; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = (void*) aBuffer.Ptr(); - f.size = aBuffer.Length(); - f.timestamp.u32.lo = timeStamp_; - f.bit_info = 0; - - // Call the callback. - recCb_ (userData_, &f); - - // Increment timestamp. - timeStamp_ += parentStrm_->param.samples_per_frame; + pjmedia_frame f; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = (void*)aBuffer.Ptr(); + f.size = aBuffer.Length(); + f.timestamp.u32.lo = timeStamp_; + f.bit_info = 0; + + // Call the callback. + recCb_(userData_, &f); + + // Increment timestamp. + timeStamp_ += parentStrm_->param.samples_per_frame; } // Record next frame TPtr8 & frm = GetFrame(); - - TRAPD (err2, iInputStream_->ReadL (frm)); - + TRAPD(err2, iInputStream_->ReadL(frm)); if (err2) { - PJ_LOG (4, (THIS_FILE, "Exception in iInputStream_->ReadL()")); + PJ_LOG(4,(THIS_FILE, "Exception in iInputStream_->ReadL()")); } } -void CPjAudioInputEngine::MaiscRecordComplete (TInt aError) +void CPjAudioInputEngine::MaiscRecordComplete(TInt aError) { lastError_ = aError; state_ = STATE_INACTIVE; - if (aError != KErrNone && aError != KErrCancel) { - snd_perror ("Error in MaiscRecordComplete()", aError); + snd_perror("Error in MaiscRecordComplete()", aError); } } @@ -536,78 +492,77 @@ void CPjAudioInputEngine::MaiscRecordComplete (TInt aError) class CPjAudioOutputEngine : public CBase, MMdaAudioOutputStreamCallback { +public: + enum State + { + STATE_INACTIVE, + STATE_ACTIVE, + }; + + ~CPjAudioOutputEngine(); + + static CPjAudioOutputEngine *NewL(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data); + + static CPjAudioOutputEngine *NewLC(struct mda_stream *parent_strm, + pjmedia_aud_play_cb rec_cb, + void *user_data); + + pj_status_t StartPlay(); + void Stop(); + + pj_status_t SetVolume(TInt vol) { + if (iOutputStream_) { + iOutputStream_->SetVolume(vol); + return PJ_SUCCESS; + } else + return PJ_EINVALIDOP; + } + + TInt GetVolume() { + if (iOutputStream_) { + return iOutputStream_->Volume(); + } else + return PJ_EINVALIDOP; + } + + TInt GetMaxVolume() { + if (iOutputStream_) { + return iOutputStream_->MaxVolume(); + } else + return PJ_EINVALIDOP; + } - public: - enum State { - STATE_INACTIVE, - STATE_ACTIVE, - }; - - ~CPjAudioOutputEngine(); - - static CPjAudioOutputEngine *NewL (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data); - - static CPjAudioOutputEngine *NewLC (struct mda_stream *parent_strm, - pjmedia_aud_play_cb rec_cb, - void *user_data); - - pj_status_t StartPlay(); - void Stop(); - - pj_status_t SetVolume (TInt vol) { - if (iOutputStream_) { - iOutputStream_->SetVolume (vol); - return PJ_SUCCESS; - } else - return PJ_EINVALIDOP; - } - - TInt GetVolume() { - if (iOutputStream_) { - return iOutputStream_->Volume(); - } else - return PJ_EINVALIDOP; - } - - TInt GetMaxVolume() { - if (iOutputStream_) { - return iOutputStream_->MaxVolume(); - } else - return PJ_EINVALIDOP; - } - - private: - State state_; - - struct mda_stream *parentStrm_; - pjmedia_aud_play_cb playCb_; - void *userData_; - CMdaAudioOutputStream *iOutputStream_; - TUint8 *frameBuf_; - unsigned frameBufSize_; - TPtrC8 frame_; - TInt lastError_; - unsigned timestamp_; - - CPjAudioOutputEngine (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data); - void ConstructL(); - - virtual void MaoscOpenComplete (TInt aError); - virtual void MaoscBufferCopied (TInt aError, const TDesC8& aBuffer); - virtual void MaoscPlayComplete (TInt aError); +private: + State state_; + struct mda_stream *parentStrm_; + pjmedia_aud_play_cb playCb_; + void *userData_; + CMdaAudioOutputStream *iOutputStream_; + TUint8 *frameBuf_; + unsigned frameBufSize_; + TPtrC8 frame_; + TInt lastError_; + unsigned timestamp_; + + CPjAudioOutputEngine(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data); + void ConstructL(); + + virtual void MaoscOpenComplete(TInt aError); + virtual void MaoscBufferCopied(TInt aError, const TDesC8& aBuffer); + virtual void MaoscPlayComplete(TInt aError); }; -CPjAudioOutputEngine::CPjAudioOutputEngine (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data) - : state_ (STATE_INACTIVE), parentStrm_ (parent_strm), playCb_ (play_cb), - userData_ (user_data), iOutputStream_ (NULL), frameBuf_ (NULL), - lastError_ (KErrNone), timestamp_ (0) +CPjAudioOutputEngine::CPjAudioOutputEngine(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data) +: state_(STATE_INACTIVE), parentStrm_(parent_strm), playCb_(play_cb), + userData_(user_data), iOutputStream_(NULL), frameBuf_(NULL), + lastError_(KErrNone), timestamp_(0) { } @@ -615,36 +570,36 @@ CPjAudioOutputEngine::CPjAudioOutputEngine (struct mda_stream *parent_strm, void CPjAudioOutputEngine::ConstructL() { frameBufSize_ = parentStrm_->param.samples_per_frame * - BYTES_PER_SAMPLE; + BYTES_PER_SAMPLE; frameBuf_ = new TUint8[frameBufSize_]; } CPjAudioOutputEngine::~CPjAudioOutputEngine() { Stop(); - delete [] frameBuf_; + delete [] frameBuf_; } CPjAudioOutputEngine * -CPjAudioOutputEngine::NewLC (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data) +CPjAudioOutputEngine::NewLC(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data) { - CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine (parent_strm, - play_cb, - user_data); - CleanupStack::PushL (self); + CPjAudioOutputEngine* self = new (ELeave) CPjAudioOutputEngine(parent_strm, + play_cb, + user_data); + CleanupStack::PushL(self); self->ConstructL(); return self; } CPjAudioOutputEngine * -CPjAudioOutputEngine::NewL (struct mda_stream *parent_strm, - pjmedia_aud_play_cb play_cb, - void *user_data) +CPjAudioOutputEngine::NewL(struct mda_stream *parent_strm, + pjmedia_aud_play_cb play_cb, + void *user_data) { - CPjAudioOutputEngine *self = NewLC (parent_strm, play_cb, user_data); - CleanupStack::Pop (self); + CPjAudioOutputEngine *self = NewLC(parent_strm, play_cb, user_data); + CleanupStack::Pop(self); return self; } @@ -652,44 +607,38 @@ pj_status_t CPjAudioOutputEngine::StartPlay() { // Ignore command if playing is in progress. if (state_ == STATE_ACTIVE) - return PJ_SUCCESS; - + return PJ_SUCCESS; + // Destroy existing stream. if (iOutputStream_) delete iOutputStream_; - iOutputStream_ = NULL; - + // Create the stream - TRAPD (err, iOutputStream_ = CMdaAudioOutputStream::NewL (*this)); - + TRAPD(err, iOutputStream_ = CMdaAudioOutputStream::NewL(*this)); if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); - + return PJ_RETURN_OS_ERROR(err); + // Initialize settings. TMdaAudioDataSettings iStreamSettings; - - iStreamSettings.iChannels = - get_channel_cap (parentStrm_->param.channel_count); - - iStreamSettings.iSampleRate = - get_clock_rate_cap (parentStrm_->param.clock_rate); - - pj_assert (iStreamSettings.iChannels != 0 && - iStreamSettings.iSampleRate != 0); - - PJ_LOG (4, (THIS_FILE, "Opening sound device for playback, " - "clock rate=%d, channel count=%d..", - parentStrm_->param.clock_rate, - parentStrm_->param.channel_count)); + iStreamSettings.iChannels = + get_channel_cap(parentStrm_->param.channel_count); + iStreamSettings.iSampleRate = + get_clock_rate_cap(parentStrm_->param.clock_rate); + + pj_assert(iStreamSettings.iChannels != 0 && + iStreamSettings.iSampleRate != 0); + + PJ_LOG(4,(THIS_FILE, "Opening sound device for playback, " + "clock rate=%d, channel count=%d..", + parentStrm_->param.clock_rate, + parentStrm_->param.channel_count)); // Open stream. lastError_ = KRequestPending; - - iOutputStream_->Open (&iStreamSettings); + iOutputStream_->Open(&iStreamSettings); // Success - PJ_LOG (4, (THIS_FILE, "Sound playback started")); - + PJ_LOG(4,(THIS_FILE, "Sound playback started")); return PJ_SUCCESS; } @@ -698,137 +647,131 @@ void CPjAudioOutputEngine::Stop() { // Stop stream if it's playing if (iOutputStream_ && state_ != STATE_INACTIVE) { - lastError_ = KRequestPending; - iOutputStream_->Stop(); + lastError_ = KRequestPending; + iOutputStream_->Stop(); - // Wait until it's actually stopped - - while (lastError_ == KRequestPending) - pj_symbianos_poll (-1, 100); + // Wait until it's actually stopped + while (lastError_ == KRequestPending) + pj_symbianos_poll(-1, 100); } - - if (iOutputStream_) { - delete iOutputStream_; - iOutputStream_ = NULL; + + if (iOutputStream_) { + delete iOutputStream_; + iOutputStream_ = NULL; } - + state_ = STATE_INACTIVE; } -void CPjAudioOutputEngine::MaoscOpenComplete (TInt aError) +void CPjAudioOutputEngine::MaoscOpenComplete(TInt aError) { lastError_ = aError; - + if (aError==KErrNone) { - // output stream opened succesfully, set status to Active - state_ = STATE_ACTIVE; - - // set stream properties, 16bit 8KHz mono - TMdaAudioDataSettings iSettings; - iSettings.iChannels = - get_channel_cap (parentStrm_->param.channel_count); - iSettings.iSampleRate = - get_clock_rate_cap (parentStrm_->param.clock_rate); - - iOutputStream_->SetAudioPropertiesL (iSettings.iSampleRate, - iSettings.iChannels); - - // set volume to 1/2th of stream max volume - iOutputStream_->SetVolume (iOutputStream_->MaxVolume() /2); - - // set stream priority to normal and time sensitive - iOutputStream_->SetPriority (EPriorityNormal, - EMdaPriorityPreferenceTime); - - // Call callback to retrieve frame from upstream. - pjmedia_frame f; - pj_status_t status; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = frameBuf_; - f.size = frameBufSize_; - f.timestamp.u32.lo = timestamp_; - f.bit_info = 0; - - status = playCb_ (this->userData_, &f); - - if (status != PJ_SUCCESS) { - this->Stop(); - return; - } - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) - pj_bzero (frameBuf_, frameBufSize_); - - // Increment timestamp. - timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); - - // issue WriteL() to write the first audio data block, - // subsequent calls to WriteL() will be issued in - // MMdaAudioOutputStreamCallback::MaoscBufferCopied() - // until whole data buffer is written. - frame_.Set (frameBuf_, frameBufSize_); - - iOutputStream_->WriteL (frame_); + // output stream opened succesfully, set status to Active + state_ = STATE_ACTIVE; + + // set stream properties, 16bit 8KHz mono + TMdaAudioDataSettings iSettings; + iSettings.iChannels = + get_channel_cap(parentStrm_->param.channel_count); + iSettings.iSampleRate = + get_clock_rate_cap(parentStrm_->param.clock_rate); + + iOutputStream_->SetAudioPropertiesL(iSettings.iSampleRate, + iSettings.iChannels); + + // set volume to 1/2th of stream max volume + iOutputStream_->SetVolume(iOutputStream_->MaxVolume()/2); + + // set stream priority to normal and time sensitive + iOutputStream_->SetPriority(EPriorityNormal, + EMdaPriorityPreferenceTime); + + // Call callback to retrieve frame from upstream. + pjmedia_frame f; + pj_status_t status; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = frameBuf_; + f.size = frameBufSize_; + f.timestamp.u32.lo = timestamp_; + f.bit_info = 0; + + status = playCb_(this->userData_, &f); + if (status != PJ_SUCCESS) { + this->Stop(); + return; + } + + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) + pj_bzero(frameBuf_, frameBufSize_); + + // Increment timestamp. + timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); + + // issue WriteL() to write the first audio data block, + // subsequent calls to WriteL() will be issued in + // MMdaAudioOutputStreamCallback::MaoscBufferCopied() + // until whole data buffer is written. + frame_.Set(frameBuf_, frameBufSize_); + iOutputStream_->WriteL(frame_); } else { - snd_perror ("Error in MaoscOpenComplete()", aError); + snd_perror("Error in MaoscOpenComplete()", aError); } } -void CPjAudioOutputEngine::MaoscBufferCopied (TInt aError, - const TDesC8& aBuffer) +void CPjAudioOutputEngine::MaoscBufferCopied(TInt aError, + const TDesC8& aBuffer) { - PJ_UNUSED_ARG (aBuffer); + PJ_UNUSED_ARG(aBuffer); if (aError==KErrNone) { - // Buffer successfully written, feed another one. - - // Call callback to retrieve frame from upstream. - pjmedia_frame f; - pj_status_t status; - - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.buf = frameBuf_; - f.size = frameBufSize_; - f.timestamp.u32.lo = timestamp_; - f.bit_info = 0; - - status = playCb_ (this->userData_, &f); - - if (status != PJ_SUCCESS) { - this->Stop(); - return; - } - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) - pj_bzero (frameBuf_, frameBufSize_); - - // Increment timestamp. - timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); - - // Write to playback stream. - frame_.Set (frameBuf_, frameBufSize_); - - iOutputStream_->WriteL (frame_); + // Buffer successfully written, feed another one. + + // Call callback to retrieve frame from upstream. + pjmedia_frame f; + pj_status_t status; + + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.buf = frameBuf_; + f.size = frameBufSize_; + f.timestamp.u32.lo = timestamp_; + f.bit_info = 0; + + status = playCb_(this->userData_, &f); + if (status != PJ_SUCCESS) { + this->Stop(); + return; + } + + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) + pj_bzero(frameBuf_, frameBufSize_); + + // Increment timestamp. + timestamp_ += (frameBufSize_ / BYTES_PER_SAMPLE); + + // Write to playback stream. + frame_.Set(frameBuf_, frameBufSize_); + iOutputStream_->WriteL(frame_); } else if (aError==KErrAbort) { - // playing was aborted, due to call to CMdaAudioOutputStream::Stop() - state_ = STATE_INACTIVE; + // playing was aborted, due to call to CMdaAudioOutputStream::Stop() + state_ = STATE_INACTIVE; } else { - // error writing data to output - lastError_ = aError; - state_ = STATE_INACTIVE; - snd_perror ("Error in MaoscBufferCopied()", aError); + // error writing data to output + lastError_ = aError; + state_ = STATE_INACTIVE; + snd_perror("Error in MaoscBufferCopied()", aError); } } -void CPjAudioOutputEngine::MaoscPlayComplete (TInt aError) +void CPjAudioOutputEngine::MaoscPlayComplete(TInt aError) { lastError_ = aError; state_ = STATE_INACTIVE; - if (aError != KErrNone && aError != KErrCancel) { - snd_perror ("Error in MaoscPlayComplete()", aError); + snd_perror("Error in MaoscPlayComplete()", aError); } } @@ -840,20 +783,19 @@ void CPjAudioOutputEngine::MaoscPlayComplete (TInt aError) * C compatible declaration of MDA factory. */ PJ_BEGIN_DECL -PJ_DECL (pjmedia_aud_dev_factory*) pjmedia_symb_mda_factory (pj_pool_factory *pf); +PJ_DECL(pjmedia_aud_dev_factory*) pjmedia_symb_mda_factory(pj_pool_factory *pf); PJ_END_DECL /* * Init Symbian audio driver. */ -pjmedia_aud_dev_factory* pjmedia_symb_mda_factory (pj_pool_factory *pf) +pjmedia_aud_dev_factory* pjmedia_symb_mda_factory(pj_pool_factory *pf) { - struct mda_factory *f; pj_pool_t *pool; - pool = pj_pool_create (pf, "symb_aud", 1000, 1000, NULL); - f = PJ_POOL_ZALLOC_T (pool, struct mda_factory); + pool = pj_pool_create(pf, "symb_aud", 1000, 1000, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct mda_factory); f->pf = pf; f->pool = pool; f->base.op = &factory_op; @@ -862,71 +804,67 @@ pjmedia_aud_dev_factory* pjmedia_symb_mda_factory (pj_pool_factory *pf) } /* API: init factory */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f) +static pj_status_t factory_init(pjmedia_aud_dev_factory *f) { + struct mda_factory *af = (struct mda_factory*)f; - struct mda_factory *af = (struct mda_factory*) f; - - pj_ansi_strcpy (af->dev_info.name, "Symbian Audio"); + pj_ansi_strcpy(af->dev_info.name, "Symbian Audio"); af->dev_info.default_samples_per_sec = 8000; af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; af->dev_info.input_count = 1; af->dev_info.output_count = 1; - PJ_LOG (4, (THIS_FILE, "Symb Mda initialized")); + PJ_LOG(4, (THIS_FILE, "Symb Mda initialized")); return PJ_SUCCESS; } /* API: destroy factory */ -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f) +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f) { - - struct mda_factory *af = (struct mda_factory*) f; + struct mda_factory *af = (struct mda_factory*)f; pj_pool_t *pool = af->pool; af->pool = NULL; - pj_pool_release (pool); - - PJ_LOG (4, (THIS_FILE, "Symbian Mda destroyed")); + pj_pool_release(pool); + PJ_LOG(4, (THIS_FILE, "Symbian Mda destroyed")); + return PJ_SUCCESS; } /* API: get number of devices */ -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f) +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f) { - PJ_UNUSED_ARG (f); + PJ_UNUSED_ARG(f); return 1; } /* API: get device info */ -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info) +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info) { + struct mda_factory *af = (struct mda_factory*)f; - struct mda_factory *af = (struct mda_factory*) f; + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); - - pj_memcpy (info, &af->dev_info, sizeof (*info)); + pj_memcpy(info, &af->dev_info, sizeof(*info)); return PJ_SUCCESS; } /* API: create default device parameter */ -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param) +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param) { + struct mda_factory *af = (struct mda_factory*)f; - struct mda_factory *af = (struct mda_factory*) f; - - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - pj_bzero (param, sizeof (*param)); + pj_bzero(param, sizeof(*param)); param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; param->rec_id = index; param->play_id = index; @@ -941,239 +879,210 @@ static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, /* API: create stream */ -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm) +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) { - - struct mda_factory *mf = (struct mda_factory*) f; + struct mda_factory *mf = (struct mda_factory*)f; pj_pool_t *pool; - struct mda_stream *strm; /* Can only support 16bits per sample raw PCM format. */ - PJ_ASSERT_RETURN (param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); - PJ_ASSERT_RETURN ( (param->flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT) ==0 || - param->ext_fmt.id == PJMEDIA_FORMAT_L16, - PJ_ENOTSUP); - + PJ_ASSERT_RETURN(param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); + PJ_ASSERT_RETURN((param->flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT)==0 || + param->ext_fmt.id == PJMEDIA_FORMAT_L16, + PJ_ENOTSUP); + /* It seems that MDA recorder only supports for mono channel. */ - PJ_ASSERT_RETURN (param->channel_count == 1, PJ_EINVAL); + PJ_ASSERT_RETURN(param->channel_count == 1, PJ_EINVAL); /* Create and Initialize stream descriptor */ - pool = pj_pool_create (mf->pf, "symb_aud_dev", 1000, 1000, NULL); - PJ_ASSERT_RETURN (pool, PJ_ENOMEM); + pool = pj_pool_create(mf->pf, "symb_aud_dev", 1000, 1000, NULL); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); - strm = PJ_POOL_ZALLOC_T (pool, struct mda_stream); + strm = PJ_POOL_ZALLOC_T(pool, struct mda_stream); strm->pool = pool; strm->param = *param; // Create the output stream. - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - TRAPD (err, strm->out_engine = CPjAudioOutputEngine::NewL (strm, play_cb, - user_data)); - - if (err != KErrNone) { - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); - } + TRAPD(err, strm->out_engine = CPjAudioOutputEngine::NewL(strm, play_cb, + user_data)); + if (err != KErrNone) { + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); + } } // Create the input stream. if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - TRAPD (err, strm->in_engine = CPjAudioInputEngine::NewL (strm, rec_cb, - user_data)); - - if (err != KErrNone) { - strm->in_engine = NULL; - delete strm->out_engine; - strm->out_engine = NULL; - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); - } + TRAPD(err, strm->in_engine = CPjAudioInputEngine::NewL(strm, rec_cb, + user_data)); + if (err != KErrNone) { + strm->in_engine = NULL; + delete strm->out_engine; + strm->out_engine = NULL; + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); + } } - + /* Done */ strm->base.op = &stream_op; - *p_aud_strm = &strm->base; return PJ_SUCCESS; } /* API: Get stream info. */ -static pj_status_t stream_get_param (pjmedia_aud_stream *s, - pjmedia_aud_param *pi) +static pj_status_t stream_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) { + struct mda_stream *strm = (struct mda_stream*)s; - struct mda_stream *strm = (struct mda_stream*) s; - - PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); - - pj_memcpy (pi, &strm->param, sizeof (*pi)); + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); + pj_memcpy(pi, &strm->param, sizeof(*pi)); + return PJ_SUCCESS; } /* API: get capability */ -static pj_status_t stream_get_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - void *pval) +static pj_status_t stream_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) { - - struct mda_stream *strm = (struct mda_stream*) s; + struct mda_stream *strm = (struct mda_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN (strm->in_engine, PJ_EINVAL); - - TInt max_gain = strm->in_engine->GetMaxGain(); - TInt gain = strm->in_engine->GetGain(); - - if (max_gain > 0 && gain >= 0) { - * (unsigned*) pval = gain * 100 / max_gain; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->out_engine, PJ_EINVAL); - - TInt max_vol = strm->out_engine->GetMaxVolume(); - TInt vol = strm->out_engine->GetVolume(); - - if (max_vol > 0 && vol >= 0) { - * (unsigned*) pval = vol * 100 / max_vol; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->in_engine, PJ_EINVAL); + + TInt max_gain = strm->in_engine->GetMaxGain(); + TInt gain = strm->in_engine->GetGain(); + + if (max_gain > 0 && gain >= 0) { + *(unsigned*)pval = gain * 100 / max_gain; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->out_engine, PJ_EINVAL); + + TInt max_vol = strm->out_engine->GetMaxVolume(); + TInt vol = strm->out_engine->GetVolume(); + + if (max_vol > 0 && vol >= 0) { + *(unsigned*)pval = vol * 100 / max_vol; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: set capability */ -static pj_status_t stream_set_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - const void *pval) +static pj_status_t stream_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *pval) { - - struct mda_stream *strm = (struct mda_stream*) s; + struct mda_stream *strm = (struct mda_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN (strm->in_engine, PJ_EINVAL); - - TInt max_gain = strm->in_engine->GetMaxGain(); - - if (max_gain > 0) { - TInt gain; - - gain = * (unsigned*) pval * max_gain / 100; - status = strm->in_engine->SetGain (gain); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN (strm->out_engine, PJ_EINVAL); - - TInt max_vol = strm->out_engine->GetMaxVolume(); - - if (max_vol > 0) { - TInt vol; - - vol = * (unsigned*) pval * max_vol / 100; - status = strm->out_engine->SetVolume (vol); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->in_engine, PJ_EINVAL); + + TInt max_gain = strm->in_engine->GetMaxGain(); + if (max_gain > 0) { + TInt gain; + + gain = *(unsigned*)pval * max_gain / 100; + status = strm->in_engine->SetGain(gain); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->out_engine, PJ_EINVAL); + + TInt max_vol = strm->out_engine->GetMaxVolume(); + if (max_vol > 0) { + TInt vol; + + vol = *(unsigned*)pval * max_vol / 100; + status = strm->out_engine->SetVolume(vol); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: Start stream. */ -static pj_status_t stream_start (pjmedia_aud_stream *strm) +static pj_status_t stream_start(pjmedia_aud_stream *strm) { + struct mda_stream *stream = (struct mda_stream*)strm; - struct mda_stream *stream = (struct mda_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->out_engine) { - pj_status_t status; - status = stream->out_engine->StartPlay(); - - if (status != PJ_SUCCESS) - return status; + pj_status_t status; + status = stream->out_engine->StartPlay(); + if (status != PJ_SUCCESS) + return status; } - + if (stream->in_engine) { - pj_status_t status; - status = stream->in_engine->StartRecord(); - - if (status != PJ_SUCCESS) - return status; + pj_status_t status; + status = stream->in_engine->StartRecord(); + if (status != PJ_SUCCESS) + return status; } return PJ_SUCCESS; } /* API: Stop stream. */ -static pj_status_t stream_stop (pjmedia_aud_stream *strm) +static pj_status_t stream_stop(pjmedia_aud_stream *strm) { + struct mda_stream *stream = (struct mda_stream*)strm; - struct mda_stream *stream = (struct mda_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->in_engine) { - stream->in_engine->Stop(); + stream->in_engine->Stop(); } - + if (stream->out_engine) { - stream->out_engine->Stop(); + stream->out_engine->Stop(); } return PJ_SUCCESS; @@ -1181,14 +1090,13 @@ static pj_status_t stream_stop (pjmedia_aud_stream *strm) /* API: Destroy stream. */ -static pj_status_t stream_destroy (pjmedia_aud_stream *strm) +static pj_status_t stream_destroy(pjmedia_aud_stream *strm) { + struct mda_stream *stream = (struct mda_stream*)strm; - struct mda_stream *stream = (struct mda_stream*) strm; + PJ_ASSERT_RETURN(stream, PJ_EINVAL); - PJ_ASSERT_RETURN (stream, PJ_EINVAL); - - stream_stop (strm); + stream_stop(strm); delete stream->in_engine; stream->in_engine = NULL; @@ -1198,10 +1106,9 @@ static pj_status_t stream_destroy (pjmedia_aud_stream *strm) pj_pool_t *pool; pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release (pool); + stream->pool = NULL; + pj_pool_release(pool); } return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp index a4c156bebb9f73e00f598a8ac271df2a65ac39de..93eb284404ee4d76d25c7abd9a9bb49386577e2f 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp @@ -1,5 +1,5 @@ -/* $Id: symb_vas_dev.cpp 2833 2009-07-14 14:33:39Z nanang $ */ -/* +/* $Id: symb_vas_dev.cpp 3025 2009-11-24 12:24:35Z nanang $ */ +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev_imp.h> #include <pjmedia-audiodev/errno.h> @@ -40,10 +40,10 @@ #include <VoIPILBCDecoderIntfc.h> #include <VoIPILBCEncoderIntfc.h> -/* AMR helper */ +/* AMR helper */ #include <pjmedia-codec/amr_helper.h> -/* Pack/unpack G.729 frame of S60 DSP codec, taken from: +/* Pack/unpack G.729 frame of S60 DSP codec, taken from: * http://wiki.forum.nokia.com/index.php/TSS000776_-_Payload_conversion_for_G.729_audio_format */ #include "s60_g729_bitstream.h" @@ -70,8 +70,8 @@ static pj_uint8_t vas_g711_frame_len; /* VAS factory */ - -struct vas_factory { +struct vas_factory +{ pjmedia_aud_dev_factory base; pj_pool_t *pool; pj_pool_factory *pf; @@ -80,16 +80,15 @@ struct vas_factory { /* Forward declaration of CPjAudioEngine */ - class CPjAudioEngine; /* VAS stream. */ - -struct vas_stream { +struct vas_stream +{ // Base pjmedia_aud_stream base; /**< Base class. */ - + // Pool pj_pool_t *pool; /**< Memory pool. */ @@ -112,7 +111,7 @@ struct vas_stream { pj_uint16_t rec_buf_len; /**< Record buffer length. */ void *strm_data; /**< Stream data. */ - /* Resampling is needed, in case audio device is opened with clock rate + /* Resampling is needed, in case audio device is opened with clock rate * other than 8kHz (only for PCM format). */ pjmedia_resample *play_resample; /**< Resampler for playback. */ @@ -129,37 +128,38 @@ struct vas_stream { /* Prototypes */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f); -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f); -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f); -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info); -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param); -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm); - -static pj_status_t stream_get_param (pjmedia_aud_stream *strm, - pjmedia_aud_param *param); -static pj_status_t stream_get_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - void *value); -static pj_status_t stream_set_cap (pjmedia_aud_stream *strm, - pjmedia_aud_dev_cap cap, - const void *value); -static pj_status_t stream_start (pjmedia_aud_stream *strm); -static pj_status_t stream_stop (pjmedia_aud_stream *strm); -static pj_status_t stream_destroy (pjmedia_aud_stream *strm); +static pj_status_t factory_init(pjmedia_aud_dev_factory *f); +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f); +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f); +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info); +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param); +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm); + +static pj_status_t stream_get_param(pjmedia_aud_stream *strm, + pjmedia_aud_param *param); +static pj_status_t stream_get_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + void *value); +static pj_status_t stream_set_cap(pjmedia_aud_stream *strm, + pjmedia_aud_dev_cap cap, + const void *value); +static pj_status_t stream_start(pjmedia_aud_stream *strm); +static pj_status_t stream_stop(pjmedia_aud_stream *strm); +static pj_status_t stream_destroy(pjmedia_aud_stream *strm); /* Operations */ -static pjmedia_aud_dev_factory_op factory_op = { +static pjmedia_aud_dev_factory_op factory_op = +{ &factory_init, &factory_destroy, &factory_get_dev_count, @@ -168,7 +168,8 @@ static pjmedia_aud_dev_factory_op factory_op = { &factory_create_stream }; -static pjmedia_aud_stream_op stream_op = { +static pjmedia_aud_stream_op stream_op = +{ &stream_get_param, &stream_get_cap, &stream_set_cap, @@ -185,303 +186,277 @@ static pjmedia_aud_stream_op stream_op = { /* * Utility: print sound device error */ -static void snd_perror (const char *title, TInt rc) +static void snd_perror(const char *title, TInt rc) { - PJ_LOG (1, (THIS_FILE, "%s (error code=%d)", title, rc)); + PJ_LOG(1,(THIS_FILE, "%s (error code=%d)", title, rc)); } -typedef void (*PjAudioCallback) (CVoIPDataBuffer *buf, void *user_data); +typedef void(*PjAudioCallback)(CVoIPDataBuffer *buf, void *user_data); /* * Audio setting for CPjAudioEngine. */ - class CPjAudioSetting { - - public: - TVoIPCodecFormat format; - TInt mode; - TBool plc; - TBool vad; - TBool cng; - TBool loudspk; +public: + TVoIPCodecFormat format; + TInt mode; + TBool plc; + TBool vad; + TBool cng; + TBool loudspk; }; /* * Implementation: Symbian Input & Output Stream. */ - class CPjAudioEngine : public CBase, - public MVoIPDownlinkObserver, - public MVoIPUplinkObserver, - public MVoIPFormatObserver + public MVoIPDownlinkObserver, + public MVoIPUplinkObserver, + public MVoIPFormatObserver { - - public: - enum State { - STATE_NULL, - STATE_STARTING, - STATE_READY, - STATE_STREAMING - }; - - ~CPjAudioEngine(); - - static CPjAudioEngine *NewL (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - - TInt Start(); - void Stop(); - - TInt ActivateSpeaker (TBool active); - - TInt SetVolume (TInt vol) { - return iVoIPDnlink->SetVolume (vol); - } - - TInt GetVolume() { - TInt vol; - iVoIPDnlink->GetVolume (vol); - return vol; - } - - TInt GetMaxVolume() { - TInt vol; - iVoIPDnlink->GetMaxVolume (vol); - return vol; - } - - TInt SetGain (TInt gain) { - return iVoIPUplink->SetGain (gain); - } - - TInt GetGain() { - TInt gain; - iVoIPUplink->GetGain (gain); - return gain; - } - - TInt GetMaxGain() { - TInt gain; - iVoIPUplink->GetMaxGain (gain); - return gain; - } - - private: - CPjAudioEngine (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting); - void ConstructL(); - - TInt InitPlay(); - TInt InitRec(); - - TInt StartPlay(); - TInt StartRec(); - - // From MVoIPDownlinkObserver - virtual void FillBuffer (const CVoIPAudioDownlinkStream& aSrc, - CVoIPDataBuffer* aBuffer); - virtual void Event (const CVoIPAudioDownlinkStream& aSrc, - TInt aEventType, - TInt aError); - - // From MVoIPUplinkObserver - virtual void EmptyBuffer (const CVoIPAudioUplinkStream& aSrc, - CVoIPDataBuffer* aBuffer); - virtual void Event (const CVoIPAudioUplinkStream& aSrc, - TInt aEventType, - TInt aError); - - // From MVoIPFormatObserver - virtual void Event (const CVoIPFormatIntfc& aSrc, TInt aEventType); - - State dn_state_; - State up_state_; - - struct vas_stream *parentStrm_; - CPjAudioSetting setting_; - PjAudioCallback rec_cb_; - PjAudioCallback play_cb_; - void *user_data_; - - // VAS objects - CVoIPUtilityFactory *iFactory; - CVoIPAudioDownlinkStream *iVoIPDnlink; - CVoIPAudioUplinkStream *iVoIPUplink; - CVoIPFormatIntfc *enc_fmt_if; - CVoIPFormatIntfc *dec_fmt_if; +public: + enum State + { + STATE_NULL, + STATE_STARTING, + STATE_READY, + STATE_STREAMING + }; + + ~CPjAudioEngine(); + + static CPjAudioEngine *NewL(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + + TInt Start(); + void Stop(); + + TInt ActivateSpeaker(TBool active); + + TInt SetVolume(TInt vol) { return iVoIPDnlink->SetVolume(vol); } + TInt GetVolume() { TInt vol;iVoIPDnlink->GetVolume(vol);return vol; } + TInt GetMaxVolume() { TInt vol;iVoIPDnlink->GetMaxVolume(vol);return vol; } + + TInt SetGain(TInt gain) { return iVoIPUplink->SetGain(gain); } + TInt GetGain() { TInt gain;iVoIPUplink->GetGain(gain);return gain; } + TInt GetMaxGain() { TInt gain;iVoIPUplink->GetMaxGain(gain);return gain; } + + TBool IsStarted(); + +private: + CPjAudioEngine(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting); + void ConstructL(); + + TInt InitPlay(); + TInt InitRec(); + + TInt StartPlay(); + TInt StartRec(); + + // From MVoIPDownlinkObserver + void FillBuffer(const CVoIPAudioDownlinkStream& aSrc, + CVoIPDataBuffer* aBuffer); + void Event(const CVoIPAudioDownlinkStream& aSrc, + TInt aEventType, + TInt aError); + + // From MVoIPUplinkObserver + void EmptyBuffer(const CVoIPAudioUplinkStream& aSrc, + CVoIPDataBuffer* aBuffer); + void Event(const CVoIPAudioUplinkStream& aSrc, + TInt aEventType, + TInt aError); + + // From MVoIPFormatObserver + void Event(const CVoIPFormatIntfc& aSrc, TInt aEventType); + + State dn_state_; + State up_state_; + struct vas_stream *parentStrm_; + CPjAudioSetting setting_; + PjAudioCallback rec_cb_; + PjAudioCallback play_cb_; + void *user_data_; + + // VAS objects + CVoIPUtilityFactory *iFactory; + CVoIPAudioDownlinkStream *iVoIPDnlink; + CVoIPAudioUplinkStream *iVoIPUplink; + CVoIPFormatIntfc *enc_fmt_if; + CVoIPFormatIntfc *dec_fmt_if; }; -CPjAudioEngine* CPjAudioEngine::NewL (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) +CPjAudioEngine* CPjAudioEngine::NewL(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) { - CPjAudioEngine* self = new (ELeave) CPjAudioEngine (parent_strm, - rec_cb, play_cb, - user_data, - setting); - CleanupStack::PushL (self); + CPjAudioEngine* self = new (ELeave) CPjAudioEngine(parent_strm, + rec_cb, play_cb, + user_data, + setting); + CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop (self); + CleanupStack::Pop(self); return self; } void CPjAudioEngine::ConstructL() { TInt err; - const TVersion ver (1, 0, 0); /* Not really used at this time */ + const TVersion ver(1, 0, 0); /* Not really used at this time */ - err = CVoIPUtilityFactory::CreateFactory (iFactory); - User::LeaveIfError (err); + err = CVoIPUtilityFactory::CreateFactory(iFactory); + User::LeaveIfError(err); if (parentStrm_->param.dir != PJMEDIA_DIR_CAPTURE) { - err = iFactory->CreateDownlinkStream (ver, - CVoIPUtilityFactory::EVoIPCall, - iVoIPDnlink); - User::LeaveIfError (err); + err = iFactory->CreateDownlinkStream(ver, + CVoIPUtilityFactory::EVoIPCall, + iVoIPDnlink); + User::LeaveIfError(err); } if (parentStrm_->param.dir != PJMEDIA_DIR_PLAYBACK) { - err = iFactory->CreateUplinkStream (ver, - CVoIPUtilityFactory::EVoIPCall, - iVoIPUplink); - User::LeaveIfError (err); + err = iFactory->CreateUplinkStream(ver, + CVoIPUtilityFactory::EVoIPCall, + iVoIPUplink); + User::LeaveIfError(err); } } -CPjAudioEngine::CPjAudioEngine (struct vas_stream *parent_strm, - PjAudioCallback rec_cb, - PjAudioCallback play_cb, - void *user_data, - const CPjAudioSetting &setting) - : dn_state_ (STATE_NULL), - up_state_ (STATE_NULL), - parentStrm_ (parent_strm), - setting_ (setting), - rec_cb_ (rec_cb), - play_cb_ (play_cb), - user_data_ (user_data), - iFactory (NULL), - iVoIPDnlink (NULL), - iVoIPUplink (NULL), - enc_fmt_if (NULL), - dec_fmt_if (NULL) +CPjAudioEngine::CPjAudioEngine(struct vas_stream *parent_strm, + PjAudioCallback rec_cb, + PjAudioCallback play_cb, + void *user_data, + const CPjAudioSetting &setting) + : dn_state_(STATE_NULL), + up_state_(STATE_NULL), + parentStrm_(parent_strm), + setting_(setting), + rec_cb_(rec_cb), + play_cb_(play_cb), + user_data_(user_data), + iFactory(NULL), + iVoIPDnlink(NULL), + iVoIPUplink(NULL), + enc_fmt_if(NULL), + dec_fmt_if(NULL) { } CPjAudioEngine::~CPjAudioEngine() { Stop(); - + if (iVoIPUplink) - iVoIPUplink->Close(); - + iVoIPUplink->Close(); + if (iVoIPDnlink) - iVoIPDnlink->Close(); + iVoIPDnlink->Close(); delete iVoIPDnlink; - delete iVoIPUplink; - delete iFactory; + + TRACE_((THIS_FILE, "Sound device destroyed")); +} - TRACE_ ( (THIS_FILE, "Sound device destroyed")); +TBool CPjAudioEngine::IsStarted() +{ + return ((((parentStrm_->param.dir & PJMEDIA_DIR_CAPTURE) == 0) || + up_state_ == STATE_STREAMING) && + (((parentStrm_->param.dir & PJMEDIA_DIR_PLAYBACK) == 0) || + dn_state_ == STATE_STREAMING)); } TInt CPjAudioEngine::InitPlay() { TInt err; - pj_assert (iVoIPDnlink); - - err = iVoIPDnlink->SetFormat (setting_.format, dec_fmt_if); + pj_assert(iVoIPDnlink); + err = iVoIPDnlink->SetFormat(setting_.format, dec_fmt_if); if (err != KErrNone) - return err; - - err = dec_fmt_if->SetObserver (*this); - + return err; + + err = dec_fmt_if->SetObserver(*this); if (err != KErrNone) - return err; + return err; - return iVoIPDnlink->Open (*this); + return iVoIPDnlink->Open(*this); } TInt CPjAudioEngine::InitRec() { TInt err; + + pj_assert(iVoIPUplink); - pj_assert (iVoIPUplink); - - err = iVoIPUplink->SetFormat (setting_.format, enc_fmt_if); - + err = iVoIPUplink->SetFormat(setting_.format, enc_fmt_if); if (err != KErrNone) - return err; - - err = enc_fmt_if->SetObserver (*this); - + return err; + + err = enc_fmt_if->SetObserver(*this); if (err != KErrNone) - return err; - - return iVoIPUplink->Open (*this); + return err; + + return iVoIPUplink->Open(*this); } TInt CPjAudioEngine::StartPlay() { TInt err; - - pj_assert (iVoIPDnlink); - pj_assert (dn_state_ == STATE_READY); + + pj_assert(iVoIPDnlink); + pj_assert(dn_state_ == STATE_READY); /* Configure specific codec setting */ - switch (setting_.format) { - - case EG711: { - CVoIPG711DecoderIntfc *g711dec_if = (CVoIPG711DecoderIntfc*) - dec_fmt_if; - err = g711dec_if->SetMode ( (CVoIPFormatIntfc::TG711CodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - case EILBC: { - CVoIPILBCDecoderIntfc *ilbcdec_if = (CVoIPILBCDecoderIntfc*) - dec_fmt_if; - err = ilbcdec_if->SetMode ( (CVoIPFormatIntfc::TILBCCodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - default: - break; + case EG711: + { + CVoIPG711DecoderIntfc *g711dec_if = (CVoIPG711DecoderIntfc*) + dec_fmt_if; + err = g711dec_if->SetMode((CVoIPFormatIntfc::TG711CodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + case EILBC: + { + CVoIPILBCDecoderIntfc *ilbcdec_if = (CVoIPILBCDecoderIntfc*) + dec_fmt_if; + err = ilbcdec_if->SetMode((CVoIPFormatIntfc::TILBCCodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + default: + break; } - + /* Configure audio routing */ - ActivateSpeaker (setting_.loudspk); + ActivateSpeaker(setting_.loudspk); /* Start player */ err = iVoIPDnlink->Start(); - + if (err == KErrNone) { - dn_state_ = STATE_STREAMING; - TRACE_ ( (THIS_FILE, "Downlink started")); + dn_state_ = STATE_STREAMING; + TRACE_((THIS_FILE, "Downlink started")); } else { - snd_perror ("Failed starting downlink", err); + snd_perror("Failed starting downlink", err); } return err; @@ -490,49 +465,47 @@ TInt CPjAudioEngine::StartPlay() TInt CPjAudioEngine::StartRec() { TInt err; - - pj_assert (iVoIPUplink); - pj_assert (up_state_ == STATE_READY); + + pj_assert(iVoIPUplink); + pj_assert(up_state_ == STATE_READY); /* Configure specific codec setting */ - switch (setting_.format) { - - case EG711: { - CVoIPG711EncoderIntfc *g711enc_if = (CVoIPG711EncoderIntfc*) - enc_fmt_if; - err = g711enc_if->SetMode ( (CVoIPFormatIntfc::TG711CodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - case EILBC: { - CVoIPILBCEncoderIntfc *ilbcenc_if = (CVoIPILBCEncoderIntfc*) - enc_fmt_if; - err = ilbcenc_if->SetMode ( (CVoIPFormatIntfc::TILBCCodecMode) - setting_.mode); - pj_assert (err == KErrNone); - } - - break; - - default: - break; + case EG711: + { + CVoIPG711EncoderIntfc *g711enc_if = (CVoIPG711EncoderIntfc*) + enc_fmt_if; + err = g711enc_if->SetMode((CVoIPFormatIntfc::TG711CodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + case EILBC: + { + CVoIPILBCEncoderIntfc *ilbcenc_if = (CVoIPILBCEncoderIntfc*) + enc_fmt_if; + err = ilbcenc_if->SetMode((CVoIPFormatIntfc::TILBCCodecMode) + setting_.mode); + pj_assert(err == KErrNone); + } + break; + + default: + break; } - + /* Configure general codec setting */ - enc_fmt_if->SetVAD (setting_.vad); - + enc_fmt_if->SetVAD(setting_.vad); + /* Start recorder */ err = iVoIPUplink->Start(); - + if (err == KErrNone) { - up_state_ = STATE_STREAMING; - TRACE_ ( (THIS_FILE, "Uplink started")); + up_state_ = STATE_STREAMING; + TRACE_((THIS_FILE, "Uplink started")); } else { - snd_perror ("Failed starting uplink", err); + snd_perror("Failed starting uplink", err); } return err; @@ -541,49 +514,37 @@ TInt CPjAudioEngine::StartRec() TInt CPjAudioEngine::Start() { TInt err = KErrNone; - + if (iVoIPDnlink) { - switch (dn_state_) { - - case STATE_READY: - err = StartPlay(); - break; - - case STATE_NULL: - err = InitPlay(); - - if (err != KErrNone) - return err; - - dn_state_ = STATE_STARTING; - - break; - - default: - break; - } + switch(dn_state_) { + case STATE_READY: + err = StartPlay(); + break; + case STATE_NULL: + err = InitPlay(); + if (err != KErrNone) + return err; + dn_state_ = STATE_STARTING; + break; + default: + break; + } } - + if (iVoIPUplink) { - switch (up_state_) { - - case STATE_READY: - err = StartRec(); - break; - - case STATE_NULL: - err = InitRec(); - - if (err != KErrNone) - return err; - - up_state_ = STATE_STARTING; - - break; - - default: - break; - } + switch(up_state_) { + case STATE_READY: + err = StartRec(); + break; + case STATE_NULL: + err = InitRec(); + if (err != KErrNone) + return err; + up_state_ = STATE_STARTING; + break; + default: + break; + } } return err; @@ -592,147 +553,134 @@ TInt CPjAudioEngine::Start() void CPjAudioEngine::Stop() { if (iVoIPDnlink) { - switch (dn_state_) { - - case STATE_STREAMING: - iVoIPDnlink->Stop(); - dn_state_ = STATE_READY; - break; - - case STATE_STARTING: - dn_state_ = STATE_NULL; - break; - - default: - break; - } + switch(dn_state_) { + case STATE_STREAMING: + iVoIPDnlink->Stop(); + dn_state_ = STATE_READY; + break; + case STATE_STARTING: + dn_state_ = STATE_NULL; + break; + default: + break; + } } if (iVoIPUplink) { - switch (up_state_) { - - case STATE_STREAMING: - iVoIPUplink->Stop(); - up_state_ = STATE_READY; - break; - - case STATE_STARTING: - up_state_ = STATE_NULL; - break; - - default: - break; - } + switch(up_state_) { + case STATE_STREAMING: + iVoIPUplink->Stop(); + up_state_ = STATE_READY; + break; + case STATE_STARTING: + up_state_ = STATE_NULL; + break; + default: + break; + } } } -TInt CPjAudioEngine::ActivateSpeaker (TBool active) +TInt CPjAudioEngine::ActivateSpeaker(TBool active) { TInt err = KErrNotSupported; - + if (iVoIPDnlink) { - err = iVoIPDnlink->SetAudioDevice (active? - CVoIPAudioDownlinkStream::ELoudSpeaker : - CVoIPAudioDownlinkStream::EHandset); - TRACE_ ( (THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); + err = iVoIPDnlink->SetAudioDevice(active? + CVoIPAudioDownlinkStream::ELoudSpeaker : + CVoIPAudioDownlinkStream::EHandset); + TRACE_((THIS_FILE, "Loudspeaker turned %s", (active? "on":"off"))); } - + return err; } // Callback from MVoIPDownlinkObserver -void CPjAudioEngine::FillBuffer (const CVoIPAudioDownlinkStream& aSrc, - CVoIPDataBuffer* aBuffer) +void CPjAudioEngine::FillBuffer(const CVoIPAudioDownlinkStream& aSrc, + CVoIPDataBuffer* aBuffer) { - play_cb_ (aBuffer, user_data_); - iVoIPDnlink->BufferFilled (aBuffer); + play_cb_(aBuffer, user_data_); + iVoIPDnlink->BufferFilled(aBuffer); } // Callback from MVoIPUplinkObserver -void CPjAudioEngine::EmptyBuffer (const CVoIPAudioUplinkStream& aSrc, - CVoIPDataBuffer* aBuffer) +void CPjAudioEngine::EmptyBuffer(const CVoIPAudioUplinkStream& aSrc, + CVoIPDataBuffer* aBuffer) { - rec_cb_ (aBuffer, user_data_); - iVoIPUplink->BufferEmptied (aBuffer); + rec_cb_(aBuffer, user_data_); + iVoIPUplink->BufferEmptied(aBuffer); } // Callback from MVoIPDownlinkObserver -void CPjAudioEngine::Event (const CVoIPAudioDownlinkStream& /*aSrc*/, - TInt aEventType, - TInt aError) +void CPjAudioEngine::Event(const CVoIPAudioDownlinkStream& /*aSrc*/, + TInt aEventType, + TInt aError) { switch (aEventType) { - - case MVoIPDownlinkObserver::KOpenComplete: - - if (aError == KErrNone) { - State last_state = dn_state_; - - dn_state_ = STATE_READY; - TRACE_ ( (THIS_FILE, "Downlink opened")); - - if (last_state == STATE_STARTING) - StartPlay(); - } - - break; - - case MVoIPDownlinkObserver::KDownlinkClosed: - dn_state_ = STATE_NULL; - TRACE_ ( (THIS_FILE, "Downlink closed")); - break; - - case MVoIPDownlinkObserver::KDownlinkError: - dn_state_ = STATE_READY; - snd_perror ("Downlink problem", aError); - break; - - default: - break; + case MVoIPDownlinkObserver::KOpenComplete: + if (aError == KErrNone) { + State last_state = dn_state_; + + dn_state_ = STATE_READY; + TRACE_((THIS_FILE, "Downlink opened")); + + if (last_state == STATE_STARTING) + StartPlay(); + } + break; + + case MVoIPDownlinkObserver::KDownlinkClosed: + dn_state_ = STATE_NULL; + TRACE_((THIS_FILE, "Downlink closed")); + break; + + case MVoIPDownlinkObserver::KDownlinkError: + dn_state_ = STATE_READY; + snd_perror("Downlink problem", aError); + break; + default: + break; } } // Callback from MVoIPUplinkObserver -void CPjAudioEngine::Event (const CVoIPAudioUplinkStream& /*aSrc*/, - TInt aEventType, - TInt aError) +void CPjAudioEngine::Event(const CVoIPAudioUplinkStream& /*aSrc*/, + TInt aEventType, + TInt aError) { switch (aEventType) { - - case MVoIPUplinkObserver::KOpenComplete: - - if (aError == KErrNone) { - State last_state = up_state_; - - up_state_ = STATE_READY; - TRACE_ ( (THIS_FILE, "Uplink opened")); - - if (last_state == STATE_STARTING) - StartRec(); - } - - break; - - case MVoIPUplinkObserver::KUplinkClosed: - up_state_ = STATE_NULL; - TRACE_ ( (THIS_FILE, "Uplink closed")); - break; - - case MVoIPUplinkObserver::KUplinkError: - up_state_ = STATE_READY; - snd_perror ("Uplink problem", aError); - break; - - default: - break; + case MVoIPUplinkObserver::KOpenComplete: + if (aError == KErrNone) { + State last_state = up_state_; + + up_state_ = STATE_READY; + TRACE_((THIS_FILE, "Uplink opened")); + + if (last_state == STATE_STARTING) + StartRec(); + } + break; + + case MVoIPUplinkObserver::KUplinkClosed: + up_state_ = STATE_NULL; + TRACE_((THIS_FILE, "Uplink closed")); + break; + + case MVoIPUplinkObserver::KUplinkError: + up_state_ = STATE_READY; + snd_perror("Uplink problem", aError); + break; + default: + break; } } // Callback from MVoIPFormatObserver -void CPjAudioEngine::Event (const CVoIPFormatIntfc& /*aSrc*/, - TInt /*aEventType*/) +void CPjAudioEngine::Event(const CVoIPFormatIntfc& /*aSrc*/, + TInt aEventType) { + snd_perror("Format event", aEventType); } /**************************************************************************** @@ -741,101 +689,89 @@ void CPjAudioEngine::Event (const CVoIPFormatIntfc& /*aSrc*/, #ifdef USE_NATIVE_PCM -static void RecCbPcm2 (CVoIPDataBuffer *buf, void *user_data) +static void RecCbPcm2(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); pj_int16_t *p_buf; unsigned buf_len; /* Get the buffer */ - buf->GetPayloadPtr (buffer); - + buf->GetPayloadPtr(buffer); + /* Call parent callback */ p_buf = (pj_int16_t*) buffer.Ptr(); buf_len = buffer.Length() >> 1; - while (buf_len) { - unsigned req; - - req = strm->param.samples_per_frame - strm->rec_buf_len; - - if (req > buf_len) - req = buf_len; - - pjmedia_copy_samples (strm->rec_buf + strm->rec_buf_len, p_buf, req); - - p_buf += req; - - buf_len -= req; - - strm->rec_buf_len += req; - - if (strm->rec_buf_len >= strm->param.samples_per_frame) { - pjmedia_frame f; - - f.buf = strm->rec_buf; - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - f.size = strm->param.samples_per_frame << 1; - strm->rec_cb (strm->user_data, &f); - strm->rec_buf_len = 0; - } + unsigned req; + + req = strm->param.samples_per_frame - strm->rec_buf_len; + if (req > buf_len) + req = buf_len; + pjmedia_copy_samples(strm->rec_buf + strm->rec_buf_len, p_buf, req); + p_buf += req; + buf_len -= req; + strm->rec_buf_len += req; + + if (strm->rec_buf_len >= strm->param.samples_per_frame) { + pjmedia_frame f; + + f.buf = strm->rec_buf; + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.size = strm->param.samples_per_frame << 1; + strm->rec_cb(strm->user_data, &f); + strm->rec_buf_len = 0; + } } } -static void PlayCbPcm2 (CVoIPDataBuffer *buf, void *user_data) +static void PlayCbPcm2(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); pjmedia_frame f; /* Get the buffer */ - buf->GetPayloadPtr (buffer); + buf->GetPayloadPtr(buffer); /* Call parent callback */ f.buf = strm->play_buf; f.size = strm->param.samples_per_frame << 1; - strm->play_cb (strm->user_data, &f); - + strm->play_cb(strm->user_data, &f); if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { - pjmedia_zero_samples ( (pj_int16_t*) f.buf, - strm->param.samples_per_frame); + pjmedia_zero_samples((pj_int16_t*)f.buf, + strm->param.samples_per_frame); } - f.size = strm->param.samples_per_frame << 1; /* Init buffer attributes and header. */ buffer.Zero(); - buffer.Append ( (TUint8*) f.buf, f.size); + buffer.Append((TUint8*)f.buf, f.size); /* Set the buffer */ - buf->SetPayloadPtr (buffer); + buf->SetPayloadPtr(buffer); } #else // not USE_NATIVE_PCM -static void RecCbPcm (CVoIPDataBuffer *buf, void *user_data) +static void RecCbPcm(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); - + buf->GetPayloadPtr(buffer); + /* Buffer has to contain normal speech. */ - pj_assert (buffer[0] == 1 && buffer[1] == 0); + pj_assert(buffer[0] == 1 && buffer[1] == 0); /* Detect the recorder G.711 frame size, player frame size will follow * this recorder frame size. */ - if (vas_g711_frame_len == 0) { - vas_g711_frame_len = buffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected VAS G.711 frame size = %u samples", - vas_g711_frame_len)); + vas_g711_frame_len = buffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected VAS G.711 frame size = %u samples", + vas_g711_frame_len)); } /* Decode VAS buffer (coded in G.711) and put the PCM result into rec_buf. @@ -844,539 +780,511 @@ static void RecCbPcm (CVoIPDataBuffer *buf, void *user_data) unsigned samples_processed = 0; while (samples_processed < vas_g711_frame_len) { - unsigned samples_to_process; - unsigned samples_req; - - samples_to_process = vas_g711_frame_len - samples_processed; - samples_req = (strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) - - strm->rec_buf_len; - - if (samples_to_process > samples_req) - samples_to_process = samples_req; - - pjmedia_ulaw_decode (&strm->rec_buf[strm->rec_buf_len], - buffer.Ptr() + 2 + samples_processed, - samples_to_process); - - strm->rec_buf_len += samples_to_process; - - samples_processed += samples_to_process; - - /* Buffer is full, time to call parent callback */ - if (strm->rec_buf_len == strm->param.samples_per_frame / - strm->param.channel_count / - strm->resample_factor) { - pjmedia_frame f; - - /* Need to resample clock rate? */ - - if (strm->rec_resample) { - unsigned resampled = 0; - - while (resampled < strm->rec_buf_len) { - pjmedia_resample_run (strm->rec_resample, - &strm->rec_buf[resampled], - strm->pcm_buf + - resampled * strm->resample_factor); - resampled += 80; - } - - f.buf = strm->pcm_buf; - } else { - f.buf = strm->rec_buf; - } - - /* Need to convert channel count? */ - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_1ton ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame / - strm->param.channel_count, - 0); - } - - /* Call parent callback */ - f.type = PJMEDIA_FRAME_TYPE_AUDIO; - - f.size = strm->param.samples_per_frame << 1; - - strm->rec_cb (strm->user_data, &f); - - strm->rec_buf_len = 0; - } + unsigned samples_to_process; + unsigned samples_req; + + samples_to_process = vas_g711_frame_len - samples_processed; + samples_req = (strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) - + strm->rec_buf_len; + if (samples_to_process > samples_req) + samples_to_process = samples_req; + + pjmedia_ulaw_decode(&strm->rec_buf[strm->rec_buf_len], + buffer.Ptr() + 2 + samples_processed, + samples_to_process); + + strm->rec_buf_len += samples_to_process; + samples_processed += samples_to_process; + + /* Buffer is full, time to call parent callback */ + if (strm->rec_buf_len == strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor) + { + pjmedia_frame f; + + /* Need to resample clock rate? */ + if (strm->rec_resample) { + unsigned resampled = 0; + + while (resampled < strm->rec_buf_len) { + pjmedia_resample_run(strm->rec_resample, + &strm->rec_buf[resampled], + strm->pcm_buf + + resampled * strm->resample_factor); + resampled += 80; + } + f.buf = strm->pcm_buf; + } else { + f.buf = strm->rec_buf; + } + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_1ton((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame / + strm->param.channel_count, + 0); + } + + /* Call parent callback */ + f.type = PJMEDIA_FRAME_TYPE_AUDIO; + f.size = strm->param.samples_per_frame << 1; + strm->rec_cb(strm->user_data, &f); + strm->rec_buf_len = 0; + } } } #endif // USE_NATIVE_PCM -static void PlayCbPcm (CVoIPDataBuffer *buf, void *user_data) +static void PlayCbPcm(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; unsigned g711_frame_len = vas_g711_frame_len; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); + buf->GetPayloadPtr(buffer); /* Init buffer attributes and header. */ buffer.Zero(); - buffer.Append (1); - buffer.Append (0); + buffer.Append(1); + buffer.Append(0); /* Assume frame size is 10ms if frame size hasn't been known. */ - if (g711_frame_len == 0) - g711_frame_len = 80; + g711_frame_len = 80; /* Call parent stream callback to get PCM samples to play, * encode the PCM samples into G.711 and put it into VAS buffer. */ unsigned samples_processed = 0; - + while (samples_processed < g711_frame_len) { - /* Need more samples to play, time to call parent callback */ - if (strm->play_buf_len == 0) { - pjmedia_frame f; - unsigned samples_got; - - f.size = strm->param.samples_per_frame << 1; - - if (strm->play_resample || strm->param.channel_count != 1) - f.buf = strm->pcm_buf; - else - f.buf = strm->play_buf; - - /* Call parent callback */ - strm->play_cb (strm->user_data, &f); - - if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { - pjmedia_zero_samples ( (pj_int16_t*) f.buf, - strm->param.samples_per_frame); - } - - samples_got = strm->param.samples_per_frame / - - strm->param.channel_count / - strm->resample_factor; - - /* Need to convert channel count? */ - - if (strm->param.channel_count != 1) { - pjmedia_convert_channel_nto1 ( (pj_int16_t*) f.buf, - (pj_int16_t*) f.buf, - strm->param.channel_count, - strm->param.samples_per_frame, - PJ_FALSE, - 0); - } - - /* Need to resample clock rate? */ - if (strm->play_resample) { - unsigned resampled = 0; - - while (resampled < samples_got) { - pjmedia_resample_run (strm->play_resample, - strm->pcm_buf + - resampled * strm->resample_factor, - &strm->play_buf[resampled]); - resampled += 80; - } - } - - strm->play_buf_len = samples_got; - - strm->play_buf_start = 0; - } - - unsigned tmp; - - tmp = PJ_MIN (strm->play_buf_len, g711_frame_len - samples_processed); - pjmedia_ulaw_encode ( (pj_uint8_t*) &strm->play_buf[strm->play_buf_start], - &strm->play_buf[strm->play_buf_start], - tmp); - buffer.Append ( (TUint8*) &strm->play_buf[strm->play_buf_start], tmp); - samples_processed += tmp; - strm->play_buf_len -= tmp; - strm->play_buf_start += tmp; + /* Need more samples to play, time to call parent callback */ + if (strm->play_buf_len == 0) { + pjmedia_frame f; + unsigned samples_got; + + f.size = strm->param.samples_per_frame << 1; + if (strm->play_resample || strm->param.channel_count != 1) + f.buf = strm->pcm_buf; + else + f.buf = strm->play_buf; + + /* Call parent callback */ + strm->play_cb(strm->user_data, &f); + if (f.type != PJMEDIA_FRAME_TYPE_AUDIO) { + pjmedia_zero_samples((pj_int16_t*)f.buf, + strm->param.samples_per_frame); + } + + samples_got = strm->param.samples_per_frame / + strm->param.channel_count / + strm->resample_factor; + + /* Need to convert channel count? */ + if (strm->param.channel_count != 1) { + pjmedia_convert_channel_nto1((pj_int16_t*)f.buf, + (pj_int16_t*)f.buf, + strm->param.channel_count, + strm->param.samples_per_frame, + PJ_FALSE, + 0); + } + + /* Need to resample clock rate? */ + if (strm->play_resample) { + unsigned resampled = 0; + + while (resampled < samples_got) + { + pjmedia_resample_run(strm->play_resample, + strm->pcm_buf + + resampled * strm->resample_factor, + &strm->play_buf[resampled]); + resampled += 80; + } + } + + strm->play_buf_len = samples_got; + strm->play_buf_start = 0; + } + + unsigned tmp; + + tmp = PJ_MIN(strm->play_buf_len, g711_frame_len - samples_processed); + pjmedia_ulaw_encode((pj_uint8_t*)&strm->play_buf[strm->play_buf_start], + &strm->play_buf[strm->play_buf_start], + tmp); + buffer.Append((TUint8*)&strm->play_buf[strm->play_buf_start], tmp); + samples_processed += tmp; + strm->play_buf_len -= tmp; + strm->play_buf_start += tmp; } /* Set the buffer */ - buf->SetPayloadPtr (buffer); + buf->SetPayloadPtr(buffer); } /**************************************************************************** * Internal VAS callbacks for non-PCM format */ -static void RecCb (CVoIPDataBuffer *buf, void *user_data) +static void RecCb(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->rec_buf; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); - - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - const pj_uint8_t *p = (const pj_uint8_t*) buffer.Ptr() + 1; - unsigned len = buffer.Length() - 1; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, 160); - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - /* Check if we got a normal or SID frame. */ - if (buffer[0] != 0) { - enum { NORMAL_LEN = 22, SID_LEN = 8 }; - TBitStream *bitstream = (TBitStream*) strm->strm_data; - unsigned src_len = buffer.Length()- 2; - - pj_assert (src_len == NORMAL_LEN || src_len == SID_LEN); - - const TDesC8& p = bitstream->CompressG729Frame ( - buffer.Right (src_len), - src_len == SID_LEN); - - pjmedia_frame_ext_append_subframe (frame, p.Ptr(), - p.Length() << 3, 80); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, 80); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - unsigned samples_got; - - samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; - - /* Check if we got a normal or SID frame. */ - - if (buffer[0] != 0) { - const pj_uint8_t *p = (const pj_uint8_t*) buffer.Ptr() + 2; - unsigned len = buffer.Length() - 2; - - pjmedia_frame_ext_append_subframe (frame, p, len << 3, - samples_got); - } else { /* We got null frame. */ - pjmedia_frame_ext_append_subframe (frame, NULL, 0, samples_got); - } - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_processed = 0; - - /* Make sure it is normal frame. */ - pj_assert (buffer[0] == 1 && buffer[1] == 0); - - /* Detect the recorder G.711 frame size, player frame size will - * follow this recorder frame size. - */ - - if (vas_g711_frame_len == 0) { - vas_g711_frame_len = buffer.Length() < 160? 80 : 160; - TRACE_ ( (THIS_FILE, "Detected VAS G.711 frame size = %u samples", - vas_g711_frame_len)); - } - - /* Convert VAS buffer format into pjmedia_frame_ext. Whenever - * samples count in the frame is equal to stream's samples per - * frame, call parent stream callback. - */ - while (samples_processed < vas_g711_frame_len) { - unsigned tmp; - const pj_uint8_t *pb = (const pj_uint8_t*) buffer.Ptr() + - 2 + samples_processed; - - tmp = PJ_MIN (strm->param.samples_per_frame - frame->samples_cnt, - vas_g711_frame_len - samples_processed); - - pjmedia_frame_ext_append_subframe (frame, pb, tmp << 3, tmp); - samples_processed += tmp; - - if (frame->samples_cnt == strm->param.samples_per_frame) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->rec_cb (strm->user_data, (pjmedia_frame*) frame); - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + buf->GetPayloadPtr(buffer); + + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + const pj_uint8_t *p = (const pj_uint8_t*)buffer.Ptr() + 1; + unsigned len = buffer.Length() - 1; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, 160); + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + /* Check if we got a normal or SID frame. */ + if (buffer[0] != 0) { + enum { NORMAL_LEN = 22, SID_LEN = 8 }; + TBitStream *bitstream = (TBitStream*)strm->strm_data; + unsigned src_len = buffer.Length()- 2; + + pj_assert(src_len == NORMAL_LEN || src_len == SID_LEN); + + const TDesC8& p = bitstream->CompressG729Frame( + buffer.Right(src_len), + src_len == SID_LEN); + + pjmedia_frame_ext_append_subframe(frame, p.Ptr(), + p.Length() << 3, 80); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, 80); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + unsigned samples_got; + + samples_got = strm->param.ext_fmt.bitrate == 15200? 160 : 240; + + /* Check if we got a normal or SID frame. */ + if (buffer[0] != 0) { + const pj_uint8_t *p = (const pj_uint8_t*)buffer.Ptr() + 2; + unsigned len = buffer.Length() - 2; + + pjmedia_frame_ext_append_subframe(frame, p, len << 3, + samples_got); + } else { /* We got null frame. */ + pjmedia_frame_ext_append_subframe(frame, NULL, 0, samples_got); + } + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_processed = 0; + + /* Make sure it is normal frame. */ + pj_assert(buffer[0] == 1 && buffer[1] == 0); + + /* Detect the recorder G.711 frame size, player frame size will + * follow this recorder frame size. + */ + if (vas_g711_frame_len == 0) { + vas_g711_frame_len = buffer.Length() < 160? 80 : 160; + TRACE_((THIS_FILE, "Detected VAS G.711 frame size = %u samples", + vas_g711_frame_len)); + } + + /* Convert VAS buffer format into pjmedia_frame_ext. Whenever + * samples count in the frame is equal to stream's samples per + * frame, call parent stream callback. + */ + while (samples_processed < vas_g711_frame_len) { + unsigned tmp; + const pj_uint8_t *pb = (const pj_uint8_t*)buffer.Ptr() + + 2 + samples_processed; + + tmp = PJ_MIN(strm->param.samples_per_frame - frame->samples_cnt, + vas_g711_frame_len - samples_processed); + + pjmedia_frame_ext_append_subframe(frame, pb, tmp << 3, tmp); + samples_processed += tmp; + + if (frame->samples_cnt == strm->param.samples_per_frame) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->rec_cb(strm->user_data, (pjmedia_frame*)frame); + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } } -static void PlayCb (CVoIPDataBuffer *buf, void *user_data) +static void PlayCb(CVoIPDataBuffer *buf, void *user_data) { - struct vas_stream *strm = (struct vas_stream*) user_data; pjmedia_frame_ext *frame = (pjmedia_frame_ext*) strm->play_buf; - TPtr8 buffer (0, 0, 0); + TPtr8 buffer(0, 0, 0); /* Get the buffer */ - buf->GetPayloadPtr (buffer); + buf->GetPayloadPtr(buffer); /* Init buffer attributes and header. */ buffer.Zero(); - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_AMR: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - /* AMR header for VAS is one byte, the format (may be!): - * 0xxxxy00, where xxxx:frame type, y:not sure. - */ - unsigned len = (sf->bitlen+7) >>3; - enum {SID_FT = 8 }; - pj_uint8_t amr_header = 4, ft = SID_FT; - - if (len >= pjmedia_codec_amrnb_framelen[0]) - ft = pjmedia_codec_amr_get_mode2 (PJ_TRUE, len); - - amr_header |= ft << 3; - - buffer.Append (amr_header); - - buffer.Append ( (TUint8*) sf->data, len); - } else { - buffer.Append (0); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buffer.Append (0); - - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - - break; - - case PJMEDIA_FORMAT_G729: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - enum { NORMAL_LEN = 10, SID_LEN = 2 }; - pj_bool_t sid_frame = ( (sf->bitlen >> 3) == SID_LEN); - TBitStream *bitstream = (TBitStream*) strm->strm_data; - const TPtrC8 src (sf->data, sf->bitlen>>3); - const TDesC8 &dst = bitstream->ExpandG729Frame (src, - sid_frame); - - if (sid_frame) { - buffer.Append (2); - buffer.Append (0); - } else { - buffer.Append (1); - buffer.Append (0); - } - - buffer.Append (dst); - } else { - buffer.Append (2); - buffer.Append (0); - - buffer.AppendFill (0, 22); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - buffer.Append (2); - buffer.Append (0); - - buffer.AppendFill (0, 22); - } - } - - break; - - case PJMEDIA_FORMAT_ILBC: { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - pj_assert ( (strm->param.ext_fmt.bitrate == 15200 && - samples_cnt == 160) || - (strm->param.ext_fmt.bitrate != 15200 && - samples_cnt == 240)); - - if (sf->data && sf->bitlen) { - buffer.Append (1); - buffer.Append (0); - buffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - unsigned frame_len; - - buffer.Append (1); - buffer.Append (0); - - /* VAS iLBC frame is 20ms or 30ms */ - frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; - buffer.AppendFill (0, frame_len); - } - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - - unsigned frame_len; - - buffer.Append (1); - buffer.Append (0); - - /* VAS iLBC frame is 20ms or 30ms */ - frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; - buffer.AppendFill (0, frame_len); - - } - } - - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: { - unsigned samples_ready = 0; - unsigned samples_req = vas_g711_frame_len; - - /* Assume frame size is 10ms if frame size hasn't been known. */ - - if (samples_req == 0) - samples_req = 80; - - buffer.Append (1); - - buffer.Append (0); - - /* Call parent stream callback to get samples to play. */ - while (samples_ready < samples_req) { - if (frame->samples_cnt == 0) { - frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; - strm->play_cb (strm->user_data, (pjmedia_frame*) frame); - pj_assert (frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || - frame->base.type==PJMEDIA_FRAME_TYPE_NONE); - } - - if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { - pjmedia_frame_ext_subframe *sf; - unsigned samples_cnt; - - sf = pjmedia_frame_ext_get_subframe (frame, 0); - samples_cnt = frame->samples_cnt / frame->subframe_cnt; - - if (sf->data && sf->bitlen) { - buffer.Append ( (TUint8*) sf->data, sf->bitlen>>3); - } else { - pj_uint8_t silc; - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buffer.AppendFill (silc, samples_cnt); - } - - samples_ready += samples_cnt; - - pjmedia_frame_ext_pop_subframes (frame, 1); - - } else { /* PJMEDIA_FRAME_TYPE_NONE */ - pj_uint8_t silc; - - silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU) ? - pjmedia_linear2ulaw (0) : pjmedia_linear2alaw (0); - buffer.AppendFill (silc, samples_req - samples_ready); - - samples_ready = samples_req; - frame->samples_cnt = 0; - frame->subframe_cnt = 0; - } - } - } - - break; - - default: - break; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_AMR: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + /* AMR header for VAS is one byte, the format (may be!): + * 0xxxxy00, where xxxx:frame type, y:not sure. + */ + unsigned len = (sf->bitlen+7)>>3; + enum {SID_FT = 8 }; + pj_uint8_t amr_header = 4, ft = SID_FT; + + if (len >= pjmedia_codec_amrnb_framelen[0]) + ft = pjmedia_codec_amr_get_mode2(PJ_TRUE, len); + + amr_header |= ft << 3; + buffer.Append(amr_header); + + buffer.Append((TUint8*)sf->data, len); + } else { + buffer.Append(0); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buffer.Append(0); + + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + break; + + case PJMEDIA_FORMAT_G729: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + if (sf->data && sf->bitlen) { + enum { NORMAL_LEN = 10, SID_LEN = 2 }; + pj_bool_t sid_frame = ((sf->bitlen >> 3) == SID_LEN); + TBitStream *bitstream = (TBitStream*)strm->strm_data; + const TPtrC8 src(sf->data, sf->bitlen>>3); + const TDesC8 &dst = bitstream->ExpandG729Frame(src, + sid_frame); + if (sid_frame) { + buffer.Append(2); + buffer.Append(0); + } else { + buffer.Append(1); + buffer.Append(0); + } + buffer.Append(dst); + } else { + buffer.Append(2); + buffer.Append(0); + + buffer.AppendFill(0, 22); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + buffer.Append(2); + buffer.Append(0); + + buffer.AppendFill(0, 22); + } + } + break; + + case PJMEDIA_FORMAT_ILBC: + { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + + pj_assert((strm->param.ext_fmt.bitrate == 15200 && + samples_cnt == 160) || + (strm->param.ext_fmt.bitrate != 15200 && + samples_cnt == 240)); + + if (sf->data && sf->bitlen) { + buffer.Append(1); + buffer.Append(0); + buffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + unsigned frame_len; + + buffer.Append(1); + buffer.Append(0); + + /* VAS iLBC frame is 20ms or 30ms */ + frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; + buffer.AppendFill(0, frame_len); + } + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + + unsigned frame_len; + + buffer.Append(1); + buffer.Append(0); + + /* VAS iLBC frame is 20ms or 30ms */ + frame_len = strm->param.ext_fmt.bitrate == 15200? 38 : 50; + buffer.AppendFill(0, frame_len); + + } + } + break; + + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + { + unsigned samples_ready = 0; + unsigned samples_req = vas_g711_frame_len; + + /* Assume frame size is 10ms if frame size hasn't been known. */ + if (samples_req == 0) + samples_req = 80; + + buffer.Append(1); + buffer.Append(0); + + /* Call parent stream callback to get samples to play. */ + while (samples_ready < samples_req) { + if (frame->samples_cnt == 0) { + frame->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; + strm->play_cb(strm->user_data, (pjmedia_frame*)frame); + pj_assert(frame->base.type==PJMEDIA_FRAME_TYPE_EXTENDED || + frame->base.type==PJMEDIA_FRAME_TYPE_NONE); + } + + if (frame->base.type == PJMEDIA_FRAME_TYPE_EXTENDED) { + pjmedia_frame_ext_subframe *sf; + unsigned samples_cnt; + + sf = pjmedia_frame_ext_get_subframe(frame, 0); + samples_cnt = frame->samples_cnt / frame->subframe_cnt; + if (sf->data && sf->bitlen) { + buffer.Append((TUint8*)sf->data, sf->bitlen>>3); + } else { + pj_uint8_t silc; + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buffer.AppendFill(silc, samples_cnt); + } + samples_ready += samples_cnt; + + pjmedia_frame_ext_pop_subframes(frame, 1); + + } else { /* PJMEDIA_FRAME_TYPE_NONE */ + pj_uint8_t silc; + + silc = (strm->param.ext_fmt.id==PJMEDIA_FORMAT_PCMU)? + pjmedia_linear2ulaw(0) : pjmedia_linear2alaw(0); + buffer.AppendFill(silc, samples_req - samples_ready); + + samples_ready = samples_req; + frame->samples_cnt = 0; + frame->subframe_cnt = 0; + } + } + } + break; + + default: + break; } /* Set the buffer */ - buf->SetPayloadPtr (buffer); + buf->SetPayloadPtr(buffer); } @@ -1388,20 +1296,19 @@ static void PlayCb (CVoIPDataBuffer *buf, void *user_data) * C compatible declaration of VAS factory. */ PJ_BEGIN_DECL -PJ_DECL (pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory (pj_pool_factory *pf); +PJ_DECL(pjmedia_aud_dev_factory*)pjmedia_symb_vas_factory(pj_pool_factory *pf); PJ_END_DECL /* * Init VAS audio driver. */ -PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory (pj_pool_factory *pf) +PJ_DEF(pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory(pj_pool_factory *pf) { - struct vas_factory *f; pj_pool_t *pool; - pool = pj_pool_create (pf, "VAS", 1000, 1000, NULL); - f = PJ_POOL_ZALLOC_T (pool, struct vas_factory); + pool = pj_pool_create(pf, "VAS", 1000, 1000, NULL); + f = PJ_POOL_ZALLOC_T(pool, struct vas_factory); f->pf = pf; f->pool = pool; f->base.op = &factory_op; @@ -1410,185 +1317,171 @@ PJ_DEF (pjmedia_aud_dev_factory*) pjmedia_symb_vas_factory (pj_pool_factory *pf) } /* API: init factory */ -static pj_status_t factory_init (pjmedia_aud_dev_factory *f) +static pj_status_t factory_init(pjmedia_aud_dev_factory *f) { - - struct vas_factory *af = (struct vas_factory*) f; - CVoIPUtilityFactory *vas_factory; + struct vas_factory *af = (struct vas_factory*)f; + CVoIPUtilityFactory *vas_factory_; CVoIPAudioUplinkStream *vas_uplink; CVoIPAudioDownlinkStream *vas_dnlink; RArray<TVoIPCodecFormat> uplink_formats, dnlink_formats; unsigned ext_fmt_cnt = 0; - TVersion vas_version (1, 0, 0); /* Not really used at this time */ + TVersion vas_version(1, 0, 0); /* Not really used at this time */ TInt err; - pj_ansi_strcpy (af->dev_info.name, "S60 VAS"); + pj_ansi_strcpy(af->dev_info.name, "S60 VAS"); af->dev_info.default_samples_per_sec = 8000; af->dev_info.caps = PJMEDIA_AUD_DEV_CAP_EXT_FORMAT | - //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | - PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | - PJMEDIA_AUD_DEV_CAP_VAD | - PJMEDIA_AUD_DEV_CAP_CNG; - af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | - PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + //PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING | + PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE | + PJMEDIA_AUD_DEV_CAP_VAD | + PJMEDIA_AUD_DEV_CAP_CNG; + af->dev_info.routes = PJMEDIA_AUD_DEV_ROUTE_EARPIECE | + PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; af->dev_info.input_count = 1; af->dev_info.output_count = 1; af->dev_info.ext_fmt_cnt = 0; /* Enumerate supported formats */ - err = CVoIPUtilityFactory::CreateFactory (vas_factory); - + err = CVoIPUtilityFactory::CreateFactory(vas_factory_); if (err != KErrNone) - goto on_error; + goto on_error; - /* On VAS 2.0, uplink & downlink stream should be instantiated before + /* On VAS 2.0, uplink & downlink stream should be instantiated before * querying formats. */ - err = vas_factory->CreateUplinkStream (vas_version, - CVoIPUtilityFactory::EVoIPCall, - vas_uplink); - + err = vas_factory_->CreateUplinkStream(vas_version, + CVoIPUtilityFactory::EVoIPCall, + vas_uplink); if (err != KErrNone) - goto on_error; - - err = vas_factory->CreateDownlinkStream (vas_version, - CVoIPUtilityFactory::EVoIPCall, - vas_dnlink); - + goto on_error; + + err = vas_factory_->CreateDownlinkStream(vas_version, + CVoIPUtilityFactory::EVoIPCall, + vas_dnlink); if (err != KErrNone) - goto on_error; - + goto on_error; + uplink_formats.Reset(); - - err = vas_factory->GetSupportedUplinkFormats (uplink_formats); - + err = vas_factory_->GetSupportedUplinkFormats(uplink_formats); if (err != KErrNone) - goto on_error; + goto on_error; dnlink_formats.Reset(); - - err = vas_factory->GetSupportedDownlinkFormats (dnlink_formats); - + err = vas_factory_->GetSupportedDownlinkFormats(dnlink_formats); if (err != KErrNone) - goto on_error; + goto on_error; /* Free the streams, they are just used for querying formats */ delete vas_uplink; - vas_uplink = NULL; - delete vas_dnlink; - vas_dnlink = NULL; - + delete vas_factory_; + vas_factory_ = NULL; + for (TInt i = 0; i < dnlink_formats.Count(); i++) { - /* Format must be supported by both downlink & uplink. */ - if (uplink_formats.Find (dnlink_formats[i]) == KErrNotFound) - continue; - - switch (dnlink_formats[i]) { - - case EAMR_NB: - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_AMR; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 7400; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; - break; - - case EG729: - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_G729; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 8000; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; - break; - - case EILBC: - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_ILBC; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 13333; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; - break; - - case EG711: + /* Format must be supported by both downlink & uplink. */ + if (uplink_formats.Find(dnlink_formats[i]) == KErrNotFound) + continue; + + switch (dnlink_formats[i]) { + case EAMR_NB: + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_AMR; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 7400; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; + break; + + case EG729: + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_G729; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 8000; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; + break; + + case EILBC: + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_ILBC; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 13333; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_TRUE; + break; + + case EG711: #if PJMEDIA_AUDIO_DEV_SYMB_VAS_VERSION==2 - - case EG711_10MS: + case EG711_10MS: #endif - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMU; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; - ++ext_fmt_cnt; - af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMA; - af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; - af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; - break; - - default: - continue; - } - - ++ext_fmt_cnt; + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMU; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; + ++ext_fmt_cnt; + af->dev_info.ext_fmt[ext_fmt_cnt].id = PJMEDIA_FORMAT_PCMA; + af->dev_info.ext_fmt[ext_fmt_cnt].bitrate = 64000; + af->dev_info.ext_fmt[ext_fmt_cnt].vad = PJ_FALSE; + break; + + default: + continue; + } + + ++ext_fmt_cnt; } - + af->dev_info.ext_fmt_cnt = ext_fmt_cnt; uplink_formats.Close(); dnlink_formats.Close(); - - PJ_LOG (3, (THIS_FILE, "VAS initialized")); + + PJ_LOG(3, (THIS_FILE, "VAS initialized")); return PJ_SUCCESS; - + on_error: - return PJ_RETURN_OS_ERROR (err); + return PJ_RETURN_OS_ERROR(err); } /* API: destroy factory */ -static pj_status_t factory_destroy (pjmedia_aud_dev_factory *f) +static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f) { - - struct vas_factory *af = (struct vas_factory*) f; + struct vas_factory *af = (struct vas_factory*)f; pj_pool_t *pool = af->pool; af->pool = NULL; - pj_pool_release (pool); - - PJ_LOG (3, (THIS_FILE, "VAS destroyed")); + pj_pool_release(pool); + PJ_LOG(3, (THIS_FILE, "VAS destroyed")); + return PJ_SUCCESS; } /* API: get number of devices */ -static unsigned factory_get_dev_count (pjmedia_aud_dev_factory *f) +static unsigned factory_get_dev_count(pjmedia_aud_dev_factory *f) { - PJ_UNUSED_ARG (f); + PJ_UNUSED_ARG(f); return 1; } /* API: get device info */ -static pj_status_t factory_get_dev_info (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_dev_info *info) +static pj_status_t factory_get_dev_info(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_dev_info *info) { + struct vas_factory *af = (struct vas_factory*)f; - struct vas_factory *af = (struct vas_factory*) f; - - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - pj_memcpy (info, &af->dev_info, sizeof (*info)); + pj_memcpy(info, &af->dev_info, sizeof(*info)); return PJ_SUCCESS; } /* API: create default device parameter */ -static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, - unsigned index, - pjmedia_aud_param *param) +static pj_status_t factory_default_param(pjmedia_aud_dev_factory *f, + unsigned index, + pjmedia_aud_param *param) { + struct vas_factory *af = (struct vas_factory*)f; - struct vas_factory *af = (struct vas_factory*) f; + PJ_ASSERT_RETURN(index == 0, PJMEDIA_EAUD_INVDEV); - PJ_ASSERT_RETURN (index == 0, PJMEDIA_EAUD_INVDEV); - - pj_bzero (param, sizeof (*param)); + pj_bzero(param, sizeof(*param)); param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; param->rec_id = index; param->play_id = index; @@ -1604,17 +1497,15 @@ static pj_status_t factory_default_param (pjmedia_aud_dev_factory *f, /* API: create stream */ -static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, - const pjmedia_aud_param *param, - pjmedia_aud_rec_cb rec_cb, - pjmedia_aud_play_cb play_cb, - void *user_data, - pjmedia_aud_stream **p_aud_strm) +static pj_status_t factory_create_stream(pjmedia_aud_dev_factory *f, + const pjmedia_aud_param *param, + pjmedia_aud_rec_cb rec_cb, + pjmedia_aud_play_cb play_cb, + void *user_data, + pjmedia_aud_stream **p_aud_strm) { - - struct vas_factory *af = (struct vas_factory*) f; + struct vas_factory *af = (struct vas_factory*)f; pj_pool_t *pool; - struct vas_stream *strm; CPjAudioSetting vas_setting; @@ -1622,433 +1513,422 @@ static pj_status_t factory_create_stream (pjmedia_aud_dev_factory *f, PjAudioCallback vas_play_cb; /* Can only support 16bits per sample */ - PJ_ASSERT_RETURN (param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); + PJ_ASSERT_RETURN(param->bits_per_sample == BITS_PER_SAMPLE, PJ_EINVAL); /* Supported clock rates: - * - for non-PCM format: 8kHz - * - for PCM format: 8kHz and 16kHz + * - for non-PCM format: 8kHz + * - for PCM format: 8kHz and 16kHz */ - PJ_ASSERT_RETURN (param->clock_rate == 8000 || - (param->clock_rate == 16000 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->clock_rate == 8000 || + (param->clock_rate == 16000 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Supported channels number: * - for non-PCM format: mono - * - for PCM format: mono and stereo + * - for PCM format: mono and stereo */ - PJ_ASSERT_RETURN (param->channel_count == 1 || - (param->channel_count == 2 && - param->ext_fmt.id == PJMEDIA_FORMAT_L16), - PJ_EINVAL); + PJ_ASSERT_RETURN(param->channel_count == 1 || + (param->channel_count == 2 && + param->ext_fmt.id == PJMEDIA_FORMAT_L16), + PJ_EINVAL); /* Create and Initialize stream descriptor */ - pool = pj_pool_create (af->pf, "vas-dev", 1000, 1000, NULL); - PJ_ASSERT_RETURN (pool, PJ_ENOMEM); + pool = pj_pool_create(af->pf, "vas-dev", 1000, 1000, NULL); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); - strm = PJ_POOL_ZALLOC_T (pool, struct vas_stream); + strm = PJ_POOL_ZALLOC_T(pool, struct vas_stream); strm->pool = pool; strm->param = *param; if (strm->param.flags & PJMEDIA_AUD_DEV_CAP_EXT_FORMAT == 0) - strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; - + strm->param.ext_fmt.id = PJMEDIA_FORMAT_L16; + /* Set audio engine fourcc. */ - switch (strm->param.ext_fmt.id) { - - case PJMEDIA_FORMAT_L16: -#ifdef USE_NATIVE_PCM - vas_setting.format = EPCM16; + switch(strm->param.ext_fmt.id) { + case PJMEDIA_FORMAT_L16: +#ifdef USE_NATIVE_PCM + vas_setting.format = EPCM16; #else - vas_setting.format = EG711; + vas_setting.format = EG711; #endif - break; - - case PJMEDIA_FORMAT_PCMU: - - case PJMEDIA_FORMAT_PCMA: - vas_setting.format = EG711; - break; - - case PJMEDIA_FORMAT_AMR: - vas_setting.format = EAMR_NB; - break; - - case PJMEDIA_FORMAT_G729: - vas_setting.format = EG729; - break; - - case PJMEDIA_FORMAT_ILBC: - vas_setting.format = EILBC; - break; - - default: - vas_setting.format = ENULL; - break; + break; + case PJMEDIA_FORMAT_PCMU: + case PJMEDIA_FORMAT_PCMA: + vas_setting.format = EG711; + break; + case PJMEDIA_FORMAT_AMR: + vas_setting.format = EAMR_NB; + break; + case PJMEDIA_FORMAT_G729: + vas_setting.format = EG729; + break; + case PJMEDIA_FORMAT_ILBC: + vas_setting.format = EILBC; + break; + default: + vas_setting.format = ENULL; + break; } /* Set audio engine mode. */ - if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { -#ifdef USE_NATIVE_PCM - vas_setting.mode = 0; + if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) + { +#ifdef USE_NATIVE_PCM + vas_setting.mode = 0; #else - vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; + vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; #endif - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) { - vas_setting.mode = strm->param.ext_fmt.bitrate; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU) { - vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA) { - vas_setting.mode = CVoIPFormatIntfc::EG711ALaw; - } else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC) { - if (strm->param.ext_fmt.bitrate == 15200) - vas_setting.mode = CVoIPFormatIntfc::EiLBC20mSecFrame; - else - vas_setting.mode = CVoIPFormatIntfc::EiLBC30mSecFrame; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_AMR) + { + vas_setting.mode = strm->param.ext_fmt.bitrate; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU) + { + vas_setting.mode = CVoIPFormatIntfc::EG711uLaw; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA) + { + vas_setting.mode = CVoIPFormatIntfc::EG711ALaw; + } + else if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC) + { + if (strm->param.ext_fmt.bitrate == 15200) + vas_setting.mode = CVoIPFormatIntfc::EiLBC20mSecFrame; + else + vas_setting.mode = CVoIPFormatIntfc::EiLBC30mSecFrame; } else { - vas_setting.mode = 0; + vas_setting.mode = 0; } - /* Disable VAD on L16, G711, iLBC, and also G729 (G729's SID + /* Disable VAD on L16, G711, iLBC, and also G729 (G729's SID * potentially cause noise?). */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMU || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC || - strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - vas_setting.vad = EFalse; + strm->param.ext_fmt.id == PJMEDIA_FORMAT_PCMA || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_ILBC || + strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) + { + vas_setting.vad = EFalse; } else { - vas_setting.vad = strm->param.ext_fmt.vad; + vas_setting.vad = strm->param.ext_fmt.vad; } - + /* Set other audio engine attributes. */ vas_setting.plc = strm->param.plc_enabled; - vas_setting.cng = vas_setting.vad; - - vas_setting.loudspk = - strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + vas_setting.loudspk = + strm->param.output_route==PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; /* Set audio engine callbacks. */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { #ifdef USE_NATIVE_PCM - vas_play_cb = &PlayCbPcm2; - vas_rec_cb = &RecCbPcm2; + vas_play_cb = &PlayCbPcm2; + vas_rec_cb = &RecCbPcm2; #else - vas_play_cb = &PlayCbPcm; - vas_rec_cb = &RecCbPcm; + vas_play_cb = &PlayCbPcm; + vas_rec_cb = &RecCbPcm; #endif } else { - vas_play_cb = &PlayCb; - vas_rec_cb = &RecCb; + vas_play_cb = &PlayCb; + vas_rec_cb = &RecCb; } strm->rec_cb = rec_cb; - strm->play_cb = play_cb; strm->user_data = user_data; strm->resample_factor = strm->param.clock_rate / 8000; /* play_buf size is samples per frame scaled in to 8kHz mono. */ - strm->play_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->play_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->play_buf_len = 0; strm->play_buf_start = 0; /* rec_buf size is samples per frame scaled in to 8kHz mono. */ - strm->rec_buf = (pj_int16_t*) pj_pool_zalloc ( - pool, - (strm->param.samples_per_frame / - strm->resample_factor / - strm->param.channel_count) << 1); + strm->rec_buf = (pj_int16_t*)pj_pool_zalloc( + pool, + (strm->param.samples_per_frame / + strm->resample_factor / + strm->param.channel_count) << 1); strm->rec_buf_len = 0; if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = new TBitStream; - - PJ_ASSERT_RETURN (g729_bitstream, PJ_ENOMEM); - strm->strm_data = (void*) g729_bitstream; + TBitStream *g729_bitstream = new TBitStream; + + PJ_ASSERT_RETURN(g729_bitstream, PJ_ENOMEM); + strm->strm_data = (void*)g729_bitstream; } - + /* Init resampler when format is PCM and clock rate is not 8kHz */ - if (strm->param.clock_rate != 8000 && - strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) { - pj_status_t status; - - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - /* Create resample for recorder */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - 8000, - strm->param.clock_rate, - 80, - &strm->rec_resample); - - if (status != PJ_SUCCESS) - return status; - } - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - /* Create resample for player */ - status = pjmedia_resample_create (pool, PJ_TRUE, PJ_FALSE, 1, - strm->param.clock_rate, - 8000, - 80 * strm->resample_factor, - &strm->play_resample); - - if (status != PJ_SUCCESS) - return status; - } + if (strm->param.clock_rate != 8000 && + strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16) + { + pj_status_t status; + + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + /* Create resample for recorder */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + 8000, + strm->param.clock_rate, + 80, + &strm->rec_resample); + if (status != PJ_SUCCESS) + return status; + } + + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + /* Create resample for player */ + status = pjmedia_resample_create( pool, PJ_TRUE, PJ_FALSE, 1, + strm->param.clock_rate, + 8000, + 80 * strm->resample_factor, + &strm->play_resample); + if (status != PJ_SUCCESS) + return status; + } } /* Create PCM buffer, when the clock rate is not 8kHz or not mono */ if (strm->param.ext_fmt.id == PJMEDIA_FORMAT_L16 && - (strm->resample_factor > 1 || strm->param.channel_count != 1)) { - strm->pcm_buf = (pj_int16_t*) pj_pool_zalloc (pool, - strm->param.samples_per_frame << 1); + (strm->resample_factor > 1 || strm->param.channel_count != 1)) + { + strm->pcm_buf = (pj_int16_t*)pj_pool_zalloc(pool, + strm->param.samples_per_frame << 1); } - + /* Create the audio engine. */ - TRAPD (err, strm->engine = CPjAudioEngine::NewL (strm, - vas_rec_cb, vas_play_cb, - strm, vas_setting)); - + TRAPD(err, strm->engine = CPjAudioEngine::NewL(strm, + vas_rec_cb, vas_play_cb, + strm, vas_setting)); if (err != KErrNone) { - pj_pool_release (pool); - return PJ_RETURN_OS_ERROR (err); + pj_pool_release(pool); + return PJ_RETURN_OS_ERROR(err); } /* Apply output volume setting if specified */ if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING) { - stream_set_cap (&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - ¶m->output_vol); + stream_set_cap(&strm->base, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + ¶m->output_vol); } /* Done */ strm->base.op = &stream_op; - *p_aud_strm = &strm->base; return PJ_SUCCESS; } /* API: Get stream info. */ -static pj_status_t stream_get_param (pjmedia_aud_stream *s, - pjmedia_aud_param *pi) +static pj_status_t stream_get_param(pjmedia_aud_stream *s, + pjmedia_aud_param *pi) { + struct vas_stream *strm = (struct vas_stream*)s; - struct vas_stream *strm = (struct vas_stream*) s; + PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); - PJ_ASSERT_RETURN (strm && pi, PJ_EINVAL); - - pj_memcpy (pi, &strm->param, sizeof (*pi)); + pj_memcpy(pi, &strm->param, sizeof(*pi)); /* Update the output volume setting */ - - if (stream_get_cap (s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - &pi->output_vol) == PJ_SUCCESS) { - pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; + if (stream_get_cap(s, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + &pi->output_vol) == PJ_SUCCESS) + { + pi->flags |= PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING; } - + return PJ_SUCCESS; } /* API: get capability */ -static pj_status_t stream_get_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - void *pval) +static pj_status_t stream_get_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + void *pval) { - - struct vas_stream *strm = (struct vas_stream*) s; + struct vas_stream *strm = (struct vas_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - * (pjmedia_aud_dev_route*) pval = strm->param.output_route; - status = PJ_SUCCESS; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - TInt gain = strm->engine->GetGain(); - - if (max_gain > 0 && gain >= 0) { - *(unsigned*)pval = gain * 100 / max_gain; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - TInt vol = strm->engine->GetVolume(); - - if (max_vol > 0 && vol >= 0) { - * (unsigned*) pval = vol * 100 / max_vol; - status = PJ_SUCCESS; - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + *(pjmedia_aud_dev_route*)pval = strm->param.output_route; + status = PJ_SUCCESS; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + TInt gain = strm->engine->GetGain(); + + if (max_gain > 0 && gain >= 0) { + *(unsigned*)pval = gain * 100 / max_gain; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + TInt vol = strm->engine->GetVolume(); + + if (max_vol > 0 && vol >= 0) { + *(unsigned*)pval = vol * 100 / max_vol; + status = PJ_SUCCESS; + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + } + break; + default: + break; } - + return status; } /* API: set capability */ -static pj_status_t stream_set_cap (pjmedia_aud_stream *s, - pjmedia_aud_dev_cap cap, - const void *pval) +static pj_status_t stream_set_cap(pjmedia_aud_stream *s, + pjmedia_aud_dev_cap cap, + const void *pval) { - - struct vas_stream *strm = (struct vas_stream*) s; + struct vas_stream *strm = (struct vas_stream*)s; pj_status_t status = PJ_ENOTSUP; - PJ_ASSERT_RETURN (s && pval, PJ_EINVAL); + PJ_ASSERT_RETURN(s && pval, PJ_EINVAL); switch (cap) { - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - pjmedia_aud_dev_route r = * (const pjmedia_aud_dev_route*) pval; - TInt err; - - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - switch (r) { - - case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: - - case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: - err = strm->engine->ActivateSpeaker (EFalse); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: - err = strm->engine->ActivateSpeaker (ETrue); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - break; - - default: - status = PJ_EINVAL; - break; - } - - if (status == PJ_SUCCESS) - strm->param.output_route = r; - } - - break; - - /* There is a case that GetMaxGain() stucks, e.g: in N95. */ - /* - case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: - if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { - PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); - - TInt max_gain = strm->engine->GetMaxGain(); - if (max_gain > 0) { - TInt gain, err; - - gain = *(unsigned*)pval * max_gain / 100; - err = strm->engine->SetGain(gain); - status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - if (status == PJ_SUCCESS) - strm->param.input_vol = *(unsigned*)pval; - } - break; - */ - - case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: - - if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { - PJ_ASSERT_RETURN (strm->engine, PJ_EINVAL); - - TInt max_vol = strm->engine->GetMaxVolume(); - - if (max_vol > 0) { - TInt vol, err; - - vol = * (unsigned*) pval * max_vol / 100; - err = strm->engine->SetVolume (vol); - status = (err==KErrNone) ? PJ_SUCCESS:PJ_RETURN_OS_ERROR (err); - } else { - status = PJMEDIA_EAUD_NOTREADY; - } - - if (status == PJ_SUCCESS) - strm->param.output_vol = * (unsigned*) pval; - } - - break; - - default: - break; + case PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + pjmedia_aud_dev_route r = *(const pjmedia_aud_dev_route*)pval; + TInt err; + + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + switch (r) { + case PJMEDIA_AUD_DEV_ROUTE_DEFAULT: + case PJMEDIA_AUD_DEV_ROUTE_EARPIECE: + err = strm->engine->ActivateSpeaker(EFalse); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + case PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER: + err = strm->engine->ActivateSpeaker(ETrue); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + break; + default: + status = PJ_EINVAL; + break; + } + if (status == PJ_SUCCESS) + strm->param.output_route = r; + } + break; + + /* There is a case that GetMaxGain() stucks, e.g: in N95. */ + /* + case PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_CAPTURE) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_gain = strm->engine->GetMaxGain(); + if (max_gain > 0) { + TInt gain, err; + + gain = *(unsigned*)pval * max_gain / 100; + err = strm->engine->SetGain(gain); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.input_vol = *(unsigned*)pval; + } + break; + */ + + case PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING: + if (strm->param.dir & PJMEDIA_DIR_PLAYBACK) { + PJ_ASSERT_RETURN(strm->engine, PJ_EINVAL); + + TInt max_vol = strm->engine->GetMaxVolume(); + if (max_vol > 0) { + TInt vol, err; + + vol = *(unsigned*)pval * max_vol / 100; + err = strm->engine->SetVolume(vol); + status = (err==KErrNone)? PJ_SUCCESS:PJ_RETURN_OS_ERROR(err); + } else { + status = PJMEDIA_EAUD_NOTREADY; + } + if (status == PJ_SUCCESS) + strm->param.output_vol = *(unsigned*)pval; + } + break; + default: + break; } - + return status; } /* API: Start stream. */ -static pj_status_t stream_start (pjmedia_aud_stream *strm) +static pj_status_t stream_start(pjmedia_aud_stream *strm) { + struct vas_stream *stream = (struct vas_stream*)strm; - struct vas_stream *stream = (struct vas_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - TInt err = stream->engine->Start(); - - if (err != KErrNone) - return PJ_RETURN_OS_ERROR (err); - } - - return PJ_SUCCESS; + enum { VAS_WAIT_START = 2000 }; /* in msecs */ + TTime start, now; + TInt err = stream->engine->Start(); + + if (err != KErrNone) + return PJ_RETURN_OS_ERROR(err); + + /* Perform synchronous start, timeout after VAS_WAIT_START ms */ + start.UniversalTime(); + do { + pj_symbianos_poll(-1, 100); + now.UniversalTime(); + } while (!stream->engine->IsStarted() && + (now.MicroSecondsFrom(start) < VAS_WAIT_START * 1000)); + + if (stream->engine->IsStarted()) + return PJ_SUCCESS; + else + return PJ_ETIMEDOUT; + } + + return PJ_EINVALIDOP; } /* API: Stop stream. */ -static pj_status_t stream_stop (pjmedia_aud_stream *strm) +static pj_status_t stream_stop(pjmedia_aud_stream *strm) { + struct vas_stream *stream = (struct vas_stream*)strm; - struct vas_stream *stream = (struct vas_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); if (stream->engine) { - stream->engine->Stop(); + stream->engine->Stop(); } return PJ_SUCCESS; @@ -2056,31 +1936,28 @@ static pj_status_t stream_stop (pjmedia_aud_stream *strm) /* API: Destroy stream. */ -static pj_status_t stream_destroy (pjmedia_aud_stream *strm) +static pj_status_t stream_destroy(pjmedia_aud_stream *strm) { + struct vas_stream *stream = (struct vas_stream*)strm; - struct vas_stream *stream = (struct vas_stream*) strm; - - PJ_ASSERT_RETURN (stream, PJ_EINVAL); + PJ_ASSERT_RETURN(stream, PJ_EINVAL); - stream_stop (strm); + stream_stop(strm); delete stream->engine; stream->engine = NULL; if (stream->param.ext_fmt.id == PJMEDIA_FORMAT_G729) { - TBitStream *g729_bitstream = (TBitStream*) stream->strm_data; - stream->strm_data = NULL; - delete g729_bitstream; + TBitStream *g729_bitstream = (TBitStream*)stream->strm_data; + stream->strm_data = NULL; + delete g729_bitstream; } pj_pool_t *pool; - pool = stream->pool; - if (pool) { - stream->pool = NULL; - pj_pool_release (pool); + stream->pool = NULL; + pj_pool_release(pool); } return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c index f7a3436b257e10eb4943868325455c75c582fce3..66924d8f235ec639ac9eb07c0f55c7bd61d63fe7 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-audiodev/wmme_dev.c @@ -1,4 +1,4 @@ -/* $Id: wmme_dev.c 2841 2009-07-18 09:21:09Z bennylp $ */ +/* $Id: wmme_dev.c 2941 2009-10-13 11:19:57Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -283,7 +283,15 @@ static pj_status_t factory_init(pjmedia_aud_dev_factory *f) if (devCount==0) { PJ_LOG(4,(THIS_FILE, "WMME found no sound devices")); + /* Enabling this will cause pjsua-lib initialization to fail when there + * is no sound device installed in the system, even when pjsua has been + * run with --null-audio. Moreover, it might be better to think that + * the WMME backend initialization is successfull, regardless there is + * no audio device installed, as later application can check it using + * get_dev_count(). return PJMEDIA_EAUD_NODEV; + */ + return PJ_SUCCESS; } wf->dev_info = (struct wmme_dev_info*) @@ -450,7 +458,7 @@ static pj_status_t init_waveformatex(LPWAVEFORMATEX wfx, const pjmedia_aud_param *prm) { - pj_bzero(wfx, sizeof(PCMWAVEFORMAT)); + pj_bzero(wfx, sizeof(WAVEFORMATEX)); if (prm->ext_fmt.id == PJMEDIA_FORMAT_L16) { enum { BYTES_PER_SAMPLE = 2 }; wfx->wFormatTag = WAVE_FORMAT_PCM; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c index 42042acca490d5dd6c70286da234ede4b6d37d60..884c3e954b38f82f0bec7f0f061aef4714b2b273 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia-codec/passthrough.c @@ -1,4 +1,4 @@ -/* $Id: passthrough.c 2834 2009-07-15 17:55:16Z nanang $ */ +/* $Id: passthrough.c 2997 2009-11-09 08:49:32Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -719,6 +719,8 @@ static pj_status_t codec_open( pjmedia_codec *codec, #endif #if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC + /* Init iLBC settings */ + if (desc->pt == PJMEDIA_RTP_PT_ILBC) { enum { DEFAULT_MODE = 30 }; static pj_str_t STR_MODE = {"mode", 4}; @@ -915,7 +917,9 @@ static pj_status_t codec_decode( pjmedia_codec *codec, struct pjmedia_frame *output) { codec_private_t *codec_data = (codec_private_t*) codec->codec_data; +#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR struct codec_desc *desc = &codec_desc[codec_data->codec_idx]; +#endif pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; pj_assert(input); @@ -960,7 +964,6 @@ static pj_status_t codec_recover( pjmedia_codec *codec, struct pjmedia_frame *output) { codec_private_t *codec_data = (codec_private_t*) codec->codec_data; - struct codec_desc *desc = &codec_desc[codec_data->codec_idx]; pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; PJ_UNUSED_ARG(output_buf_len); diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c index fac084e9b973d98af727bf56d1e99922f58a30d9..3cdcc6acbdf5db874bec5c1950b2528af8e694bd 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/jbuf.c @@ -1,4 +1,4 @@ -/* $Id: jbuf.c 2844 2009-07-29 12:14:21Z bennylp $ */ +/* $Id: jbuf.c 3015 2009-11-11 04:26:00Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -735,7 +735,7 @@ PJ_DEF(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb, } else { - pjmedia_jb_frame_type ftype; + pjmedia_jb_frame_type ftype = PJMEDIA_JB_MISSING_FRAME; pj_bool_t res; /* Retrieve a frame from frame list */ diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c index e383e964ee9f4a5df33edbddac12939e512349d6..fbebb155f6732a3f079666948255355168619365 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/rtp.c @@ -1,4 +1,4 @@ -/* $Id: rtp.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: rtp.c 2904 2009-08-20 13:06:17Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -170,7 +170,7 @@ PJ_DEF(pj_status_t) pjmedia_rtp_decode_rtp( pjmedia_rtp_session *ses, if ((*hdr)->x) { pjmedia_rtp_ext_hdr *ext = (pjmedia_rtp_ext_hdr*) (((pj_uint8_t*)pkt) + offset); - offset += (pj_ntohs(ext->length) * sizeof(pj_uint32_t)); + offset += ((pj_ntohs(ext->length)+1) * sizeof(pj_uint32_t)); } /* Check that offset is less than packet size */ diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c index 77bf5da68b569d77a0d9a6a82bb1449eb2207ea7..2a44d2f62e7aa009b3f77b0c5e845f8f165f4785 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp.c @@ -1,4 +1,4 @@ -/* $Id: sdp.c 2847 2009-07-30 19:35:24Z bennylp $ */ +/* $Id: sdp.c 2995 2009-11-09 05:18:12Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -174,6 +174,7 @@ PJ_DEF(pjmedia_sdp_attr*) pjmedia_sdp_attr_find2(unsigned count, } + PJ_DEF(pj_status_t) pjmedia_sdp_attr_add(unsigned *count, pjmedia_sdp_attr *attr_array[], pjmedia_sdp_attr *attr) @@ -680,6 +681,12 @@ PJ_DEF(pj_status_t) pjmedia_sdp_media_add_attr( pjmedia_sdp_media *m, return pjmedia_sdp_attr_add(&m->attr_count, m->attr, attr); } +PJ_DEF(pj_status_t) pjmedia_sdp_session_add_attr(pjmedia_sdp_session *s, + pjmedia_sdp_attr *attr) +{ + return pjmedia_sdp_attr_add(&s->attr_count, s->attr, attr); +} + PJ_DEF(unsigned) pjmedia_sdp_media_remove_all_attr(pjmedia_sdp_media *m, const char *name) { @@ -978,13 +985,22 @@ static void parse_media(pj_scanner *scanner, pjmedia_sdp_media *med, /* format list */ med->desc.fmt_count = 0; while (*scanner->curptr == ' ') { + pj_str_t fmt; + pj_scan_get_char(scanner); /* Check again for the end of the line */ if ((*scanner->curptr == '\r') || (*scanner->curptr == '\n')) break; - pj_scan_get(scanner, &cs_token, &med->desc.fmt[med->desc.fmt_count++]); + pj_scan_get(scanner, &cs_token, &fmt); + if (med->desc.fmt_count < PJMEDIA_MAX_SDP_FMT) + med->desc.fmt[med->desc.fmt_count++] = fmt; + else + PJ_PERROR(2,(THIS_FILE, PJ_ETOOMANY, + "Error adding SDP media format %.*s, " + "format is ignored", + (int)fmt.slen, fmt.ptr)); } /* We've got what we're looking for, skip anything until newline */ @@ -1019,7 +1035,9 @@ static pjmedia_sdp_attr *parse_attr( pj_pool_t *pool, pj_scanner *scanner, /* get attr name. */ pj_scan_get(scanner, &cs_token, &attr->name); - if (*scanner->curptr != '\r' && *scanner->curptr != '\n') { + if (*scanner->curptr && *scanner->curptr != '\r' && + *scanner->curptr != '\n') + { /* skip ':' if present. */ if (*scanner->curptr == ':') pj_scan_get_char(scanner); @@ -1080,9 +1098,9 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool, attr = parse_attr(pool, &scanner, &ctx); if (attr) { if (media) { - media->attr[media->attr_count++] = attr; + pjmedia_sdp_media_add_attr(media, attr); } else { - session->attr[session->attr_count++] = attr; + pjmedia_sdp_session_add_attr(session, attr); } } break; @@ -1107,7 +1125,11 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool, case 'm': media = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); parse_media(&scanner, media, &ctx); - session->media[ session->media_count++ ] = media; + if (session->media_count < PJMEDIA_MAX_SDP_MEDIA) + session->media[ session->media_count++ ] = media; + else + PJ_PERROR(2,(THIS_FILE, PJ_ETOOMANY, + "Error adding media, media is ignored")); break; case 'v': parse_version(&scanner, &ctx); @@ -1350,11 +1372,14 @@ PJ_DEF(pj_status_t) pjmedia_sdp_media_deactivate(pj_pool_t *pool, pjmedia_sdp_attr *attr; static const pj_str_t ID_INACTIVE = { "inactive", 8 }; + if (m->attr_count >= PJMEDIA_MAX_SDP_ATTR) + return PJ_ETOOMANY; + attr = pjmedia_sdp_attr_create(pool, ID_INACTIVE.ptr, NULL); if (NULL == attr) return PJ_ENOMEM; - m->attr[m->attr_count++] = attr; + pjmedia_sdp_media_add_attr(m, attr); m->desc.port = 0; return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c index 881b65342e4104161ea7aa5d5be7abaf1bac39a2..9e283027dd999409ad2d5b2bc065f9cfeb393178 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_neg.c @@ -1,4 +1,4 @@ -/* $Id: sdp_neg.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sdp_neg.c 2926 2009-10-06 11:29:14Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1006,6 +1006,15 @@ static pj_status_t match_offer(pj_pool_t *pool, const pjmedia_sdp_media *master, *slave; pj_str_t pt_amr_need_adapt = {NULL, 0}; + /* If offer has zero port, just clone the offer and update direction */ + if (offer->desc.port == 0) { + answer = pjmedia_sdp_media_clone(pool, offer); + remove_all_media_directions(answer); + update_media_direction(pool, offer, answer); + *p_answer = answer; + return PJ_SUCCESS; + } + /* Set master/slave negotiator based on prefer_remote_codec_order. */ if (prefer_remote_codec_order) { master = offer; @@ -1218,10 +1227,6 @@ static pj_status_t match_offer(pj_pool_t *pool, } answer->desc.fmt_count = pt_answer_count; - /* If offer has zero port, set our answer with zero port too */ - if (offer->desc.port == 0) - answer->desc.port = 0; - /* Update media direction. */ update_media_direction(pool, offer, answer); diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp index cfca6d28ccc016aa5bb9112daaf12b3c2e61f14e..dd5b8fd09cb13bf51740f6a9a199bcfa927ee63f 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/sdp_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sdp_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c index b3f947bdcb7fdae34d0b3fcfa5a611c99f5caec9..2bf078273ad3204c19c537f5f55a7165c0a6b6c8 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/pjmedia/transport_ice.c @@ -1,4 +1,4 @@ -/* $Id: transport_ice.c 2896 2009-08-17 18:55:13Z bennylp $ */ +/* $Id: transport_ice.c 2957 2009-10-20 14:44:00Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1147,7 +1147,9 @@ static pj_status_t transport_encode_sdp(pjmedia_transport *tp, pj_status_t status; /* Validate media transport */ - /* For now, this transport only support RTP/AVP transport */ + /* This transport only support RTP/AVP transport, unless if + * transport checking is disabled + */ if ((tp_ice->media_option & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { pjmedia_sdp_media *loc_m, *rem_m; @@ -1410,6 +1412,17 @@ static pj_status_t transport_media_start(pjmedia_transport *tp, } } + /* Ticket #977: Update role if turns out we're supposed to be the + * Controlling agent (e.g. when talking to ice-lite peer). + */ + if (tp_ice->rem_offer_state.local_role==PJ_ICE_SESS_ROLE_CONTROLLING && + pj_ice_strans_has_sess(tp_ice->ice_st)) + { + pj_ice_strans_change_role(tp_ice->ice_st, + PJ_ICE_SESS_ROLE_CONTROLLING); + } + + /* start ICE */ } @@ -1473,6 +1486,38 @@ static pj_status_t transport_get_info(pjmedia_transport *tp, info->src_rtcp_name = tp_ice->rtcp_src_addr; } + /* Fill up transport specific info */ + if (info->specific_info_cnt < PJ_ARRAY_SIZE(info->spc_info)) { + pjmedia_transport_specific_info *tsi; + pjmedia_ice_transport_info *ii; + unsigned i; + + pj_assert(sizeof(*ii) <= sizeof(tsi->buffer)); + tsi = &info->spc_info[info->specific_info_cnt++]; + tsi->type = PJMEDIA_TRANSPORT_TYPE_ICE; + tsi->cbsize = sizeof(*ii); + + ii = (pjmedia_ice_transport_info*) tsi->buffer; + pj_bzero(ii, sizeof(*ii)); + + if (pj_ice_strans_has_sess(tp_ice->ice_st)) + ii->role = pj_ice_strans_get_role(tp_ice->ice_st); + else + ii->role = PJ_ICE_SESS_ROLE_UNKNOWN; + ii->sess_state = pj_ice_strans_get_state(tp_ice->ice_st); + ii->comp_cnt = pj_ice_strans_get_running_comp_cnt(tp_ice->ice_st); + + for (i=1; i<=ii->comp_cnt && i<=PJ_ARRAY_SIZE(ii->comp); ++i) { + const pj_ice_sess_check *chk; + + chk = pj_ice_strans_get_valid_pair(tp_ice->ice_st, i); + if (chk) { + ii->comp[i-1].lcand_type = chk->lcand->type; + ii->comp[i-1].rcand_type = chk->rcand->type; + } + } + } + return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c b/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c index 4c734a20713cf2bcd19437a43246ca971be87e9e..d5cdcd3112bcb0d6a7e84882988cfa63987d0d06 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/test/mips_test.c @@ -1,4 +1,4 @@ -/* $Id: mips_test.c 2882 2009-08-15 10:05:36Z bennylp $ */ +/* $Id: mips_test.c 2978 2009-10-30 01:18:28Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -2407,7 +2407,7 @@ int mips_test(void) struct test_entry *e = &entries[i]; pj_timestamp times[RETRY], tzero; int usec; - float cpu_pct, mips; + float cpu_pct, mips_val; unsigned j, clock_rate = clock_rates[c]; if ((e->valid_clock_rate & k[c]) == 0) @@ -2438,10 +2438,10 @@ int mips_test(void) usec = usec / (DURATION / 1000); - mips = (float)(CPU_IPS * usec / 1000000.0 / 1000000); + mips_val = (float)(CPU_IPS * usec / 1000000.0 / 1000000); cpu_pct = (float)(100.0 * usec / 1000000); PJ_LOG(3,(THIS_FILE, "%2dKHz %-38s % 8d %8.3f %7.2f", - clock_rate/1000, e->title, usec, cpu_pct, mips)); + clock_rate/1000, e->title, usec, cpu_pct, mips_val)); } } diff --git a/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c b/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c index 25b9010adbb70f90af18fed6b004fda0bf9f1582..437bd41301b8387b0a743e21bee7e69a482cec1d 100644 --- a/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c +++ b/sflphone-common/libs/pjproject/pjmedia/src/test/sdp_neg_test.c @@ -1,4 +1,4 @@ -/* $Id: sdp_neg_test.c 2675 2009-05-06 14:34:13Z bennylp $ */ +/* $Id: sdp_neg_test.c 3014 2009-11-11 04:18:58Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -129,7 +129,7 @@ static struct test "m=audio 49170 RTP/AVP 0\r\n" "a=rtpmap:0 PCMU/8000\r\n" "m=video 0 RTP/AVP 31\r\n" - "a=rtpmap:31 H261/90000\r\n" /* <-- this is not necessary */ + //"a=rtpmap:31 H261/90000\r\n" /* <-- this is not necessary */ "m=video 53000 RTP/AVP 32\r\n" "a=rtpmap:32 MPV/90000\r\n" "m=audio 0 RTP/AVP 110\r\n" diff --git a/sflphone-common/libs/pjproject/pjnath/build/Makefile b/sflphone-common/libs/pjproject/pjnath/build/Makefile index 13bd9f65862776b882f21c960bf4e8d3f305124b..3012659f48b8c989c814c9a15c1265b9463f2e74 100644 --- a/sflphone-common/libs/pjproject/pjnath/build/Makefile +++ b/sflphone-common/libs/pjproject/pjnath/build/Makefile @@ -7,9 +7,9 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=../../pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -export PJNATH_LIB:=../lib/libpjnath-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +export PJNATH_LIB:=../lib/libpjnath-$(TARGET_NAME)$(LIBEXT) ############################################################################### # Gather all flags. diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h index 91ab258825971a4528788888a14b62d63396ed4a..5a5ebac783aad94a58b2bb75e7dbef990cecefc9 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/config.h @@ -1,5 +1,5 @@ -/* $Id: config.h 2724 2009-05-29 13:04:03Z bennylp $ */ -/* +/* $Id: config.h 2966 2009-10-25 09:02:07Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJNATH_CONFIG_H__ #define __PJNATH_CONFIG_H__ @@ -66,9 +66,9 @@ /** * The default initial STUN round-trip time estimation (the RTO value - * in RFC 3489-bis), in miliseconds. - * This value is used to control the STUN request - * retransmit time. The initial value of retransmission interval + * in RFC 3489-bis), in miliseconds. + * This value is used to control the STUN request + * retransmit time. The initial value of retransmission interval * would be set to this value, and will be doubled after each * retransmission. */ @@ -79,7 +79,7 @@ /** * The STUN transaction timeout value, in miliseconds. - * After the last retransmission is sent and if no response is received + * After the last retransmission is sent and if no response is received * after this time, the STUN transaction will be considered to have failed. * * The default value is 16x RTO (as per RFC 3489-bis). @@ -202,8 +202,8 @@ /** - * Number of seconds to refresh the permission/channel binding before the - * permission/channel binding expires. This value should be greater than + * Number of seconds to refresh the permission/channel binding before the + * permission/channel binding expires. This value should be greater than * PJ_TURN_PERM_TIMEOUT setting. */ #ifndef PJ_TURN_REFRESH_SEC_BEFORE @@ -212,7 +212,7 @@ /** - * The TURN session timer heart beat interval. When this timer occurs, the + * The TURN session timer heart beat interval. When this timer occurs, the * TURN session will scan all the permissions/channel bindings to see which * need to be refreshed. */ @@ -250,14 +250,14 @@ * the maximum number of components (PJ_ICE_MAX_COMP) value. */ #ifndef PJ_ICE_COMP_BITS -# define PJ_ICE_COMP_BITS 3 +# define PJ_ICE_COMP_BITS 1 #endif /** * Maximum number of ICE components. */ -#define PJ_ICE_MAX_COMP (2<<PJ_ICE_COMP_BITS) +#define PJ_ICE_MAX_COMP (2<<PJ_ICE_COMP_BITS) /** * Use the priority value according to the ice-draft. @@ -282,10 +282,10 @@ /** * The number of bits to represent ICE candidate's local preference. The * local preference is used to specify preference among candidates with - * the same type, and ICE draft suggests 65535 as the default local - * preference, which means we need 16 bits to represent the value. But + * the same type, and ICE draft suggests 65535 as the default local + * preference, which means we need 16 bits to represent the value. But * since we don't have the facility to specify local preference, we'll - * just disable this feature and let the preference sorted by the + * just disable this feature and let the preference sorted by the * type only. * * Default: 0 @@ -316,15 +316,15 @@ /** - * According to ICE Section 8.2. Updating States, if an In-Progress pair in - * the check list is for the same component as a nominated pair, the agent + * According to ICE Section 8.2. Updating States, if an In-Progress pair in + * the check list is for the same component as a nominated pair, the agent * SHOULD cease retransmissions for its check if its pair priority is lower * than the lowest priority nominated pair for that component. * * If a higher priority check is In Progress, this rule would cause that * check to be performed even when it most likely will fail. * - * The macro here controls if ICE session should cancel all In Progress + * The macro here controls if ICE session should cancel all In Progress * checks for the same component regardless of its priority. * * Default: 1 (yes, cancel all) diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h index 0182d63b10ab7b0fa1adbd9d8dac26d100424ed6..c576f4551e47c4acb4ac0618ac5897d00dd631ba 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/ice_strans.h @@ -1,4 +1,4 @@ -/* $Id: ice_strans.h 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: ice_strans.h 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -270,6 +270,13 @@ typedef struct pj_ice_strans_cfg * TURN specific settings. */ struct { + /** + * Optional TURN socket settings. The default values will be + * initialized by #pj_turn_sock_cfg_default(). This contains + * settings such as QoS. + */ + pj_turn_sock_cfg cfg; + /** * Specify the TURN server domain or hostname or IP address. * If DNS SRV resolution is required, application must fill @@ -324,9 +331,82 @@ typedef struct pj_ice_strans_cfg } turn; + /** + * Component specific settings, which will override the settings in + * the STUN and TURN settings above. For example, setting the QoS + * parameters here allows the application to have different QoS + * traffic type for RTP and RTCP component. + */ + struct { + /** + * QoS traffic type to be set on this transport. When application + * wants to apply QoS tagging to the transport, it's preferable to + * set this field rather than \a qos_param fields since this is + * more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a + * lower level operation than setting the \a qos_type field and + * may not be supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + } comp[PJ_ICE_MAX_COMP]; + } pj_ice_strans_cfg; +/** + * ICE stream transport's state. + */ +typedef enum pj_ice_strans_state +{ + /** + * ICE stream transport is not created. + */ + PJ_ICE_STRANS_STATE_NULL, + + /** + * ICE candidate gathering process is in progress. + */ + PJ_ICE_STRANS_STATE_INIT, + + /** + * ICE stream transport initialization/candidate gathering process is + * complete, ICE session may be created on this stream transport. + */ + PJ_ICE_STRANS_STATE_READY, + + /** + * New session has been created and the session is ready. + */ + PJ_ICE_STRANS_STATE_SESS_READY, + + /** + * ICE negotiation is in progress. + */ + PJ_ICE_STRANS_STATE_NEGO, + + /** + * ICE negotiation has completed successfully and media is ready + * to be used. + */ + PJ_ICE_STRANS_STATE_RUNNING, + + /** + * ICE negotiation has completed with failure. + */ + PJ_ICE_STRANS_STATE_FAILED + +} pj_ice_strans_state; + + /** * Initialize ICE transport configuration with default values. * @@ -370,6 +450,26 @@ PJ_DECL(pj_status_t) pj_ice_strans_create(const char *name, const pj_ice_strans_cb *cb, pj_ice_strans **p_ice_st); +/** + * Get ICE session state. + * + * @param ice_st The ICE stream transport. + * + * @return ICE session state. + */ +PJ_DECL(pj_ice_strans_state) pj_ice_strans_get_state(pj_ice_strans *ice_st); + + +/** + * Get string representation of ICE state. + * + * @param state ICE stream transport state. + * + * @return String. + */ +PJ_DECL(const char*) pj_ice_strans_state_name(pj_ice_strans_state state); + + /** * Destroy the ICE stream transport. This will destroy the ICE session * inside the ICE stream transport, close all sockets and release all @@ -521,6 +621,17 @@ PJ_DECL(pj_status_t) pj_ice_strans_get_ufrag_pwd(pj_ice_strans *ice_st, pj_str_t *rem_pwd); +/** + * Get the number of local candidates for the specified component ID. + * + * @param ice_st The ICE stream transport. + * @param comp_id Component ID. + * + * @return The number of candidates. + */ +PJ_DECL(unsigned) pj_ice_strans_get_cands_count(pj_ice_strans *ice_st, + unsigned comp_id); + /** * Enumerate the local candidates for the specified component. * diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h index 0e7a2bce0f837796d3fd4af2ee63173aa550e3e1..a4fd2676c2e13998b9a9767fca8853da98cc78dc 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/stun_sock.h @@ -1,4 +1,4 @@ -/* $Id: stun_sock.h 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: stun_sock.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -28,6 +28,7 @@ #include <pjlib-util/resolver.h> #include <pj/ioqueue.h> #include <pj/sock.h> +#include <pj/sock_qos.h> PJ_BEGIN_DECL @@ -247,6 +248,32 @@ typedef struct pj_stun_sock_cfg */ int ka_interval; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + /** + * Specify if STUN socket should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + } pj_stun_sock_cfg; diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h index b083bf727775b6009efb00ea02b4c49422ec20d0..7ea6ed2ecceeb55b1054073d04bf7c28ab98d6a2 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_session.h @@ -1,4 +1,4 @@ -/* $Id: turn_session.h 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: turn_session.h 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -455,11 +455,19 @@ PJ_DECL(pj_status_t) pj_turn_session_shutdown(pj_turn_session *sess); * be notified about the client destruction. * * @param sess The TURN client session. + * @param last_err Optional error code to be set to the session, + * which would be returned back in the \a info + * parameter of #pj_turn_session_get_info(). If + * this argument value is PJ_SUCCESS, the error + * code will not be set. If the session already + * has an error code set, this function will not + * overwrite that error code either. * * @return PJ_SUCCESS if the operation has been successful, * or the appropriate error code on failure. */ -PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess); +PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess, + pj_status_t last_err); /** diff --git a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h index fdad56197badd248f331a9d18727fd2637160da4..3bbb26ce13a9f35faeddf33ff67e2b98cda61380 100644 --- a/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h +++ b/sflphone-common/libs/pjproject/pjnath/include/pjnath/turn_sock.h @@ -1,4 +1,4 @@ -/* $Id: turn_sock.h 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: turn_sock.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -25,6 +25,7 @@ * @brief TURN relay using UDP client as transport protocol */ #include <pjnath/turn_session.h> +#include <pj/sock_qos.h> PJ_BEGIN_DECL @@ -100,6 +101,48 @@ typedef struct pj_turn_sock_cb } pj_turn_sock_cb; +/** + * This structure describes options that can be specified when creating + * the TURN socket. Application should call #pj_turn_sock_cfg_default() + * to initialize this structure with its default values before using it. + */ +typedef struct pj_turn_sock_cfg +{ + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are not set. + */ + pj_qos_params qos_params; + + /** + * Specify if STUN socket should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + +} pj_turn_sock_cfg; + + +/** + * Initialize pj_turn_sock_cfg structure with default values. + */ +PJ_DECL(void) pj_turn_sock_cfg_default(pj_turn_sock_cfg *cfg); + + /** * Create a TURN transport instance with the specified address family and * connection type. Once TURN transport instance is created, application @@ -114,7 +157,9 @@ typedef struct pj_turn_sock_cb * @param conn_type Connection type to the TURN server. Both TCP and * UDP are supported. * @param cb Callback to receive events from the TURN transport. - * @param options Option flags, currently this value must be zero. + * @param setting Optional settings to be specified to the transport. + * If this parameter is NULL, default values will be + * used. * @param user_data Arbitrary application data to be associated with * this transport. * @param p_turn_sock Pointer to receive the created instance of the @@ -127,7 +172,7 @@ PJ_DECL(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, int af, pj_turn_tp_type conn_type, const pj_turn_sock_cb *cb, - unsigned options, + const pj_turn_sock_cfg *setting, void *user_data, pj_turn_sock **p_turn_sock); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c index 587c5a2e4628be262841b4b987c7cb557abb67ba..bfda94244edffe0c47701aa00b7331a56751b5c7 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath-test/stun.c @@ -1,4 +1,4 @@ -/* $Id: stun.c 2775 2009-06-18 14:04:44Z nanang $ */ +/* $Id: stun.c 2938 2009-10-11 05:06:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -479,7 +479,9 @@ static struct test_vector "", "", &create_msgint1 - }, + } + /* disabled: see http://trac.pjsip.org/repos/ticket/960 + , { PJ_STUN_BINDING_RESPONSE, "\xb7\xe7\xa7\x01\xbc\x34\xd6\x86\xfa\x87\xdf\xae", @@ -503,6 +505,9 @@ static struct test_vector "", &create_msgint2 } + */ + + /* disabled: see http://trac.pjsip.org/repos/ticket/960 #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6!=0 , { @@ -542,6 +547,7 @@ static struct test_vector &create_msgint3 } #endif + */ }; @@ -591,6 +597,10 @@ static int fingerprint_test_vector() unsigned i; int rc = 0; + /* To avoid function not referenced warnings */ + (void)create_msgint2; + (void)create_msgint3; + PJ_LOG(3,(THIS_FILE, " draft-denis-behave-rfc3489bis-test-vectors-02")); pool = pj_pool_create(mem, "fingerprint", 1024, 1024, NULL); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c index 80c27358dcef530fef0c5cefb0828d17d7596862..3a7727d0c9f92f1d28ad44f070ac100f03930564 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_session.c @@ -1,4 +1,4 @@ -/* $Id: ice_session.c 2827 2009-07-02 11:09:23Z nanang $ */ +/* $Id: ice_session.c 3022 2009-11-23 15:02:18Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -531,7 +531,9 @@ PJ_DEF(pj_status_t) pj_ice_sess_set_prefs(pj_ice_sess *ice, ice->prefs = (pj_uint8_t*) pj_pool_calloc(ice->pool, PJ_ARRAY_SIZE(prefs), sizeof(pj_uint8_t)); for (i=0; i<4; ++i) { +#if PJ_ICE_CAND_TYPE_PREF_BITS < 8 pj_assert(prefs[i] < (2 << PJ_ICE_CAND_TYPE_PREF_BITS)); +#endif ice->prefs[i] = prefs[i]; } return PJ_SUCCESS; @@ -947,12 +949,24 @@ static void clist_set_state(pj_ice_sess *ice, pj_ice_sess_checklist *clist, } /* Sort checklist based on priority */ -static void sort_checklist(pj_ice_sess_checklist *clist) +static void sort_checklist(pj_ice_sess *ice, pj_ice_sess_checklist *clist) { unsigned i; + pj_ice_sess_check **check_ptr[PJ_ICE_MAX_COMP*2]; + unsigned check_ptr_cnt = 0; + + for (i=0; i<ice->comp_cnt; ++i) { + if (ice->comp[i].valid_check) { + check_ptr[check_ptr_cnt++] = &ice->comp[i].valid_check; + } + if (ice->comp[i].nominated_check) { + check_ptr[check_ptr_cnt++] = &ice->comp[i].nominated_check; + } + } for (i=0; i<clist->count-1; ++i) { unsigned j, highest = i; + for (j=i+1; j<clist->count; ++j) { if (CMP_CHECK_PRIO(&clist->checks[j], &clist->checks[highest]) > 0) { highest = j; @@ -961,12 +975,23 @@ static void sort_checklist(pj_ice_sess_checklist *clist) if (highest != i) { pj_ice_sess_check tmp; + unsigned k; pj_memcpy(&tmp, &clist->checks[i], sizeof(pj_ice_sess_check)); pj_memcpy(&clist->checks[i], &clist->checks[highest], sizeof(pj_ice_sess_check)); pj_memcpy(&clist->checks[highest], &tmp, sizeof(pj_ice_sess_check)); + + /* Update valid and nominated check pointers, since we're moving + * around checks + */ + for (k=0; k<check_ptr_cnt; ++k) { + if (*check_ptr[k] == &clist->checks[highest]) + *check_ptr[k] = &clist->checks[i]; + else if (*check_ptr[k] == &clist->checks[i]) + *check_ptr[k] = &clist->checks[highest]; + } } } } @@ -1099,6 +1124,7 @@ static void on_timer(pj_timer_heap_t *th, pj_timer_entry *te) { pj_ice_sess *ice = (pj_ice_sess*) te->user_data; enum timer_type type = (enum timer_type)te->id; + pj_bool_t has_mutex = PJ_TRUE; PJ_UNUSED_ARG(th); @@ -1114,16 +1140,27 @@ static void on_timer(pj_timer_heap_t *th, pj_timer_entry *te) on_ice_complete(ice, PJNATH_EICENOMTIMEOUT); break; case TIMER_COMPLETION_CALLBACK: - /* Start keep-alive timer but don't send any packets yet. - * Need to do it here just in case app destroy the session - * in the callback. - */ - if (ice->ice_status == PJ_SUCCESS) - ice_keep_alive(ice, PJ_FALSE); + { + void (*on_ice_complete)(pj_ice_sess *ice, pj_status_t status); + pj_status_t ice_status; + + /* Start keep-alive timer but don't send any packets yet. + * Need to do it here just in case app destroy the session + * in the callback. + */ + if (ice->ice_status == PJ_SUCCESS) + ice_keep_alive(ice, PJ_FALSE); - /* Notify app about ICE completion*/ - if (ice->cb.on_ice_complete) - (*ice->cb.on_ice_complete)(ice, ice->ice_status); + /* Release mutex in case app destroy us in the callback */ + ice_status = ice->ice_status; + on_ice_complete = ice->cb.on_ice_complete; + has_mutex = PJ_FALSE; + pj_mutex_unlock(ice->mutex); + + /* Notify app about ICE completion*/ + if (on_ice_complete) + (*on_ice_complete)(ice, ice_status); + } break; case TIMER_START_NOMINATED_CHECK: start_nominated_check(ice); @@ -1136,7 +1173,8 @@ static void on_timer(pj_timer_heap_t *th, pj_timer_entry *te) break; } - pj_mutex_unlock(ice->mutex); + if (has_mutex) + pj_mutex_unlock(ice->mutex); } /* Send keep-alive */ @@ -1651,7 +1689,7 @@ PJ_DEF(pj_status_t) pj_ice_sess_create_check_list( } /* Sort checklist based on priority */ - sort_checklist(clist); + sort_checklist(ice, clist); /* Prune the checklist */ status = prune_checklist(ice, clist); @@ -1904,7 +1942,7 @@ static void start_nominated_check(pj_ice_sess *ice) } /* And (re)start the periodic check */ - if (!ice->clist.timer.id) { + if (ice->clist.timer.id) { pj_timer_heap_cancel(ice->stun_cfg.timer_heap, &ice->clist.timer); ice->clist.timer.id = PJ_FALSE; } @@ -2313,12 +2351,14 @@ static void on_stun_request_complete(pj_stun_session *stun_sess, ice->valid_list.checks[i].nominated = check->nominated; } - /* Sort valid_list */ - sort_checklist(&ice->valid_list); - /* Update valid check and nominated check for the component */ update_comp_check(ice, new_check->lcand->comp_id, new_check); + /* Sort valid_list (must do so after update_comp_check(), otherwise + * new_check will point to something else (#953) + */ + sort_checklist(ice, &ice->valid_list); + /* 7.1.2.2.2. Updating Pair States * * The agent sets the state of the pair that generated the check to diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c index 17656565344779bf4d921594e22e18e6dd8f3c33..fa6c067b9a0a418d0f0cb3cc4496a063b46cf707 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/ice_strans.c @@ -1,4 +1,4 @@ -/* $Id: ice_strans.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: ice_strans.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -173,6 +173,7 @@ struct pj_ice_strans pj_ice_strans_cb cb; /**< Application callback. */ pj_lock_t *init_lock; /**< Initialization mutex. */ + pj_ice_strans_state state; /**< Session state. */ pj_ice_sess *ice; /**< ICE session. */ pj_time_val start_time;/**< Time when ICE was started */ @@ -210,6 +211,7 @@ PJ_DEF(void) pj_ice_strans_cfg_default(pj_ice_strans_cfg *cfg) pj_stun_config_init(&cfg->stun_cfg, NULL, 0, NULL, NULL); pj_stun_sock_cfg_default(&cfg->stun.cfg); pj_turn_alloc_param_default(&cfg->turn.alloc_param); + pj_turn_sock_cfg_default(&cfg->turn.cfg); pj_ice_sess_options_default(&cfg->opt); @@ -272,6 +274,17 @@ static pj_status_t create_comp(pj_ice_strans *ice_st, unsigned comp_id) stun_sock_cb.on_status = &stun_on_status; stun_sock_cb.on_data_sent = &stun_on_data_sent; + /* Override component specific QoS settings, if any */ + if (ice_st->cfg.comp[comp_id-1].qos_type) { + ice_st->cfg.stun.cfg.qos_type = + ice_st->cfg.comp[comp_id-1].qos_type; + } + if (ice_st->cfg.comp[comp_id-1].qos_params.flags) { + pj_memcpy(&ice_st->cfg.stun.cfg.qos_params, + &ice_st->cfg.comp[comp_id-1].qos_params, + sizeof(ice_st->cfg.stun.cfg.qos_params)); + } + /* Create the STUN transport */ status = pj_stun_sock_create(&ice_st->cfg.stun_cfg, NULL, ice_st->cfg.af, &stun_sock_cb, @@ -390,10 +403,22 @@ static pj_status_t create_comp(pj_ice_strans *ice_st, unsigned comp_id) turn_sock_cb.on_rx_data = &turn_on_rx_data; turn_sock_cb.on_state = &turn_on_state; + /* Override with component specific QoS settings, if any */ + if (ice_st->cfg.comp[comp_id-1].qos_type) { + ice_st->cfg.turn.cfg.qos_type = + ice_st->cfg.comp[comp_id-1].qos_type; + } + if (ice_st->cfg.comp[comp_id-1].qos_params.flags) { + pj_memcpy(&ice_st->cfg.turn.cfg.qos_params, + &ice_st->cfg.comp[comp_id-1].qos_params, + sizeof(ice_st->cfg.turn.cfg.qos_params)); + } + + /* Create the TURN transport */ status = pj_turn_sock_create(&ice_st->cfg.stun_cfg, ice_st->cfg.af, ice_st->cfg.turn.conn_type, - &turn_sock_cb, 0, comp, - &comp->turn_sock); + &turn_sock_cb, &ice_st->cfg.turn.cfg, + comp, &comp->turn_sock); if (status != PJ_SUCCESS) { return status; } @@ -452,7 +477,8 @@ PJ_DEF(pj_status_t) pj_ice_strans_create( const char *name, if (status != PJ_SUCCESS) return status; - PJ_ASSERT_RETURN(comp_cnt && cb && p_ice_st, PJ_EINVAL); + PJ_ASSERT_RETURN(comp_cnt && cb && p_ice_st && + comp_cnt <= PJ_ICE_MAX_COMP , PJ_EINVAL); if (name == NULL) name = "ice%p"; @@ -488,6 +514,9 @@ PJ_DEF(pj_status_t) pj_ice_strans_create( const char *name, ice_st->comp = (pj_ice_strans_comp**) pj_pool_calloc(pool, comp_cnt, sizeof(pj_ice_strans_comp*)); + /* Move state to candidate gathering */ + ice_st->state = PJ_ICE_STRANS_STATE_INIT; + /* Acquire initialization mutex to prevent callback to be * called before we finish initialization. */ @@ -561,6 +590,29 @@ static void destroy_ice_st(pj_ice_strans *ice_st) pj_pool_release(ice_st->pool); } +/* Get ICE session state. */ +PJ_DEF(pj_ice_strans_state) pj_ice_strans_get_state(pj_ice_strans *ice_st) +{ + return ice_st->state; +} + +/* State string */ +PJ_DEF(const char*) pj_ice_strans_state_name(pj_ice_strans_state state) +{ + const char *names[] = { + "Null", + "Candidate Gathering", + "Candidate Gathering Complete", + "Session Initialized", + "Negotiation In Progress", + "Negotiation Success", + "Negotiation Failed" + }; + + PJ_ASSERT_RETURN(state <= PJ_ICE_STRANS_STATE_FAILED, "???"); + return names[state]; +} + /* Notification about failure */ static void sess_fail(pj_ice_strans *ice_st, pj_ice_strans_op op, const char *title, pj_status_t status) @@ -603,6 +655,7 @@ static void sess_init_update(pj_ice_strans *ice_st) /* All candidates have been gathered */ ice_st->cb_called = PJ_TRUE; + ice_st->state = PJ_ICE_STRANS_STATE_READY; if (ice_st->cb.on_ice_complete) (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_INIT, PJ_SUCCESS); @@ -782,6 +835,9 @@ PJ_DEF(pj_status_t) pj_ice_strans_init_ice(pj_ice_strans *ice_st, } } + /* ICE session is ready for negotiation */ + ice_st->state = PJ_ICE_STRANS_STATE_SESS_READY; + return PJ_SUCCESS; on_error: @@ -855,6 +911,27 @@ PJ_DEF(pj_status_t) pj_ice_strans_get_ufrag_pwd( pj_ice_strans *ice_st, return PJ_SUCCESS; } +/* + * Get number of candidates + */ +PJ_DEF(unsigned) pj_ice_strans_get_cands_count(pj_ice_strans *ice_st, + unsigned comp_id) +{ + unsigned i, cnt; + + PJ_ASSERT_RETURN(ice_st && ice_st->ice && comp_id && + comp_id <= ice_st->comp_cnt, 0); + + cnt = 0; + for (i=0; i<ice_st->ice->lcand_cnt; ++i) { + if (ice_st->ice->lcand[i].comp_id != comp_id) + continue; + ++cnt; + } + + return cnt; +} + /* * Enum candidates */ @@ -982,6 +1059,7 @@ PJ_DEF(pj_status_t) pj_ice_strans_start_ice( pj_ice_strans *ice_st, return status; } + ice_st->state = PJ_ICE_STRANS_STATE_NEGO; return status; } @@ -1011,6 +1089,7 @@ PJ_DEF(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st) ice_st->ice = NULL; } + ice_st->state = PJ_ICE_STRANS_STATE_INIT; return PJ_SUCCESS; } @@ -1169,6 +1248,9 @@ static void on_ice_complete(pj_ice_sess *ice, pj_status_t status) } } + ice_st->state = (status==PJ_SUCCESS) ? PJ_ICE_STRANS_STATE_RUNNING : + PJ_ICE_STRANS_STATE_FAILED; + (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_NEGOTIATION, status); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c index 00f0cf148f04dbf87054a2afa34d228908dca09a..a90b0aeb9859ba848d35a0199ee86c7f7ee5301d 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_msg.c @@ -1,4 +1,4 @@ -/* $Id: stun_msg.c 2691 2009-05-12 10:01:21Z bennylp $ */ +/* $Id: stun_msg.c 2928 2009-10-07 08:38:02Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1234,8 +1234,23 @@ static pj_status_t encode_string_attr(const void *a, pj_uint8_t *buf, } PUTVAL16H(buf, 0, ca->hdr.type); - PUTVAL16H(buf, 2, (pj_uint16_t)ca->value.slen); - + + /* Special treatment for SOFTWARE attribute: + * This attribute had caused interop problem when talking to + * legacy RFC 3489 STUN servers, due to different "length" + * rules with RFC 5389. + */ + if (msghdr->magic != PJ_STUN_MAGIC || + ca->hdr.type == PJ_STUN_ATTR_SOFTWARE) + { + /* Set the length to be 4-bytes aligned so that we can + * communicate with RFC 3489 endpoints + */ + PUTVAL16H(buf, 2, (pj_uint16_t)((ca->value.slen + 3) & (~3))); + } else { + /* Use RFC 5389 rule */ + PUTVAL16H(buf, 2, (pj_uint16_t)ca->value.slen); + } /* Copy the string */ pj_memcpy(buf+ATTR_HDR_LEN, ca->value.ptr, ca->value.slen); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c index 414d422889b081f9d2ac3ddae3af66abdbee3c1f..5b149d5834ca51ea912bcce183716bc1a4a708d7 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_session.c @@ -1,4 +1,4 @@ -/* $Id: stun_session.c 2773 2009-06-17 19:14:20Z bennylp $ */ +/* $Id: stun_session.c 2938 2009-10-11 05:06:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -227,7 +227,7 @@ static pj_status_t apply_msg_options(pj_stun_session *sess, if (sess->srv_name.slen && pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_SOFTWARE, 0)==NULL && (PJ_STUN_IS_RESPONSE(msg->hdr.type) || - PJ_STUN_IS_REQUEST(msg->hdr.type) && msg->hdr.magic==PJ_STUN_MAGIC)) + (PJ_STUN_IS_REQUEST(msg->hdr.type) && msg->hdr.magic==PJ_STUN_MAGIC))) { pj_stun_msg_add_string_attr(pool, msg, PJ_STUN_ATTR_SOFTWARE, &sess->srv_name); diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c index 213b05cf2a7e860997daedeb4499c176bfe1aa6c..2ba37f82e0fbd7cbebda7e359a2f88f18d2a8405 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/stun_sock.c @@ -1,4 +1,4 @@ -/* $Id: stun_sock.c 2667 2009-04-30 17:14:50Z bennylp $ */ +/* $Id: stun_sock.c 2993 2009-11-09 04:32:33Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -136,6 +136,8 @@ PJ_DEF(void) pj_stun_sock_cfg_default(pj_stun_sock_cfg *cfg) cfg->max_pkt_size = PJ_STUN_SOCK_PKT_LEN; cfg->async_cnt = 1; cfg->ka_interval = PJ_STUN_KEEP_ALIVE_SEC; + cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + cfg->qos_ignore_error = PJ_TRUE; } @@ -200,6 +202,14 @@ PJ_DEF(pj_status_t) pj_stun_sock_create( pj_stun_config *stun_cfg, if (status != PJ_SUCCESS) goto on_error; + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(stun_sock->sock_fd, cfg->qos_type, + &cfg->qos_params, 2, stun_sock->obj_name, + NULL); + if (status != PJ_SUCCESS && !cfg->qos_ignore_error) + goto on_error; + + /* Bind socket */ if (pj_sockaddr_has_addr(&cfg->bound_addr)) { status = pj_sock_bind(stun_sock->sock_fd, &cfg->bound_addr, pj_sockaddr_get_len(&cfg->bound_addr)); @@ -429,12 +439,11 @@ static pj_bool_t sess_fail(pj_stun_sock *stun_sock, pj_stun_sock_op op, pj_status_t status) { - char errmsg[PJ_ERR_MSG_SIZE]; pj_bool_t ret; - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(stun_sock->obj_name, "Session failed because %s failed: %s", - pj_stun_sock_op_name(op), errmsg)); + PJ_PERROR(4,(stun_sock->obj_name, status, + "Session failed because %s failed", + pj_stun_sock_op_name(op))); ret = (*stun_sock->cb.on_status)(stun_sock, op, status); @@ -758,10 +767,7 @@ static pj_bool_t on_data_recvfrom(pj_activesock_t *asock, /* Log socket error */ if (status != PJ_SUCCESS) { - char errmsg[PJ_ERR_MSG_SIZE]; - - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(2,(stun_sock->obj_name, "recvfrom() error: %s", errmsg)); + PJ_PERROR(2,(stun_sock->obj_name, status, "recvfrom() error")); return PJ_TRUE; } diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c index 1c264968acbd646dfd7ddfeac6ae238364f3da91..98a7371cd49c58e1684265a0622acbc1dbc17b9e 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_session.c @@ -1,4 +1,4 @@ -/* $Id: turn_session.c 2774 2009-06-17 19:20:11Z bennylp $ */ +/* $Id: turn_session.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -461,10 +461,13 @@ PJ_DEF(pj_status_t) pj_turn_session_shutdown(pj_turn_session *sess) /** * Forcefully destroy the TURN session. */ -PJ_DEF(pj_status_t) pj_turn_session_destroy( pj_turn_session *sess) +PJ_DEF(pj_status_t) pj_turn_session_destroy( pj_turn_session *sess, + pj_status_t last_err) { PJ_ASSERT_RETURN(sess, PJ_EINVAL); + if (last_err != PJ_SUCCESS && sess->last_status == PJ_SUCCESS) + sess->last_status = last_err; set_state(sess, PJ_TURN_STATE_DEALLOCATED); sess_shutdown(sess, PJ_SUCCESS); return PJ_SUCCESS; @@ -959,12 +962,16 @@ PJ_DEF(pj_status_t) pj_turn_session_sendto( pj_turn_session *sess, ch = lookup_ch_by_addr(sess, addr, pj_sockaddr_get_len(addr), PJ_FALSE, PJ_FALSE); if (ch && ch->num != PJ_TURN_INVALID_CHANNEL && ch->bound) { + unsigned total_len; + /* Peer is assigned a channel number, we can use ChannelData */ pj_turn_channel_data *cd = (pj_turn_channel_data*)sess->tx_pkt; pj_assert(sizeof(*cd)==4); - if (pkt_len > sizeof(sess->tx_pkt)-sizeof(*cd)) { + /* Calculate total length, including paddings */ + total_len = (pkt_len + sizeof(*cd) + 3) & (~3); + if (total_len > sizeof(sess->tx_pkt)) { status = PJ_ETOOBIG; goto on_return; } @@ -975,7 +982,7 @@ PJ_DEF(pj_status_t) pj_turn_session_sendto( pj_turn_session *sess, pj_assert(sess->srv_addr != NULL); - status = sess->cb.on_send_pkt(sess, sess->tx_pkt, pkt_len+sizeof(*cd), + status = sess->cb.on_send_pkt(sess, sess->tx_pkt, total_len, sess->srv_addr, pj_sockaddr_get_len(sess->srv_addr)); @@ -1156,7 +1163,8 @@ PJ_DEF(pj_status_t) pj_turn_session_on_rx_pkt(pj_turn_session *sess, goto on_return; } else { if (parsed_len) { - *parsed_len = cd.length + sizeof(cd); + /* Apply padding too */ + *parsed_len = ((cd.length + 3) & (~3)) + sizeof(cd); } } diff --git a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c index 53a4d2a840ac0a0f3dbfd9443b4e83374dd56b5a..70acf7481d775b095974ec2efec89bda68c38108 100644 --- a/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c +++ b/sflphone-common/libs/pjproject/pjnath/src/pjnath/turn_sock.c @@ -1,4 +1,4 @@ -/* $Id: turn_sock.c 2642 2009-04-22 17:20:24Z bennylp $ */ +/* $Id: turn_sock.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -46,6 +46,7 @@ struct pj_turn_sock pj_turn_alloc_param alloc_param; pj_stun_config cfg; + pj_turn_sock_cfg setting; pj_bool_t destroy_request; pj_timer_entry timer; @@ -92,6 +93,14 @@ static void destroy(pj_turn_sock *turn_sock); static void timer_cb(pj_timer_heap_t *th, pj_timer_entry *e); +/* Init config */ +PJ_DEF(void) pj_turn_sock_cfg_default(pj_turn_sock_cfg *cfg) +{ + pj_bzero(cfg, sizeof(*cfg)); + cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + cfg->qos_ignore_error = PJ_TRUE; +} + /* * Create. */ @@ -99,21 +108,26 @@ PJ_DEF(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, int af, pj_turn_tp_type conn_type, const pj_turn_sock_cb *cb, - unsigned options, + const pj_turn_sock_cfg *setting, void *user_data, pj_turn_sock **p_turn_sock) { pj_turn_sock *turn_sock; pj_turn_session_cb sess_cb; + pj_turn_sock_cfg default_setting; pj_pool_t *pool; const char *name_tmpl; pj_status_t status; PJ_ASSERT_RETURN(cfg && p_turn_sock, PJ_EINVAL); PJ_ASSERT_RETURN(af==pj_AF_INET() || af==pj_AF_INET6(), PJ_EINVAL); - PJ_ASSERT_RETURN(options==0, PJ_EINVAL); PJ_ASSERT_RETURN(conn_type!=PJ_TURN_TP_TCP || PJ_HAS_TCP, PJ_EINVAL); + if (!setting) { + pj_turn_sock_cfg_default(&default_setting); + setting = &default_setting; + } + switch (conn_type) { case PJ_TURN_TP_UDP: name_tmpl = "udprel%p"; @@ -139,6 +153,9 @@ PJ_DEF(pj_status_t) pj_turn_sock_create(pj_stun_config *cfg, /* Copy STUN config (this contains ioqueue, timer heap, etc.) */ pj_memcpy(&turn_sock->cfg, cfg, sizeof(*cfg)); + /* Copy setting (QoS parameters etc */ + pj_memcpy(&turn_sock->setting, setting, sizeof(*setting)); + /* Set callback */ if (cb) { pj_memcpy(&turn_sock->cb, cb, sizeof(*cb)); @@ -256,14 +273,7 @@ static void timer_cb(pj_timer_heap_t *th, pj_timer_entry *e) static void show_err(pj_turn_sock *turn_sock, const char *title, pj_status_t status) { - char errmsg[PJ_ERR_MSG_SIZE]; - - if (status != PJ_SUCCESS) { - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(4,(turn_sock->obj_name, "%s: %s", title, errmsg)); - } else { - PJ_LOG(4,(turn_sock->obj_name, "%s", title, errmsg)); - } + PJ_PERROR(4,(turn_sock->obj_name, status, title)); } /* On error, terminate session */ @@ -271,8 +281,9 @@ static void sess_fail(pj_turn_sock *turn_sock, const char *title, pj_status_t status) { show_err(turn_sock, title, status); - if (turn_sock->sess) - pj_turn_session_destroy(turn_sock->sess); + if (turn_sock->sess) { + pj_turn_session_destroy(turn_sock->sess, status); + } } /* @@ -477,6 +488,49 @@ static pj_bool_t on_connect_complete(pj_activesock_t *asock, return PJ_TRUE; } +static pj_uint16_t GETVAL16H(const pj_uint8_t *buf, unsigned pos) +{ + return (pj_uint16_t) ((buf[pos + 0] << 8) | \ + (buf[pos + 1] << 0)); +} + +/* Quick check to determine if there is enough packet to process in the + * incoming buffer. Return the packet length, or zero if there's no packet. + */ +static unsigned has_packet(pj_turn_sock *turn_sock, const void *buf, pj_size_t bufsize) +{ + pj_bool_t is_stun; + + if (turn_sock->conn_type == PJ_TURN_TP_UDP) + return bufsize; + + /* Quickly check if this is STUN message, by checking the first two bits and + * size field which must be multiple of 4 bytes + */ + is_stun = ((((pj_uint8_t*)buf)[0] & 0xC0) == 0) && + ((GETVAL16H((const pj_uint8_t*)buf, 2) & 0x03)==0); + + if (is_stun) { + pj_size_t msg_len = GETVAL16H((const pj_uint8_t*)buf, 2); + return (msg_len+20 <= bufsize) ? msg_len+20 : 0; + } else { + /* This must be ChannelData. */ + pj_turn_channel_data cd; + + if (bufsize < 4) + return 0; + + /* Decode ChannelData packet */ + pj_memcpy(&cd, buf, sizeof(pj_turn_channel_data)); + cd.length = pj_ntohs(cd.length); + + if (bufsize >= cd.length+sizeof(cd)) + return (cd.length+sizeof(cd)+3) & (~3); + else + return 0; + } +} + /* * Notification from ioqueue when incoming UDP packet is received. */ @@ -487,21 +541,51 @@ static pj_bool_t on_data_read(pj_activesock_t *asock, pj_size_t *remainder) { pj_turn_sock *turn_sock; - pj_size_t parsed_len; pj_bool_t ret = PJ_TRUE; turn_sock = (pj_turn_sock*) pj_activesock_get_user_data(asock); pj_lock_acquire(turn_sock->lock); if (status == PJ_SUCCESS && turn_sock->sess) { - /* Report incoming packet to TURN session */ - parsed_len = (unsigned)size; - pj_turn_session_on_rx_pkt(turn_sock->sess, data, size, &parsed_len); - if (parsed_len < (unsigned)size) { - *remainder = size - parsed_len; - pj_memmove(data, ((char*)data)+parsed_len, *remainder); - } else { - *remainder = 0; + /* Report incoming packet to TURN session, repeat while we have + * "packet" in the buffer (required for stream-oriented transports) + */ + unsigned pkt_len; + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Incoming data, %lu bytes total buffer", size)); + + while ((pkt_len=has_packet(turn_sock, data, size)) != 0) { + pj_size_t parsed_len; + //const pj_uint8_t *pkt = (const pj_uint8_t*)data; + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Packet start: %02X %02X %02X %02X", + // pkt[0], pkt[1], pkt[2], pkt[3])); + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Processing %lu bytes packet of %lu bytes total buffer", + // pkt_len, size)); + + parsed_len = (unsigned)size; + pj_turn_session_on_rx_pkt(turn_sock->sess, data, size, &parsed_len); + + /* parsed_len may be zero if we have parsing error, so use our + * previous calculation to exhaust the bad packet. + */ + if (parsed_len == 0) + parsed_len = pkt_len; + + if (parsed_len < (unsigned)size) { + *remainder = size - parsed_len; + pj_memmove(data, ((char*)data)+parsed_len, *remainder); + } else { + *remainder = 0; + } + size = *remainder; + + //PJ_LOG(5,(turn_sock->pool->obj_name, + // "Buffer size now %lu bytes", size)); } } else if (status != PJ_SUCCESS && turn_sock->conn_type != PJ_TURN_TP_UDP) @@ -652,6 +736,16 @@ static void turn_on_state(pj_turn_session *sess, return; } + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, turn_sock->setting.qos_type, + &turn_sock->setting.qos_params, + (turn_sock->setting.qos_ignore_error?2:1), + turn_sock->pool->obj_name, NULL); + if (status != PJ_SUCCESS && !turn_sock->setting.qos_ignore_error) { + pj_turn_sock_destroy(turn_sock); + return; + } + /* Create active socket */ pj_bzero(&asock_cb, sizeof(asock_cb)); asock_cb.on_data_read = &on_data_read; diff --git a/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile b/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile index 3752b731110424f1b044fb05091bdc8f55d9d1c1..08e2ca00cd2e6dda86ccf175eb57a0eb80f30ee4 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile +++ b/sflphone-common/libs/pjproject/pjsip-apps/build/Makefile @@ -4,16 +4,16 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=../../pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -PJNATH_LIB:=../../pjnath/lib/libpjnath-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_AUDIODEV_LIB:=../../pjmedia/lib/libpjmedia-audiodev-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME)$(LIBEXT) -PJSIP_LIB:=../../pjsip/lib/libpjsip-sfl-$(TARGET_NAME)$(LIBEXT) -PJSIP_UA_LIB:=../../pjsip/lib/libpjsip-ua-sfl-$(TARGET_NAME)$(LIBEXT) -PJSIP_SIMPLE_LIB:=../../pjsip/lib/libpjsip-simple-sfl-$(TARGET_NAME)$(LIBEXT) -PJSUA_LIB_LIB=../../pjsip/lib/libpjsua-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +PJNATH_LIB:=../../pjnath/lib/libpjnath-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_AUDIODEV_LIB:=../../pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) +PJSIP_LIB:=../../pjsip/lib/libpjsip-$(TARGET_NAME)$(LIBEXT) +PJSIP_UA_LIB:=../../pjsip/lib/libpjsip-ua-$(TARGET_NAME)$(LIBEXT) +PJSIP_SIMPLE_LIB:=../../pjsip/lib/libpjsip-simple-$(TARGET_NAME)$(LIBEXT) +PJSUA_LIB_LIB=../../pjsip/lib/libpjsua-$(TARGET_NAME)$(LIBEXT) ############################################################################### @@ -39,12 +39,23 @@ export PJSUA_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) export PJSUA_EXE:=../bin/pjsua-$(TARGET_NAME)$(HOST_EXE) +############################################################################### +# Defines for building pjsystest +# +export PJSYSTEST_SRCDIR = ../src/pjsystest +export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ + systest.o main_console.o +export PJSYSTEST_CFLAGS += $(_CFLAGS) +export PJSYSTEST_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) +export PJSYSTEST_EXE:=../bin/pjsystest-$(TARGET_NAME)$(HOST_EXE) + + export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT ############################################################################### # Main entry # # -TARGETS := pjsua samples +TARGETS := pjsua pjsystest samples .PHONY: $(TARGETS) @@ -60,6 +71,9 @@ distclean: realclean pjsua: $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(PJSUA_EXE) +pjsystest: + $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(PJSYSTEST_EXE) + samples: $(MAKE) -f Samples.mak @@ -69,9 +83,11 @@ samples: clean depend realclean: $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $@ + $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $@ $(MAKE) -f Samples.mak $@ @if test "$@" = "depend"; then \ echo '$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ + echo '$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \ fi diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/confbot.py b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/confbot.py new file mode 100644 index 0000000000000000000000000000000000000000..572c50c117f38440cf176c3cbb31b44cbf12eb9b --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/confbot.py @@ -0,0 +1,575 @@ +# $Id: confbot.py 2912 2009-08-24 11:56:13Z bennylp $ +# +# SIP Conference Bot +# +# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +import pjsua as pj +import string +import sys + +CFG_FILE = "config" + +INFO = 1 +TRACE = 2 + +# Call callback. This would just forward the event to the Member class +class CallCb(pj.CallCallback): + def __init__(self, member, call=None): + pj.CallCallback.__init__(self, call) + self.member = member + + def on_state(self): + self.member.on_call_state(self.call) + + def on_media_state(self): + self.member.on_call_media_state(self.call) + + def on_dtmf_digit(self, digits): + self.member.on_call_dtmf_digit(self.call, digits) + + def on_transfer_request(self, dst, code): + return self.member.on_call_transfer_request(self.call, dst, code) + + def on_transfer_status(self, code, reason, final, cont): + return self.member.on_call_transfer_status(self.call, code, reason, final, cont) + + def on_replace_request(self, code, reason): + return self.member.on_call_replace_request(self.call, code, reason) + + def on_replaced(self, new_call): + self.member.on_call_replaced(self.call, new_call) + + def on_typing(self, is_typing): + self.member.on_typing(is_typing, call=self.call) + + def on_pager(self, mime_type, body): + self.member.on_pager(mime_type, body, call=self.call) + + def on_pager_status(self, body, im_id, code, reason): + self.member.on_pager_status(body, im_id, code, reason, call=self.call) + +# Buddy callback. This would just forward the event to Member class +class BuddyCb(pj.BuddyCallback): + def __init__(self, member, buddy=None): + pj.BuddyCallback.__init__(self, buddy) + self.member = member + + def on_pager(self, mime_type, body): + self.member.on_pager(mime_type, body, buddy=self.buddy) + + def on_pager_status(self, body, im_id, code, reason): + self.member.on_pager_status(body, im_id, code, reason, buddy=self.buddy) + + def on_state(self): + self.member.on_pres_state(self.buddy) + + def on_typing(self, is_typing): + self.member.on_typing(is_typing, buddy=self.buddy) + + + + +############################################################################## +# +# +# This class represents individual room member (either/both chat and voice conf) +# +# +class Member: + def __init__(self, bot, uri): + self.uri = uri + self.bot = bot + self.call = None + self.buddy = None + self.bi = pj.BuddyInfo() + self.in_chat = False + self.in_voice = False + self.im_error = False + self.html = False + + def __str__(self): + str = string.ljust(self.uri, 30) + " -- " + if self.buddy: + bi = self.buddy.info() + str = str + bi.online_text + else: + str = str + "Offline" + str = str + " [" + if (self.in_voice): + str = str + " voice" + if (self.in_chat): + str = str + " chat" + if (self.html): + str = str + " html" + else: + str = str + " plain" + + if (self.im_error): + str = str + " im_error" + str = str + "]" + return str + + def join_call(self, call): + if self.call: + self.call.hangup(603, "You have been disconnected for making another call") + self.call = call + call.set_callback(CallCb(self, call)) + msg = "%(uri)s is attempting to join the voice conference" % \ + {'uri': self.uri} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(None, msg) + + def join_chat(self): + if not self.buddy: + self.bot.DEBUG(self.uri + " joining chatroom...\n", INFO) + self.buddy = self.bot.acc.add_buddy(self.uri) + self.buddy.set_callback(BuddyCb(self, self.buddy)) + self.buddy.subscribe() + else: + self.bot.DEBUG(self.uri + " already in chatroom, resubscribing..\n", INFO) + self.buddy.subscribe() + + def send_pager(self, body, mime="text/plain"): + self.bot.DEBUG("send_pager() to " + self.uri) + if self.in_chat and not self.im_error and self.buddy: + if self.html: + #This will make us receive html! + #mime = "text/html" + body = body.replace("<", "<") + body = body.replace(">", ">") + body = body.replace('"', """) + body = body.replace("\n", "<BR>\n") + self.buddy.send_pager(body, content_type=mime) + self.bot.DEBUG("..sent\n") + else: + self.bot.DEBUG("..not sent!\n") + + def on_call_state(self, call): + ci = call.info() + if ci.state==pj.CallState.DISCONNECTED: + if self.in_voice: + msg = "%(uri)s has left the voice conference (%(1)d/%(2)s)" % \ + {'uri': self.uri, '1': ci.last_code, '2': ci.last_reason} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(None, msg) + self.in_voice = False + self.call = None + self.bot.on_member_left(self) + elif ci.state==pj.CallState.CONFIRMED: + msg = "%(uri)s has joined the voice conference" % \ + {'uri': self.uri} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(None, msg) + + def on_call_media_state(self, call): + self.bot.DEBUG("Member.on_call_media_state\n") + ci = call.info() + if ci.conf_slot!=-1: + if not self.in_voice: + msg = self.uri + " call media is active" + self.bot.broadcast_pager(None, msg) + self.in_voice = True + self.bot.add_to_voice_conf(self) + else: + if self.in_voice: + msg = self.uri + " call media is inactive" + self.bot.broadcast_pager(None, msg) + self.in_voice = False + + def on_call_dtmf_digit(self, call, digits): + msg = "%(uri)s sent DTMF digits %(dig)s" % \ + {'uri': self.uri, 'dig': digits} + self.bot.broadcast_pager(None, msg) + + def on_call_transfer_request(self, call, dst, code): + msg = "%(uri)s is transfering the call to %(dst)s" % \ + {'uri': self.uri, 'dst': dst} + self.bot.broadcast_pager(None, msg) + return 202 + + def on_call_transfer_status(self, call, code, reason, final, cont): + msg = "%(uri)s call transfer status is %(code)d/%(res)s" % \ + {'uri': self.uri, 'code': code, 'res': reason} + self.bot.broadcast_pager(None, msg) + return True + + def on_call_replace_request(self, call, code, reason): + msg = "%(uri)s is requesting call replace" % \ + {'uri': self.uri} + self.bot.broadcast_pager(None, msg) + return (code, reason) + + def on_call_replaced(self, call, new_call): + msg = "%(uri)s call is replaced" % \ + {'uri': self.uri} + self.bot.broadcast_pager(None, msg) + + def on_pres_state(self, buddy): + old_bi = self.bi + self.bi = buddy.info() + msg = "%(uri)s status is %(st)s" % \ + {'uri': self.uri, 'st': self.bi.online_text} + self.bot.DEBUG(msg + "\n", INFO) + self.bot.broadcast_pager(self, msg) + + if self.bi.sub_state==pj.SubscriptionState.ACTIVE: + if not self.in_chat: + self.in_chat = True + buddy.send_pager("Welcome to chatroom") + self.bot.broadcast_pager(self, self.uri + " has joined the chat room") + else: + self.in_chat = True + elif self.bi.sub_state==pj.SubscriptionState.NULL or \ + self.bi.sub_state==pj.SubscriptionState.TERMINATED or \ + self.bi.sub_state==pj.SubscriptionState.UNKNOWN: + self.buddy.delete() + self.buddy = None + if self.in_chat: + self.in_chat = False + self.bot.broadcast_pager(self, self.uri + " has left the chat room") + else: + self.in_chat = False + self.bot.on_member_left(self) + + def on_typing(self, is_typing, call=None, buddy=None): + if is_typing: + msg = self.uri + " is typing..." + else: + msg = self.uri + " has stopped typing" + self.bot.broadcast_pager(self, msg) + + def on_pager(self, mime_type, body, call=None, buddy=None): + if not self.bot.handle_cmd(self, None, body): + msg = self.uri + ": " + body + self.bot.broadcast_pager(self, msg, mime_type) + + def on_pager_status(self, body, im_id, code, reason, call=None, buddy=None): + self.im_error = (code/100 != 2) + + + +############################################################################## +# +# +# The Bot instance (singleton) +# +# +class Bot(pj.AccountCallback): + def __init__(self): + pj.AccountCallback.__init__(self, None) + self.lib = pj.Lib() + self.acc = None + self.calls = [] + self.members = {} + self.cfg = None + + def DEBUG(self, msg, level=TRACE): + print msg, + + def helpstring(self): + return """ +--h[elp] Display this help screen +--j[oin] Join the chat room +--html on|off Set to receive HTML or plain text + +Participant commands: +--s[how] Show confbot settings +--leave Leave the chatroom +--l[ist] List all members + +Admin commands: +--a[dmin] <CMD> Where <CMD> are: + list List the admins + add <URI> Add URI as admin + del <URI> Remove URI as admin + rr Reregister account to server + call <URI> Make call to the URI and add to voice conf + dc <URI> Disconnect call to URI + hold <URI> Hold call with that URI + update <URI> Send UPDATE to call with that URI + reinvite <URI> Send re-INVITE to call with that URI +""" + + def listmembers(self): + msg = "" + for uri, m in self.members.iteritems(): + msg = msg + str(m) + "\n" + return msg + + def showsettings(self): + ai = self.acc.info() + msg = """ +ConfBot status and settings: + URI: %(uri)s + Status: %(pres)s + Reg Status: %(reg_st)d + Reg Reason: %(reg_res)s +""" % {'uri': ai.uri, 'pres': ai.online_text, \ + 'reg_st': ai.reg_status, 'reg_res': ai.reg_reason} + return msg + + def main(self, cfg_file): + try: + cfg = self.cfg = __import__(cfg_file) + + self.lib.init(ua_cfg=cfg.ua_cfg, log_cfg=cfg.log_cfg, media_cfg=cfg.media_cfg) + self.lib.set_null_snd_dev() + + transport = None + if cfg.udp_cfg: + transport = self.lib.create_transport(pj.TransportType.UDP, cfg.udp_cfg) + if cfg.tcp_cfg: + t = self.lib.create_transport(pj.TransportType.TCP, cfg.tcp_cfg) + if not transport: + transport = t + + self.lib.start() + + if cfg.acc_cfg: + self.DEBUG("Creating account %(uri)s..\n" % {'uri': cfg.acc_cfg.id}, INFO) + self.acc = self.lib.create_account(cfg.acc_cfg, cb=self) + else: + self.DEBUG("Creating account for %(t)s..\n" % \ + {'t': transport.info().description}, INFO) + self.acc = self.lib.create_account_for_transport(transport, cb=self) + + self.acc.set_basic_status(True) + + # Wait for ENTER before quitting + print "Press q to quit or --help/--h for help" + while True: + input = sys.stdin.readline().strip(" \t\r\n") + if not self.handle_cmd(None, None, input): + if input=="q": + break + + self.lib.destroy() + self.lib = None + + except pj.Error, e: + print "Exception: " + str(e) + if self.lib: + self.lib.destroy() + self.lib = None + + def broadcast_pager(self, exclude_member, body, mime_type="text/plain"): + self.DEBUG("Broadcast: " + body + "\n") + for uri, m in self.members.iteritems(): + if m != exclude_member: + m.send_pager(body, mime_type) + + def add_to_voice_conf(self, member): + if not member.call: + return + src_ci = member.call.info() + self.DEBUG("bot.add_to_voice_conf\n") + for uri, m in self.members.iteritems(): + if m==member: + continue + if not m.call: + continue + dst_ci = m.call.info() + if dst_ci.media_state==pj.MediaState.ACTIVE and dst_ci.conf_slot!=-1: + self.lib.conf_connect(src_ci.conf_slot, dst_ci.conf_slot) + self.lib.conf_connect(dst_ci.conf_slot, src_ci.conf_slot) + + def on_member_left(self, member): + if not member.call and not member.buddy: + del self.members[member.uri] + del member + + def handle_admin_cmd(self, member, body): + if member and self.cfg.admins and not member.uri in self.cfg.admins: + member.send_pager("You are not admin") + return + args = body.split() + msg = "" + + if len(args)==1: + args.append(" ") + + if args[1]=="list": + if not self.cfg.admins: + msg = "Everyone is admin!" + else: + msg = str(self.cfg.admins) + elif args[1]=="add": + if len(args)!=3: + msg = "Usage: add <URI>" + else: + self.cfg.admins.append(args[2]) + msg = args[2] + " added as admin" + elif args[1]=="del": + if len(args)!=3: + msg = "Usage: del <URI>" + elif args[2] not in self.cfg.admins: + msg = args[2] + " is not admin" + else: + self.cfg.admins.remove(args[2]) + msg = args[2] + " has been removed from admins" + elif args[1]=="rr": + msg = "Reregistering.." + self.acc.set_registration(True) + elif args[1]=="call": + if len(args)!=3: + msg = "Usage: call <URI>" + else: + uri = args[2] + try: + call = self.acc.make_call(uri) + except pj.Error, e: + msg = "Error: " + str(e) + call = None + + if call: + if not uri in self.members: + m = Member(self, uri) + self.members[m.uri] = m + else: + m = self.members[uri] + msg = "Adding " + m.uri + " to voice conference.." + m.join_call(call) + elif args[1]=="dc" or args[1]=="hold" or args[1]=="update" or args[1]=="reinvite": + if len(args)!=3: + msg = "Usage: " + args[1] + " <URI>" + else: + uri = args[2] + if not uri in self.members: + msg = "Member not found/URI doesn't match (note: case matters!)" + else: + m = self.members[uri] + if m.call: + if args[1]=="dc": + msg = "Disconnecting.." + m.call.hangup(603, "You're disconnected by admin") + elif args[1]=="hold": + msg = "Holding the call" + m.call.hold() + elif args[1]=="update": + msg = "Sending UPDATE" + m.call.update() + elif args[1]=="reinvite": + msg = "Sending re-INVITE" + m.call.reinvite() + else: + msg = "He is not in call" + else: + msg = "Unknown admin command " + body + + #print "msg is '%(msg)s'" % {'msg': msg} + + if True: + if member: + member.send_pager(msg) + else: + print msg + + def handle_cmd(self, member, from_uri, body): + body = body.strip(" \t\r\n") + msg = "" + handled = True + if body=="--l" or body=="--list": + msg = self.listmembers() + if msg=="": + msg = "Nobody is here" + elif body[0:3]=="--s": + msg = self.showsettings() + elif body[0:6]=="--html" and member: + if body[8:11]=="off": + member.html = False + else: + member.html = True + elif body=="--h" or body=="--help": + msg = self.helpstring() + elif body=="--leave": + if not member or not member.buddy: + msg = "You are not in chatroom" + else: + member.buddy.unsubscribe() + elif body[0:3]=="--j": + if not from_uri in self.members: + m = Member(self, from_uri) + self.members[m.uri] = m + self.DEBUG("Adding " + m.uri + " to chatroom\n") + m.join_chat() + else: + m = self.members[from_uri] + self.DEBUG("Adding " + m.uri + " to chatroom\n") + m.join_chat() + elif body[0:3]=="--a": + self.handle_admin_cmd(member, body) + handled = True + else: + handled = False + + if msg: + if member: + member.send_pager(msg) + elif from_uri: + self.acc.send_pager(from_uri, msg); + else: + print msg + return handled + + def on_incoming_call(self, call): + self.DEBUG("on_incoming_call from %(uri)s\n" % {'uri': call.info().remote_uri}, INFO) + ci = call.info() + if not ci.remote_uri in self.members: + m = Member(self, ci.remote_uri) + self.members[m.uri] = m + m.join_call(call) + else: + m = self.members[ci.remote_uri] + m.join_call(call) + call.answer(200) + + def on_incoming_subscribe(self, buddy, from_uri, contact_uri, pres_obj): + self.DEBUG("on_incoming_subscribe from %(uri)s\n" % from_uri, INFO) + return (200, 'OK') + + def on_reg_state(self): + ai = self.acc.info() + self.DEBUG("Registration state: %(code)d/%(reason)s\n" % \ + {'code': ai.reg_status, 'reason': ai.reg_reason}, INFO) + if ai.reg_status/100==2 and ai.reg_expires > 0: + self.acc.set_basic_status(True) + + def on_pager(self, from_uri, contact, mime_type, body): + body = body.strip(" \t\r\n") + if not self.handle_cmd(None, from_uri, body): + self.acc.send_pager(from_uri, "You have not joined the chat room. Type '--join' to join or '--help' for the help") + + def on_pager_status(self, to_uri, body, im_id, code, reason): + pass + + def on_typing(self, from_uri, contact, is_typing): + pass + + + + +############################################################################## +# +# +# main() +# +# +if __name__ == "__main__": + bot = Bot() + bot.main(CFG_FILE) + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/config.py b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/config.py new file mode 100644 index 0000000000000000000000000000000000000000..9dd31b4a18ac9d9f7e1bec4fdeb47b044003ca6c --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/confbot/config.py @@ -0,0 +1,41 @@ +# $Id: config.py 2912 2009-08-24 11:56:13Z bennylp $ +# +# Confbot settings +# +import pjsua as pj + +# Set of admins. If empty then everyone is admin! +admins = set([]) + +# acc_cfg holds the account config (set it to None to disable account) +acc_cfg = None +acc_cfg = pj.AccountConfig() +if acc_cfg: + acc_cfg.id = "sip:bot@pjsip.org" + acc_cfg.reg_uri = "sip:pjsip.org" + acc_cfg.proxy = [ "sip:pjsip.org;lr;transport=tcp" ] + acc_cfg.auth_cred = [ pj.AuthCred("*", "bot", "secretpass") ] + acc_cfg.publish_enabled = True + #acc_cfg.require_timer = True + +# Transport configs (set them to None to disable the transport) +udp_cfg = pj.TransportConfig(5080) +tcp_cfg = pj.TransportConfig(0) +#tcp_cfg = None + +# Logging Config (you can also set it to None to use default values) +def log_cb(level, str, len): + print str, + +log_cfg = pj.LogConfig() +#log_cfg.callback = log_cb + +# UA Config (you can also set it to None to use default values) +ua_cfg = pj.UAConfig() +ua_cfg.user_agent = "PJSIP ConfBot" +ua_cfg.stun_host = "stun.pjsip.org" + +# Media config (you can also set it to None to use default values) +media_cfg = pj.MediaConfig() +media_cfg.enable_ice = True +media_cfg.max_calls = 20 diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c index 275387f9de14ba42fc52590fc3cb535e60c52449..5b43b055115f9f6d6433832bb95c40de86181f9b 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua/pjsua_app.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_app.c 2897 2009-08-17 20:28:47Z nanang $ */ +/* $Id: pjsua_app.c 3039 2009-12-30 06:35:20Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -59,6 +59,7 @@ static struct app_config pjsua_media_config media_cfg; pj_bool_t no_refersub; pj_bool_t ipv6; + pj_bool_t enable_qos; pj_bool_t no_tcp; pj_bool_t no_udp; pj_bool_t use_tls; @@ -103,6 +104,8 @@ static struct app_config #ifdef STEREO_DEMO pjmedia_snd_port *snd; + pjmedia_port *sc, *sc_ch1; + pjsua_conf_port_id sc_ch1_slot; #endif float mic_level, @@ -190,6 +193,7 @@ static void usage(void) puts (" --username=string Set authentication username"); puts (" --password=string Set authentication password"); puts (" --publish Send presence PUBLISH for this account"); + puts (" --mwi Subscribe to message summary/waiting indication"); puts (" --use-100rel Require reliable provisional response (100rel)"); puts (" --use-timer Require SIP session timers"); puts (" --timer-se=N Session timers expiration period, in secs (def:1800)"); @@ -205,6 +209,7 @@ static void usage(void) #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6 puts (" --ipv6 Use IPv6 instead for SIP and media."); #endif + puts (" --set-qos Enable QoS tagging for SIP and media."); puts (" --local-port=port Set TCP/UDP port. This implicitly enables both "); puts (" TCP and UDP transports on the specified port, unless"); puts (" if TCP or UDP is disabled."); @@ -479,7 +484,7 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_REGISTRAR, OPT_REG_TIMEOUT, OPT_PUBLISH, OPT_ID, OPT_CONTACT, OPT_BOUND_ADDR, OPT_CONTACT_PARAMS, OPT_CONTACT_URI_PARAMS, OPT_100REL, OPT_USE_IMS, OPT_REALM, OPT_USERNAME, OPT_PASSWORD, - OPT_NAMESERVER, OPT_STUN_SRV, + OPT_MWI, OPT_NAMESERVER, OPT_STUN_SRV, OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP, OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_SND_CLOCK_RATE, OPT_STEREO, @@ -498,7 +503,7 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_TLS_NEG_TIMEOUT, OPT_TLS_SRV_NAME, OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV, OPT_CAPTURE_LAT, OPT_PLAYBACK_LAT, OPT_NO_TONES, OPT_JB_MAX_SIZE, - OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, + OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, OPT_QOS, #ifdef _IONBF OPT_STDOUT_NO_BUF, #endif @@ -531,6 +536,7 @@ static pj_status_t parse_args(int argc, char *argv[], { "registrar", 1, 0, OPT_REGISTRAR}, { "reg-timeout",1, 0, OPT_REG_TIMEOUT}, { "publish", 0, 0, OPT_PUBLISH}, + { "mwi", 0, 0, OPT_MWI}, { "use-100rel", 0, 0, OPT_100REL}, { "use-ims", 0, 0, OPT_USE_IMS}, { "id", 1, 0, OPT_ID}, @@ -614,6 +620,7 @@ static pj_status_t parse_args(int argc, char *argv[], #if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6 { "ipv6", 0, 0, OPT_IPV6}, #endif + { "set-qos", 0, 0, OPT_QOS}, { "use-timer", 0, 0, OPT_TIMER}, { "timer-se", 1, 0, OPT_TIMER_SE}, { "timer-min-se", 1, 0, OPT_TIMER_MIN_SE}, @@ -828,6 +835,10 @@ static pj_status_t parse_args(int argc, char *argv[], cur_acc->publish_enabled = PJ_TRUE; break; + case OPT_MWI: /* mwi */ + cur_acc->mwi_enabled = PJ_TRUE; + break; + case OPT_100REL: /** 100rel */ cur_acc->require_100rel = PJ_TRUE; cfg->cfg.require_100rel = PJ_TRUE; @@ -1268,6 +1279,7 @@ static pj_status_t parse_args(int argc, char *argv[], case OPT_TLS_VERIFY_CLIENT: cfg->udp_cfg.tls_setting.verify_client = PJ_TRUE; + cfg->udp_cfg.tls_setting.require_client_cert = PJ_TRUE; break; case OPT_TLS_NEG_TIMEOUT: @@ -1325,7 +1337,17 @@ static pj_status_t parse_args(int argc, char *argv[], cfg->ipv6 = PJ_TRUE; break; #endif - + case OPT_QOS: + cfg->enable_qos = PJ_TRUE; + /* Set RTP traffic type to Voice */ + cfg->rtp_cfg.qos_type = PJ_QOS_TYPE_VOICE; + /* Directly apply DSCP value to SIP traffic. Say lets + * set it to CS3 (DSCP 011000). Note that this will not + * work on all platforms. + */ + cfg->udp_cfg.qos_params.flags = PJ_QOS_PARAM_HAS_DSCP; + cfg->udp_cfg.qos_params.dscp_val = 0x18; + break; default: PJ_LOG(1,(THIS_FILE, "Argument \"%s\" is not valid. Use --help to see help", @@ -1535,6 +1557,13 @@ static void write_account_settings(int acc_index, pj_str_t *result) pj_strcat2(result, line); } + /* Publish */ + if (acc_cfg->publish_enabled) + pj_strcat2(result, "--publish\n"); + + /* MWI */ + if (acc_cfg->mwi_enabled) + pj_strcat2(result, "--mwi\n"); } @@ -1605,6 +1634,9 @@ static int write_settings(const struct app_config *config, if (config->ipv6) { pj_strcat2(&cfg, "--ipv6\n"); } + if (config->enable_qos) { + pj_strcat2(&cfg, "--set-qos\n"); + } /* UDP Transport. */ pj_ansi_sprintf(line, "--local-port %d\n", config->udp_cfg.port); @@ -2617,12 +2649,16 @@ static void on_buddy_state(pjsua_buddy_id buddy_id) pjsua_buddy_info info; pjsua_buddy_get_info(buddy_id, &info); - PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s (subscription state is %s)", + PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s, subscription state is %s " + "(last termination reason code=%d %.*s)", (int)info.uri.slen, info.uri.ptr, (int)info.status_text.slen, info.status_text.ptr, - info.sub_state_name)); + info.sub_state_name, + info.sub_term_code, + (int)info.sub_term_reason.slen, + info.sub_term_reason.ptr)); } @@ -2720,6 +2756,37 @@ static void on_nat_detect(const pj_stun_nat_detect_result *res) } +/* + * MWI indication + */ +static void on_mwi_info(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info) +{ + pj_str_t body; + + PJ_LOG(3,(THIS_FILE, "Received MWI for acc %d:", acc_id)); + + if (mwi_info->rdata->msg_info.ctype) { + const pjsip_ctype_hdr *ctype = mwi_info->rdata->msg_info.ctype; + + PJ_LOG(3,(THIS_FILE, " Content-Type: %.*s/%.*s", + (int)ctype->media.type.slen, + ctype->media.type.ptr, + (int)ctype->media.subtype.slen, + ctype->media.subtype.ptr)); + } + + if (!mwi_info->rdata->msg_info.msg->body) { + PJ_LOG(3,(THIS_FILE, " no message body")); + return; + } + + body.ptr = mwi_info->rdata->msg_info.msg->body->data; + body.slen = mwi_info->rdata->msg_info.msg->body->len; + + PJ_LOG(3,(THIS_FILE, " Body:\n%.*s", (int)body.slen, body.ptr)); +} + + /* * Print buddy list. */ @@ -4315,6 +4382,7 @@ pj_status_t app_init(int argc, char *argv[]) app_config.cfg.cb.on_call_transfer_status = &on_call_transfer_status; app_config.cfg.cb.on_call_replaced = &on_call_replaced; app_config.cfg.cb.on_nat_detect = &on_nat_detect; + app_config.cfg.cb.on_mwi_info = &on_mwi_info; /* Set sound device latency */ if (app_config.capture_lat > 0) @@ -4533,6 +4601,11 @@ pj_status_t app_init(int argc, char *argv[]) pjsua_acc_id acc_id; + /* Copy the QoS settings */ + tcp_cfg.tls_setting.qos_type = tcp_cfg.qos_type; + pj_memcpy(&tcp_cfg.tls_setting.qos_params, &tcp_cfg.qos_params, + sizeof(tcp_cfg.qos_params)); + /* Set TLS port as TCP port+1 */ tcp_cfg.port++; status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, @@ -4678,6 +4751,16 @@ pj_status_t app_destroy(void) pjmedia_snd_port_destroy(app_config.snd); app_config.snd = NULL; } + if (app_config.sc_ch1) { + pjsua_conf_remove_port(app_config.sc_ch1_slot); + app_config.sc_ch1_slot = PJSUA_INVALID_ID; + pjmedia_port_destroy(app_config.sc_ch1); + app_config.sc_ch1 = NULL; + } + if (app_config.sc) { + pjmedia_port_destroy(app_config.sc); + app_config.sc = NULL; + } #endif /* Close ringback port */ @@ -4717,9 +4800,25 @@ pj_status_t app_destroy(void) #ifdef STEREO_DEMO +/* + * In this stereo demo, we open the sound device in stereo mode and + * arrange the attachment to the PJSUA-LIB conference bridge as such + * so that channel0/left channel of the sound device corresponds to + * slot 0 in the bridge, and channel1/right channel of the sound + * device corresponds to slot 1 in the bridge. Then user can independently + * feed different media to/from the speakers/microphones channels, by + * connecting them to slot 0 or 1 respectively. + * + * Here's how the connection looks like: + * + +-----------+ stereo +-----------------+ 2x mono +-----------+ + | AUDIO DEV |<------>| SPLITCOMB left|<------->|#0 BRIDGE | + +-----------+ | right|<------->|#1 | + +-----------------+ +-----------+ + */ static void stereo_demo() { - pjmedia_port *conf, *splitter, *ch1; + pjmedia_port *conf; pj_status_t status; /* Disable existing sound device */ @@ -4732,27 +4831,28 @@ static void stereo_demo() 2 * conf->info.samples_per_frame, conf->info.bits_per_sample, 0 /* options */, - &splitter); + &app_config.sc); pj_assert(status == PJ_SUCCESS); /* Connect channel0 (left channel?) to conference port slot0 */ - status = pjmedia_splitcomb_set_channel(splitter, 0 /* ch0 */, + status = pjmedia_splitcomb_set_channel(app_config.sc, 0 /* ch0 */, 0 /*options*/, conf); pj_assert(status == PJ_SUCCESS); /* Create reverse channel for channel1 (right channel?)... */ status = pjmedia_splitcomb_create_rev_channel(app_config.pool, - splitter, + app_config.sc, 1 /* ch1 */, 0 /* options */, - &ch1); + &app_config.sc_ch1); pj_assert(status == PJ_SUCCESS); /* .. and register it to conference bridge (it would be slot1 * if there's no other devices connected to the bridge) */ - status = pjsua_conf_add_port(app_config.pool, ch1, NULL); + status = pjsua_conf_add_port(app_config.pool, app_config.sc_ch1, + &app_config.sc_ch1_slot); pj_assert(status == PJ_SUCCESS); /* Create sound device */ @@ -4766,7 +4866,7 @@ static void stereo_demo() /* Connect the splitter to the sound device */ - status = pjmedia_snd_port_connect(app_config.snd, splitter); + status = pjmedia_snd_port_connect(app_config.snd, app_config.sc); pj_assert(status == PJ_SUCCESS); } @@ -4899,3 +4999,4 @@ static pj_status_t create_ipv6_media_transports(void) return pjsua_media_transports_attach(tp, i, PJ_TRUE); } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp index 8609fc5f0ed414089f4666ff9c1bebe9c0b85d7c..a10c67f887e3396f998e694ce5b4f3322de127f2 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp @@ -54,15 +54,15 @@ static HWND hwndActionButton, hwndExitButton; // // STUN server #if 0 -// Use this to have the STUN server resolved normally + // Use this to have the STUN server resolved normally # define STUN_DOMAIN NULL # define STUN_SERVER "stun.fwdnet.net" #elif 0 -// Use this to have the STUN server resolved with DNS SRV + // Use this to have the STUN server resolved with DNS SRV # define STUN_DOMAIN "iptel.org" # define STUN_SERVER NULL #else -// Use this to disable STUN + // Use this to disable STUN # define STUN_DOMAIN NULL # define STUN_SERVER NULL #endif @@ -82,14 +82,16 @@ static int g_current_acc; static int g_current_call = PJSUA_INVALID_ID; static int g_current_action; -enum { +enum +{ ID_GLOBAL_STATUS = 21, ID_URI, ID_CALL_STATUS, ID_POLL_TIMER, }; -enum { +enum +{ ID_MENU_NONE = 64, ID_MENU_CALL, ID_MENU_ANSWER, @@ -102,101 +104,85 @@ enum { static ATOM MyRegisterClass (HINSTANCE, LPTSTR); BOOL InitInstance (HINSTANCE, int); static void OnCreate (HWND hWnd); -static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); +static LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); ///////////////////////////////////////////////////////////////////////////// -static void OnError (const wchar_t *title, pj_status_t status) +static void OnError(const wchar_t *title, pj_status_t status) { char errmsg[PJ_ERR_MSG_SIZE]; - PJ_DECL_UNICODE_TEMP_BUF (werrmsg, PJ_ERR_MSG_SIZE); - - pj_strerror (status, errmsg, sizeof (errmsg)); + PJ_DECL_UNICODE_TEMP_BUF(werrmsg, PJ_ERR_MSG_SIZE); - MessageBox (NULL, PJ_STRING_TO_NATIVE (errmsg, werrmsg, PJ_ERR_MSG_SIZE), - title, MB_OK); + pj_strerror(status, errmsg, sizeof(errmsg)); + + MessageBox(NULL, PJ_STRING_TO_NATIVE(errmsg, werrmsg, PJ_ERR_MSG_SIZE), + title, MB_OK); } -static void SetLocalURI (const char *uri, int len, bool enabled=true) +static void SetLocalURI(const char *uri, int len, bool enabled=true) { wchar_t tmp[128]; - - if (len==-1) len=pj_ansi_strlen (uri); - - pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp)); - - SetDlgItemText (hMainWnd, ID_GLOBAL_STATUS, tmp); - - EnableWindow (hwndGlobalStatus, enabled?TRUE:FALSE); + if (len==-1) len=pj_ansi_strlen(uri); + pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); + SetDlgItemText(hMainWnd, ID_GLOBAL_STATUS, tmp); + EnableWindow(hwndGlobalStatus, enabled?TRUE:FALSE); } -static void SetURI (const char *uri, int len, bool enabled=true) +static void SetURI(const char *uri, int len, bool enabled=true) { wchar_t tmp[128]; - - if (len==-1) len=pj_ansi_strlen (uri); - - pj_ansi_to_unicode (uri, len, tmp, PJ_ARRAY_SIZE (tmp)); - - SetDlgItemText (hMainWnd, ID_URI, tmp); - - EnableWindow (hwndURI, enabled?TRUE:FALSE); + if (len==-1) len=pj_ansi_strlen(uri); + pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); + SetDlgItemText(hMainWnd, ID_URI, tmp); + EnableWindow(hwndURI, enabled?TRUE:FALSE); } -static void SetCallStatus (const char *state, int len) +static void SetCallStatus(const char *state, int len) { wchar_t tmp[128]; - - if (len==-1) len=pj_ansi_strlen (state); - - pj_ansi_to_unicode (state, len, tmp, PJ_ARRAY_SIZE (tmp)); - - SetDlgItemText (hMainWnd, ID_CALL_STATUS, tmp); + if (len==-1) len=pj_ansi_strlen(state); + pj_ansi_to_unicode(state, len, tmp, PJ_ARRAY_SIZE(tmp)); + SetDlgItemText(hMainWnd, ID_CALL_STATUS, tmp); } -static void SetAction (int action, bool enable=true) +static void SetAction(int action, bool enable=true) { HMENU hMenu; - hMenu = CommandBar_GetMenu (hwndCB, 0); + hMenu = CommandBar_GetMenu(hwndCB, 0); - RemoveMenu (hMenu, ID_MENU_NONE, MF_BYCOMMAND); - RemoveMenu (hMenu, ID_MENU_CALL, MF_BYCOMMAND); - RemoveMenu (hMenu, ID_MENU_ANSWER, MF_BYCOMMAND); - RemoveMenu (hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_NONE, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_CALL, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_ANSWER, MF_BYCOMMAND); + RemoveMenu(hMenu, ID_MENU_DISCONNECT, MF_BYCOMMAND); switch (action) { - - case ID_MENU_NONE: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("None")); - SetWindowText (hwndActionButton, TEXT ("-")); - break; - - case ID_MENU_CALL: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Call")); - SetWindowText (hwndActionButton, TEXT ("&Call")); - break; - - case ID_MENU_ANSWER: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Answer")); - SetWindowText (hwndActionButton, TEXT ("&Answer")); - break; - - case ID_MENU_DISCONNECT: - InsertMenu (hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT ("Hangup")); - SetWindowText (hwndActionButton, TEXT ("&Hangup")); - break; + case ID_MENU_NONE: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("None")); + SetWindowText(hwndActionButton, TEXT("-")); + break; + case ID_MENU_CALL: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Call")); + SetWindowText(hwndActionButton, TEXT("&Call")); + break; + case ID_MENU_ANSWER: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Answer")); + SetWindowText(hwndActionButton, TEXT("&Answer")); + break; + case ID_MENU_DISCONNECT: + InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Hangup")); + SetWindowText(hwndActionButton, TEXT("&Hangup")); + break; } - EnableMenuItem (hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); - - DrawMenuBar (hMainWnd); + EnableMenuItem(hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); + DrawMenuBar(hMainWnd); g_current_action = action; } @@ -205,35 +191,35 @@ static void SetAction (int action, bool enable=true) /* * Handler when invite state has changed. */ -static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +static void on_call_state(pjsua_call_id call_id, pjsip_event *e) { pjsua_call_info call_info; - PJ_UNUSED_ARG (e); + PJ_UNUSED_ARG(e); - pjsua_call_get_info (call_id, &call_info); + pjsua_call_get_info(call_id, &call_info); if (call_info.state == PJSIP_INV_STATE_DISCONNECTED) { - g_current_call = PJSUA_INVALID_ID; - SetURI (SIP_DST_URI, -1); - SetAction (ID_MENU_CALL); - //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); - SetCallStatus (call_info.last_status_text.ptr, call_info.last_status_text.slen); + g_current_call = PJSUA_INVALID_ID; + SetURI(SIP_DST_URI, -1); + SetAction(ID_MENU_CALL); + //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); + SetCallStatus(call_info.last_status_text.ptr, call_info.last_status_text.slen); } else { - //if (g_current_call == PJSUA_INVALID_ID) - // g_current_call = call_id; + //if (g_current_call == PJSUA_INVALID_ID) + // g_current_call = call_id; - if (call_info.remote_contact.slen) - SetURI (call_info.remote_contact.ptr, call_info.remote_contact.slen, false); - else - SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false); + if (call_info.remote_contact.slen) + SetURI(call_info.remote_contact.ptr, call_info.remote_contact.slen, false); + else + SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false); - if (call_info.state == PJSIP_INV_STATE_CONFIRMED) - SetAction (ID_MENU_DISCONNECT); + if (call_info.state == PJSIP_INV_STATE_CONFIRMED) + SetAction(ID_MENU_DISCONNECT); - SetCallStatus (call_info.state_text.ptr, call_info.state_text.slen); + SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); } } @@ -243,15 +229,15 @@ static void on_call_state (pjsua_call_id call_id, pjsip_event *e) * The action may connect the call to sound device, to file, or * to loop the call. */ -static void on_call_media_state (pjsua_call_id call_id) +static void on_call_media_state(pjsua_call_id call_id) { pjsua_call_info call_info; - pjsua_call_get_info (call_id, &call_info); + pjsua_call_get_info(call_id, &call_info); if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - pjsua_conf_connect (call_info.conf_slot, 0); - pjsua_conf_connect (0, call_info.conf_slot); + pjsua_conf_connect(call_info.conf_slot, 0); + pjsua_conf_connect(0, call_info.conf_slot); } } @@ -259,37 +245,37 @@ static void on_call_media_state (pjsua_call_id call_id) /** * Handler when there is incoming call. */ -static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { pjsua_call_info call_info; - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(rdata); if (g_current_call != PJSUA_INVALID_ID) { - pj_str_t reason; - reason = pj_str ("Another call is in progress"); - pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, &reason, NULL); - return; + pj_str_t reason; + reason = pj_str("Another call is in progress"); + pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, &reason, NULL); + return; } g_current_call = call_id; - pjsua_call_get_info (call_id, &call_info); + pjsua_call_get_info(call_id, &call_info); - SetAction (ID_MENU_ANSWER); - SetURI (call_info.remote_info.ptr, call_info.remote_info.slen, false); - pjsua_call_answer (call_id, 200, NULL, NULL); + SetAction(ID_MENU_ANSWER); + SetURI(call_info.remote_info.ptr, call_info.remote_info.slen, false); + pjsua_call_answer(call_id, 200, NULL, NULL); } /* * Handler registration status has changed. */ -static void on_reg_state (pjsua_acc_id acc_id) +static void on_reg_state(pjsua_acc_id acc_id) { - PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG(acc_id); // Log already written. } @@ -298,65 +284,65 @@ static void on_reg_state (pjsua_acc_id acc_id) /* * Handler on buddy state changed. */ -static void on_buddy_state (pjsua_buddy_id buddy_id) +static void on_buddy_state(pjsua_buddy_id buddy_id) { /* Currently this is not processed */ - PJ_UNUSED_ARG (buddy_id); + PJ_UNUSED_ARG(buddy_id); } /** * Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +static void on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { /* Currently this is not processed */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (from); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - PJ_UNUSED_ARG (text); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(from); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + PJ_UNUSED_ARG(text); } /** * Received typing indication */ -static void on_typing (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) +static void on_typing(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) { /* Currently this is not processed */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (from); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (is_typing); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(from); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(is_typing); } -/** - * Callback upon NAT detection completion +/** + * Callback upon NAT detection completion */ -static void nat_detect_cb (const pj_stun_nat_detect_result *res) +static void nat_detect_cb(const pj_stun_nat_detect_result *res) { if (res->status != PJ_SUCCESS) { - char msg[250]; - pj_ansi_snprintf (msg, sizeof (msg), "NAT detection failed: %s", - res->status_text); - SetCallStatus (msg, pj_ansi_strlen (msg)); + char msg[250]; + pj_ansi_snprintf(msg, sizeof(msg), "NAT detection failed: %s", + res->status_text); + SetCallStatus(msg, pj_ansi_strlen(msg)); } else { - char msg[250]; - pj_ansi_snprintf (msg, sizeof (msg), "NAT type is %s", - res->nat_type_name); - SetCallStatus (msg, pj_ansi_strlen (msg)); + char msg[250]; + pj_ansi_snprintf(msg, sizeof(msg), "NAT type is %s", + res->nat_type_name); + SetCallStatus(msg, pj_ansi_strlen(msg)); } } -static BOOL OnInitStack (void) +static BOOL OnInitStack(void) { pjsua_config cfg; pjsua_logging_config log_cfg; @@ -370,172 +356,141 @@ static BOOL OnInitStack (void) /* Create pjsua */ status = pjsua_create(); - if (status != PJ_SUCCESS) { - OnError (TEXT ("Error creating pjsua"), status); - return FALSE; + OnError(TEXT("Error creating pjsua"), status); + return FALSE; } /* Create global pool for application */ - g_pool = pjsua_pool_create ("pjsua", 4000, 4000); + g_pool = pjsua_pool_create("pjsua", 4000, 4000); /* Init configs */ - pjsua_config_default (&cfg); - - pjsua_media_config_default (&media_cfg); - - pjsua_transport_config_default (&udp_cfg); - + pjsua_config_default(&cfg); + pjsua_media_config_default(&media_cfg); + pjsua_transport_config_default(&udp_cfg); udp_cfg.port = SIP_PORT; - pjsua_transport_config_default (&rtp_cfg); - + pjsua_transport_config_default(&rtp_cfg); rtp_cfg.port = 40000; - pjsua_logging_config_default (&log_cfg); - + pjsua_logging_config_default(&log_cfg); log_cfg.level = 5; - - log_cfg.log_filename = pj_str ("\\pjsua.txt"); - + log_cfg.log_filename = pj_str("\\pjsua.txt"); log_cfg.msg_logging = 1; - log_cfg.decor = pj_log_get_decor() | PJ_LOG_HAS_CR; /* Setup media */ media_cfg.clock_rate = 8000; - media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; - media_cfg.ec_tail_len = 256; - // use default quality setting //media_cfg.quality = 1; media_cfg.ptime = 20; - media_cfg.enable_ice = USE_ICE; /* Initialize application callbacks */ cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_reg_state = &on_reg_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_nat_detect = &nat_detect_cb; if (SIP_PROXY) { - cfg.outbound_proxy_cnt = 1; - cfg.outbound_proxy[0] = pj_str (SIP_PROXY); + cfg.outbound_proxy_cnt = 1; + cfg.outbound_proxy[0] = pj_str(SIP_PROXY); } - + if (NAMESERVER) { - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (NAMESERVER); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(NAMESERVER); } - + if (NAMESERVER && STUN_DOMAIN) { - cfg.stun_domain = pj_str (STUN_DOMAIN); + cfg.stun_domain = pj_str(STUN_DOMAIN); } else if (STUN_SERVER) { - cfg.stun_host = pj_str (STUN_SERVER); + cfg.stun_host = pj_str(STUN_SERVER); } - - + + /* Initialize pjsua */ - status = pjsua_init (&cfg, &log_cfg, &media_cfg); - + status = pjsua_init(&cfg, &log_cfg, &media_cfg); if (status != PJ_SUCCESS) { - OnError (TEXT ("Initialization error"), status); - return FALSE; + OnError(TEXT("Initialization error"), status); + return FALSE; } /* Set codec priority */ - pjsua_codec_set_priority (pj_cstr (&tmp, "pcmu"), 240); - - pjsua_codec_set_priority (pj_cstr (&tmp, "pcma"), 230); - - pjsua_codec_set_priority (pj_cstr (&tmp, "speex/8000"), 190); - - pjsua_codec_set_priority (pj_cstr (&tmp, "ilbc"), 189); - - pjsua_codec_set_priority (pj_cstr (&tmp, "speex/16000"), 180); - - pjsua_codec_set_priority (pj_cstr (&tmp, "speex/32000"), 0); - - pjsua_codec_set_priority (pj_cstr (&tmp, "gsm"), 100); + pjsua_codec_set_priority(pj_cstr(&tmp, "pcmu"), 240); + pjsua_codec_set_priority(pj_cstr(&tmp, "pcma"), 230); + pjsua_codec_set_priority(pj_cstr(&tmp, "speex/8000"), 190); + pjsua_codec_set_priority(pj_cstr(&tmp, "ilbc"), 189); + pjsua_codec_set_priority(pj_cstr(&tmp, "speex/16000"), 180); + pjsua_codec_set_priority(pj_cstr(&tmp, "speex/32000"), 0); + pjsua_codec_set_priority(pj_cstr(&tmp, "gsm"), 100); /* Add UDP transport and the corresponding PJSUA account */ - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, - &udp_cfg, &transport_id); - + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, + &udp_cfg, &transport_id); if (status != PJ_SUCCESS) { - OnError (TEXT ("Error starting SIP transport"), status); - return FALSE; + OnError(TEXT("Error starting SIP transport"), status); + return FALSE; } - pjsua_transport_get_info (transport_id, &transport_info); + pjsua_transport_get_info(transport_id, &transport_info); - g_local_uri.ptr = (char*) pj_pool_alloc (g_pool, 128); - g_local_uri.slen = pj_ansi_sprintf (g_local_uri.ptr, - "<sip:%.*s:%d>", - (int) transport_info.local_name.host.slen, - transport_info.local_name.host.ptr, - transport_info.local_name.port); + g_local_uri.ptr = (char*)pj_pool_alloc(g_pool, 128); + g_local_uri.slen = pj_ansi_sprintf(g_local_uri.ptr, + "<sip:%.*s:%d>", + (int)transport_info.local_name.host.slen, + transport_info.local_name.host.ptr, + transport_info.local_name.port); /* Add local account */ - pjsua_acc_add_local (transport_id, PJ_TRUE, &g_current_acc); - pjsua_acc_set_online_status (g_current_acc, PJ_TRUE); + pjsua_acc_add_local(transport_id, PJ_TRUE, &g_current_acc); + pjsua_acc_set_online_status(g_current_acc, PJ_TRUE); /* Add account */ - if (HAS_SIP_ACCOUNT) { - pjsua_acc_config cfg; - - pjsua_acc_config_default (&cfg); - cfg.id = pj_str ("sip:" SIP_USER "@" SIP_DOMAIN); - cfg.reg_uri = pj_str ("sip:" SIP_DOMAIN); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str (SIP_REALM); - cfg.cred_info[0].scheme = pj_str ("digest"); - cfg.cred_info[0].username = pj_str (SIP_USER); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str (SIP_PASSWD); - - status = pjsua_acc_add (&cfg, PJ_TRUE, &g_current_acc); - - if (status != PJ_SUCCESS) { - pjsua_destroy(); - return PJ_FALSE; - } + pjsua_acc_config cfg; + + pjsua_acc_config_default(&cfg); + cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN); + cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str(SIP_REALM); + cfg.cred_info[0].scheme = pj_str("digest"); + cfg.cred_info[0].username = pj_str(SIP_USER); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str(SIP_PASSWD); + + status = pjsua_acc_add(&cfg, PJ_TRUE, &g_current_acc); + if (status != PJ_SUCCESS) { + pjsua_destroy(); + return PJ_FALSE; + } } /* Add buddy */ if (SIP_DST_URI) { - pjsua_buddy_config bcfg; - - pjsua_buddy_config_default (&bcfg); - bcfg.uri = pj_str (SIP_DST_URI); - bcfg.subscribe = PJ_FALSE; - - pjsua_buddy_add (&bcfg, NULL); + pjsua_buddy_config bcfg; + + pjsua_buddy_config_default(&bcfg); + bcfg.uri = pj_str(SIP_DST_URI); + bcfg.subscribe = PJ_FALSE; + + pjsua_buddy_add(&bcfg, NULL); } /* Start pjsua */ status = pjsua_start(); - if (status != PJ_SUCCESS) { - OnError (TEXT ("Error starting pjsua"), status); - return FALSE; + OnError(TEXT("Error starting pjsua"), status); + return FALSE; } return TRUE; @@ -544,39 +499,40 @@ static BOOL OnInitStack (void) ////////////////////////////////////////////////////////////////////////////// -int WINAPI WinMain (HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) +int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) { MSG msg; HACCEL hAccelTable; - PJ_UNUSED_ARG (lpCmdLine); - PJ_UNUSED_ARG (hPrevInstance); + PJ_UNUSED_ARG(lpCmdLine); + PJ_UNUSED_ARG(hPrevInstance); // Perform application initialization: - - if (!InitInstance (hInstance, nCmdShow)) { - return FALSE; + if (!InitInstance (hInstance, nCmdShow)) + { + return FALSE; } - - hAccelTable = LoadAccelerators (hInstance, (LPCTSTR) IDC_PJSUA_WINCE); - - + + hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_PJSUA_WINCE); + + // Main message loop: - - while (GetMessage (&msg, NULL, 0, 0)) { - if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) { - TranslateMessage (&msg); - DispatchMessage (&msg); - } + while (GetMessage(&msg, NULL, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } } - + return msg.wParam; } -static ATOM MyRegisterClass (HINSTANCE hInstance, LPTSTR szWindowClass) +static ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) { WNDCLASS wc; @@ -585,17 +541,17 @@ static ATOM MyRegisterClass (HINSTANCE hInstance, LPTSTR szWindowClass) wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; - wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_PJSUA_WINCE)); + wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PJSUA_WINCE)); wc.hCursor = 0; - wc.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); + wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wc.lpszMenuName = 0; wc.lpszClassName = szWindowClass; - return RegisterClass (&wc); + return RegisterClass(&wc); } -BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; TCHAR szTitle[MAX_LOADSTRING]; @@ -604,244 +560,221 @@ BOOL InitInstance (HINSTANCE hInstance, int nCmdShow) hInst = hInstance; /* Init stack */ - if (OnInitStack() == FALSE) - return FALSE; - - LoadString (hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); + return FALSE; - MyRegisterClass (hInstance, szWindowClass); + LoadString(hInstance, IDC_PJSUA_WINCE, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance, szWindowClass); - LoadString (hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, + NULL, NULL, hInstance, NULL); - hWnd = CreateWindow (szWindowClass, szTitle, WS_VISIBLE, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, - NULL, NULL, hInstance, NULL); - - if (!hWnd) { - return FALSE; + if (!hWnd) + { + return FALSE; } hMainWnd = hWnd; - - ShowWindow (hWnd, nCmdShow); - UpdateWindow (hWnd); - + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); if (hwndCB) - CommandBar_Show (hwndCB, TRUE); + CommandBar_Show(hwndCB, TRUE); - SetTimer (hMainWnd, ID_POLL_TIMER, 50, NULL); + SetTimer(hMainWnd, ID_POLL_TIMER, 50, NULL); pjsua_detect_nat_type(); - return TRUE; } -static void OnCreate (HWND hWnd) +static void OnCreate(HWND hWnd) { - enum { - X = 10, - Y = 40, - W = 220, - H = 30, + enum + { + X = 10, + Y = 40, + W = 220, + H = 30, }; DWORD dwStyle; hMainWnd = hWnd; - hwndCB = CommandBar_Create (hInst, hWnd, 1); - CommandBar_InsertMenubar (hwndCB, hInst, IDM_MENU, 0); - CommandBar_AddAdornments (hwndCB, 0, 0); + hwndCB = CommandBar_Create(hInst, hWnd, 1); + CommandBar_InsertMenubar(hwndCB, hInst, IDM_MENU, 0); + CommandBar_AddAdornments(hwndCB, 0, 0); // Create global status text - dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT; - hwndGlobalStatus = CreateWindow ( - TEXT ("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+0, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_GLOBAL_STATUS, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - SetLocalURI (g_local_uri.ptr, g_local_uri.slen, false); + dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED | ES_LEFT; + hwndGlobalStatus = CreateWindow( + TEXT("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+0, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_GLOBAL_STATUS, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + SetLocalURI(g_local_uri.ptr, g_local_uri.slen, false); // Create URI edit - dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER; + dwStyle = WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER; hwndURI = CreateWindow ( - TEXT ("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+H, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_URI, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control + TEXT("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+H, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_URI, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control // Create action Button - hwndActionButton = CreateWindow (L"button", L"Action", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - X, Y+2*H, - 60, H-5, hWnd, - (HMENU) ID_BTN_ACTION, - hInst, NULL); + hwndActionButton = CreateWindow( L"button", L"Action", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + X, Y+2*H, + 60, H-5, hWnd, + (HMENU) ID_BTN_ACTION, + hInst, NULL ); // Create exit button - hwndExitButton = CreateWindow (L"button", L"E&xit", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - X+70, Y+2*H, - 60, H-5, hWnd, - (HMENU) ID_EXIT, - hInst, NULL); + hwndExitButton = CreateWindow( L"button", L"E&xit", + WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, + X+70, Y+2*H, + 60, H-5, hWnd, + (HMENU) ID_EXIT, + hInst, NULL ); // Create call status edit - dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED; + dwStyle = WS_CHILD | WS_VISIBLE | WS_DISABLED; hwndCallStatus = CreateWindow ( - TEXT ("EDIT"), // Class name - NULL, // Window text - dwStyle, // Window style - X, // x-coordinate of the upper-left corner - Y+3*H, // y-coordinate of the upper-left corner - W, // Width of the window for the edit - // control - H-5, // Height of the window for the edit - // control - hWnd, // Window handle to the parent window - (HMENU) ID_CALL_STATUS, // Control identifier - hInst, // Instance handle - NULL); // Specify NULL for this parameter when - // you create a control - SetCallStatus ("Ready", 5); - SetAction (ID_MENU_CALL); - SetURI (SIP_DST_URI, -1); - SetFocus (hWnd); + TEXT("EDIT"), // Class name + NULL, // Window text + dwStyle, // Window style + X, // x-coordinate of the upper-left corner + Y+3*H, // y-coordinate of the upper-left corner + W, // Width of the window for the edit + // control + H-5, // Height of the window for the edit + // control + hWnd, // Window handle to the parent window + (HMENU) ID_CALL_STATUS, // Control identifier + hInst, // Instance handle + NULL); // Specify NULL for this parameter when + // you create a control + SetCallStatus("Ready", 5); + SetAction(ID_MENU_CALL); + SetURI(SIP_DST_URI, -1); + SetFocus(hWnd); } -static void OnDestroy (void) +static void OnDestroy(void) { pjsua_destroy(); } -static LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; - + switch (message) { - - case WM_KEYUP: - - if (wParam==114) { - wParam = ID_MENU_CALL; - } else if (wParam==115) { - if (g_current_call == PJSUA_INVALID_ID) - wParam = ID_EXIT; - else - wParam = ID_MENU_DISCONNECT; - } else - break; - - case WM_COMMAND: - wmId = LOWORD (wParam); - - wmEvent = HIWORD (wParam); - - if (wmId == ID_BTN_ACTION) - wmId = g_current_action; - - switch (wmId) { - - case ID_MENU_CALL: - - if (g_current_call != PJSUA_INVALID_ID) { - MessageBox (NULL, TEXT ("Can not make call"), - TEXT ("You already have one call active"), MB_OK); - } - - pj_str_t dst_uri; - - wchar_t text[256]; - char tmp[256]; - pj_status_t status; - - GetWindowText (hwndURI, text, PJ_ARRAY_SIZE (text)); - pj_unicode_to_ansi (text, pj_unicode_strlen (text), - tmp, sizeof (tmp)); - dst_uri.ptr = tmp; - dst_uri.slen = pj_ansi_strlen (tmp); - status = pjsua_call_make_call (g_current_acc, - &dst_uri, 0, NULL, - NULL, &g_current_call); - - if (status != PJ_SUCCESS) - OnError (TEXT ("Unable to make call"), status); - - break; - - case ID_MENU_ANSWER: - if (g_current_call == PJSUA_INVALID_ID) - MessageBox (NULL, TEXT ("Can not answer"), - TEXT ("There is no call!"), MB_OK); - else - pjsua_call_answer (g_current_call, 200, NULL, NULL); - - break; - - case ID_MENU_DISCONNECT: - if (g_current_call == PJSUA_INVALID_ID) - MessageBox (NULL, TEXT ("Can not disconnect"), - TEXT ("There is no call!"), MB_OK); - else - pjsua_call_hangup (g_current_call, PJSIP_SC_DECLINE, NULL, NULL); - - break; - - case ID_EXIT: - DestroyWindow (hWnd); - - break; - - default: - return DefWindowProc (hWnd, message, wParam, lParam); - } - - break; - - case WM_CREATE: - OnCreate (hWnd); - break; - - case WM_DESTROY: - OnDestroy(); - CommandBar_Destroy (hwndCB); - PostQuitMessage (0); - break; - - case WM_TIMER: - pjsua_handle_events (1); - break; - - default: - return DefWindowProc (hWnd, message, wParam, lParam); + case WM_KEYUP: + if (wParam==114) { + wParam = ID_MENU_CALL; + } else if (wParam==115) { + if (g_current_call == PJSUA_INVALID_ID) + wParam = ID_EXIT; + else + wParam = ID_MENU_DISCONNECT; + } else + break; + + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + if (wmId == ID_BTN_ACTION) + wmId = g_current_action; + switch (wmId) + { + case ID_MENU_CALL: + if (g_current_call != PJSUA_INVALID_ID) { + MessageBox(NULL, TEXT("Can not make call"), + TEXT("You already have one call active"), MB_OK); + } + pj_str_t dst_uri; + wchar_t text[256]; + char tmp[256]; + pj_status_t status; + + GetWindowText(hwndURI, text, PJ_ARRAY_SIZE(text)); + pj_unicode_to_ansi(text, pj_unicode_strlen(text), + tmp, sizeof(tmp)); + dst_uri.ptr = tmp; + dst_uri.slen = pj_ansi_strlen(tmp); + status = pjsua_call_make_call(g_current_acc, + &dst_uri, 0, NULL, + NULL, &g_current_call); + if (status != PJ_SUCCESS) + OnError(TEXT("Unable to make call"), status); + break; + case ID_MENU_ANSWER: + if (g_current_call == PJSUA_INVALID_ID) + MessageBox(NULL, TEXT("Can not answer"), + TEXT("There is no call!"), MB_OK); + else + pjsua_call_answer(g_current_call, 200, NULL, NULL); + break; + case ID_MENU_DISCONNECT: + if (g_current_call == PJSUA_INVALID_ID) + MessageBox(NULL, TEXT("Can not disconnect"), + TEXT("There is no call!"), MB_OK); + else + pjsua_call_hangup(g_current_call, PJSIP_SC_DECLINE, NULL, NULL); + break; + case ID_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + + case WM_CREATE: + OnCreate(hWnd); + break; + + case WM_DESTROY: + OnDestroy(); + CommandBar_Destroy(hwndCB); + PostQuitMessage(0); + break; + + case WM_TIMER: + pjsua_handle_events(1); + break; + + default: + return DefWindowProc(hWnd, message, wParam, lParam); } - - return 0; + return 0; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c index 3b8474357feb809284912e2ac44f6850ced8cd03..0ac9c67d384c951f6fae50864be258969c820d75 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.c @@ -1,4 +1,4 @@ -/* $Id: systest.c 2840 2009-07-18 09:18:26Z bennylp $ */ +/* $Id: systest.c 2991 2009-11-08 03:35:41Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -114,7 +114,7 @@ static void systest_perror(const char *title, pj_status_t status) errmsg[0] = '\0'; strcpy(themsg, title); - strncat(themsg, errmsg, sizeof(themsg)); + strncat(themsg, errmsg, sizeof(themsg)-1); themsg[sizeof(themsg)-1] = '\0'; gui_msgbox("Error", themsg, WITH_OK); @@ -245,16 +245,32 @@ on_return: return; } +/* Util: create file player, each time trying different paths until we get + * the file. + */ +static pj_status_t create_player(unsigned path_cnt, const char *paths[], + pjsua_player_id *p_id) +{ + pj_str_t name; + pj_status_t status = PJ_ENOTFOUND; + unsigned i; + + for (i=0; i<path_cnt; ++i) { + status = pjsua_player_create(pj_cstr(&name, paths[i]), 0, p_id); + if (status == PJ_SUCCESS) + return PJ_SUCCESS; + } + return status; +} /***************************************************************************** * test: play WAV file */ -static void systest_play_wav(const char *filename) +static void systest_play_wav(unsigned path_cnt, const char *paths[]) { pjsua_player_id play_id = PJSUA_INVALID_ID; enum gui_key key; test_item_t *ti; - pj_str_t name; const char *title = "WAV File Playback Test"; pj_status_t status; @@ -268,7 +284,7 @@ static void systest_play_wav(const char *filename) "impairments such as stutter. Let this test run " "for a while to make sure that everything is okay." " Press OK to start, CANCEL to skip", - filename); + paths[0]); key = gui_msgbox(title, textbuf, WITH_OKCANCEL); @@ -280,7 +296,7 @@ static void systest_play_wav(const char *filename) PJ_LOG(3,(THIS_FILE, "Running %s", title)); /* WAV port */ - status = pjsua_player_create(pj_cstr(&name, filename), 0, &play_id); + status = create_player(path_cnt, paths, &play_id); if (status != PJ_SUCCESS) goto on_return; @@ -313,12 +329,16 @@ on_return: static void systest_play_wav1(void) { - systest_play_wav(WAV_PLAYBACK_PATH); + const char *paths[] = { WAV_PLAYBACK_PATH, + ALT_PATH1 WAV_PLAYBACK_PATH }; + systest_play_wav(PJ_ARRAY_SIZE(paths), paths); } static void systest_play_wav2(void) { - systest_play_wav(WAV_TOCK8_PATH); + const char *paths[] = { WAV_TOCK8_PATH, + ALT_PATH1 WAV_TOCK8_PATH}; + systest_play_wav(PJ_ARRAY_SIZE(paths), paths); } @@ -712,7 +732,7 @@ static int calculate_latency(pj_pool_t *pool, pjmedia_port *wav, static void systest_latency_test(void) { - const pj_str_t ref_wav_file = pj_str(WAV_TOCK8_PATH); + const char *ref_wav_paths[] = { WAV_TOCK8_PATH, ALT_PATH1 WAV_TOCK8_PATH }; const pj_str_t rec_wav_file = pj_str(WAV_LATENCY_OUT_PATH); pjsua_player_id play_id = PJSUA_INVALID_ID; pjsua_conf_port_id play_slot = PJSUA_INVALID_ID; @@ -754,7 +774,8 @@ static void systest_latency_test(void) PJ_LOG(3,(THIS_FILE, "Running %s", title)); - status = pjsua_player_create(&ref_wav_file, 0, &play_id); + status = create_player(PJ_ARRAY_SIZE(ref_wav_paths), ref_wav_paths, + &play_id); if (status != PJ_SUCCESS) goto on_return; diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h index 0f10bd83cdba4e4fe0033b4a3681108ccff13535..cb5475c35031a88807d17b35d864200115f1cd7e 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pjsystest/systest.h @@ -1,4 +1,4 @@ -/* $Id: systest.h 2839 2009-07-17 11:37:42Z bennylp $ */ +/* $Id: systest.h 2991 2009-11-08 03:35:41Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -53,6 +53,7 @@ #define WAV_REC_OUT_PATH "\\PJSYSTEST_TESTREC.WAV" #define WAV_TOCK8_PATH "\\Program Files\\pjsystest\\tock8.WAV" #define WAV_LATENCY_OUT_PATH "\\PJSYSTEST_LATREC.WAV" + #define ALT_PATH1 "" #else #define LOG_OUT_PATH "PJSYSTEST.LOG" #define RESULT_OUT_PATH "PJSYSTEST_RESULT.TXT" @@ -60,6 +61,7 @@ #define WAV_REC_OUT_PATH "PJSYSTEST_TESTREC.WAV" #define WAV_TOCK8_PATH "tock8.wav" #define WAV_LATENCY_OUT_PATH "PJSYSTEST_LATREC.WAV" + #define ALT_PATH1 "../../tests/pjsua/wavs/" #endif #ifdef __cplusplus diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp index cc75d884ba8ed66ab5e30a943b74a3ec7d4f896e..2d42d96e2ea3f8e259bbfb5dc4ab2966ea01d874 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJ.cpp @@ -14,21 +14,21 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // CPocketPJApp -BEGIN_MESSAGE_MAP (CPocketPJApp, CWinApp) - //{{AFX_MSG_MAP(CPocketPJApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP(CPocketPJApp, CWinApp) + //{{AFX_MSG_MAP(CPocketPJApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPocketPJApp construction CPocketPJApp::CPocketPJApp() - : CWinApp() + : CWinApp() { - // TODO: add construction code here, - // Place all significant initialization in InitInstance + // TODO: add construction code here, + // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// @@ -41,24 +41,26 @@ CPocketPJApp theApp; BOOL CPocketPJApp::InitInstance() { - // Standard initialization - // If you are not using these features and wish to reduce the size - // of your final executable, you should remove from the following - // the specific initialization routines you do not need. + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. - CPocketPJDlg dlg; - m_pMainWnd = &dlg; - int nResponse = dlg.DoModal(); + CPocketPJDlg dlg; + m_pMainWnd = &dlg; + int nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } - if (nResponse == IDOK) { - // TODO: Place code here to handle when the dialog is - // dismissed with OK - } else if (nResponse == IDCANCEL) { - // TODO: Place code here to handle when the dialog is - // dismissed with Cancel - } - - // Since the dialog has been closed, return FALSE so that we exit the - // application, rather than start the application's message pump. - return FALSE; + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp index ecec2641ab1e47d227c98d472cb441bc3e739422..b8a6bf2f1e7b3b3853bd122c02513c3e7d2fc0c2 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PocketPJDlg.cpp @@ -18,65 +18,64 @@ static CPocketPJDlg *theDlg; ///////////////////////////////////////////////////////////////////////////// // CPocketPJDlg dialog -CPocketPJDlg::CPocketPJDlg (CWnd* pParent /*=NULL*/) - : CDialog (CPocketPJDlg::IDD, pParent), m_PopUp (NULL) +CPocketPJDlg::CPocketPJDlg(CWnd* pParent /*=NULL*/) + : CDialog(CPocketPJDlg::IDD, pParent), m_PopUp(NULL) { - //{{AFX_DATA_INIT(CPocketPJDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon (IDR_MAINFRAME); - - theDlg = this; - - m_PopUp = new CPopUpWnd (this); - m_PopUp->Hide(); - - unsigned i; - m_PopUpCount = 0; - - for (i=0; i<POPUP_MAX_TYPE; ++i) { - m_PopUpState[i] = FALSE; - } + //{{AFX_DATA_INIT(CPocketPJDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + + theDlg = this; + + m_PopUp = new CPopUpWnd(this); + m_PopUp->Hide(); + + unsigned i; + m_PopUpCount = 0; + for (i=0; i<POPUP_MAX_TYPE; ++i) { + m_PopUpState[i] = FALSE; + } } -void CPocketPJDlg::DoDataExchange (CDataExchange* pDX) +void CPocketPJDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange (pDX); - //{{AFX_DATA_MAP(CPocketPJDlg) - DDX_Control (pDX, IDC_URL, m_Url); - DDX_Control (pDX, IDC_BUDDY_LIST, m_BuddyList); - DDX_Control (pDX, IDC_BTN_ACTION, m_BtnUrlAction); - DDX_Control (pDX, IDC_BTN_ACC, m_BtnAcc); - DDX_Control (pDX, IDC_ACC_ID, m_AccId); - //}}AFX_DATA_MAP + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CPocketPJDlg) + DDX_Control(pDX, IDC_URL, m_Url); + DDX_Control(pDX, IDC_BUDDY_LIST, m_BuddyList); + DDX_Control(pDX, IDC_BTN_ACTION, m_BtnUrlAction); + DDX_Control(pDX, IDC_BTN_ACC, m_BtnAcc); + DDX_Control(pDX, IDC_ACC_ID, m_AccId); + //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP (CPocketPJDlg, CDialog) - //{{AFX_MSG_MAP(CPocketPJDlg) - ON_BN_CLICKED (IDC_BTN_ACC, OnBtnAcc) - ON_BN_CLICKED (IDC_BTN_ACTION, OnBtnAction) - ON_COMMAND (IDC_ACC_SETTINGS, OnSettings) - ON_COMMAND (IDC_URI_CALL, OnUriCall) - ON_WM_TIMER() - ON_COMMAND (IDC_URI_ADD_BUDDY, OnUriAddBuddy) - ON_COMMAND (IDC_URI_DEL_BUDDY, OnUriDelBuddy) - ON_COMMAND (IDC_ACC_ONLINE, OnAccOnline) - ON_COMMAND (IDC_ACC_INVISIBLE, OnAccInvisible) - ON_NOTIFY (NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList) - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP(CPocketPJDlg, CDialog) + //{{AFX_MSG_MAP(CPocketPJDlg) + ON_BN_CLICKED(IDC_BTN_ACC, OnBtnAcc) + ON_BN_CLICKED(IDC_BTN_ACTION, OnBtnAction) + ON_COMMAND(IDC_ACC_SETTINGS, OnSettings) + ON_COMMAND(IDC_URI_CALL, OnUriCall) + ON_WM_TIMER() + ON_COMMAND(IDC_URI_ADD_BUDDY, OnUriAddBuddy) + ON_COMMAND(IDC_URI_DEL_BUDDY, OnUriDelBuddy) + ON_COMMAND(IDC_ACC_ONLINE, OnAccOnline) + ON_COMMAND(IDC_ACC_INVISIBLE, OnAccInvisible) + ON_NOTIFY(NM_CLICK, IDC_BUDDY_LIST, OnClickBuddyList) + //}}AFX_MSG_MAP END_MESSAGE_MAP() -void CPocketPJDlg::Error (const CString &title, pj_status_t rc) +void CPocketPJDlg::Error(const CString &title, pj_status_t rc) { char errmsg[PJ_ERR_MSG_SIZE]; wchar_t werrmsg[PJ_ERR_MSG_SIZE]; - pj_strerror (rc, errmsg, sizeof (errmsg)); - pj_ansi_to_unicode (errmsg, strlen (errmsg), werrmsg, PJ_ARRAY_SIZE (werrmsg)); + pj_strerror(rc, errmsg, sizeof(errmsg)); + pj_ansi_to_unicode(errmsg, strlen(errmsg), werrmsg, PJ_ARRAY_SIZE(werrmsg)); - AfxMessageBox (title + _T (": ") + werrmsg); + AfxMessageBox(title + _T(": ") + werrmsg); } BOOL CPocketPJDlg::Restart() @@ -85,43 +84,41 @@ BOOL CPocketPJDlg::Restart() pj_status_t status; char ver[80]; - sprintf (ver, "PocketPJ/%s", pj_get_version()); + sprintf(ver, "PocketPJ/%s", pj_get_version()); - ShowWindow (SW_SHOW); - PopUp_Show (POPUP_REGISTRATION, ver, - "Starting up....", "", "", "", 0); + ShowWindow(SW_SHOW); + PopUp_Show(POPUP_REGISTRATION, ver, + "Starting up....", "", "", "", 0); - KillTimer (TIMER_ID); + KillTimer(TIMER_ID); // Destroy first. - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up.."); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Cleaning up.."); pjsua_destroy(); - m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_OFFLINE))); + m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_OFFLINE)) ); UpdateWindow(); // Create - PopUp_Show (POPUP_REGISTRATION, ver, - "Starting up....", "Creating stack..", "", "", 0); + PopUp_Show(POPUP_REGISTRATION, ver, + "Starting up....", "Creating stack..", "", "", 0); status = pjsua_create(); - if (status != PJ_SUCCESS) { - Error (_T ("Error in creating library"), status); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error in creating library"), status); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } pjsua_config cfg; - pjsua_logging_config log_cfg; pjsua_media_config media_cfg; - pjsua_config_default (&cfg); + pjsua_config_default(&cfg); cfg.max_calls = 1; cfg.thread_cnt = 0; - cfg.user_agent = pj_str (ver); + cfg.user_agent = pj_str(ver); cfg.cb.on_call_state = &on_call_state; cfg.cb.on_call_media_state = &on_call_media_state; @@ -133,50 +130,53 @@ BOOL CPocketPJDlg::Restart() /* Configure nameserver */ char nameserver[60]; { - FIXED_INFO fi; - ULONG len = sizeof (fi); - CString err; - - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters.."); - - if (GetNetworkParams (&fi, &len) != ERROR_SUCCESS) { - err = _T ("Info: Error querying network parameters. You must configure DNS server."); - } else if (fi.CurrentDnsServer == NULL) { - err = _T ("Info: DNS server not configured. You must configure DNS server."); - } - - if (err.GetLength()) { - if (m_Cfg.m_DNS.GetLength()) { - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(), - nameserver, sizeof (nameserver)); - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (nameserver); - } else { - AfxMessageBox (err); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; - } - } else { - strcpy (nameserver, fi.CurrentDnsServer->IpAddress.String); - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (nameserver); - } + FIXED_INFO fi; + PIP_ADDR_STRING pDNS = NULL; + ULONG len = sizeof(fi); + CString err; + + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Retrieving network parameters.."); + if (GetNetworkParams(&fi, &len) != ERROR_SUCCESS) { + err = _T("Info: Error querying network parameters. You must configure DNS server."); + } else if (fi.CurrentDnsServer) { + pDNS = fi.CurrentDnsServer; + } else if (fi.DnsServerList.IpAddress.String[0] != 0) { + pDNS = &fi.DnsServerList; + } else { + err = _T("Info: DNS server not configured. You must configure DNS server."); + } + + if (err.GetLength()) { + if (m_Cfg.m_DNS.GetLength()) { + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_DNS, m_Cfg.m_DNS.GetLength(), + nameserver, sizeof(nameserver)); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(nameserver); + } else { + AfxMessageBox(err); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; + } + } else { + strcpy(nameserver, pDNS->IpAddress.String); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(nameserver); + } } char tmp_stun[80]; - if (m_Cfg.m_UseStun) { - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(), - tmp_stun, sizeof (tmp_stun)); - cfg.stun_host = pj_str (tmp_stun); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_StunSrv, m_Cfg.m_StunSrv.GetLength(), + tmp_stun, sizeof(tmp_stun)); + cfg.stun_host = pj_str(tmp_stun); } - pjsua_logging_config_default (&log_cfg); - - log_cfg.log_filename = pj_str ("\\PocketPJ.TXT"); + pjsua_logging_config_default(&log_cfg); + log_cfg.msg_logging = PJ_TRUE; + log_cfg.log_filename = pj_str("\\PocketPJ.TXT"); - pjsua_media_config_default (&media_cfg); + pjsua_media_config_default(&media_cfg); media_cfg.clock_rate = 8000; media_cfg.audio_frame_ptime = 40; media_cfg.ec_tail_len = 0; @@ -189,246 +189,208 @@ BOOL CPocketPJDlg::Restart() media_cfg.no_vad = !m_Cfg.m_VAD; if (m_Cfg.m_EchoSuppress) { - media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; - media_cfg.ec_tail_len = m_Cfg.m_EcTail; + media_cfg.ec_options = PJMEDIA_ECHO_SIMPLE; + media_cfg.ec_tail_len = m_Cfg.m_EcTail; } // Init - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing.."); - - status = pjsua_init (&cfg, &log_cfg, &media_cfg); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Initializing.."); + status = pjsua_init(&cfg, &log_cfg, &media_cfg); if (status != PJ_SUCCESS) { - Error (_T ("Error initializing library"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error initializing library"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } // Create one UDP transport - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding UDP transport.."); pjsua_transport_id transport_id; - pjsua_transport_config udp_cfg; - pjsua_transport_config_default (&udp_cfg); - + pjsua_transport_config_default(&udp_cfg); udp_cfg.port = 0; - - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, - &udp_cfg, &transport_id); - + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, + &udp_cfg, &transport_id); if (status != PJ_SUCCESS) { - Error (_T ("Error creating UDP transport"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error creating UDP transport"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } - if (m_Cfg.m_TCP) { - // Create one TCP transport - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); - pjsua_transport_id transport_id; - pjsua_transport_config tcp_cfg; - - pjsua_transport_config_default (&tcp_cfg); - tcp_cfg.port = 0; - status = pjsua_transport_create (PJSIP_TRANSPORT_TCP, - &tcp_cfg, &transport_id); - - if (status != PJ_SUCCESS) { - Error (_T ("Error creating TCP transport"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; - } + // Always instantiate TCP to support auto-switching to TCP when + // packet is larger than 1300 bytes. If TCP is disabled when + // no auto-switching will occur + if (1) { + // Create one TCP transport + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding TCP transport.."); + pjsua_transport_id transport_id; + pjsua_transport_config tcp_cfg; + + pjsua_transport_config_default(&tcp_cfg); + tcp_cfg.port = 0; + status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, + &tcp_cfg, &transport_id); + if (status != PJ_SUCCESS) { + Error(_T("Error creating TCP transport"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; + } } // Adjust codecs priority pj_str_t tmp; - - pjsua_codec_set_priority (pj_cstr (&tmp, "*"), 0); - - for (i=0; i< (unsigned) m_Cfg.m_Codecs.GetSize(); ++i) { - CString codec = m_Cfg.m_Codecs.GetAt (i); - char tmp_nam[80]; - - pj_unicode_to_ansi ( (LPCTSTR) codec, codec.GetLength(), - tmp_nam, sizeof (tmp_nam)); - pjsua_codec_set_priority (pj_cstr (&tmp, tmp_nam), (pj_uint8_t) (200-i)); + pjsua_codec_set_priority(pj_cstr(&tmp, "*"), 0); + for (i=0; i<(unsigned)m_Cfg.m_Codecs.GetSize(); ++i) { + CString codec = m_Cfg.m_Codecs.GetAt(i); + char tmp_nam[80]; + + pj_unicode_to_ansi((LPCTSTR)codec, codec.GetLength(), + tmp_nam, sizeof(tmp_nam)); + pjsua_codec_set_priority(pj_cstr(&tmp, tmp_nam), (pj_uint8_t)(200-i)); } // Start! - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting.."); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Starting.."); status = pjsua_start(); - if (status != PJ_SUCCESS) { - Error (_T ("Error starting library"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Error starting library"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } // Add account - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account.."); - + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, "Adding account.."); char domain[80], username[80], passwd[80]; - char id[80], reg_uri[80]; - pjsua_acc_config acc_cfg; - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(), - domain, sizeof (domain)); - - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_User, m_Cfg.m_User.GetLength(), - username, sizeof (username)); - - pj_unicode_to_ansi ( (LPCTSTR) m_Cfg.m_Password, m_Cfg.m_Password.GetLength(), - passwd, sizeof (passwd)); - - snprintf (id, sizeof (id), "<sip:%s@%s>", username, domain); - - snprintf (reg_uri, sizeof (reg_uri), "sip:%s", domain); - - pjsua_acc_config_default (&acc_cfg); - - acc_cfg.id = pj_str (id); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Domain, m_Cfg.m_Domain.GetLength(), + domain, sizeof(domain)); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_User, m_Cfg.m_User.GetLength(), + username, sizeof(username)); + pj_unicode_to_ansi((LPCTSTR)m_Cfg.m_Password, m_Cfg.m_Password.GetLength(), + passwd, sizeof(passwd)); - acc_cfg.reg_uri = pj_str (reg_uri); + snprintf(id, sizeof(id), "<sip:%s@%s>", username, domain); + snprintf(reg_uri, sizeof(reg_uri), "sip:%s", domain); + pjsua_acc_config_default(&acc_cfg); + acc_cfg.id = pj_str(id); + acc_cfg.reg_uri = pj_str(reg_uri); acc_cfg.cred_count = 1; - - acc_cfg.cred_info[0].scheme = pj_str ("Digest"); - - acc_cfg.cred_info[0].realm = pj_str ("*"); - - acc_cfg.cred_info[0].username = pj_str (username); - + acc_cfg.cred_info[0].scheme = pj_str("Digest"); + acc_cfg.cred_info[0].realm = pj_str("*"); + acc_cfg.cred_info[0].username = pj_str(username); acc_cfg.cred_info[0].data_type = 0; - - acc_cfg.cred_info[0].data = pj_str (passwd); + acc_cfg.cred_info[0].data = pj_str(passwd); #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) acc_cfg.use_srtp = (m_Cfg.m_UseSrtp ? PJMEDIA_SRTP_OPTIONAL : PJMEDIA_SRTP_DISABLED); - acc_cfg.srtp_secure_signaling = 0; - #endif acc_cfg.publish_enabled = m_Cfg.m_UsePublish; - + char route[80]; - if (m_Cfg.m_TCP) { - snprintf (route, sizeof (route), "<sip:%s;lr;transport=tcp>", domain); - acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route); + snprintf(route, sizeof(route), "<sip:%s;lr;transport=tcp>", domain); + acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); } else { - snprintf (route, sizeof (route), "<sip:%s;lr>", domain); - acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str (route); + snprintf(route, sizeof(route), "<sip:%s;lr>", domain); + acc_cfg.proxy[acc_cfg.proxy_cnt++] = pj_str(route); } - status = pjsua_acc_add (&acc_cfg, PJ_TRUE, &m_PjsuaAccId); - + status = pjsua_acc_add(&acc_cfg, PJ_TRUE, &m_PjsuaAccId); if (status != PJ_SUCCESS) { - Error (_T ("Invalid account settings"), status); - pjsua_destroy(); - PopUp_Hide (POPUP_REGISTRATION); - return FALSE; + Error(_T("Invalid account settings"), status); + pjsua_destroy(); + PopUp_Hide(POPUP_REGISTRATION); + return FALSE; } - CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain; - - m_AccId.SetWindowText (acc_text); + CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain; + m_AccId.SetWindowText(acc_text); - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text); - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering.."); - PopUp_Modify (POPUP_REGISTRATION, POPUP_EL_TITLE3, ""); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE1, acc_text); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE2, "Registering.."); + PopUp_Modify(POPUP_REGISTRATION, POPUP_EL_TITLE3, ""); - SetTimer (TIMER_ID, 100, NULL); + SetTimer(TIMER_ID, 100, NULL); return TRUE; } -void CPocketPJDlg::PopUp_Show (PopUpType type, - const CString& title1, - const CString& title2, - const CString& title3, - const CString& btn1, - const CString& btn2, - unsigned userData) +void CPocketPJDlg::PopUp_Show( PopUpType type, + const CString& title1, + const CString& title2, + const CString& title3, + const CString& btn1, + const CString& btn2, + unsigned userData) { - PJ_UNUSED_ARG (userData); + PJ_UNUSED_ARG(userData); if (!m_PopUpState[type]) - ++m_PopUpCount; + ++m_PopUpCount; m_PopUpState[type] = TRUE; m_PopUpContent[type].m_Title1 = title1; - m_PopUpContent[type].m_Title2 = title2; - m_PopUpContent[type].m_Title3 = title3; - m_PopUpContent[type].m_Btn1 = btn1; - m_PopUpContent[type].m_Btn2 = btn2; - m_PopUp->SetContent (m_PopUpContent[type]); - + m_PopUp->SetContent(m_PopUpContent[type]); m_PopUp->Show(); } -void CPocketPJDlg::PopUp_Modify (PopUpType type, - PopUpElement el, - const CString& text) +void CPocketPJDlg::PopUp_Modify(PopUpType type, + PopUpElement el, + const CString& text) { switch (el) { - - case POPUP_EL_TITLE1: - m_PopUpContent[type].m_Title1 = text; - break; - - case POPUP_EL_TITLE2: - m_PopUpContent[type].m_Title2 = text; - break; - - case POPUP_EL_TITLE3: - m_PopUpContent[type].m_Title3 = text; - break; - - case POPUP_EL_BUTTON1: - m_PopUpContent[type].m_Btn1 = text; - break; - - case POPUP_EL_BUTTON2: - m_PopUpContent[type].m_Btn1 = text; - break; + case POPUP_EL_TITLE1: + m_PopUpContent[type].m_Title1 = text; + break; + case POPUP_EL_TITLE2: + m_PopUpContent[type].m_Title2 = text; + break; + case POPUP_EL_TITLE3: + m_PopUpContent[type].m_Title3 = text; + break; + case POPUP_EL_BUTTON1: + m_PopUpContent[type].m_Btn1 = text; + break; + case POPUP_EL_BUTTON2: + m_PopUpContent[type].m_Btn1 = text; + break; } - m_PopUp->SetContent (m_PopUpContent[type]); + m_PopUp->SetContent(m_PopUpContent[type]); } -void CPocketPJDlg::PopUp_Hide (PopUpType type) +void CPocketPJDlg::PopUp_Hide(PopUpType type) { if (m_PopUpState[type]) - --m_PopUpCount; + --m_PopUpCount; m_PopUpState[type] = FALSE; if (m_PopUpCount == 0) { - m_PopUp->Hide(); - UpdateWindow(); + m_PopUp->Hide(); + UpdateWindow(); } else { - for (int i=POPUP_MAX_TYPE-1; i>=0; --i) { - if (m_PopUpState[i]) { - m_PopUp->SetContent (m_PopUpContent[i]); - break; - } - } + for (int i=POPUP_MAX_TYPE-1; i>=0; --i) { + if (m_PopUpState[i]) { + m_PopUp->SetContent(m_PopUpContent[i]); + break; + } + } } } @@ -436,120 +398,109 @@ void CPocketPJDlg::OnCallState() { pjsua_call_info ci; - pjsua_call_get_info (0, &ci); - + pjsua_call_get_info(0, &ci); + switch (ci.state) { - - case PJSIP_INV_STATE_NULL: /**< Before INVITE is sent or received */ - break; - - case PJSIP_INV_STATE_CALLING: /**< After INVITE is sent */ - PopUp_Show (POPUP_CALL, "Calling..", ci.remote_info.ptr, "", - "", "Hangup", 0); - break; - - case PJSIP_INV_STATE_INCOMING: /**< After INVITE is received. */ - PopUp_Show (POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "", - "Answer", "Hangup", 0); - pjsua_call_answer (0, 180, NULL, NULL); - - if (m_Cfg.m_AutoAnswer) - OnPopUpButton (1); - - break; - - case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */ - - case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received. */ - - case PJSIP_INV_STATE_CONFIRMED: { /**< After ACK is sent/received. */ - CString stateText = ci.state_text.ptr; - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, stateText); - } - - break; - - case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated. */ - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, "Disconnected"); - PopUp_Hide (POPUP_CALL); - break; - } + case PJSIP_INV_STATE_NULL: /**< Before INVITE is sent or received */ + break; + case PJSIP_INV_STATE_CALLING: /**< After INVITE is sent */ + PopUp_Show(POPUP_CALL, "Calling..", ci.remote_info.ptr, "", + "", "Hangup", 0); + break; + case PJSIP_INV_STATE_INCOMING: /**< After INVITE is received. */ + PopUp_Show(POPUP_CALL, "Incoming call..", ci.remote_info.ptr, "", + "Answer", "Hangup", 0); + pjsua_call_answer(0, 180, NULL, NULL); + if (m_Cfg.m_AutoAnswer) + OnPopUpButton(1); + break; + case PJSIP_INV_STATE_EARLY: /**< After response with To tag. */ + case PJSIP_INV_STATE_CONNECTING:/**< After 2xx is sent/received. */ + case PJSIP_INV_STATE_CONFIRMED: /**< After ACK is sent/received. */ + { + CString stateText = ci.state_text.ptr; + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, stateText); + } + break; + case PJSIP_INV_STATE_DISCONNECTED:/**< Session is terminated. */ + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, "Disconnected"); + PopUp_Hide(POPUP_CALL); + break; + } } -void CPocketPJDlg::on_call_state (pjsua_call_id call_id, pjsip_event *e) +void CPocketPJDlg::on_call_state(pjsua_call_id call_id, pjsip_event *e) { - PJ_UNUSED_ARG (e); - PJ_UNUSED_ARG (call_id); + PJ_UNUSED_ARG(e); + PJ_UNUSED_ARG(call_id); theDlg->OnCallState(); } -void CPocketPJDlg::on_call_media_state (pjsua_call_id call_id) +void CPocketPJDlg::on_call_media_state(pjsua_call_id call_id) { pjsua_call_info call_info; - pjsua_call_get_info (call_id, &call_info); - + pjsua_call_get_info(call_id, &call_info); if (call_info.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - pjsua_conf_connect (call_info.conf_slot, 0); - pjsua_conf_connect (0, call_info.conf_slot); + pjsua_conf_connect(call_info.conf_slot, 0); + pjsua_conf_connect(0, call_info.conf_slot); } } -void CPocketPJDlg::on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +void CPocketPJDlg::on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(rdata); } void CPocketPJDlg::OnRegState() { pjsua_acc_info ai; - pjsua_acc_get_info (m_PjsuaAccId, &ai); + pjsua_acc_get_info(m_PjsuaAccId, &ai); - CString acc_text = m_Cfg.m_User + _T ("@") + m_Cfg.m_Domain; + CString acc_text = m_Cfg.m_User + _T("@") + m_Cfg.m_Domain; if (ai.expires>0 && ai.status/100==2) { - /* Registration success */ - HBITMAP old = m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE))); - PJ_UNUSED_ARG (old); - acc_text += " (OK)"; - m_AccId.SetWindowText (acc_text); + /* Registration success */ + HBITMAP old = m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) ); + PJ_UNUSED_ARG(old); + acc_text += " (OK)"; + m_AccId.SetWindowText(acc_text); } else if (ai.status/100 != 2) { - acc_text += " (err)"; - Error (_T ("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS (ai.status)); - m_AccId.SetWindowText (acc_text); + acc_text += " (err)"; + Error(_T("SIP registration error"), PJSIP_ERRNO_FROM_SIP_STATUS(ai.status)); + m_AccId.SetWindowText(acc_text); } - - PopUp_Hide (POPUP_REGISTRATION); + PopUp_Hide(POPUP_REGISTRATION); } -void CPocketPJDlg::on_reg_state (pjsua_acc_id acc_id) +void CPocketPJDlg::on_reg_state(pjsua_acc_id acc_id) { - PJ_UNUSED_ARG (acc_id); + PJ_UNUSED_ARG(acc_id); theDlg->OnRegState(); } -void CPocketPJDlg::on_buddy_state (pjsua_buddy_id buddy_id) +void CPocketPJDlg::on_buddy_state(pjsua_buddy_id buddy_id) { - PJ_UNUSED_ARG (buddy_id); + PJ_UNUSED_ARG(buddy_id); theDlg->RedrawBuddyList(); } -void CPocketPJDlg::on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +void CPocketPJDlg::on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (from); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - PJ_UNUSED_ARG (text); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(from); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + PJ_UNUSED_ARG(text); } ///////////////////////////////////////////////////////////////////////////// @@ -557,150 +508,143 @@ void CPocketPJDlg::on_pager (pjsua_call_id call_id, const pj_str_t *from, BOOL CPocketPJDlg::OnInitDialog() { - CDialog::OnInitDialog(); - - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon (m_hIcon, TRUE); // Set big icon - SetIcon (m_hIcon, FALSE); // Set small icon - - CenterWindow (GetDesktopWindow()); // center to the hpc screen - - // TODO: Add extra initialization here - - m_Cfg.LoadRegistry(); - //ShowWindow(SW_SHOW); - m_AccId.SetWindowText (m_Cfg.m_User); - - CImageList *il = new CImageList; - VERIFY (il->Create (16, 16, ILC_COLOR|ILC_MASK, 2, 4)); - - CBitmap *bmp = new CBitmap; - bmp->LoadBitmap (MAKEINTRESOURCE (IDB_BLANK)); - il->Add (bmp, RGB (255,255,255)); - bmp = new CBitmap; - bmp->LoadBitmap (MAKEINTRESOURCE (IDB_ONLINE)); - il->Add (bmp, RGB (255,255,255)); - - m_BuddyList.SetImageList (il, LVSIL_SMALL); - - if (m_Cfg.m_Domain.GetLength() ==0 || Restart() == FALSE) { - for (;;) { - CSettingsDlg dlg (m_Cfg); - - if (dlg.DoModal() != IDOK) { - EndDialog (IDOK); - return TRUE; - } - - m_Cfg.SaveRegistry(); - - if (Restart()) - break; - } - } - - RedrawBuddyList(); - - return TRUE; // return TRUE unless you set the focus to a control + CDialog::OnInitDialog(); + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + CenterWindow(GetDesktopWindow()); // center to the hpc screen + + // TODO: Add extra initialization here + + m_Cfg.LoadRegistry(); + //ShowWindow(SW_SHOW); + m_AccId.SetWindowText(m_Cfg.m_User); + + CImageList *il = new CImageList; + VERIFY(il->Create(16, 16, ILC_COLOR|ILC_MASK, 2, 4)); + + CBitmap *bmp = new CBitmap; + bmp->LoadBitmap(MAKEINTRESOURCE(IDB_BLANK)); + il->Add(bmp, RGB(255,255,255)); + bmp = new CBitmap; + bmp->LoadBitmap(MAKEINTRESOURCE(IDB_ONLINE)); + il->Add(bmp, RGB(255,255,255)); + + m_BuddyList.SetImageList(il, LVSIL_SMALL); + + if (m_Cfg.m_Domain.GetLength()==0 || Restart() == FALSE) { + for (;;) { + CSettingsDlg dlg(m_Cfg); + if (dlg.DoModal() != IDOK) { + EndDialog(IDOK); + return TRUE; + } + + m_Cfg.SaveRegistry(); + + if (Restart()) + break; + } + } + + RedrawBuddyList(); + return TRUE; // return TRUE unless you set the focus to a control } -void CPocketPJDlg::OnBtnAcc() +void CPocketPJDlg::OnBtnAcc() { CMenu menu; - VERIFY (menu.LoadMenu (IDR_ACC_MENU)); - CMenu* pPopup = menu.GetSubMenu (0); - ASSERT (pPopup != NULL); + VERIFY(menu.LoadMenu(IDR_ACC_MENU)); + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); RECT r; - m_BtnAcc.GetWindowRect (&r); - pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this); + m_BtnAcc.GetWindowRect(&r); + pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this); } -void CPocketPJDlg::OnBtnAction() +void CPocketPJDlg::OnBtnAction() { CMenu menu; - VERIFY (menu.LoadMenu (IDR_URI_MENU)); - CMenu* pPopup = menu.GetSubMenu (0); - ASSERT (pPopup != NULL); + VERIFY(menu.LoadMenu(IDR_URI_MENU)); + CMenu* pPopup = menu.GetSubMenu(0); + ASSERT(pPopup != NULL); RECT r; - this->m_BtnUrlAction.GetWindowRect (&r); - pPopup->TrackPopupMenu (TPM_LEFTALIGN, r.left+4, r.top+4, this); + this->m_BtnUrlAction.GetWindowRect(&r); + pPopup->TrackPopupMenu(TPM_LEFTALIGN, r.left+4, r.top+4, this); } -void CPocketPJDlg::OnSettings() +void CPocketPJDlg::OnSettings() { for (;;) { - CSettingsDlg dlg (m_Cfg); - - if (dlg.DoModal() != IDOK) { - return; - } + CSettingsDlg dlg(m_Cfg); + if (dlg.DoModal() != IDOK) { + return; + } - m_Cfg.SaveRegistry(); + m_Cfg.SaveRegistry(); - if (Restart()) - break; + if (Restart()) + break; } } void CPocketPJDlg::OnOK() { - if (AfxMessageBox (_T ("Quit PocketPJ?"), MB_YESNO) ==IDYES) { - KillTimer (TIMER_ID); - PopUp_Show (POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0); - pjsua_destroy(); - CDialog::OnOK(); - PopUp_Hide (POPUP_REGISTRATION); - m_Cfg.SaveRegistry(); - return; + if (AfxMessageBox(_T("Quit PocketPJ?"), MB_YESNO)==IDYES) { + KillTimer(TIMER_ID); + PopUp_Show(POPUP_REGISTRATION, "", "Shutting down..", "", "", "", 0); + pjsua_destroy(); + CDialog::OnOK(); + PopUp_Hide(POPUP_REGISTRATION); + m_Cfg.SaveRegistry(); + return; } } -void CPocketPJDlg::OnTimer (UINT nIDEvent) +void CPocketPJDlg::OnTimer(UINT nIDEvent) { - pjsua_handle_events (10); - CDialog::OnTimer (nIDEvent); + pjsua_handle_events(10); + CDialog::OnTimer(nIDEvent); } -int CPocketPJDlg::FindBuddyInPjsua (const CString &Uri) +int CPocketPJDlg::FindBuddyInPjsua(const CString &Uri) { char uri[80]; pjsua_buddy_id id[128]; - unsigned i, count = PJ_ARRAY_SIZE (id); - - if (pjsua_enum_buddies (id, &count) != PJ_SUCCESS) - return PJSUA_INVALID_ID; + unsigned i, count = PJ_ARRAY_SIZE(id); + if (pjsua_enum_buddies(id, &count) != PJ_SUCCESS) + return PJSUA_INVALID_ID; if (count==0) - return PJSUA_INVALID_ID; + return PJSUA_INVALID_ID; - pj_unicode_to_ansi ( (LPCTSTR) Uri, Uri.GetLength(), uri, sizeof (uri)); + pj_unicode_to_ansi((LPCTSTR)Uri, Uri.GetLength(), uri, sizeof(uri)); for (i=0; i<count; ++i) { - pjsua_buddy_info bi; - pjsua_buddy_get_info (id[i], &bi); - - if (pj_strcmp2 (&bi.uri, uri) ==0) - return i; + pjsua_buddy_info bi; + pjsua_buddy_get_info(id[i], &bi); + if (pj_strcmp2(&bi.uri, uri)==0) + return i; } return PJSUA_INVALID_ID; } -int CPocketPJDlg::FindBuddyInCfg (const CString &uri) +int CPocketPJDlg::FindBuddyInCfg(const CString &uri) { int i; - for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - if (m_Cfg.m_BuddyList.GetAt (0) == uri) { - return i; - } + if (m_Cfg.m_BuddyList.GetAt(0) == uri) { + return i; + } } - return -1; } @@ -711,136 +655,127 @@ void CPocketPJDlg::RedrawBuddyList() m_BuddyList.DeleteAllItems(); for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - int isOnline; - int id; - - id = FindBuddyInPjsua (m_Cfg.m_BuddyList.GetAt (i)); - - if (id != PJSUA_INVALID_ID) { - pjsua_buddy_info bi; - pjsua_buddy_get_info (id, &bi); - isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE); - } else { - isOnline = 0; - } - - LVITEM lvi; - - memset (&lvi, 0, sizeof (lvi)); - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - lvi.iItem = i; - lvi.iImage = isOnline; - lvi.pszText = (LPTSTR) (LPCTSTR) m_Cfg.m_BuddyList.GetAt (i); - - m_BuddyList.InsertItem (&lvi); + int isOnline; + int id; + + id = FindBuddyInPjsua(m_Cfg.m_BuddyList.GetAt(i)); + if (id != PJSUA_INVALID_ID) { + pjsua_buddy_info bi; + pjsua_buddy_get_info(id, &bi); + isOnline = (bi.status == PJSUA_BUDDY_STATUS_ONLINE); + } else { + isOnline = 0; + } + + LVITEM lvi; + memset(&lvi, 0, sizeof(lvi)); + lvi.mask = LVIF_TEXT | LVIF_IMAGE; + lvi.iItem = i; + lvi.iImage = isOnline; + lvi.pszText = (LPTSTR)(LPCTSTR)m_Cfg.m_BuddyList.GetAt(i); + + m_BuddyList.InsertItem(&lvi); } } -void CPocketPJDlg::OnUriCall() +void CPocketPJDlg::OnUriCall() { char tmp[120]; CString uri; pj_status_t status; - m_Url.GetWindowText (uri); - pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp)); - - if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) { - Error ("The URL is not valid SIP URL", status); - return; + m_Url.GetWindowText(uri); + pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp)); + if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) { + Error("The URL is not valid SIP URL", status); + return; } - pj_str_t dest_uri = pj_str (tmp); - + pj_str_t dest_uri = pj_str(tmp); pjsua_call_id call_id; - status = pjsua_call_make_call (m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id); + status = pjsua_call_make_call(m_PjsuaAccId, &dest_uri, 0, NULL, NULL, &call_id); if (status != PJ_SUCCESS) - Error ("Unable to make call", status); + Error("Unable to make call", status); } -void CPocketPJDlg::OnUriAddBuddy() +void CPocketPJDlg::OnUriAddBuddy() { int i; char tmp[120]; CString uri; pj_status_t status; - m_Url.GetWindowText (uri); - pj_unicode_to_ansi ( (LPCTSTR) uri, uri.GetLength(), tmp, sizeof (tmp)); - - if ( (status=pjsua_verify_sip_url (tmp)) != PJ_SUCCESS) { - Error ("The URL is not valid SIP URL", status); - return; + m_Url.GetWindowText(uri); + pj_unicode_to_ansi((LPCTSTR)uri, uri.GetLength(), tmp, sizeof(tmp)); + if ((status=pjsua_verify_sip_url(tmp)) != PJ_SUCCESS) { + Error("The URL is not valid SIP URL", status); + return; } for (i=0; i<m_Cfg.m_BuddyList.GetSize(); ++i) { - if (m_Cfg.m_BuddyList.GetAt (0) == uri) { - AfxMessageBox (_T ("The URI is already in the buddy list")); - return; - } + if (m_Cfg.m_BuddyList.GetAt(0) == uri) { + AfxMessageBox(_T("The URI is already in the buddy list")); + return; + } } - m_Cfg.m_BuddyList.Add (uri); - + m_Cfg.m_BuddyList.Add(uri); RedrawBuddyList(); } -void CPocketPJDlg::OnUriDelBuddy() +void CPocketPJDlg::OnUriDelBuddy() { CString uri; - m_Url.GetWindowText (uri); - int i = FindBuddyInCfg (uri); - + m_Url.GetWindowText(uri); + int i = FindBuddyInCfg(uri); if (i<0) { - /* Buddy not found */ - return; + /* Buddy not found */ + return; } - m_Cfg.m_BuddyList.RemoveAt (i); - + m_Cfg.m_BuddyList.RemoveAt(i); RedrawBuddyList(); - AfxMessageBox (_T ("Buddy " + uri + " deleted")); + AfxMessageBox(_T("Buddy " + uri + " deleted")); } -void CPocketPJDlg::OnAccOnline() +void CPocketPJDlg::OnAccOnline() { - pjsua_acc_set_online_status (m_PjsuaAccId, PJ_TRUE); - m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_ONLINE))); + pjsua_acc_set_online_status(m_PjsuaAccId, PJ_TRUE); + m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_ONLINE)) ); } -void CPocketPJDlg::OnAccInvisible() +void CPocketPJDlg::OnAccInvisible() { - pjsua_acc_set_online_status (m_PjsuaAccId, PJ_FALSE); - m_BtnAcc.SetBitmap (::LoadBitmap (AfxGetInstanceHandle(), MAKEINTRESOURCE (IDB_INVISIBLE))); + pjsua_acc_set_online_status(m_PjsuaAccId, PJ_FALSE); + m_BtnAcc.SetBitmap(::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_INVISIBLE)) ); } -void CPocketPJDlg::OnPopUpButton (int btnNo) +void CPocketPJDlg::OnPopUpButton(int btnNo) { if (btnNo == 1) { - pjsua_call_answer (0, 200, NULL, 0); - PopUp_Modify (POPUP_CALL, POPUP_EL_BUTTON1, ""); + pjsua_call_answer(0, 200, NULL, 0); + PopUp_Modify(POPUP_CALL, POPUP_EL_BUTTON1, ""); } else if (btnNo == 2) { - // Hangup button - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE2, "Hang up.."); - PopUp_Modify (POPUP_CALL, POPUP_EL_TITLE3, ""); - pjsua_call_hangup (0, PJSIP_SC_DECLINE, 0, 0); + // Hangup button + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE2, "Hang up.."); + PopUp_Modify(POPUP_CALL, POPUP_EL_TITLE3, ""); + pjsua_call_hangup(0, PJSIP_SC_DECLINE, 0, 0); } } -void CPocketPJDlg::OnClickBuddyList (NMHDR* pNMHDR, LRESULT* pResult) +void CPocketPJDlg::OnClickBuddyList(NMHDR* pNMHDR, LRESULT* pResult) { POSITION pos = m_BuddyList.GetFirstSelectedItemPosition(); - PJ_UNUSED_ARG (pNMHDR); + PJ_UNUSED_ARG(pNMHDR); if (pos != NULL) { - int iItem = m_BuddyList.GetNextSelectedItem (pos); - CString uri = m_BuddyList.GetItemText (iItem, 0); - m_Url.SetWindowText (uri); + int iItem = m_BuddyList.GetNextSelectedItem(pos); + CString uri = m_BuddyList.GetItemText(iItem, 0); + m_Url.SetWindowText(uri); } - *pResult = 0; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp index a92d2454e21f48256aa624a55358b576c276ebc3..1f1654f0621eca2dd67e4686be3002f1a647eff5 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/PopUpWnd.cpp @@ -16,9 +16,9 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // CPopUpWnd -CPopUpWnd::CPopUpWnd (CPocketPJDlg* pParent) +CPopUpWnd::CPopUpWnd(CPocketPJDlg* pParent) { - Create (pParent); + Create(pParent); } CPopUpWnd::~CPopUpWnd() @@ -26,95 +26,81 @@ CPopUpWnd::~CPopUpWnd() DestroyWindow(); } -BOOL CPopUpWnd::Create (CPocketPJDlg* pParent) +BOOL CPopUpWnd::Create(CPocketPJDlg* pParent) { BOOL bSuccess; m_ParentWnd = pParent; // Register window class - CString csClassName = AfxRegisterWndClass (CS_HREDRAW|CS_VREDRAW, - 0, - CBrush (::GetSysColor (COLOR_BTNFACE))); + CString csClassName = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW, + 0, + CBrush(::GetSysColor(COLOR_BTNFACE))); // Create popup window - bSuccess = CreateEx (WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style - csClassName, // Classname - _T ("PocketPJ"), // Title - WS_POPUP|WS_BORDER|WS_CAPTION, // style - 0,0, // position - updated soon. - 1,1, // Size - updated soon - pParent->GetSafeHwnd(), // handle to parent - 0, // No menu - NULL); - - if (!bSuccess) - return FALSE; - - ShowWindow (SW_HIDE); + bSuccess = CreateEx(WS_EX_DLGMODALFRAME|WS_EX_TOPMOST, // Extended style + csClassName, // Classname + _T("PocketPJ"), // Title + WS_POPUP|WS_BORDER|WS_CAPTION, // style + 0,0, // position - updated soon. + 1,1, // Size - updated soon + pParent->GetSafeHwnd(), // handle to parent + 0, // No menu + NULL); + if (!bSuccess) + return FALSE; + + ShowWindow(SW_HIDE); // Now create the controls - CRect TempRect (0,0,10,10); + CRect TempRect(0,0,10,10); /* |SS_LEFTNOWORDWRAP */ - bSuccess = m_Title1.Create (_T ("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE1); - + bSuccess = m_Title1.Create(_T("Title1"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE1); if (!bSuccess) - return FALSE; - - bSuccess = m_Title2.Create (_T ("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE2); + return FALSE; + bSuccess = m_Title2.Create(_T("Title2"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE2); if (!bSuccess) - return FALSE; - - bSuccess = m_Title3.Create (_T ("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, - TempRect, this, IDC_TITLE3); + return FALSE; + bSuccess = m_Title3.Create(_T("Title3"), WS_CHILD|WS_VISIBLE|SS_NOPREFIX, + TempRect, this, IDC_TITLE3); if (!bSuccess) - return FALSE; - - bSuccess = m_Btn1.Create (_T ("Button1"), - WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, - TempRect, this, IDC_BTN1); + return FALSE; + bSuccess = m_Btn1.Create(_T("Button1"), + WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, + TempRect, this, IDC_BTN1); if (!bSuccess) - return FALSE; - - bSuccess = m_Btn2.Create (_T ("Button2"), - WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, - TempRect, this, IDC_BTN2); + return FALSE; + bSuccess = m_Btn2.Create(_T("Button2"), + WS_CHILD|WS_VISIBLE|WS_TABSTOP| BS_PUSHBUTTON, + TempRect, this, IDC_BTN2); if (!bSuccess) - return FALSE; + return FALSE; - CFont *ft1 = new CFont, - *ft2 = new CFont, - *ft3 = new CFont; + CFont *ft1 = new CFont, + *ft2 = new CFont, + *ft3 = new CFont; LOGFONT lf; - - memset (&lf, 0, sizeof (LOGFONT)); - + memset(&lf, 0, sizeof(LOGFONT)); lf.lfHeight = 12; - - lstrcpy (lf.lfFaceName, _T ("Arial")); - - VERIFY (ft1->CreateFontIndirect (&lf)); - - VERIFY (ft3->CreateFontIndirect (&lf)); + lstrcpy(lf.lfFaceName, _T("Arial")); + VERIFY(ft1->CreateFontIndirect(&lf)); + VERIFY(ft3->CreateFontIndirect(&lf)); lf.lfHeight = 20; + VERIFY(ft2->CreateFontIndirect(&lf)); - VERIFY (ft2->CreateFontIndirect (&lf)); - - m_Title1.SetFont (ft1, TRUE); - - m_Title2.SetFont (ft2, TRUE); - - m_Title3.SetFont (ft3, TRUE); + m_Title1.SetFont(ft1, TRUE); + m_Title2.SetFont(ft2, TRUE); + m_Title3.SetFont(ft3, TRUE); SetWindowSize(); @@ -127,111 +113,109 @@ BOOL CPopUpWnd::Create (CPocketPJDlg* pParent) return TRUE; } -void CPopUpWnd::SetContent (const CPopUpContent &content) +void CPopUpWnd::SetContent(const CPopUpContent &content) { - m_Title1.SetWindowText (content.m_Title1); - m_Title2.SetWindowText (content.m_Title2); - m_Title3.SetWindowText (content.m_Title3); + m_Title1.SetWindowText(content.m_Title1); + m_Title2.SetWindowText(content.m_Title2); + m_Title3.SetWindowText(content.m_Title3); if (content.m_Btn1 != "") { - m_Btn1.SetWindowText (content.m_Btn1); - m_Btn1.ShowWindow (SW_SHOW); + m_Btn1.SetWindowText(content.m_Btn1); + m_Btn1.ShowWindow(SW_SHOW); } else { - m_Btn1.ShowWindow (SW_HIDE); + m_Btn1.ShowWindow(SW_HIDE); } if (content.m_Btn2 != "") { - m_Btn2.SetWindowText (content.m_Btn2); - m_Btn2.ShowWindow (SW_SHOW); + m_Btn2.SetWindowText(content.m_Btn2); + m_Btn2.ShowWindow(SW_SHOW); } else { - m_Btn2.ShowWindow (SW_HIDE); + m_Btn2.ShowWindow(SW_HIDE); } UpdateWindow(); - - ShowWindow (SW_SHOW); + ShowWindow(SW_SHOW); } -void CPopUpWnd::SetWindowSize (int width, int height) +void CPopUpWnd::SetWindowSize(int width, int height) { enum { H1 = 16, H2 = 40, H3 = 16, S = 5, G = 10, BW=60, BH=20, BG=40}; - CRect rootRect (0, 0, 320, 240); + CRect rootRect(0, 0, 320, 240); int Y; - MoveWindow ( (rootRect.Width() - width) /2, (rootRect.Height() - height) /2, - width, height); + MoveWindow((rootRect.Width() - width)/2, (rootRect.Height() - height)/2, + width, height); - m_Title1.MoveWindow (10, Y=S, width-20, H1); - m_Title2.MoveWindow (10, Y+=H1+G, width-20, H2); - m_Title3.MoveWindow (10, Y+=H2+G, width-20, H3); + m_Title1.MoveWindow(10, Y=S, width-20, H1); + m_Title2.MoveWindow(10, Y+=H1+G, width-20, H2); + m_Title3.MoveWindow(10, Y+=H2+G, width-20, H3); - m_Btn1.MoveWindow ( (width-2*BW-BG) /2, Y+=H3+G, BW, BH); - m_Btn2.MoveWindow ( (width-2*BW-BG) /2+BW+BG, Y, BW, BH); + m_Btn1.MoveWindow((width-2*BW-BG)/2, Y+=H3+G, BW, BH); + m_Btn2.MoveWindow((width-2*BW-BG)/2+BW+BG, Y, BW, BH); } -void CPopUpWnd::Hide() -{ - if (!::IsWindow (GetSafeHwnd())) +void CPopUpWnd::Hide() +{ + if (!::IsWindow(GetSafeHwnd())) return; - if (IsWindowVisible()) { - ShowWindow (SW_HIDE); - ModifyStyle (WS_VISIBLE, 0); + if (IsWindowVisible()) + { + ShowWindow(SW_HIDE); + ModifyStyle(WS_VISIBLE, 0); } } -void CPopUpWnd::Show() -{ - if (!::IsWindow (GetSafeHwnd())) +void CPopUpWnd::Show() +{ + if (!::IsWindow(GetSafeHwnd())) return; - ModifyStyle (0, WS_VISIBLE); - - ShowWindow (SW_SHOWNA); - - RedrawWindow (NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); + ModifyStyle(0, WS_VISIBLE); + ShowWindow(SW_SHOWNA); + RedrawWindow(NULL,NULL,RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); } -BEGIN_MESSAGE_MAP (CPopUpWnd, CWnd) +BEGIN_MESSAGE_MAP(CPopUpWnd, CWnd) //{{AFX_MSG_MAP(CPopUpWnd) ON_WM_ERASEBKGND() - //}}AFX_MSG_MAP - ON_BN_CLICKED (IDC_BTN1, OnCancel1) - ON_BN_CLICKED (IDC_BTN2, OnCancel2) + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDC_BTN1, OnCancel1) + ON_BN_CLICKED(IDC_BTN2, OnCancel2) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPopUpWnd message handlers -BOOL CPopUpWnd::OnEraseBkgnd (CDC* pDC) +BOOL CPopUpWnd::OnEraseBkgnd(CDC* pDC) { CBrush backBrush; - backBrush.CreateSolidBrush (RGB (255,255,255)); - CBrush* pOldBrush = pDC->SelectObject (&backBrush); + backBrush.CreateSolidBrush(RGB(255,255,255)); + CBrush* pOldBrush = pDC->SelectObject(&backBrush); CRect rect; - pDC->GetClipBox (&rect); // Erase the area needed - pDC->PatBlt (rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY); - pDC->SelectObject (pOldBrush); + pDC->GetClipBox(&rect); // Erase the area needed + pDC->PatBlt(rect.left, rect.top, rect.Width(), rect.Height(), PATCOPY); + pDC->SelectObject(pOldBrush); return TRUE; } -void CPopUpWnd::OnCancel1() +void CPopUpWnd::OnCancel1() { - m_ParentWnd->OnPopUpButton (1); + m_ParentWnd->OnPopUpButton(1); } -void CPopUpWnd::OnCancel2() +void CPopUpWnd::OnCancel2() { - m_ParentWnd->OnPopUpButton (2); + m_ParentWnd->OnPopUpButton(2); } -BOOL CPopUpWnd::DestroyWindow() +BOOL CPopUpWnd::DestroyWindow() { return CWnd::DestroyWindow(); } @@ -239,12 +223,13 @@ BOOL CPopUpWnd::DestroyWindow() void CPopUpWnd::PeekAndPump() { MSG msg; - - while (::PeekMessage (&msg, NULL,0,0,PM_NOREMOVE)) { - if (!AfxGetApp()->PumpMessage()) { - ::PostQuitMessage (0); + while (::PeekMessage(&msg, NULL,0,0,PM_NOREMOVE)) + { + if (!AfxGetApp()->PumpMessage()) + { + ::PostQuitMessage(0); return; - } + } } } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp index 6d963f81fa3ec9b2ec11faf8c56bd006f3464868..1357044ae2c4675b973a6de003ba6a4a8476b784 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/pocketpj/SettingsDlg.cpp @@ -37,20 +37,20 @@ static char THIS_FILE[] = __FILE__; ///////////////////////////////////////////////////////////////////////////// // Settings CPocketPJSettings::CPocketPJSettings() - : m_UseStun (FALSE), m_UseIce (FALSE), m_UseSrtp (FALSE), m_UsePublish (FALSE), - m_EchoSuppress (TRUE), m_EcTail (200), m_TCP (FALSE), m_VAD (FALSE), - m_AutoAnswer (FALSE) +: m_UseStun(FALSE), m_UseIce(FALSE), m_UseSrtp(FALSE), m_UsePublish(FALSE), + m_EchoSuppress(TRUE), m_EcTail(200), m_TCP(FALSE), m_VAD(FALSE), + m_AutoAnswer(FALSE) { /* Init codec list */ #if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC - m_Codecs.Add (_T ("GSM")); + m_Codecs.Add(_T("GSM")); #endif #if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC - m_Codecs.Add (_T ("PCMU")); - m_Codecs.Add (_T ("PCMA")); + m_Codecs.Add(_T("PCMU")); + m_Codecs.Add(_T("PCMA")); #endif #if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC - m_Codecs.Add (_T ("Speex")); + m_Codecs.Add(_T("Speex")); #endif } @@ -63,131 +63,113 @@ void CPocketPJSettings::LoadRegistry() DWORD cbData; - if (key.Open (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) - return; + if (key.Open(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) + return; - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) { - m_Domain = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_DOMAIN, &cbData) == ERROR_SUCCESS) { + m_Domain = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_USER, &cbData) == ERROR_SUCCESS) { - m_User = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_USER, &cbData) == ERROR_SUCCESS) { + m_User = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) { - m_Password = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_PASSWD, &cbData) == ERROR_SUCCESS) { + m_Password = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) { - m_StunSrv = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_STUN_SRV, &cbData) == ERROR_SUCCESS) { + m_StunSrv = textVal; } - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, REG_DNS, &cbData) == ERROR_SUCCESS) { - m_DNS = textVal; + cbData = sizeof(textVal); + if (key.QueryValue(textVal, REG_DNS, &cbData) == ERROR_SUCCESS) { + m_DNS = textVal; } dwordVal = 0; - - if (key.QueryValue (dwordVal, REG_USE_STUN) == ERROR_SUCCESS) { - m_UseStun = dwordVal != 0; + if (key.QueryValue(dwordVal, REG_USE_STUN) == ERROR_SUCCESS) { + m_UseStun = dwordVal != 0; } - if (key.QueryValue (dwordVal, REG_USE_ICE) == ERROR_SUCCESS) { - m_UseIce = dwordVal != 0; + if (key.QueryValue(dwordVal, REG_USE_ICE) == ERROR_SUCCESS) { + m_UseIce = dwordVal != 0; } - if (key.QueryValue (dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) { - m_UseSrtp = dwordVal != 0; + if (key.QueryValue(dwordVal, REG_USE_SRTP) == ERROR_SUCCESS) { + m_UseSrtp = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) { - m_UsePublish = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_USE_PUBLISH) == ERROR_SUCCESS) { + m_UsePublish = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) { - m_EchoSuppress = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_ENABLE_EC) == ERROR_SUCCESS) { + m_EchoSuppress = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) { - m_EcTail = dwordVal; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_EC_TAIL) == ERROR_SUCCESS) { + m_EcTail = dwordVal; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) { - m_TCP = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_ENABLE_TCP) == ERROR_SUCCESS) { + m_TCP = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) { - m_VAD = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_ENABLE_VAD) == ERROR_SUCCESS) { + m_VAD = dwordVal != 0; } - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) { - m_AutoAnswer = dwordVal != 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_AUTO_ANSWER) == ERROR_SUCCESS) { + m_AutoAnswer = dwordVal != 0; } m_BuddyList.RemoveAll(); DWORD buddyCount = 0; - cbData = sizeof (dwordVal); - - if (key.QueryValue (dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) { - buddyCount = dwordVal; + cbData = sizeof(dwordVal); + if (key.QueryValue(dwordVal, REG_BUDDY_CNT) == ERROR_SUCCESS) { + buddyCount = dwordVal; } unsigned i; - for (i=0; i<buddyCount; ++i) { - CString entry; - entry.Format (REG_BUDDY_X, i); + CString entry; + entry.Format(REG_BUDDY_X, i); - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) { - m_BuddyList.Add (textVal); - } + cbData = sizeof(textVal); + if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) { + m_BuddyList.Add(textVal); + } } DWORD codecCount = 0; + cbData = sizeof(dwordVal); + if (key.QueryValue(codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) { - cbData = sizeof (dwordVal); - - if (key.QueryValue (codecCount, REG_CODEC_CNT) == ERROR_SUCCESS) { + m_Codecs.RemoveAll(); - m_Codecs.RemoveAll(); + for (i=0; i<codecCount; ++i) { + CString entry; + entry.Format(REG_CODEC_X, i); - for (i=0; i<codecCount; ++i) { - CString entry; - entry.Format (REG_CODEC_X, i); - - cbData = sizeof (textVal); - - if (key.QueryValue (textVal, entry, &cbData) == ERROR_SUCCESS) { - m_Codecs.Add (textVal); - } - } + cbData = sizeof(textVal); + if (key.QueryValue(textVal, entry, &cbData) == ERROR_SUCCESS) { + m_Codecs.Add(textVal); + } + } } key.Close(); @@ -198,55 +180,42 @@ void CPocketPJSettings::SaveRegistry() { CRegKey key; - if (key.Create (HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) - return; - - key.SetValue (m_Domain, REG_DOMAIN); - - key.SetValue (m_User, REG_USER); - - key.SetValue (m_Password, REG_PASSWD); + if (key.Create(HKEY_CURRENT_USER, REG_PATH) != ERROR_SUCCESS) + return; - key.SetValue (m_StunSrv, REG_STUN_SRV); + key.SetValue(m_Domain, REG_DOMAIN); + key.SetValue(m_User, REG_USER); + key.SetValue(m_Password, REG_PASSWD); + key.SetValue(m_StunSrv, REG_STUN_SRV); + key.SetValue(m_DNS, REG_DNS); + + key.SetValue(m_UseStun, REG_USE_STUN); + key.SetValue(m_UseIce, REG_USE_ICE); + key.SetValue(m_UseSrtp, REG_USE_SRTP); + key.SetValue(m_UsePublish, REG_USE_PUBLISH); - key.SetValue (m_DNS, REG_DNS); + key.SetValue(m_EchoSuppress, REG_ENABLE_EC); + key.SetValue(m_EcTail, REG_EC_TAIL); - key.SetValue (m_UseStun, REG_USE_STUN); + key.SetValue(m_TCP, REG_ENABLE_TCP); + key.SetValue(m_VAD, REG_ENABLE_VAD); + key.SetValue(m_AutoAnswer, REG_AUTO_ANSWER); - key.SetValue (m_UseIce, REG_USE_ICE); - - key.SetValue (m_UseSrtp, REG_USE_SRTP); - - key.SetValue (m_UsePublish, REG_USE_PUBLISH); - - key.SetValue (m_EchoSuppress, REG_ENABLE_EC); - - key.SetValue (m_EcTail, REG_EC_TAIL); - - key.SetValue (m_TCP, REG_ENABLE_TCP); - - key.SetValue (m_VAD, REG_ENABLE_VAD); - - key.SetValue (m_AutoAnswer, REG_AUTO_ANSWER); - - key.SetValue (m_BuddyList.GetSize(), REG_BUDDY_CNT); + key.SetValue(m_BuddyList.GetSize(), REG_BUDDY_CNT); int i; - for (i=0; i<m_BuddyList.GetSize(); ++i) { - CString entry; - entry.Format (REG_BUDDY_X, i); - key.SetValue (m_BuddyList.GetAt (i), entry); + CString entry; + entry.Format(REG_BUDDY_X, i); + key.SetValue(m_BuddyList.GetAt(i), entry); } DWORD N = m_Codecs.GetSize(); - - key.SetValue (N, REG_CODEC_CNT); - + key.SetValue(N, REG_CODEC_CNT); for (i=0; i<m_Codecs.GetSize(); ++i) { - CString entry; - entry.Format (REG_CODEC_X, i); - key.SetValue (m_Codecs.GetAt (i), entry); + CString entry; + entry.Format(REG_CODEC_X, i); + key.SetValue(m_Codecs.GetAt(i), entry); } key.Close(); @@ -257,137 +226,127 @@ void CPocketPJSettings::SaveRegistry() // CSettingsDlg dialog -CSettingsDlg::CSettingsDlg (CPocketPJSettings &cfg, CWnd* pParent) - : CDialog (CSettingsDlg::IDD, pParent), m_Cfg (cfg) +CSettingsDlg::CSettingsDlg(CPocketPJSettings &cfg, CWnd* pParent) + : CDialog(CSettingsDlg::IDD, pParent), m_Cfg(cfg) { - //{{AFX_DATA_INIT(CSettingsDlg) - m_Domain = _T (""); - m_ICE = FALSE; - m_Passwd = _T (""); - m_PUBLISH = FALSE; - m_SRTP = FALSE; - m_STUN = FALSE; - m_StunSrv = _T (""); - m_User = _T (""); - m_Dns = _T (""); - m_EchoSuppress = FALSE; - m_EcTail = _T (""); - m_TCP = FALSE; - m_VAD = FALSE; - m_AutoAnswer = FALSE; - //}}AFX_DATA_INIT - - m_Domain = m_Cfg.m_Domain; - m_ICE = m_Cfg.m_UseIce; - m_Passwd = m_Cfg.m_Password; - m_PUBLISH = m_Cfg.m_UsePublish; - m_SRTP = m_Cfg.m_UseSrtp; - m_STUN = m_Cfg.m_UseStun; - m_StunSrv = m_Cfg.m_StunSrv; - m_User = m_Cfg.m_User; - m_Dns = m_Cfg.m_DNS; - m_EchoSuppress = m_Cfg.m_EchoSuppress; - m_TCP = m_Cfg.m_TCP; - m_VAD = m_Cfg.m_VAD; - m_AutoAnswer= m_Cfg.m_AutoAnswer; - - CString s; - s.Format (_T ("%d"), m_Cfg.m_EcTail); - m_EcTail = s; + //{{AFX_DATA_INIT(CSettingsDlg) + m_Domain = _T(""); + m_ICE = FALSE; + m_Passwd = _T(""); + m_PUBLISH = FALSE; + m_SRTP = FALSE; + m_STUN = FALSE; + m_StunSrv = _T(""); + m_User = _T(""); + m_Dns = _T(""); + m_EchoSuppress = FALSE; + m_EcTail = _T(""); + m_TCP = FALSE; + m_VAD = FALSE; + m_AutoAnswer = FALSE; + //}}AFX_DATA_INIT + + m_Domain = m_Cfg.m_Domain; + m_ICE = m_Cfg.m_UseIce; + m_Passwd = m_Cfg.m_Password; + m_PUBLISH = m_Cfg.m_UsePublish; + m_SRTP = m_Cfg.m_UseSrtp; + m_STUN = m_Cfg.m_UseStun; + m_StunSrv = m_Cfg.m_StunSrv; + m_User = m_Cfg.m_User; + m_Dns = m_Cfg.m_DNS; + m_EchoSuppress = m_Cfg.m_EchoSuppress; + m_TCP = m_Cfg.m_TCP; + m_VAD = m_Cfg.m_VAD; + m_AutoAnswer= m_Cfg.m_AutoAnswer; + + CString s; + s.Format(_T("%d"), m_Cfg.m_EcTail); + m_EcTail = s; } -void CSettingsDlg::DoDataExchange (CDataExchange* pDX) +void CSettingsDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange (pDX); - //{{AFX_DATA_MAP(CSettingsDlg) - DDX_Control (pDX, IDC_CODECS, m_Codecs); - DDX_Text (pDX, IDC_DOMAIN, m_Domain); - DDX_Check (pDX, IDC_ICE, m_ICE); - DDX_Text (pDX, IDC_PASSWD, m_Passwd); - DDX_Check (pDX, IDC_PUBLISH, m_PUBLISH); - DDX_Check (pDX, IDC_SRTP, m_SRTP); - DDX_Check (pDX, IDC_STUN, m_STUN); - DDX_Text (pDX, IDC_STUN_SRV, m_StunSrv); - DDX_Text (pDX, IDC_USER, m_User); - DDX_Text (pDX, IDC_DNS, m_Dns); - DDX_Check (pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress); - DDX_Text (pDX, IDC_EC_TAIL, m_EcTail); - DDX_Check (pDX, IDC_TCP, m_TCP); - DDX_Check (pDX, IDC_VAD, m_VAD); - DDX_Check (pDX, IDC_AA, m_AutoAnswer); - //}}AFX_DATA_MAP - - - if (m_Codecs.GetCount() == 0) { - int i; - - for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) { - m_Codecs.AddString (m_Cfg.m_Codecs.GetAt (i)); - } - - m_Codecs.SetCurSel (0); - } + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSettingsDlg) + DDX_Control(pDX, IDC_CODECS, m_Codecs); + DDX_Text(pDX, IDC_DOMAIN, m_Domain); + DDX_Check(pDX, IDC_ICE, m_ICE); + DDX_Text(pDX, IDC_PASSWD, m_Passwd); + DDX_Check(pDX, IDC_PUBLISH, m_PUBLISH); + DDX_Check(pDX, IDC_SRTP, m_SRTP); + DDX_Check(pDX, IDC_STUN, m_STUN); + DDX_Text(pDX, IDC_STUN_SRV, m_StunSrv); + DDX_Text(pDX, IDC_USER, m_User); + DDX_Text(pDX, IDC_DNS, m_Dns); + DDX_Check(pDX, IDC_ECHO_SUPPRESS, m_EchoSuppress); + DDX_Text(pDX, IDC_EC_TAIL, m_EcTail); + DDX_Check(pDX, IDC_TCP, m_TCP); + DDX_Check(pDX, IDC_VAD, m_VAD); + DDX_Check(pDX, IDC_AA, m_AutoAnswer); + //}}AFX_DATA_MAP + + + if (m_Codecs.GetCount() == 0) { + int i; + for (i=0; i<m_Cfg.m_Codecs.GetSize(); ++i) { + m_Codecs.AddString(m_Cfg.m_Codecs.GetAt(i)); + } + m_Codecs.SetCurSel(0); + } } -BEGIN_MESSAGE_MAP (CSettingsDlg, CDialog) - //{{AFX_MSG_MAP(CSettingsDlg) - ON_BN_CLICKED (IDC_STUN, OnStun) - ON_BN_CLICKED (IDC_ECHO_SUPPRESS, OnEchoSuppress) - ON_CBN_SELCHANGE (IDC_CODECS, OnSelchangeCodecs) - //}}AFX_MSG_MAP +BEGIN_MESSAGE_MAP(CSettingsDlg, CDialog) + //{{AFX_MSG_MAP(CSettingsDlg) + ON_BN_CLICKED(IDC_STUN, OnStun) + ON_BN_CLICKED(IDC_ECHO_SUPPRESS, OnEchoSuppress) + ON_CBN_SELCHANGE(IDC_CODECS, OnSelchangeCodecs) + //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSettingsDlg message handlers -int CSettingsDlg::DoModal() +int CSettingsDlg::DoModal() { - int rc = CDialog::DoModal(); + int rc = CDialog::DoModal(); return rc; } -void CSettingsDlg::OnStun() +void CSettingsDlg::OnStun() { } -void CSettingsDlg::OnEchoSuppress() +void CSettingsDlg::OnEchoSuppress() { } -void CSettingsDlg::OnSelchangeCodecs() +void CSettingsDlg::OnSelchangeCodecs() { int cur = m_Codecs.GetCurSel(); - if (cur < 1) - return; + return; CString codec; - DWORD N; - m_Codecs.GetLBText (cur, codec); - + m_Codecs.GetLBText(cur, codec); N = m_Codecs.GetCount(); - - m_Codecs.DeleteString (cur); - + m_Codecs.DeleteString(cur); N = m_Codecs.GetCount(); - - m_Codecs.InsertString (0, codec); - + m_Codecs.InsertString(0, codec); N = m_Codecs.GetCount(); - - m_Codecs.SetCurSel (0); + m_Codecs.SetCurSel(0); } -void CSettingsDlg::OnOK() +void CSettingsDlg::OnOK() { - UpdateData (TRUE); + UpdateData(TRUE); m_Cfg.m_Domain = m_Domain; m_Cfg.m_UseIce = m_ICE != 0; @@ -399,7 +358,7 @@ void CSettingsDlg::OnOK() m_Cfg.m_User = m_User; m_Cfg.m_DNS = m_Dns; m_Cfg.m_EchoSuppress= m_EchoSuppress != 0; - m_Cfg.m_EcTail = _ttoi (m_EcTail); + m_Cfg.m_EcTail = _ttoi(m_EcTail); m_Cfg.m_TCP = m_TCP != 0; m_Cfg.m_VAD = m_VAD != 0; m_Cfg.m_AutoAnswer = m_AutoAnswer != 0; @@ -407,11 +366,10 @@ void CSettingsDlg::OnOK() unsigned i; m_Cfg.m_Codecs.RemoveAll(); DWORD N = m_Codecs.GetCount(); - for (i=0; i<N; ++i) { - CString codec; - m_Codecs.GetLBText (i, codec); - m_Cfg.m_Codecs.Add (codec); + CString codec; + m_Codecs.GetLBText(i, codec); + m_Cfg.m_Codecs.Add(codec); } CDialog::OnOK(); diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c index 0eb7e8009c7538afd587d4bd6e08e8ffc945ed71..3b5c580a2a971bfc486dec7120f790597b1cbd46 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.c @@ -1,4 +1,4 @@ -/* $Id: _pjsua.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: _pjsua.c 3010 2009-11-10 10:57:29Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -630,6 +630,33 @@ static void cb_on_typing(pjsua_call_id call_id, const pj_str_t *from, } +/* + * on_mwi_info + */ +static void cb_on_mwi_info(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info) +{ + if (PyCallable_Check(g_obj_callback->on_mwi_info)) { + PyObject *param_acc_id, *param_body; + pj_str_t body; + + ENTER_PYTHON(); + + body.ptr = mwi_info->rdata->msg_info.msg->body->data; + body.slen = mwi_info->rdata->msg_info.msg->body->len; + + PyObject_CallFunctionObjArgs( + g_obj_callback->on_mwi_info, + param_acc_id = Py_BuildValue("i",acc_id), + param_body = PyString_FromPJ(&body), + NULL + ); + + Py_DECREF(param_acc_id); + Py_DECREF(param_body); + + LEAVE_PYTHON(); + } +} /* * translate_hdr @@ -901,6 +928,7 @@ static PyObject *py_pjsua_init(PyObject *pSelf, PyObject *pArgs) cfg_ua.cb.on_pager2 = &cb_on_pager; cfg_ua.cb.on_pager_status2 = &cb_on_pager_status; cfg_ua.cb.on_typing2 = &cb_on_typing; + cfg_ua.cb.on_mwi_info = &cb_on_mwi_info; p_cfg_ua = &cfg_ua; @@ -2033,6 +2061,10 @@ static PyObject *py_pjsua_buddy_set_user_data(PyObject *pSelf, PyObject *pArgs) return NULL; } + if (!pjsua_buddy_is_valid(buddy_id)) { + return Py_BuildValue("i", 0); + } + old_user_data = (PyObject*) pjsua_buddy_get_user_data(buddy_id); status = pjsua_buddy_set_user_data(buddy_id, (void*)user_data); @@ -3875,6 +3907,7 @@ static PyObject *py_pj_parse_simple_sip(PyObject *pSelf, PyObject *pArgs) item = PyString_FromPJ(&sip_uri->transport_param); PyTuple_SetItem(ret, 4, item); + pj_pool_release(pool); return ret; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h index 06fc700ef98f73f5ff658644b99f6c623d65f63c..8f89464f4d61dcd2d85223eed08a49eca0d854b4 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/python/_pjsua.h @@ -1,4 +1,4 @@ -/* $Id: _pjsua.h 2859 2009-08-11 16:26:20Z nanang $ */ +/* $Id: _pjsua.h 3007 2009-11-10 10:06:58Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -235,6 +235,7 @@ typedef struct PyObj_pjsua_callback PyObject * on_pager; PyObject * on_pager_status; PyObject * on_typing; + PyObject * on_mwi_info; } PyObj_pjsua_callback; @@ -258,6 +259,7 @@ static void PyObj_pjsua_callback_delete(PyObj_pjsua_callback* self) Py_XDECREF(self->on_pager); Py_XDECREF(self->on_pager_status); Py_XDECREF(self->on_typing); + Py_XDECREF(self->on_mwi_info); self->ob_type->tp_free((PyObject*)self); } @@ -291,6 +293,7 @@ static PyObject * PyObj_pjsua_callback_new(PyTypeObject *type, self->on_pager = Py_BuildValue(""); self->on_pager_status = Py_BuildValue(""); self->on_typing = Py_BuildValue(""); + self->on_mwi_info = Py_BuildValue(""); } return (PyObject *)self; @@ -394,6 +397,11 @@ static PyMemberDef PyObj_pjsua_callback_members[] = offsetof(PyObj_pjsua_callback, on_typing), 0, "Notify application about typing indication." }, + { + "on_mwi_info", T_OBJECT_EX, + offsetof(PyObj_pjsua_callback, on_mwi_info), 0, + "Notify application about MWI indication." + }, {NULL} /* Sentinel */ }; @@ -1337,6 +1345,7 @@ static void PyObj_pjsua_transport_config_delete(PyObj_pjsua_transport_config* se static void PyObj_pjsua_transport_config_export(pjsua_transport_config *cfg, PyObj_pjsua_transport_config *obj) { + pjsua_transport_config_default(cfg); cfg->public_addr = PyString_ToPJ(obj->public_addr); cfg->bound_addr = PyString_ToPJ(obj->bound_addr); cfg->port = obj->port; @@ -1645,6 +1654,7 @@ typedef struct PyObject *id; PyObject *reg_uri; int publish_enabled; + int mwi_enabled; PyObject *force_contact; PyListObject *proxy; unsigned reg_timeout; @@ -1698,6 +1708,7 @@ static void PyObj_pjsua_acc_config_import(PyObj_pjsua_acc_config *obj, Py_XDECREF(obj->reg_uri); obj->reg_uri = PyString_FromPJ(&cfg->reg_uri); obj->publish_enabled = cfg->publish_enabled; + obj->mwi_enabled = cfg->mwi_enabled; Py_XDECREF(obj->force_contact); obj->force_contact = PyString_FromPJ(&cfg->force_contact); Py_XDECREF(obj->proxy); @@ -1753,6 +1764,7 @@ static void PyObj_pjsua_acc_config_export(pjsua_acc_config *cfg, cfg->id = PyString_ToPJ(obj->id); cfg->reg_uri = PyString_ToPJ(obj->reg_uri); cfg->publish_enabled = obj->publish_enabled; + cfg->mwi_enabled = obj->mwi_enabled; cfg->force_contact = PyString_ToPJ(obj->force_contact); cfg->proxy_cnt = PyList_Size((PyObject*)obj->proxy); @@ -1857,6 +1869,11 @@ static PyMemberDef PyObj_pjsua_acc_config_members[] = offsetof(PyObj_pjsua_acc_config, publish_enabled), 0, "Publish presence? " }, + { + "mwi_enabled", T_INT, + offsetof(PyObj_pjsua_acc_config, mwi_enabled), 0, + "Enable MWI subscription " + }, { "force_contact", T_OBJECT_EX, offsetof(PyObj_pjsua_acc_config, force_contact), 0, diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py b/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py index f653fc06e3112aa73913d39870a1705088ad1d7e..183ce0e70bfee11715dd34314de02f9195d91e42 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/python/pjsua.py @@ -1,4 +1,4 @@ -# $Id: pjsua.py 2375 2008-12-11 11:18:33Z bennylp $ +# $Id: pjsua.py 2976 2009-10-29 08:16:46Z bennylp $ # # Object oriented PJSUA wrapper. # @@ -993,6 +993,19 @@ class AccountCallback: """ pass + def on_mwi_info(self, body): + """ + Notification about change in Message Summary / Message Waiting + Indication (RFC 3842) status. MWI subscription must be enabled + in the account config to receive this notification. + + Keyword arguments: + body -- String containing message body as received in the + NOTIFY request. + + """ + pass + class Account: @@ -1222,6 +1235,28 @@ class Account: lck = self._lib().auto_lock() _pjsua.acc_pres_notify(self._id, pres_obj, state, reason, Lib._create_msg_data(hdr_list)) + + def send_pager(self, uri, text, im_id=0, content_type="text/plain", \ + hdr_list=None): + """Send instant message to arbitrary URI. + + Keyword arguments: + text -- Instant message to be sent + uri -- URI to send the Instant Message to. + im_id -- Optional instant message ID to identify this + instant message when delivery status callback + is called. + content_type -- MIME type identifying the instant message + hdr_list -- Optional list of headers to be sent with the + request. + + """ + lck = self._lib().auto_lock() + err = _pjsua.im_send(self._id, uri, \ + content_type, text, \ + Lib._create_msg_data(hdr_list), \ + im_id) + self._lib()._err_check("send_pager()", self, err) class CallCallback: """Class to receive event notification from Call objects. @@ -1658,7 +1693,7 @@ class Call: """ lck = self._lib().auto_lock() - if hdr_list and body: + if hdr_list or body: msg_data = _pjsua.Msg_Data() if hdr_list: msg_data.hdr_list = hdr_list @@ -2091,6 +2126,7 @@ class Lib: py_ua_cfg.cb.on_pager = _cb_on_pager py_ua_cfg.cb.on_pager_status = _cb_on_pager_status py_ua_cfg.cb.on_typing = _cb_on_typing + py_ua_cfg.cb.on_mwi_info = _cb_on_mwi_info; err = _pjsua.init(py_ua_cfg, log_cfg._cvt_to_pjsua(), media_cfg._cvt_to_pjsua()) @@ -2741,6 +2777,11 @@ class Lib: else: acc._cb.on_typing(from_uri, contact, is_typing) + def _cb_on_mwi_info(self, acc_id, body): + acc = self._lookup_account(acc_id) + if acc: + return acc._cb.on_mwi_info(body) + def _cb_on_buddy_state(self, buddy_id): buddy = self._lookup_buddy(buddy_id) if buddy: @@ -2794,6 +2835,8 @@ def _cb_on_pager_status(call_id, to, body, user_data, status, reason, acc_id): def _cb_on_typing(call_id, from_uri, to, contact, is_typing, acc_id): _lib._cb_on_typing(call_id, from_uri, to, contact, is_typing, acc_id) +def _cb_on_mwi_info(acc_id, body): + _lib._cb_on_mwi_info(acc_id, body) # Worker thread def _worker_thread_main(arg): diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c index e9ae2fa0e2cc776b5707d897041757645fdce124..895991fcbc2f476b87bb2ed9380e369d241cf3ed 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/debug.c @@ -1,4 +1,4 @@ -/* $Id: debug.c 2846 2009-07-29 12:28:31Z bennylp $ */ +/* $Id: debug.c 3028 2009-12-08 13:11:25Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -28,5 +28,5 @@ * E.g.: * #include "playfile.c" */ -#include "jbsim.c" +#include "icedemo.c" diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c index 44f0ed824fcd0517d654e7ea787ffbee9a9d0373..027a0536f76dd00f66e3e3c9291c81ce71f47d84 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/icedemo.c @@ -1,4 +1,4 @@ -/* $Id: icedemo.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: icedemo.c 3043 2010-01-04 14:20:22Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -47,6 +47,7 @@ static struct app_t pj_str_t turn_username; pj_str_t turn_password; pj_bool_t turn_fingerprint; + const char *log_file; } opt; /* Our global variables */ @@ -56,6 +57,7 @@ static struct app_t pj_bool_t thread_quit_flag; pj_ice_strans_cfg ice_cfg; pj_ice_strans *icest; + FILE *log_fhnd; /* Variables to store parsed remote ICE info */ struct rem_info @@ -109,6 +111,12 @@ static void err_exit(const char *title, pj_status_t status) pj_caching_pool_destroy(&icedemo.cp); pj_shutdown(); + + if (icedemo.log_fhnd) { + fclose(icedemo.log_fhnd); + icedemo.log_fhnd = NULL; + } + exit(status != PJ_SUCCESS); } @@ -216,11 +224,13 @@ static void cb_on_rx_data(pj_ice_strans *ice_st, PJ_UNUSED_ARG(src_addr_len); PJ_UNUSED_ARG(pkt); - ((char*)pkt)[size] = '\0'; + // Don't do this! It will ruin the packet buffer in case TCP is used! + //((char*)pkt)[size] = '\0'; - PJ_LOG(3,(THIS_FILE, "Component %d: received %d bytes data from %s: \"%s\"", + PJ_LOG(3,(THIS_FILE, "Component %d: received %d bytes data from %s: \"%.*s\"", comp_id, size, pj_sockaddr_print(src_addr, ipstr, sizeof(ipstr), 3), + (unsigned)size, (char*)pkt)); } @@ -236,8 +246,6 @@ static void cb_on_ice_complete(pj_ice_strans *ice_st, (op==PJ_ICE_STRANS_OP_INIT? "initialization" : (op==PJ_ICE_STRANS_OP_NEGOTIATION ? "negotiation" : "unknown_op")); - PJ_UNUSED_ARG(ice_st); - if (status == PJ_SUCCESS) { PJ_LOG(3,(THIS_FILE, "ICE %s successful", opname)); } else { @@ -245,9 +253,20 @@ static void cb_on_ice_complete(pj_ice_strans *ice_st, pj_strerror(status, errmsg, sizeof(errmsg)); PJ_LOG(1,(THIS_FILE, "ICE %s failed: %s", opname, errmsg)); + pj_ice_strans_destroy(ice_st); + icedemo.icest = NULL; } } +/* log callback to write to file */ +static void log_func(int level, const char *data, int len) +{ + pj_log_write(level, data, len); + if (icedemo.log_fhnd) { + if (fwrite(data, len, 1, icedemo.log_fhnd) != 1) + return; + } +} /* * This is the main application initialization function. It is called @@ -258,6 +277,11 @@ static pj_status_t icedemo_init(void) { pj_status_t status; + if (icedemo.opt.log_file) { + icedemo.log_fhnd = fopen(icedemo.opt.log_file, "a"); + pj_log_set_log_func(&log_func); + } + /* Initialize the libraries before anything else */ CHECK( pj_init() ); CHECK( pjlib_util_init() ); @@ -1147,6 +1171,7 @@ static void icedemo_usage() puts(" resolution"); puts(" --max-host, -H N Set max number of host candidates to N"); puts(" --regular, -R Use regular nomination (default aggressive)"); + puts(" --log-file, -L FILE Save output to log FILE"); puts(" --help, -h Display this screen."); puts(""); puts("STUN related options:"); @@ -1182,7 +1207,8 @@ int main(int argc, char *argv[]) { "turn-username", 1, 0, 'u'}, { "turn-password", 1, 0, 'p'}, { "turn-fingerprint", 0, 0, 'F'}, - { "regular", 0, 0, 'R'} + { "regular", 0, 0, 'R'}, + { "log-file", 1, 0, 'L'}, }; int c, opt_id; pj_status_t status; @@ -1190,7 +1216,7 @@ int main(int argc, char *argv[]) icedemo.opt.comp_cnt = 1; icedemo.opt.max_host = -1; - while((c=pj_getopt_long(argc,argv, "c:n:s:t:u:p:H:hTFR", long_options, &opt_id))!=-1) { + while((c=pj_getopt_long(argc,argv, "c:n:s:t:u:p:H:L:hTFR", long_options, &opt_id))!=-1) { switch (c) { case 'c': icedemo.opt.comp_cnt = atoi(pj_optarg); @@ -1229,6 +1255,9 @@ int main(int argc, char *argv[]) case 'R': icedemo.opt.regular = PJ_TRUE; break; + case 'L': + icedemo.opt.log_file = pj_optarg; + break; default: printf("Argument \"%s\" is not valid. Use -h to see help", argv[pj_optind]); diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c index 5ff871aa61dfe280cbe19b9061d414d30df0aa79..6815730d3436e6743e506d0a7fb69bf65f6f6513 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/samples/jbsim.c @@ -1,4 +1,4 @@ -/* $Id: jbsim.c 2854 2009-08-05 17:10:35Z bennylp $ */ +/* $Id: jbsim.c 2938 2009-10-11 05:06:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * @@ -310,7 +310,7 @@ static pj_status_t stream_init(const struct stream_cfg *cfg, struct stream **p_s struct stream *stream = NULL; pjmedia_codec_mgr *cm; unsigned count; - pjmedia_codec_info *ci; + const pjmedia_codec_info *ci; pjmedia_stream_info si; pj_status_t status; diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp index 75b85cab1c8c21cd04811f88fc44932da5c344f5..b1b884286cac3137827bd10a5cd42839b9d89007 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/main_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: main_symbian.cpp 2673 2009-05-05 10:46:51Z nanang $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ua.h" @@ -30,7 +30,7 @@ CConsoleBase* console; // Needed by APS //TPtrC APP_UID = _L("200235D3"); -TPtrC APP_UID = _L ("A000000D"); +TPtrC APP_UID = _L("A000000D"); //////////////////////////////////////////////////////////////////////////// @@ -38,13 +38,13 @@ TPtrC APP_UID = _L ("A000000D"); LOCAL_C void DoStartL() { CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL (scheduler); - CActiveScheduler::Install (scheduler); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); ua_main(); - - CActiveScheduler::Install (NULL); - CleanupStack::Pop (scheduler); + + CActiveScheduler::Install(NULL); + CleanupStack::Pop(scheduler); delete scheduler; } @@ -61,26 +61,22 @@ GLDEF_C TInt E32Main() CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); - + TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); if (createError) return createError; - TRAPD (startError, DoStartL()); - - console->Printf (_L ("[press any key to close]\n")); + TRAPD(startError, DoStartL()); + console->Printf(_L("[press any key to close]\n")); console->Getch(); - + delete console; - delete cleanup; - CloseSTDLIB(); + CloseSTDLIB(); // Mark end of heap usage, detect memory leaks __UHEAP_MARKEND; - return KErrNone; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp index 3b2182bc11d686be8d2b9a7525ce1de0adef5a34..7b5de03db3e38722f38500a92fd2a322304a5c7e 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua/ua.cpp @@ -1,5 +1,5 @@ -/* $Id: ua.cpp 2781 2009-06-22 14:06:40Z nanang $ */ -/* +/* $Id: ua.cpp 2999 2009-11-09 09:52:23Z bennylp $ */ +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjsua-lib/pjsua.h> #include <pjsua-lib/pjsua_internal.h> @@ -35,7 +35,7 @@ // // Destination URI (to make call, or to subscribe presence) // -#define SIP_DST_URI "sip:100@pjsip.lab" +#define SIP_DST_URI "<sip:100@pjsip.lab>" // // Account @@ -52,9 +52,14 @@ //#define SIP_PROXY "<sip:192.168.0.8;lr>" // -// Set to 1 if TCP is desired (experimental) +// SIP transports // -#define ENABLE_SIP_TCP 0 +#define ENABLE_SIP_UDP 1 +#define ENABLE_SIP_TCP 0 // experimental +#define ENABLE_SIP_TLS 0 // experimental + +#define TLS_SRV_NAME "pjsip.org" // TLS servername (required for + // TLS transport) // // Configure nameserver if DNS SRV is to be used with both SIP @@ -66,15 +71,15 @@ // // STUN server #if 0 -// Use this to have the STUN server resolved normally + // Use this to have the STUN server resolved normally # define STUN_DOMAIN NULL # define STUN_SERVER "stun.pjsip.org" #elif 0 -// Use this to have the STUN server resolved with DNS SRV + // Use this to have the STUN server resolved with DNS SRV # define STUN_DOMAIN "pjsip.org" # define STUN_SERVER NULL #else -// Use this to disable STUN + // Use this to disable STUN # define STUN_DOMAIN NULL # define STUN_SERVER NULL #endif @@ -89,6 +94,16 @@ // #define USE_SRTP PJSUA_DEFAULT_USE_SRTP +// +// Set QoS on transports? Yes! +// As an example, we set SIP transports DSCP value to CS3 (DSCP +// value 24 or 0x18), for no reason, and tag RTP/RTCP packets +// with VOICE type. +// +#define SIP_QOS_DSCP 0x18 +#define RTP_QOS_TYPE PJ_QOS_TYPE_VOICE + + // // Globals // @@ -98,180 +113,179 @@ static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; /* Callback called by the library upon receiving incoming call */ -static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { pjsua_call_info ci; - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(rdata); if (g_call_id != PJSUA_INVALID_ID) { - pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); - return; + pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); + return; } + + pjsua_call_get_info(call_id, &ci); - pjsua_call_get_info (call_id, &ci); - - PJ_LOG (3, (THIS_FILE, "Incoming call from %.*s!!", - (int) ci.remote_info.slen, - ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", + (int)ci.remote_info.slen, + ci.remote_info.ptr)); g_call_id = call_id; - + /* Automatically answer incoming calls with 180/Ringing */ - pjsua_call_answer (call_id, 180, NULL, NULL); + pjsua_call_answer(call_id, 180, NULL, NULL); } /* Callback called by the library when call's state has changed */ -static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +static void on_call_state(pjsua_call_id call_id, pjsip_event *e) { pjsua_call_info ci; - PJ_UNUSED_ARG (e); - - pjsua_call_get_info (call_id, &ci); + PJ_UNUSED_ARG(e); + pjsua_call_get_info(call_id, &ci); + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { - if (call_id == g_call_id) - g_call_id = PJSUA_INVALID_ID; + if (call_id == g_call_id) + g_call_id = PJSUA_INVALID_ID; } else if (ci.state != PJSIP_INV_STATE_INCOMING) { - if (g_call_id == PJSUA_INVALID_ID) - g_call_id = call_id; + if (g_call_id == PJSUA_INVALID_ID) + g_call_id = call_id; } - - PJ_LOG (3, (THIS_FILE, "Call %d state=%.*s", call_id, - - (int) ci.state_text.slen, - ci.state_text.ptr)); + + PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id, + (int)ci.state_text.slen, + ci.state_text.ptr)); } /* Callback called by the library when call's media state has changed */ -static void on_call_media_state (pjsua_call_id call_id) +static void on_call_media_state(pjsua_call_id call_id) { pjsua_call_info ci; - pjsua_call_get_info (call_id, &ci); + pjsua_call_get_info(call_id, &ci); if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - // When media is active, connect call to sound device. - pjsua_conf_connect (ci.conf_slot, 0); - pjsua_conf_connect (0, ci.conf_slot); + // When media is active, connect call to sound device. + pjsua_conf_connect(ci.conf_slot, 0); + pjsua_conf_connect(0, ci.conf_slot); } } /* Handler on buddy state changed. */ -static void on_buddy_state (pjsua_buddy_id buddy_id) +static void on_buddy_state(pjsua_buddy_id buddy_id) { pjsua_buddy_info info; - pjsua_buddy_get_info (buddy_id, &info); + pjsua_buddy_get_info(buddy_id, &info); - PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s", - (int) info.uri.slen, - info.uri.ptr, - (int) info.status_text.slen, - info.status_text.ptr)); + PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", + (int)info.uri.slen, + info.uri.ptr, + (int)info.status_text.slen, + info.status_text.ptr)); } /* Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +static void on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { /* Note: call index may be -1 */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - - PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s", - (int) from->slen, from->ptr, - (int) text->slen, text->ptr)); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + + PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s", + (int)from->slen, from->ptr, + (int)text->slen, text->ptr)); } /* Received typing indication */ -static void on_typing (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) +static void on_typing(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) { - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); - PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s", - (int) from->slen, from->ptr, - (is_typing?"is typing..":"has stopped typing"))); + PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s", + (int)from->slen, from->ptr, + (is_typing?"is typing..":"has stopped typing"))); } /* Call transfer request status. */ -static void on_call_transfer_status (pjsua_call_id call_id, - int status_code, - const pj_str_t *status_text, - pj_bool_t final, - pj_bool_t *p_cont) +static void on_call_transfer_status(pjsua_call_id call_id, + int status_code, + const pj_str_t *status_text, + pj_bool_t final, + pj_bool_t *p_cont) { - PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", - call_id, status_code, - (int) status_text->slen, status_text->ptr, - (final ? "[final]" : ""))); + PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", + call_id, status_code, + (int)status_text->slen, status_text->ptr, + (final ? "[final]" : ""))); if (status_code/100 == 2) { - PJ_LOG (3, (THIS_FILE, - "Call %d: call transfered successfully, disconnecting call", - call_id)); - pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL); - *p_cont = PJ_FALSE; + PJ_LOG(3,(THIS_FILE, + "Call %d: call transfered successfully, disconnecting call", + call_id)); + pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); + *p_cont = PJ_FALSE; } } /* NAT detection result */ -static void on_nat_detect (const pj_stun_nat_detect_result *res) +static void on_nat_detect(const pj_stun_nat_detect_result *res) { if (res->status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "NAT detection failed", res->status); + pjsua_perror(THIS_FILE, "NAT detection failed", res->status); } else { - PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); - } + PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); + } } /* Notification that call is being replaced. */ -static void on_call_replaced (pjsua_call_id old_call_id, - pjsua_call_id new_call_id) +static void on_call_replaced(pjsua_call_id old_call_id, + pjsua_call_id new_call_id) { pjsua_call_info old_ci, new_ci; - pjsua_call_get_info (old_call_id, &old_ci); - pjsua_call_get_info (new_call_id, &new_ci); + pjsua_call_get_info(old_call_id, &old_ci); + pjsua_call_get_info(new_call_id, &new_ci); - PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by " - "call %d with %.*s", - old_call_id, - (int) old_ci.remote_info.slen, old_ci.remote_info.ptr, - new_call_id, - (int) new_ci.remote_info.slen, new_ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by " + "call %d with %.*s", + old_call_id, + (int)old_ci.remote_info.slen, old_ci.remote_info.ptr, + new_call_id, + (int)new_ci.remote_info.slen, new_ci.remote_info.ptr)); } //#include<e32debug.h> /* Logging callback */ -static void log_writer (int level, const char *buf, int len) +static void log_writer(int level, const char *buf, int len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG(level); + + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); - - TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); + TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); //RDebug::Print(aBuf); - console->Write (aBuf); - + console->Write(aBuf); + } /* @@ -284,79 +298,63 @@ static pj_status_t app_startup() pj_status_t status; /* Redirect log before pjsua_init() */ - pj_log_set_log_func (&log_writer); - + pj_log_set_log_func(&log_writer); + /* Set log level */ - pj_log_set_level (CON_LOG_LEVEL); + pj_log_set_level(CON_LOG_LEVEL); /* Create pjsua first! */ status = pjsua_create(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_create() error", status); - return status; + pjsua_perror(THIS_FILE, "pjsua_create() error", status); + return status; } /* Init pjsua */ pjsua_config cfg; - pjsua_logging_config log_cfg; - pjsua_media_config med_cfg; - pjsua_config_default (&cfg); - + pjsua_config_default(&cfg); cfg.max_calls = 2; - cfg.thread_cnt = 0; // Disable threading on Symbian - cfg.use_srtp = USE_SRTP; - cfg.srtp_secure_signaling = 0; - + cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_call_transfer_status = &on_call_transfer_status; - cfg.cb.on_call_replaced = &on_call_replaced; - cfg.cb.on_nat_detect = &on_nat_detect; - + if (SIP_PROXY) { - cfg.outbound_proxy_cnt = 1; - cfg.outbound_proxy[0] = pj_str (SIP_PROXY); + cfg.outbound_proxy_cnt = 1; + cfg.outbound_proxy[0] = pj_str(SIP_PROXY); } - + if (NAMESERVER) { - cfg.nameserver_count = 1; - cfg.nameserver[0] = pj_str (NAMESERVER); + cfg.nameserver_count = 1; + cfg.nameserver[0] = pj_str(NAMESERVER); } - + if (NAMESERVER && STUN_DOMAIN) { - cfg.stun_domain = pj_str (STUN_DOMAIN); + cfg.stun_domain = pj_str(STUN_DOMAIN); } else if (STUN_SERVER) { - cfg.stun_host = pj_str (STUN_SERVER); + cfg.stun_host = pj_str(STUN_SERVER); } - - - pjsua_logging_config_default (&log_cfg); - + + + pjsua_logging_config_default(&log_cfg); log_cfg.level = FILE_LOG_LEVEL; log_cfg.console_level = CON_LOG_LEVEL; log_cfg.cb = &log_writer; - log_cfg.log_filename = pj_str ("C:\\data\\symbian_ua.log"); + log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log"); - pjsua_media_config_default (&med_cfg); + pjsua_media_config_default(&med_cfg); med_cfg.thread_cnt = 0; // Disable threading on Symbian med_cfg.has_ioqueue = PJ_FALSE; med_cfg.clock_rate = 8000; @@ -365,112 +363,140 @@ static pj_status_t app_startup() med_cfg.enable_ice = USE_ICE; med_cfg.snd_auto_close_time = 0; // wait for 0 seconds idle before sound dev get auto-closed //med_cfg.no_vad = PJ_TRUE; - - status = pjsua_init (&cfg, &log_cfg, &med_cfg); - + + status = pjsua_init(&cfg, &log_cfg, &med_cfg); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_init() error", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "pjsua_init() error", status); + pjsua_destroy(); + return status; } - + /* Adjust Speex priority and enable only the narrowband */ { - pj_str_t codec_id = pj_str ("speex/8000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); - - codec_id = pj_str ("speex/16000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - - codec_id = pj_str ("speex/32000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + pj_str_t codec_id = pj_str("speex/8000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); + + codec_id = pj_str("speex/16000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + + codec_id = pj_str("speex/32000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); } - /* Add UDP transport. */ + pjsua_transport_config tcfg; - pjsua_transport_id tid; - pjsua_transport_config_default (&tcfg); - +#if ENABLE_SIP_UDP + /* Add UDP transport. */ + pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; - - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid); - + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + } + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error creating UDP transport", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error creating UDP transport", status); + pjsua_destroy(); + return status; } - - /* Add TCP transport */ +#endif + #if ENABLE_SIP_TCP - pjsua_transport_config_default (&tcfg); - + /* Add TCP transport */ + pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; - - status = pjsua_transport_create (PJSIP_TRANSPORT_TCP, &tcfg, &tid); - + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + } + status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &tcfg, &tid); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error creating TCP transport", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error creating TCP transport", status); + pjsua_destroy(); + return status; } - #endif - + +#if ENABLE_SIP_TLS + /* Add TLS transport */ + pjsua_transport_config_default(&tcfg); + tcfg.port = SIP_PORT + 1; + if (SIP_QOS_DSCP) { + tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; + tcfg.qos_params.dscp_val = SIP_QOS_DSCP; + tcfg.tls_setting.qos_params = tcfg.qos_params; + } + tcfg.tls_setting.server_name = pj_str(TLS_SRV_NAME); + status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, &tcfg, &tid); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating TLS transport", status); + pjsua_destroy(); + return status; + } +#endif + /* Add account for the transport */ - pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id); - - + pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); + + /* Create media transports */ + pjsua_transport_config mtcfg; + pjsua_transport_config_default(&mtcfg); + mtcfg.port = 4000; + mtcfg.qos_type = RTP_QOS_TYPE; + status = pjsua_media_transports_create(&mtcfg); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating media transports", status); + pjsua_destroy(); + return status; + } + /* Initialization is done, now start pjsua */ status = pjsua_start(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error starting pjsua", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error starting pjsua", status); + pjsua_destroy(); + return status; } /* Register to SIP server by creating SIP account. */ if (HAS_SIP_ACCOUNT) { - pjsua_acc_config cfg; - - pjsua_acc_config_default (&cfg); - cfg.id = pj_str ("sip:" SIP_USER "@" SIP_DOMAIN); - cfg.reg_uri = pj_str ("sip:" SIP_DOMAIN); - cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str ("*"); - cfg.cred_info[0].scheme = pj_str ("digest"); - cfg.cred_info[0].username = pj_str (SIP_USER); - cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str (SIP_PASSWD); - - status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error adding account", status); - pjsua_destroy(); - return status; - } + pjsua_acc_config cfg; + + pjsua_acc_config_default(&cfg); + cfg.id = pj_str("sip:" SIP_USER "@" SIP_DOMAIN); + cfg.reg_uri = pj_str("sip:" SIP_DOMAIN); + cfg.cred_count = 1; + cfg.cred_info[0].realm = pj_str("*"); + cfg.cred_info[0].scheme = pj_str("digest"); + cfg.cred_info[0].username = pj_str(SIP_USER); + cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; + cfg.cred_info[0].data = pj_str(SIP_PASSWD); + + status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error adding account", status); + pjsua_destroy(); + return status; + } } if (SIP_DST_URI) { - pjsua_buddy_config bcfg; - - pjsua_buddy_config_default (&bcfg); - bcfg.uri = pj_str (SIP_DST_URI); - bcfg.subscribe = PJ_FALSE; - - pjsua_buddy_add (&bcfg, &g_buddy_id); + pjsua_buddy_config bcfg; + + pjsua_buddy_config_default(&bcfg); + bcfg.uri = pj_str(SIP_DST_URI); + bcfg.subscribe = PJ_FALSE; + + pjsua_buddy_add(&bcfg, &g_buddy_id); } - return PJ_SUCCESS; } @@ -481,486 +507,445 @@ static pj_status_t app_startup() */ #include <e32base.h> -class ConsoleUI : public CActive +class ConsoleUI : public CActive { - - public: - ConsoleUI (CConsoleBase *con); - ~ConsoleUI(); - - // Run console UI - void Run(); - - // Stop - void Stop(); - - protected: - // Cancel asynchronous read. - void DoCancel(); - - // Implementation: called when read has completed. - void RunL(); - - private: - CConsoleBase *con_; +public: + ConsoleUI(CConsoleBase *con); + ~ConsoleUI(); + + // Run console UI + void Run(); + + // Stop + void Stop(); + +protected: + // Cancel asynchronous read. + void DoCancel(); + + // Implementation: called when read has completed. + void RunL(); + +private: + CConsoleBase *con_; }; -ConsoleUI::ConsoleUI (CConsoleBase *con) - : CActive (EPriorityStandard), con_ (con) +ConsoleUI::ConsoleUI(CConsoleBase *con) +: CActive(EPriorityStandard), con_(con) { - CActiveScheduler::Add (this); + CActiveScheduler::Add(this); } -ConsoleUI::~ConsoleUI() +ConsoleUI::~ConsoleUI() { Stop(); } // Run console UI -void ConsoleUI::Run() +void ConsoleUI::Run() { - con_->Read (iStatus); + con_->Read(iStatus); SetActive(); } // Stop console UI -void ConsoleUI::Stop() +void ConsoleUI::Stop() { Cancel(); } // Cancel asynchronous read. -void ConsoleUI::DoCancel() +void ConsoleUI::DoCancel() { con_->ReadCancel(); } -static void PrintMainMenu() +static void PrintMainMenu() { const char *menu = - "\n\n" - "Main Menu:\n" - " d Enable/disable codecs\n" - " m Call " SIP_DST_URI "\n" - " a Answer call\n" - " g Hangup all calls\n" - " t Toggle audio route\n" + "\n\n" + "Main Menu:\n" + " d Enable/disable codecs\n" + " m Call " SIP_DST_URI "\n" + " a Answer call\n" + " g Hangup all calls\n" + " t Toggle audio route\n" #if !defined(PJMEDIA_CONF_USE_SWITCH_BOARD) || PJMEDIA_CONF_USE_SWITCH_BOARD==0 - " j Toggle loopback audio\n" + " j Toggle loopback audio\n" #endif - "up/dn Increase/decrease output volume\n" - " s Subscribe " SIP_DST_URI "\n" - " S Unsubscribe presence\n" - " o Set account online\n" - " O Set account offline\n" - " w Quit\n"; - - PJ_LOG (3, (THIS_FILE, menu)); + "up/dn Increase/decrease output volume\n" + " s Subscribe " SIP_DST_URI "\n" + " S Unsubscribe presence\n" + " o Set account online\n" + " O Set account offline\n" + " w Quit\n"; + + PJ_LOG(3, (THIS_FILE, menu)); } -static void PrintCodecMenu() +static void PrintCodecMenu() { - const char *menu = - "\n\n" - "Codec Menu:\n" - " a Enable all codecs\n" + const char *menu = + "\n\n" + "Codec Menu:\n" + " a Enable all codecs\n" #if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR - " d Enable only AMR\n" + " d Enable only AMR\n" #endif #if PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 - " g Enable only G.729\n" + " g Enable only G.729\n" #endif #if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC - " j Enable only iLBC\n" + " j Enable only iLBC\n" #endif - " m Enable only Speex\n" - " p Enable only GSM\n" - " t Enable only PCMU\n" - " w Enable only PCMA\n"; - - PJ_LOG (3, (THIS_FILE, menu)); + " m Enable only Speex\n" + " p Enable only GSM\n" + " t Enable only PCMU\n" + " w Enable only PCMA\n"; + + PJ_LOG(3, (THIS_FILE, menu)); } -static void HandleMainMenu (TKeyCode kc) -{ +static void HandleMainMenu(TKeyCode kc) { switch (kc) { - - case EKeyUpArrow: - - case EKeyDownArrow: { - unsigned vol; - pj_status_t status; - - status = pjsua_snd_get_setting ( - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); - - if (status == PJ_SUCCESS) { - if (kc == EKeyUpArrow) - vol = PJ_MIN (100, vol+10); - else - vol = (vol>=10 ? vol-10 : 0); - - status = pjsua_snd_set_setting ( - PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, - &vol, PJ_TRUE); - } - - if (status == PJ_SUCCESS) { - PJ_LOG (3, (THIS_FILE, "Output volume set to %d", vol)); - } else { - pjsua_perror (THIS_FILE, "Error setting volume", status); - } - } - - break; - - case 't': { - pjmedia_aud_dev_route route; - pj_status_t status; - - status = pjsua_snd_get_setting (PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, - &route); - - if (status == PJ_SUCCESS) { - if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) - route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; - else - route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; - - status = pjsua_snd_set_setting ( - PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, - &route, PJ_TRUE); - } - - if (status != PJ_SUCCESS) - pjsua_perror (THIS_FILE, "Error switch audio route", status); - } - - break; - - case 'j': { - static pj_bool_t loopback_active = PJ_FALSE; - - if (!loopback_active) - pjsua_conf_connect (0, 0); - else - pjsua_conf_disconnect (0, 0); - - loopback_active = !loopback_active; - } - - break; - - case 'm': - - if (g_call_id != PJSUA_INVALID_ID) { - PJ_LOG (3, (THIS_FILE, "Another call is active")); - break; - } - - if (pjsua_verify_sip_url (SIP_DST_URI) == PJ_SUCCESS) { - pj_str_t dst = pj_str (SIP_DST_URI); - pjsua_call_make_call (g_acc_id, &dst, 0, NULL, - NULL, &g_call_id); - } else { - PJ_LOG (3, (THIS_FILE, "Invalid SIP URI")); - } - - break; - - case 'a': - - if (g_call_id != PJSUA_INVALID_ID) - pjsua_call_answer (g_call_id, 200, NULL, NULL); - - break; - - case 'g': - pjsua_call_hangup_all(); - - break; - - case 's': - - case 'S': - if (g_buddy_id != PJSUA_INVALID_ID) - pjsua_buddy_subscribe_pres (g_buddy_id, kc=='s'); - - break; - - case 'o': - - case 'O': - pjsua_acc_set_online_status (g_acc_id, kc=='o'); - - break; - - default: - PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); - - break; + + case EKeyUpArrow: + case EKeyDownArrow: + { + unsigned vol; + pj_status_t status; + + status = pjsua_snd_get_setting( + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); + if (status == PJ_SUCCESS) { + if (kc == EKeyUpArrow) + vol = PJ_MIN(100, vol+10); + else + vol = (vol>=10 ? vol-10 : 0); + status = pjsua_snd_set_setting( + PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, + &vol, PJ_TRUE); + } + + if (status == PJ_SUCCESS) { + PJ_LOG(3,(THIS_FILE, "Output volume set to %d", vol)); + } else { + pjsua_perror(THIS_FILE, "Error setting volume", status); + } + } + break; + + case 't': + { + pjmedia_aud_dev_route route; + pj_status_t status; + + status = pjsua_snd_get_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, + &route); + + if (status == PJ_SUCCESS) { + if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) + route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; + else + route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; + + status = pjsua_snd_set_setting( + PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, + &route, PJ_TRUE); + } + + if (status != PJ_SUCCESS) + pjsua_perror(THIS_FILE, "Error switch audio route", status); + } + break; + + case 'j': + { + static pj_bool_t loopback_active = PJ_FALSE; + if (!loopback_active) + pjsua_conf_connect(0, 0); + else + pjsua_conf_disconnect(0, 0); + loopback_active = !loopback_active; + } + break; + + case 'm': + if (g_call_id != PJSUA_INVALID_ID) { + PJ_LOG(3,(THIS_FILE, "Another call is active")); + break; + } + + if (pjsua_verify_sip_url(SIP_DST_URI) == PJ_SUCCESS) { + pj_str_t dst = pj_str(SIP_DST_URI); + pjsua_call_make_call(g_acc_id, &dst, 0, NULL, + NULL, &g_call_id); + } else { + PJ_LOG(3,(THIS_FILE, "Invalid SIP URI")); + } + break; + case 'a': + if (g_call_id != PJSUA_INVALID_ID) + pjsua_call_answer(g_call_id, 200, NULL, NULL); + break; + case 'g': + pjsua_call_hangup_all(); + break; + case 's': + case 'S': + if (g_buddy_id != PJSUA_INVALID_ID) + pjsua_buddy_subscribe_pres(g_buddy_id, kc=='s'); + break; + case 'o': + case 'O': + pjsua_acc_set_online_status(g_acc_id, kc=='o'); + break; + + default: + PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); + break; } PrintMainMenu(); } -static void HandleCodecMenu (TKeyCode kc) -{ +static void HandleCodecMenu(TKeyCode kc) { const pj_str_t ID_ALL = {"*", 1}; pj_str_t codec = {NULL, 0}; - + if (kc == 'a') { - pjsua_codec_set_priority (&ID_ALL, PJMEDIA_CODEC_PRIO_NORMAL); - PJ_LOG (3, (THIS_FILE, "All codecs activated")); + pjsua_codec_set_priority(&ID_ALL, PJMEDIA_CODEC_PRIO_NORMAL); + PJ_LOG(3,(THIS_FILE, "All codecs activated")); } else { - switch (kc) { - - case 'd': - codec = pj_str ("AMR"); - break; - - case 'g': - codec = pj_str ("G729"); - break; - - case 'j': - codec = pj_str ("ILBC"); - break; - - case 'm': - codec = pj_str ("SPEEX/8000"); - break; - - case 'p': - codec = pj_str ("GSM"); - break; - - case 't': - codec = pj_str ("PCMU"); - break; - - case 'w': - codec = pj_str ("PCMA"); - break; - - default: - PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); - break; - } - - if (codec.slen) { - pj_status_t status; - - pjsua_codec_set_priority (&ID_ALL, PJMEDIA_CODEC_PRIO_DISABLED); - - status = pjsua_codec_set_priority (&codec, - PJMEDIA_CODEC_PRIO_NORMAL); - - if (status == PJ_SUCCESS) - PJ_LOG (3, (THIS_FILE, "%s activated", codec.ptr)); - else - PJ_LOG (3, (THIS_FILE, "Failed activating %s, err=%d", - codec.ptr, status)); - } + switch (kc) { + case 'd': + codec = pj_str("AMR"); + break; + case 'g': + codec = pj_str("G729"); + break; + case 'j': + codec = pj_str("ILBC"); + break; + case 'm': + codec = pj_str("SPEEX/8000"); + break; + case 'p': + codec = pj_str("GSM"); + break; + case 't': + codec = pj_str("PCMU"); + break; + case 'w': + codec = pj_str("PCMA"); + break; + default: + PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); + break; + } + + if (codec.slen) { + pj_status_t status; + + pjsua_codec_set_priority(&ID_ALL, PJMEDIA_CODEC_PRIO_DISABLED); + + status = pjsua_codec_set_priority(&codec, + PJMEDIA_CODEC_PRIO_NORMAL); + if (status == PJ_SUCCESS) + PJ_LOG(3,(THIS_FILE, "%s activated", codec.ptr)); + else + PJ_LOG(3,(THIS_FILE, "Failed activating %s, err=%d", + codec.ptr, status)); + } } } // Implementation: called when read has completed. -void ConsoleUI::RunL() +void ConsoleUI::RunL() { enum { - MENU_TYPE_MAIN = 0, - MENU_TYPE_CODEC = 1 + MENU_TYPE_MAIN = 0, + MENU_TYPE_CODEC = 1 }; static int menu_type = MENU_TYPE_MAIN; TKeyCode kc = con_->KeyCode(); pj_bool_t reschedule = PJ_TRUE; - + if (menu_type == MENU_TYPE_MAIN) { - if (kc == 'w') { - CActiveScheduler::Stop(); - reschedule = PJ_FALSE; - } else if (kc == 'd') { - menu_type = MENU_TYPE_CODEC; - PrintCodecMenu(); - } else { - HandleMainMenu (kc); - } + if (kc == 'w') { + CActiveScheduler::Stop(); + reschedule = PJ_FALSE; + } else if (kc == 'd') { + menu_type = MENU_TYPE_CODEC; + PrintCodecMenu(); + } else { + HandleMainMenu(kc); + } } else { - HandleCodecMenu (kc); - - menu_type = MENU_TYPE_MAIN; - PrintMainMenu(); + HandleCodecMenu(kc); + + menu_type = MENU_TYPE_MAIN; + PrintMainMenu(); } - + if (reschedule) - Run(); + Run(); } #if 0 // IP networking related testing -static pj_status_t test_addr (void) +static pj_status_t test_addr(void) { - int af; - unsigned i, count; - pj_addrinfo ai[8]; - pj_sockaddr ifs[8]; - const pj_str_t *hostname; - pj_hostent he; - pj_status_t status; - - pj_log_set_log_func (&log_writer); - - status = pj_init(); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_init() error", status); - return status; - } - - af = pj_AF_INET(); - + int af; + unsigned i, count; + pj_addrinfo ai[8]; + pj_sockaddr ifs[8]; + const pj_str_t *hostname; + pj_hostent he; + pj_status_t status; + + pj_log_set_log_func(&log_writer); + + status = pj_init(); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_init() error", status); + return status; + } + + af = pj_AF_INET(); + #if 0 - pj_in_addr in_addr; - pj_str_t aa = pj_str ("1.1.1.1"); - in_addr = pj_inet_addr (&aa); - char *the_addr = pj_inet_ntoa (in_addr); - PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); - - aa = pj_str ("192.168.0.15"); - in_addr = pj_inet_addr (&aa); - the_addr = pj_inet_ntoa (in_addr); - PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); - - aa = pj_str ("2.2.2.2"); - in_addr = pj_inet_addr (&aa); - the_addr = pj_inet_ntoa (in_addr); - PJ_LOG (3, (THIS_FILE, "IP addr=%s", the_addr)); - - return -1; + pj_in_addr in_addr; + pj_str_t aa = pj_str("1.1.1.1"); + in_addr = pj_inet_addr(&aa); + char *the_addr = pj_inet_ntoa(in_addr); + PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); + + aa = pj_str("192.168.0.15"); + in_addr = pj_inet_addr(&aa); + the_addr = pj_inet_ntoa(in_addr); + PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); + + aa = pj_str("2.2.2.2"); + in_addr = pj_inet_addr(&aa); + the_addr = pj_inet_ntoa(in_addr); + PJ_LOG(3,(THIS_FILE, "IP addr=%s", the_addr)); + + return -1; #endif - - // Hostname - hostname = pj_gethostname(); - - if (hostname == NULL) { - status = PJ_ERESOLVE; - pjsua_perror (THIS_FILE, "pj_gethostname() error", status); - goto on_return; - } - - PJ_LOG (3, (THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr)); - - // Gethostbyname - status = pj_gethostbyname (hostname, &he); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_gethostbyname() error", status); - } else { - PJ_LOG (3, (THIS_FILE, "gethostbyname: %s", - pj_inet_ntoa (* (pj_in_addr*) he.h_addr))); - } - - // Getaddrinfo - count = PJ_ARRAY_SIZE (ai); - - status = pj_getaddrinfo (af, hostname, &count, ai); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_getaddrinfo() error", status); - } else { - for (i=0; i<count; ++i) { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Addrinfo: %s", - pj_sockaddr_print (&ai[i].ai_addr, ipaddr, sizeof (ipaddr), 2))); - } - } - - // Enum interface - count = PJ_ARRAY_SIZE (ifs); - - status = pj_enum_ip_interface (af, &count, ifs); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_enum_ip_interface() error", status); - } else { - for (i=0; i<count; ++i) { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Interface: %s", - pj_sockaddr_print (&ifs[i], ipaddr, sizeof (ipaddr), 2))); - } - } - - // Get default iinterface - status = pj_getdefaultipinterface (af, &ifs[0]); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_getdefaultipinterface() error", status); - } else { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Default IP: %s", - pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2))); - } - - // Get default IP address - status = pj_gethostip (af, &ifs[0]); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pj_gethostip() error", status); - } else { - char ipaddr[PJ_INET6_ADDRSTRLEN+2]; - PJ_LOG (3, (THIS_FILE, "Host IP: %s", - pj_sockaddr_print (&ifs[0], ipaddr, sizeof (ipaddr), 2))); - } - - status = -1; - + + // Hostname + hostname = pj_gethostname(); + if (hostname == NULL) { + status = PJ_ERESOLVE; + pjsua_perror(THIS_FILE, "pj_gethostname() error", status); + goto on_return; + } + + PJ_LOG(3,(THIS_FILE, "Hostname: %.*s", hostname->slen, hostname->ptr)); + + // Gethostbyname + status = pj_gethostbyname(hostname, &he); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_gethostbyname() error", status); + } else { + PJ_LOG(3,(THIS_FILE, "gethostbyname: %s", + pj_inet_ntoa(*(pj_in_addr*)he.h_addr))); + } + + // Getaddrinfo + count = PJ_ARRAY_SIZE(ai); + status = pj_getaddrinfo(af, hostname, &count, ai); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_getaddrinfo() error", status); + } else { + for (i=0; i<count; ++i) { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Addrinfo: %s", + pj_sockaddr_print(&ai[i].ai_addr, ipaddr, sizeof(ipaddr), 2))); + } + } + + // Enum interface + count = PJ_ARRAY_SIZE(ifs); + status = pj_enum_ip_interface(af, &count, ifs); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_enum_ip_interface() error", status); + } else { + for (i=0; i<count; ++i) { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Interface: %s", + pj_sockaddr_print(&ifs[i], ipaddr, sizeof(ipaddr), 2))); + } + } + + // Get default iinterface + status = pj_getdefaultipinterface(af, &ifs[0]); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_getdefaultipinterface() error", status); + } else { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Default IP: %s", + pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2))); + } + + // Get default IP address + status = pj_gethostip(af, &ifs[0]); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "pj_gethostip() error", status); + } else { + char ipaddr[PJ_INET6_ADDRSTRLEN+2]; + PJ_LOG(3,(THIS_FILE, "Host IP: %s", + pj_sockaddr_print(&ifs[0], ipaddr, sizeof(ipaddr), 2))); + } + + status = -1; + on_return: - pj_shutdown(); - return status; + pj_shutdown(); + return status; } - #endif #include <es_sock.h> #if 0 -// Force network connection to use the first IAP, -// this is useful for debugging on emulator without GUI. +// Force network connection to use the first IAP, +// this is useful for debugging on emulator without GUI. // Include commdb.lib & apengine.lib in symbian_ua.mmp file // if this is enabled. #include <apdatahandler.h> -inline void ForceUseFirstIAP() +inline void ForceUseFirstIAP() { TUint32 rank = 1; TUint32 bearers; TUint32 prompt; TUint32 iap; - CCommsDatabase* commDb = CCommsDatabase::NewL (EDatabaseTypeIAP); - CleanupStack::PushL (commDb); - - CApDataHandler* apDataHandler = CApDataHandler::NewLC (*commDb); + CCommsDatabase* commDb = CCommsDatabase::NewL(EDatabaseTypeIAP); + CleanupStack::PushL(commDb); + CApDataHandler* apDataHandler = CApDataHandler::NewLC(*commDb); + TCommDbConnectionDirection direction = ECommDbConnectionDirectionOutgoing; - apDataHandler->GetPreferredIfDbIapTypeL (rank, direction, bearers, prompt, iap); + apDataHandler->GetPreferredIfDbIapTypeL(rank, direction, bearers, prompt, iap); prompt = ECommDbDialogPrefDoNotPrompt; - apDataHandler->SetPreferredIfDbIapTypeL (rank, direction, bearers, (TCommDbDialogPref) prompt, iap, ETrue); - CleanupStack::PopAndDestroy (2); // apDataHandler, commDb + apDataHandler->SetPreferredIfDbIapTypeL(rank, direction, bearers, (TCommDbDialogPref)prompt, iap, ETrue); + CleanupStack::PopAndDestroy(2); // apDataHandler, commDb } -static void SelectIAP() +static void SelectIAP() { ForceUseFirstIAP(); } #else -static void SelectIAP() +static void SelectIAP() { } @@ -969,108 +954,96 @@ static void SelectIAP() // Class CConnMon to monitor network connection (RConnection). Whenever // the connection is down, it will notify PJLIB and restart PJSUA-LIB. +class CConnMon : public CActive { +public: + static CConnMon* NewL(RConnection &conn, RSocketServ &sserver) { + CConnMon *self = new (ELeave) CConnMon(conn, sserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + + void Start() { + conn_.ProgressNotification(nif_progress_, iStatus); + SetActive(); + } + + void Stop() { + Cancel(); + } + + ~CConnMon() { Stop(); } + +private: + CConnMon(RConnection &conn, RSocketServ &sserver) : + CActive(EPriorityHigh), + conn_(conn), + sserver_(sserver) + { + CActiveScheduler::Add(this); + } + + void ConstructL() {} -class CConnMon : public CActive -{ - - public: - static CConnMon* NewL (RConnection &conn, RSocketServ &sserver) { - CConnMon *self = new (ELeave) CConnMon (conn, sserver); - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop (self); - return self; - } - - void Start() { - conn_.ProgressNotification (nif_progress_, iStatus); - SetActive(); - } - - void Stop() { - Cancel(); - } - - ~CConnMon() { - Stop(); - } - - private: - CConnMon (RConnection &conn, RSocketServ &sserver) : - CActive (EPriorityHigh), - conn_ (conn), - sserver_ (sserver) { - CActiveScheduler::Add (this); - } - - void ConstructL() {} - - void DoCancel() { - conn_.CancelProgressNotification(); - } - - void RunL() { - int stage = nif_progress_().iStage; - - if (stage == KLinkLayerClosed) { - pj_status_t status; - TInt err; - - // Tell pjlib that connection is down. - pj_symbianos_set_connection_status (PJ_FALSE); - - PJ_LOG (3, (THIS_FILE, "RConnection closed, restarting PJSUA..")); - - // Destroy pjsua - pjsua_destroy(); - PJ_LOG (3, (THIS_FILE, "PJSUA destroyed.")); - - // Reopen the connection - err = conn_.Open (sserver_); - - if (err == KErrNone) - err = conn_.Start(); - - if (err != KErrNone) { - CActiveScheduler::Stop(); - return; - } - - // Reinit Symbian OS param before pj_init() - pj_symbianos_params sym_params; - - pj_bzero (&sym_params, sizeof (sym_params)); - - sym_params.rsocketserv = &sserver_; - - sym_params.rconnection = &conn_; - - pj_symbianos_set_params (&sym_params); - - // Reinit pjsua - status = app_startup(); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "app_startup() error", status); - CActiveScheduler::Stop(); - return; - } - - PJ_LOG (3, (THIS_FILE, "PJSUA restarted.")); - - PrintMainMenu(); - } - - Start(); - } + void DoCancel() { + conn_.CancelProgressNotification(); + } - RConnection& conn_; - RSocketServ& sserver_; - TNifProgressBuf nif_progress_; + void RunL() { + int stage = nif_progress_().iStage; + + if (stage == KLinkLayerClosed) { + pj_status_t status; + TInt err; + + // Tell pjlib that connection is down. + pj_symbianos_set_connection_status(PJ_FALSE); + + PJ_LOG(3, (THIS_FILE, "RConnection closed, restarting PJSUA..")); + + // Destroy pjsua + pjsua_destroy(); + PJ_LOG(3, (THIS_FILE, "PJSUA destroyed.")); + + // Reopen the connection + err = conn_.Open(sserver_); + if (err == KErrNone) + err = conn_.Start(); + if (err != KErrNone) { + CActiveScheduler::Stop(); + return; + } + + // Reinit Symbian OS param before pj_init() + pj_symbianos_params sym_params; + pj_bzero(&sym_params, sizeof(sym_params)); + sym_params.rsocketserv = &sserver_; + sym_params.rconnection = &conn_; + pj_symbianos_set_params(&sym_params); + + // Reinit pjsua + status = app_startup(); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "app_startup() error", status); + CActiveScheduler::Stop(); + return; + } + + PJ_LOG(3, (THIS_FILE, "PJSUA restarted.")); + PrintMainMenu(); + } + + Start(); + } + + RConnection& conn_; + RSocketServ& sserver_; + TNifProgressBuf nif_progress_; }; //////////////////////////////////////////////////////////////////////////// -int ua_main() +int ua_main() { RSocketServ aSocketServer; RConnection aConn; @@ -1079,94 +1052,81 @@ int ua_main() pj_status_t status; SelectIAP(); - + // Initialize RSocketServ - - if ( (err=aSocketServer.Connect()) != KErrNone) - return PJ_STATUS_FROM_OS (err); - + if ((err=aSocketServer.Connect()) != KErrNone) + return PJ_STATUS_FROM_OS(err); + // Open up a connection - if ( (err=aConn.Open (aSocketServer)) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + if ((err=aConn.Open(aSocketServer)) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - - if ( (err=aConn.Start()) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + + if ((err=aConn.Start()) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - + // Set Symbian OS parameters in pjlib. // This must be done before pj_init() is called. - pj_bzero (&sym_params, sizeof (sym_params)); - + pj_bzero(&sym_params, sizeof(sym_params)); sym_params.rsocketserv = &aSocketServer; - sym_params.rconnection = &aConn; - - pj_symbianos_set_params (&sym_params); - + pj_symbianos_set_params(&sym_params); + // Initialize pjsua status = app_startup(); - //status = test_addr(); if (status != PJ_SUCCESS) { - aConn.Close(); - aSocketServer.Close(); - return status; + aConn.Close(); + aSocketServer.Close(); + return status; } - + // Run the UI - ConsoleUI *con = new ConsoleUI (console); - + ConsoleUI *con = new ConsoleUI(console); + con->Run(); - PrintMainMenu(); // Init & start connection monitor - CConnMon *connmon = CConnMon::NewL (aConn, aSocketServer); - + CConnMon *connmon = CConnMon::NewL(aConn, aSocketServer); connmon->Start(); CActiveScheduler::Start(); - + delete connmon; - delete con; // Dump memory statistics - PJ_LOG (3, (THIS_FILE, "Max heap usage: %u.%03uMB", - pjsua_var.cp.peak_used_size / 1000000, - (pjsua_var.cp.peak_used_size % 1000000) /1000)); - + PJ_LOG(3,(THIS_FILE, "Max heap usage: %u.%03uMB", + pjsua_var.cp.peak_used_size / 1000000, + (pjsua_var.cp.peak_used_size % 1000000)/1000)); + // check max stack usage #if defined(PJ_OS_HAS_CHECK_STACK) && PJ_OS_HAS_CHECK_STACK!=0 - pj_thread_t* this_thread = pj_thread_this(); - - if (!this_thread) - return status; - - const char* max_stack_file; - - int max_stack_line; - - status = pj_thread_get_stack_info (this_thread, &max_stack_file, &max_stack_line); - - PJ_LOG (3, (THIS_FILE, "Max stack usage: %u at %s:%d", - pj_thread_get_stack_max_usage (this_thread), - max_stack_file, max_stack_line)); - + pj_thread_t* this_thread = pj_thread_this(); + if (!this_thread) + return status; + + const char* max_stack_file; + int max_stack_line; + status = pj_thread_get_stack_info(this_thread, &max_stack_file, &max_stack_line); + + PJ_LOG(3,(THIS_FILE, "Max stack usage: %u at %s:%d", + pj_thread_get_stack_max_usage(this_thread), + max_stack_file, max_stack_line)); #endif - + // Shutdown pjsua pjsua_destroy(); - + // Close connection and socket server aConn.Close(); - aSocketServer.Close(); - + return status; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp index 69d842c37df7062f36df385435f9c5b97caf0431..6d7522938b924bc781abb0d7ae49544c8af38811 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp @@ -3,16 +3,16 @@ Name : Symbian_ua_guiSettingItemListSettings.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ /** - * Generated helper class which manages the settings contained + * Generated helper class which manages the settings contained * in 'symbian_ua_guiSettingItemList'. Each CAknSettingItem maintains * a reference to data in this class so that changes in the setting * item list can be synchronized with this storage. */ - + // [[[ begin generated region: do not modify [Generated Includes] #include <e32base.h> #include <stringloader.h> @@ -25,123 +25,120 @@ * C/C++ constructor for settings data, cannot throw */ TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings() -{ -} + { + } /** * Two-phase constructor for settings data */ TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL() -{ - TSymbian_ua_guiSettingItemListSettings* data = new (ELeave) TSymbian_ua_guiSettingItemListSettings; - CleanupStack::PushL (data); - data->ConstructL(); - CleanupStack::Pop (data); - return data; -} - + { + TSymbian_ua_guiSettingItemListSettings* data = new( ELeave ) TSymbian_ua_guiSettingItemListSettings; + CleanupStack::PushL( data ); + data->ConstructL(); + CleanupStack::Pop( data ); + return data; + } + /** * Second phase for initializing settings data */ void TSymbian_ua_guiSettingItemListSettings::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Initializers] - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR); - SetEd_registrar (text->Des()); - CleanupStack::PopAndDestroy (text); - } - - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER); - SetEd_user (text->Des()); - CleanupStack::PopAndDestroy (text); - } - - SetB_srtp (0); - SetB_ice (0); - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER); - SetEd_stun_server (text->Des()); - CleanupStack::PopAndDestroy (text); - } - - // ]]] end generated region [Generated Initializers] - -} - + { + // [[[ begin generated region: do not modify [Generated Initializers] + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR ); + SetEd_registrar( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER ); + SetEd_user( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + SetB_srtp( 0 ); + SetB_ice( 0 ); + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER ); + SetEd_stun_server( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + // ]]] end generated region [Generated Initializers] + + } + // [[[ begin generated region: do not modify [Generated Contents] TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar() -{ - return iEd_registrar; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar (const TDesC& aValue) -{ - if (aValue.Length() < KEd_registrarMaxLength) - iEd_registrar.Copy (aValue); - else - iEd_registrar.Copy (aValue.Ptr(), KEd_registrarMaxLength); -} + { + return iEd_registrar; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar(const TDesC& aValue) + { + if ( aValue.Length() < KEd_registrarMaxLength) + iEd_registrar.Copy( aValue ); + else + iEd_registrar.Copy( aValue.Ptr(), KEd_registrarMaxLength); + } TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user() -{ - return iEd_user; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_user (const TDesC& aValue) -{ - if (aValue.Length() < KEd_userMaxLength) - iEd_user.Copy (aValue); - else - iEd_user.Copy (aValue.Ptr(), KEd_userMaxLength); -} + { + return iEd_user; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue) + { + if ( aValue.Length() < KEd_userMaxLength) + iEd_user.Copy( aValue ); + else + iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength); + } TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password() -{ - return iEd_password; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_password (const TDesC& aValue) -{ - if (aValue.Length() < KEd_passwordMaxLength) - iEd_password.Copy (aValue); - else - iEd_password.Copy (aValue.Ptr(), KEd_passwordMaxLength); -} + { + return iEd_password; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_password(const TDesC& aValue) + { + if ( aValue.Length() < KEd_passwordMaxLength) + iEd_password.Copy( aValue ); + else + iEd_password.Copy( aValue.Ptr(), KEd_passwordMaxLength); + } TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp() -{ - return iB_srtp; -} + { + return iB_srtp; + } -void TSymbian_ua_guiSettingItemListSettings::SetB_srtp (const TBool& aValue) -{ - iB_srtp = aValue; -} +void TSymbian_ua_guiSettingItemListSettings::SetB_srtp(const TBool& aValue) + { + iB_srtp = aValue; + } TBool& TSymbian_ua_guiSettingItemListSettings::B_ice() -{ - return iB_ice; -} + { + return iB_ice; + } -void TSymbian_ua_guiSettingItemListSettings::SetB_ice (const TBool& aValue) -{ - iB_ice = aValue; -} +void TSymbian_ua_guiSettingItemListSettings::SetB_ice(const TBool& aValue) + { + iB_ice = aValue; + } TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server() -{ - return iEd_stun_server; -} - -void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server (const TDesC& aValue) -{ - if (aValue.Length() < KEd_stun_serverMaxLength) - iEd_stun_server.Copy (aValue); - else - iEd_stun_server.Copy (aValue.Ptr(), KEd_stun_serverMaxLength); -} + { + return iEd_stun_server; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server(const TDesC& aValue) + { + if ( aValue.Length() < KEd_stun_serverMaxLength) + iEd_stun_server.Copy( aValue ); + else + iEd_stun_server.Copy( aValue.Ptr(), KEd_stun_serverMaxLength); + } // ]]] end generated region [Generated Contents] diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp index 1e56a4f9fe5f534dd8c26789f89c068b324c340b..f722336a1b900a640f9aecab638b82c5b60f10cc 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua.cpp @@ -1,5 +1,5 @@ /* $Id: ua.cpp 1793 2008-02-14 13:39:24Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjsua-lib/pjsua.h> #include <pjsua-lib/pjsua_internal.h> @@ -38,230 +38,222 @@ static pjsua_buddy_id g_buddy_id = PJSUA_INVALID_ID; static symbian_ua_info_cb_t g_cb = {NULL, NULL, NULL, NULL, NULL}; -static void log_writer (int level, const char *buf, int len) +static void log_writer(int level, const char *buf, int len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); - + PJ_UNUSED_ARG(level); + if (!g_cb.on_info) - return; - - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + return; - g_cb.on_info (buf16); + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); + g_cb.on_info(buf16); } -static void on_reg_state (pjsua_acc_id acc_id) +static void on_reg_state(pjsua_acc_id acc_id) { pjsua_acc_info acc_info; pj_status_t status; - status = pjsua_acc_get_info (acc_id, &acc_info); - + status = pjsua_acc_get_info(acc_id, &acc_info); if (status != PJ_SUCCESS) - return; + return; if (acc_info.status == 200) { - if (acc_info.expires) { - PJ_LOG (3, (THIS_FILE, "Registration success!")); - - if (g_cb.on_reg_state) g_cb.on_reg_state (true); - } else { - PJ_LOG (3, (THIS_FILE, "Unregistration success!")); - - if (g_cb.on_unreg_state) g_cb.on_unreg_state (true); - } + if (acc_info.expires) { + PJ_LOG(3,(THIS_FILE, "Registration success!")); + if (g_cb.on_reg_state) g_cb.on_reg_state(true); + } else { + PJ_LOG(3,(THIS_FILE, "Unregistration success!")); + if (g_cb.on_unreg_state) g_cb.on_unreg_state(true); + } } else { - if (acc_info.expires) { - PJ_LOG (3, (THIS_FILE, "Registration failed!")); - - if (g_cb.on_reg_state) g_cb.on_reg_state (false); - } else { - PJ_LOG (3, (THIS_FILE, "Unregistration failed!")); - - if (g_cb.on_unreg_state) g_cb.on_unreg_state (false); - } + if (acc_info.expires) { + PJ_LOG(3,(THIS_FILE, "Registration failed!")); + if (g_cb.on_reg_state) g_cb.on_reg_state(false); + } else { + PJ_LOG(3,(THIS_FILE, "Unregistration failed!")); + if (g_cb.on_unreg_state) g_cb.on_unreg_state(false); + } } } /* Callback called by the library upon receiving incoming call */ -static void on_incoming_call (pjsua_acc_id acc_id, pjsua_call_id call_id, - pjsip_rx_data *rdata) +static void on_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, + pjsip_rx_data *rdata) { pjsua_call_info ci; - PJ_UNUSED_ARG (acc_id); - PJ_UNUSED_ARG (rdata); + PJ_UNUSED_ARG(acc_id); + PJ_UNUSED_ARG(rdata); if (g_call_id != PJSUA_INVALID_ID) { - pjsua_call_answer (call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); - return; + pjsua_call_answer(call_id, PJSIP_SC_BUSY_HERE, NULL, NULL); + return; } + + pjsua_call_get_info(call_id, &ci); - pjsua_call_get_info (call_id, &ci); - - PJ_LOG (3, (THIS_FILE, "Incoming call from %.*s!!", - (int) ci.remote_info.slen, - ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Incoming call from %.*s!!", + (int)ci.remote_info.slen, + ci.remote_info.ptr)); g_call_id = call_id; - + /* Automatically answer incoming calls with 180/Ringing */ - pjsua_call_answer (call_id, 180, NULL, NULL); + pjsua_call_answer(call_id, 180, NULL, NULL); if (g_cb.on_incoming_call) { - static wchar_t disp[256]; - static wchar_t uri[PJSIP_MAX_URL_SIZE]; + static wchar_t disp[256]; + static wchar_t uri[PJSIP_MAX_URL_SIZE]; - pj_ansi_to_unicode (ci.remote_info.ptr, ci.remote_info.slen, - disp, PJ_ARRAY_SIZE (disp)); - pj_ansi_to_unicode (ci.remote_contact.ptr, ci.remote_contact.slen, - uri, PJ_ARRAY_SIZE (uri)); + pj_ansi_to_unicode(ci.remote_info.ptr, ci.remote_info.slen, + disp, PJ_ARRAY_SIZE(disp)); + pj_ansi_to_unicode(ci.remote_contact.ptr, ci.remote_contact.slen, + uri, PJ_ARRAY_SIZE(uri)); - g_cb.on_incoming_call (disp, uri); + g_cb.on_incoming_call(disp, uri); } } /* Callback called by the library when call's state has changed */ -static void on_call_state (pjsua_call_id call_id, pjsip_event *e) +static void on_call_state(pjsua_call_id call_id, pjsip_event *e) { pjsua_call_info ci; - PJ_UNUSED_ARG (e); - - pjsua_call_get_info (call_id, &ci); + PJ_UNUSED_ARG(e); + pjsua_call_get_info(call_id, &ci); + if (ci.state == PJSIP_INV_STATE_DISCONNECTED) { - if (call_id == g_call_id) - g_call_id = PJSUA_INVALID_ID; - - if (g_cb.on_call_end) { - static wchar_t reason[256]; - pj_ansi_to_unicode (ci.last_status_text.ptr, ci.last_status_text.slen, - reason, PJ_ARRAY_SIZE (reason)); - g_cb.on_call_end (reason); - } + if (call_id == g_call_id) + g_call_id = PJSUA_INVALID_ID; + if (g_cb.on_call_end) { + static wchar_t reason[256]; + pj_ansi_to_unicode(ci.last_status_text.ptr, ci.last_status_text.slen, + reason, PJ_ARRAY_SIZE(reason)); + g_cb.on_call_end(reason); + } } else if (ci.state != PJSIP_INV_STATE_INCOMING) { - if (g_call_id == PJSUA_INVALID_ID) - g_call_id = call_id; + if (g_call_id == PJSUA_INVALID_ID) + g_call_id = call_id; } - - PJ_LOG (3, (THIS_FILE, "Call %d state=%.*s", call_id, - - (int) ci.state_text.slen, - ci.state_text.ptr)); + + PJ_LOG(3,(THIS_FILE, "Call %d state=%.*s", call_id, + (int)ci.state_text.slen, + ci.state_text.ptr)); } /* Callback called by the library when call's media state has changed */ -static void on_call_media_state (pjsua_call_id call_id) +static void on_call_media_state(pjsua_call_id call_id) { pjsua_call_info ci; - pjsua_call_get_info (call_id, &ci); + pjsua_call_get_info(call_id, &ci); if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) { - // When media is active, connect call to sound device. - pjsua_conf_connect (ci.conf_slot, 0); - pjsua_conf_connect (0, ci.conf_slot); + // When media is active, connect call to sound device. + pjsua_conf_connect(ci.conf_slot, 0); + pjsua_conf_connect(0, ci.conf_slot); } } /* Handler on buddy state changed. */ -static void on_buddy_state (pjsua_buddy_id buddy_id) +static void on_buddy_state(pjsua_buddy_id buddy_id) { pjsua_buddy_info info; - pjsua_buddy_get_info (buddy_id, &info); + pjsua_buddy_get_info(buddy_id, &info); - PJ_LOG (3, (THIS_FILE, "%.*s status is %.*s", - (int) info.uri.slen, - info.uri.ptr, - (int) info.status_text.slen, - info.status_text.ptr)); + PJ_LOG(3,(THIS_FILE, "%.*s status is %.*s", + (int)info.uri.slen, + info.uri.ptr, + (int)info.status_text.slen, + info.status_text.ptr)); } /* Incoming IM message (i.e. MESSAGE request)! */ -static void on_pager (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - const pj_str_t *mime_type, const pj_str_t *text) +static void on_pager(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + const pj_str_t *mime_type, const pj_str_t *text) { /* Note: call index may be -1 */ - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); - PJ_UNUSED_ARG (mime_type); - - PJ_LOG (3, (THIS_FILE,"MESSAGE from %.*s: %.*s", - (int) from->slen, from->ptr, - (int) text->slen, text->ptr)); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); + PJ_UNUSED_ARG(mime_type); + + PJ_LOG(3,(THIS_FILE,"MESSAGE from %.*s: %.*s", + (int)from->slen, from->ptr, + (int)text->slen, text->ptr)); } /* Received typing indication */ -static void on_typing (pjsua_call_id call_id, const pj_str_t *from, - const pj_str_t *to, const pj_str_t *contact, - pj_bool_t is_typing) +static void on_typing(pjsua_call_id call_id, const pj_str_t *from, + const pj_str_t *to, const pj_str_t *contact, + pj_bool_t is_typing) { - PJ_UNUSED_ARG (call_id); - PJ_UNUSED_ARG (to); - PJ_UNUSED_ARG (contact); + PJ_UNUSED_ARG(call_id); + PJ_UNUSED_ARG(to); + PJ_UNUSED_ARG(contact); - PJ_LOG (3, (THIS_FILE, "IM indication: %.*s %s", - (int) from->slen, from->ptr, - (is_typing?"is typing..":"has stopped typing"))); + PJ_LOG(3,(THIS_FILE, "IM indication: %.*s %s", + (int)from->slen, from->ptr, + (is_typing?"is typing..":"has stopped typing"))); } /* Call transfer request status. */ -static void on_call_transfer_status (pjsua_call_id call_id, - int status_code, - const pj_str_t *status_text, - pj_bool_t final, - pj_bool_t *p_cont) +static void on_call_transfer_status(pjsua_call_id call_id, + int status_code, + const pj_str_t *status_text, + pj_bool_t final, + pj_bool_t *p_cont) { - PJ_LOG (3, (THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", - call_id, status_code, - (int) status_text->slen, status_text->ptr, - (final ? "[final]" : ""))); + PJ_LOG(3,(THIS_FILE, "Call %d: transfer status=%d (%.*s) %s", + call_id, status_code, + (int)status_text->slen, status_text->ptr, + (final ? "[final]" : ""))); if (status_code/100 == 2) { - PJ_LOG (3, (THIS_FILE, - "Call %d: call transfered successfully, disconnecting call", - call_id)); - pjsua_call_hangup (call_id, PJSIP_SC_GONE, NULL, NULL); - *p_cont = PJ_FALSE; + PJ_LOG(3,(THIS_FILE, + "Call %d: call transfered successfully, disconnecting call", + call_id)); + pjsua_call_hangup(call_id, PJSIP_SC_GONE, NULL, NULL); + *p_cont = PJ_FALSE; } } /* NAT detection result */ -static void on_nat_detect (const pj_stun_nat_detect_result *res) +static void on_nat_detect(const pj_stun_nat_detect_result *res) { if (res->status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "NAT detection failed", res->status); + pjsua_perror(THIS_FILE, "NAT detection failed", res->status); } else { - PJ_LOG (3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); - } + PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name)); + } } /* Notification that call is being replaced. */ -static void on_call_replaced (pjsua_call_id old_call_id, - pjsua_call_id new_call_id) +static void on_call_replaced(pjsua_call_id old_call_id, + pjsua_call_id new_call_id) { pjsua_call_info old_ci, new_ci; - pjsua_call_get_info (old_call_id, &old_ci); - pjsua_call_get_info (new_call_id, &new_ci); + pjsua_call_get_info(old_call_id, &old_ci); + pjsua_call_get_info(new_call_id, &new_ci); - PJ_LOG (3, (THIS_FILE, "Call %d with %.*s is being replaced by " - "call %d with %.*s", - old_call_id, - (int) old_ci.remote_info.slen, old_ci.remote_info.ptr, - new_call_id, - (int) new_ci.remote_info.slen, new_ci.remote_info.ptr)); + PJ_LOG(3,(THIS_FILE, "Call %d with %.*s is being replaced by " + "call %d with %.*s", + old_call_id, + (int)old_ci.remote_info.slen, old_ci.remote_info.ptr, + new_call_id, + (int)new_ci.remote_info.slen, new_ci.remote_info.ptr)); } int symbian_ua_init() @@ -269,167 +261,132 @@ int symbian_ua_init() TInt err; pj_symbianos_params sym_params; pj_status_t status; - + // Initialize RSocketServ - - if ( (err=aSocketServer.Connect()) != KErrNone) - return PJ_STATUS_FROM_OS (err); - + if ((err=aSocketServer.Connect()) != KErrNone) + return PJ_STATUS_FROM_OS(err); + // Open up a connection - if ( (err=aConn.Open (aSocketServer)) != KErrNone) { - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + if ((err=aConn.Open(aSocketServer)) != KErrNone) { + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - - if ( (err=aConn.Start()) != KErrNone) { - aConn.Close(); - aSocketServer.Close(); - return PJ_STATUS_FROM_OS (err); + + if ((err=aConn.Start()) != KErrNone) { + aConn.Close(); + aSocketServer.Close(); + return PJ_STATUS_FROM_OS(err); } - + // Set Symbian OS parameters in pjlib. // This must be done before pj_init() is called. - pj_bzero (&sym_params, sizeof (sym_params)); - + pj_bzero(&sym_params, sizeof(sym_params)); sym_params.rsocketserv = &aSocketServer; - sym_params.rconnection = &aConn; - - pj_symbianos_set_params (&sym_params); + pj_symbianos_set_params(&sym_params); /* Redirect log before pjsua_init() */ - pj_log_set_log_func (&log_writer); - + pj_log_set_log_func(&log_writer); + /* Set log level */ - pj_log_set_level (LOG_LEVEL); + pj_log_set_level(LOG_LEVEL); /* Create pjsua first! */ status = pjsua_create(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_create() error", status); - return status; + pjsua_perror(THIS_FILE, "pjsua_create() error", status); + return status; } /* Init pjsua */ pjsua_config cfg; - pjsua_config_default (&cfg); - + pjsua_config_default(&cfg); cfg.max_calls = 2; - cfg.thread_cnt = 0; // Disable threading on Symbian - cfg.use_srtp = USE_SRTP; - cfg.srtp_secure_signaling = 0; cfg.cb.on_incoming_call = &on_incoming_call; - cfg.cb.on_call_media_state = &on_call_media_state; - cfg.cb.on_call_state = &on_call_state; - cfg.cb.on_buddy_state = &on_buddy_state; - cfg.cb.on_pager = &on_pager; - cfg.cb.on_typing = &on_typing; - cfg.cb.on_call_transfer_status = &on_call_transfer_status; - cfg.cb.on_call_replaced = &on_call_replaced; - cfg.cb.on_nat_detect = &on_nat_detect; - cfg.cb.on_reg_state = &on_reg_state; pjsua_media_config med_cfg; - pjsua_media_config_default (&med_cfg); - + pjsua_media_config_default(&med_cfg); med_cfg.thread_cnt = 0; // Disable threading on Symbian - med_cfg.has_ioqueue = PJ_FALSE; - med_cfg.clock_rate = 8000; - #if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1) med_cfg.audio_frame_ptime = 20; - #else med_cfg.audio_frame_ptime = 40; - #endif med_cfg.ec_tail_len = 0; - med_cfg.enable_ice = USE_ICE; - med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed pjsua_logging_config log_cfg; - pjsua_logging_config_default (&log_cfg); - + pjsua_logging_config_default(&log_cfg); log_cfg.console_level = LOG_LEVEL; - log_cfg.cb = &log_writer; - log_cfg.decor = 0; - status = pjsua_init (&cfg, &log_cfg, &med_cfg); - + status = pjsua_init(&cfg, &log_cfg, &med_cfg); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "pjsua_init() error", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "pjsua_init() error", status); + pjsua_destroy(); + return status; } /* Add UDP transport. */ pjsua_transport_config tcfg; - pjsua_transport_id tid; - pjsua_transport_config_default (&tcfg); - + pjsua_transport_config_default(&tcfg); tcfg.port = SIP_PORT; - - status = pjsua_transport_create (PJSIP_TRANSPORT_UDP, &tcfg, &tid); - + status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error creating transport", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error creating transport", status); + pjsua_destroy(); + return status; } /* Add account for the transport */ - pjsua_acc_add_local (tid, PJ_TRUE, &g_acc_id); + pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); /* Initialization is done, now start pjsua */ status = pjsua_start(); - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error starting pjsua", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error starting pjsua", status); + pjsua_destroy(); + return status; } /* Adjust Speex priority and enable only the narrowband */ { - pj_str_t codec_id = pj_str ("speex/8000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); - - codec_id = pj_str ("speex/16000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); - - codec_id = pj_str ("speex/32000"); - pjmedia_codec_mgr_set_codec_priority ( - pjmedia_endpt_get_codec_mgr (pjsua_var.med_endpt), - &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + pj_str_t codec_id = pj_str("speex/8000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_NORMAL+1); + + codec_id = pj_str("speex/16000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); + + codec_id = pj_str("speex/32000"); + pjmedia_codec_mgr_set_codec_priority( + pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt), + &codec_id, PJMEDIA_CODEC_PRIO_DISABLED); } return PJ_SUCCESS; @@ -440,104 +397,97 @@ int symbian_ua_destroy() { // Shutdown pjsua pjsua_destroy(); - + // Close connection and socket server aConn.Close(); aSocketServer.Close(); - + CloseSTDLIB(); return PJ_SUCCESS; } -void symbian_ua_set_info_callback (const symbian_ua_info_cb_t *cb) +void symbian_ua_set_info_callback(const symbian_ua_info_cb_t *cb) { if (cb) - g_cb = *cb; + g_cb = *cb; else - pj_bzero (&g_cb, sizeof (g_cb)); + pj_bzero(&g_cb, sizeof(g_cb)); } -int symbian_ua_set_account (const char *domain, const char *username, - const char *password, - bool use_srtp, bool use_ice) +int symbian_ua_set_account(const char *domain, const char *username, + const char *password, + bool use_srtp, bool use_ice) { pj_status_t status; - PJ_ASSERT_RETURN (username && password && domain, PJ_EINVAL); - PJ_UNUSED_ARG (use_srtp); - PJ_UNUSED_ARG (use_ice); + PJ_ASSERT_RETURN(username && password && domain, PJ_EINVAL); + PJ_UNUSED_ARG(use_srtp); + PJ_UNUSED_ARG(use_ice); if (domain[0] == 0) { - pjsua_acc_info acc_info; - pj_status_t status; - - status = pjsua_acc_get_info (g_acc_id, &acc_info); - - if (status != PJ_SUCCESS) - return status; - - if (acc_info.status == 200) { - PJ_LOG (3, (THIS_FILE, "Unregistering..")); - pjsua_acc_set_registration (g_acc_id, PJ_FALSE); - g_acc_id = 0; - } - - return PJ_SUCCESS; + pjsua_acc_info acc_info; + pj_status_t status; + + status = pjsua_acc_get_info(g_acc_id, &acc_info); + if (status != PJ_SUCCESS) + return status; + + if (acc_info.status == 200) { + PJ_LOG(3,(THIS_FILE, "Unregistering..")); + pjsua_acc_set_registration(g_acc_id, PJ_FALSE); + g_acc_id = 0; + } + return PJ_SUCCESS; } if (pjsua_acc_get_count() > 1) { - status = pjsua_acc_del (g_acc_id); - - if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error removing account", status); - return status; - } - - g_acc_id = 0; + status = pjsua_acc_del(g_acc_id); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error removing account", status); + return status; + } + g_acc_id = 0; } pjsua_acc_config cfg; - char tmp_id[PJSIP_MAX_URL_SIZE]; char tmp_reg_uri[PJSIP_MAX_URL_SIZE]; - if (!pj_ansi_strnicmp (domain, "sip:", 4)) { - domain += 4; + if (!pj_ansi_strnicmp(domain, "sip:", 4)) { + domain += 4; } - pjsua_acc_config_default (&cfg); - - pj_ansi_sprintf (tmp_id, "sip:%s@%s", username, domain); - cfg.id = pj_str (tmp_id); - pj_ansi_sprintf (tmp_reg_uri, "sip:%s", domain); - cfg.reg_uri = pj_str (tmp_reg_uri); + pjsua_acc_config_default(&cfg); + pj_ansi_sprintf(tmp_id, "sip:%s@%s", username, domain); + cfg.id = pj_str(tmp_id); + pj_ansi_sprintf(tmp_reg_uri, "sip:%s", domain); + cfg.reg_uri = pj_str(tmp_reg_uri); cfg.cred_count = 1; - cfg.cred_info[0].realm = pj_str ("*"); - cfg.cred_info[0].scheme = pj_str ("digest"); - cfg.cred_info[0].username = pj_str ( (char*) username); + cfg.cred_info[0].realm = pj_str("*"); + cfg.cred_info[0].scheme = pj_str("digest"); + cfg.cred_info[0].username = pj_str((char*)username); cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; - cfg.cred_info[0].data = pj_str ( (char*) password); - - status = pjsua_acc_add (&cfg, PJ_TRUE, &g_acc_id); + cfg.cred_info[0].data = pj_str((char*)password); + status = pjsua_acc_add(&cfg, PJ_TRUE, &g_acc_id); if (status != PJ_SUCCESS) { - pjsua_perror (THIS_FILE, "Error setting account", status); - pjsua_destroy(); - return status; + pjsua_perror(THIS_FILE, "Error setting account", status); + pjsua_destroy(); + return status; } return PJ_SUCCESS; } -int symbian_ua_makecall (const char* dest_url) +int symbian_ua_makecall(const char* dest_url) { - if (pjsua_verify_sip_url (dest_url) == PJ_SUCCESS) { - pj_str_t dst = pj_str ( (char*) dest_url); - pjsua_call_make_call (g_acc_id, &dst, 0, NULL, - NULL, &g_call_id); + if (pjsua_verify_sip_url(dest_url) == PJ_SUCCESS) { + pj_str_t dst = pj_str((char*)dest_url); + pjsua_call_make_call(g_acc_id, &dst, 0, NULL, + NULL, &g_call_id); - return PJ_SUCCESS; + return PJ_SUCCESS; } return PJ_EINVAL; @@ -552,13 +502,13 @@ int symbian_ua_endcall() bool symbian_ua_anycall() { - return (pjsua_call_get_count() >0); + return (pjsua_call_get_count()>0); } int symbian_ua_answercall() { PJ_ASSERT_RETURN (g_call_id != PJSUA_INVALID_ID, PJ_EINVAL); - return pjsua_call_answer (g_call_id, 200, NULL, NULL); + return pjsua_call_answer(g_call_id, 200, NULL, NULL); } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp index ab66bb27805fcce63c3a2a661ffca137f37d260c..ac399510b2bb98b03fe0b34dbf21a021b4be41ec 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiAppUi.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -29,168 +29,167 @@ /** * Construct the Csymbian_ua_guiAppUi instance - */ -Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer (0) -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] + */ +Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] -} + } -/** +/** * The appui's destructor removes the container from the control * stack and destroys it. */ Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi() -{ - // [[[ begin generated region: do not modify [Generated Contents] - TRAPD (err_Dlg_wait_init, RemoveDlg_wait_initL()); - // ]]] end generated region [Generated Contents] -} + { + // [[[ begin generated region: do not modify [Generated Contents] + TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() ); + // ]]] end generated region [Generated Contents] + } // [[[ begin generated function: do not modify void Csymbian_ua_guiAppUi::InitializeContainersL() -{ - iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); - AddViewL (iSymbian_ua_guiContainerView); - iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); - AddViewL (iSymbian_ua_guiSettingItemListView); - SetDefaultViewL (*iSymbian_ua_guiSettingItemListView); -} - + { + iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); + AddViewL( iSymbian_ua_guiContainerView ); + iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); + AddViewL( iSymbian_ua_guiSettingItemListView ); + SetDefaultViewL( *iSymbian_ua_guiSettingItemListView ); + } // ]]] end generated function /** * Handle a command for this appui (override) * @param aCommand command id to be handled */ -void Csymbian_ua_guiAppUi::HandleCommandL (TInt aCommand) -{ - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - - switch (aCommand) { // code to dispatch to the AppUi's menu and CBA commands is generated here - - default: - break; - } - - - if (!commandHandled) { - if (aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit) { - symbian_ua_destroy(); - Exit(); - } - } - - // ]]] end generated region [Generated Code] - -} - -/** +void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AppUi's menu and CBA commands is generated here + default: + break; + } + + + if ( !commandHandled ) + { + if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit ) + { + symbian_ua_destroy(); + Exit(); + } + } + // ]]] end generated region [Generated Code] + + } + +/** * Override of the HandleResourceChangeL virtual function */ -void Csymbian_ua_guiAppUi::HandleResourceChangeL (TInt aType) -{ - CAknViewAppUi::HandleResourceChangeL (aType); - // [[[ begin generated region: do not modify [Generated Code] - // ]]] end generated region [Generated Code] - -} - -/** +void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType ) + { + CAknViewAppUi::HandleResourceChangeL( aType ); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + + } + +/** * Override of the HandleKeyEventL virtual function * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not - * @param aKeyEvent - * @param aType + * @param aKeyEvent + * @param aType */ -TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL ( - const TKeyEvent& aKeyEvent, - TEventCode aType) -{ - // The inherited HandleKeyEventL is private and cannot be called - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - return EKeyWasNotConsumed; -} - -/** +TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // The inherited HandleKeyEventL is private and cannot be called + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + return EKeyWasNotConsumed; + } + +/** * Override of the HandleViewDeactivation virtual function * - * @param aViewIdToBeDeactivated - * @param aNewlyActivatedViewId + * @param aViewIdToBeDeactivated + * @param aNewlyActivatedViewId */ -void Csymbian_ua_guiAppUi::HandleViewDeactivation ( - const TVwsViewId& aViewIdToBeDeactivated, - const TVwsViewId& aNewlyActivatedViewId) -{ - CAknViewAppUi::HandleViewDeactivation ( - aViewIdToBeDeactivated, - aNewlyActivatedViewId); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} +void Csymbian_ua_guiAppUi::HandleViewDeactivation( + const TVwsViewId& aViewIdToBeDeactivated, + const TVwsViewId& aNewlyActivatedViewId ) + { + CAknViewAppUi::HandleViewDeactivation( + aViewIdToBeDeactivated, + aNewlyActivatedViewId ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } /** - * @brief Completes the second phase of Symbian object construction. - * Put initialization code that could leave here. - */ + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ void Csymbian_ua_guiAppUi::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Contents] - BaseConstructL (EAknEnableSkin); - InitializeContainersL(); - // ]]] end generated region [Generated Contents] - - // Create private folder - RProcess process; - TFileName path; - - path.Copy (process.FileName().Left (2)); - - if (path.Compare (_L ("c")) || path.Compare (_L ("C"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC); - else if (path.Compare (_L ("e")) || path.Compare (_L ("E"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE); - - // Init PJSUA - if (symbian_ua_init() != 0) { - symbian_ua_destroy(); - Exit(); - } - - ExecuteDlg_wait_initLD(); - - CTimer::ConstructL(); - CActiveScheduler::Add (this); - After (4000000); -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + BaseConstructL( EAknEnableSkin ); + InitializeContainersL(); + // ]]] end generated region [Generated Contents] + + // Create private folder + RProcess process; + TFileName path; + + path.Copy( process.FileName().Left(2) ); + + if(path.Compare(_L("c")) || path.Compare(_L("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + else if(path.Compare(_L("e")) || path.Compare(_L("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); + + // Init PJSUA + if (symbian_ua_init() != 0) { + symbian_ua_destroy(); + Exit(); + } + + ExecuteDlg_wait_initLD(); + + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + After(4000000); + } + +/** * Override of the HandleApplicationSpecificEventL virtual function */ -void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL ( - TInt aType, - const TWsEvent& anEvent) -{ - CAknViewAppUi::HandleApplicationSpecificEventL (aType, anEvent); - // [[[ begin generated region: do not modify [Generated Code] - // ]]] end generated region [Generated Code] - -} - -/** +void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL( + TInt aType, + const TWsEvent& anEvent ) + { + CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent ); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + + } + +/** * Handle the applicationSpecificEvent event. */ -void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL ( - TInt /* aType */, - const TWsEvent& /* anEvent */) -{ - // TODO: implement applicationSpecificEvent event handler -} - +void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL( + TInt /* aType */, + const TWsEvent& /* anEvent */ ) + { + // TODO: implement applicationSpecificEvent event handler + } + // [[[ begin generated function: do not modify /** * Execute the wait dialog for dlg_wait_init. This routine returns @@ -199,22 +198,19 @@ void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL ( * @param aOverrideText optional override text. When null the text configured * in the UI Designer is used. */ -void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText) -{ - iDlg_wait_init = new (ELeave) CAknWaitDialog ( - reinterpret_cast< CEikDialog** > (&iDlg_wait_init), EFalse); - - if (aOverrideText != NULL) { - iDlg_wait_init->SetTextL (*aOverrideText); - } - - iDlg_wait_init->ExecuteLD (R_APPLICATION_DLG_WAIT_INIT); - - iDlg_wait_initCallback = new (ELeave) CProgressDialogCallback ( - this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL); - iDlg_wait_init->SetCallback (iDlg_wait_initCallback); -} - +void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText ) + { + iDlg_wait_init = new ( ELeave ) CAknWaitDialog( + reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse ); + if ( aOverrideText != NULL ) + { + iDlg_wait_init->SetTextL( *aOverrideText ); + } + iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT ); + iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback( + this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL ); + iDlg_wait_init->SetCallback( iDlg_wait_initCallback ); + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -222,32 +218,30 @@ void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD (const TDesC* aOverrideText) * Close and dispose of the wait dialog for dlg_wait_init */ void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL() -{ - if (iDlg_wait_init != NULL) { - iDlg_wait_init->SetCallback (NULL); - iDlg_wait_init->ProcessFinishedL(); // deletes the dialog - iDlg_wait_init = NULL; - } - - delete iDlg_wait_initCallback; - - iDlg_wait_initCallback = NULL; - -} - + { + if ( iDlg_wait_init != NULL ) + { + iDlg_wait_init->SetCallback( NULL ); + iDlg_wait_init->ProcessFinishedL(); // deletes the dialog + iDlg_wait_init = NULL; + } + delete iDlg_wait_initCallback; + iDlg_wait_initCallback = NULL; + + } // ]]] end generated function -/** +/** * Handle the canceled event. */ -void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL (CAknProgressDialog* /* aDialog */) -{ - // TODO: implement canceled event handler - -} - +void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ ) + { + // TODO: implement canceled event handler + + } + void Csymbian_ua_guiAppUi::RunL() -{ - RemoveDlg_wait_initL(); - iSymbian_ua_guiSettingItemListView->HandleCommandL (EAknSoftkeySave); -} + { + RemoveDlg_wait_initL(); + iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave); + } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp index d32c672d6c7e08becc4bab7c0a2fe005a0d5948a..dc60fecd64d1cab99afdbb61aa15b9f49921935b 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiApplication.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -19,50 +19,50 @@ // Needed by APS -TPtrC APP_UID = _L ("EBD12EE4"); +TPtrC APP_UID = _L("EBD12EE4"); /** * @brief Returns the application's UID (override from CApaApplication::AppDllUid()) * @return UID for this application (KUidsymbian_ua_guiApplication) */ TUid Csymbian_ua_guiApplication::AppDllUid() const -{ - return KUidsymbian_ua_guiApplication; -} + { + return KUidsymbian_ua_guiApplication; + } /** * @brief Creates the application's document (override from CApaApplication::CreateDocumentL()) * @return Pointer to the created document object (Csymbian_ua_guiDocument) */ CApaDocument* Csymbian_ua_guiApplication::CreateDocumentL() -{ - return Csymbian_ua_guiDocument::NewL (*this); -} + { + return Csymbian_ua_guiDocument::NewL( *this ); + } #ifdef EKA2 /** * @brief Called by the application framework to construct the application object * @return The application (Csymbian_ua_guiApplication) - */ + */ LOCAL_C CApaApplication* NewApplication() -{ - return new Csymbian_ua_guiApplication; -} + { + return new Csymbian_ua_guiApplication; + } /** * @brief This standard export is the entry point for all Series 60 applications * @return error code - */ + */ GLDEF_C TInt E32Main() -{ - TInt err; - - err = EikStart::RunApplication (NewApplication); - - return err; -} + { + TInt err; + + err = EikStart::RunApplication( NewApplication ); + return err; + } + #else // Series 60 2.x main DLL program code /** @@ -70,17 +70,17 @@ GLDEF_C TInt E32Main() * @return The application (Csymbian_ua_guiApplication) */ EXPORT_C CApaApplication* NewApplication() -{ - return new Csymbian_ua_guiApplication; -} + { + return new Csymbian_ua_guiApplication; + } /** * @brief This standard export is the entry point for all Series 60 applications * @return error code */ -GLDEF_C TInt E32Dll (TDllReason /*reason*/) -{ - return KErrNone; -} +GLDEF_C TInt E32Dll(TDllReason /*reason*/) + { + return KErrNone; + } #endif // EKA2 diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp index 1ff6ff8bd9484cc2ed32a7d5af13a3deb486a0dd..777217c7de802bbeee708c77d062236f1961d719 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiContainer.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -30,35 +30,34 @@ // ]]] end generated region [Generated Constants] /** - * First phase of Symbian two-phase construction. Should not + * First phase of Symbian two-phase construction. Should not * contain any code that could leave. */ CSymbian_ua_guiContainer::CSymbian_ua_guiContainer() -{ - // [[[ begin generated region: do not modify [Generated Contents] - iLabel1 = NULL; - iEd_url = NULL; - iEd_info = NULL; - // ]]] end generated region [Generated Contents] - -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + iLabel1 = NULL; + iEd_url = NULL; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + + } +/** * Destroy child controls. */ CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() -{ - // [[[ begin generated region: do not modify [Generated Contents] - delete iLabel1; - iLabel1 = NULL; - delete iEd_url; - iEd_url = NULL; - delete iEd_info; - iEd_info = NULL; - // ]]] end generated region [Generated Contents] - -} - + { + // [[[ begin generated region: do not modify [Generated Contents] + delete iLabel1; + iLabel1 = NULL; + delete iEd_url; + iEd_url = NULL; + delete iEd_info; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + + } + /** * Construct the control (first phase). * Creates an instance and initializes it. @@ -68,18 +67,18 @@ CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() * @param aCommandObserver command observer * @return initialized instance of CSymbian_ua_guiContainer */ -CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL ( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver) -{ - CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC ( - aRect, - aParent, - aCommandObserver); - CleanupStack::Pop (self); - return self; -} +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC( + aRect, + aParent, + aCommandObserver ); + CleanupStack::Pop( self ); + return self; + } /** * Construct the control (first phase). @@ -90,205 +89,197 @@ CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL ( * @param aCommandObserver command observer * @return new instance of CSymbian_ua_guiContainer */ -CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC ( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver) -{ - CSymbian_ua_guiContainer* self = new (ELeave) CSymbian_ua_guiContainer(); - CleanupStack::PushL (self); - self->ConstructL (aRect, aParent, aCommandObserver); - return self; -} - +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + CSymbian_ua_guiContainer* self = new ( ELeave ) CSymbian_ua_guiContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aParent, aCommandObserver ); + return self; + } + /** * Construct the control (second phase). * Creates a window to contain the controls and activates it. * @param aRect bounding rectangle * @param aCommandObserver command observer * @param aParent owning parent, or NULL - */ -void CSymbian_ua_guiContainer::ConstructL ( - const TRect& aRect, - const CCoeControl* aParent, - MEikCommandObserver* aCommandObserver) -{ - if (aParent == NULL) { - CreateWindowL(); - } else { - SetContainerWindowL (*aParent); - } - - iFocusControl = NULL; - - iCommandObserver = aCommandObserver; - InitializeControlsL(); - SetRect (aRect); - ActivateL(); - // [[[ begin generated region: do not modify [Post-ActivateL initializations] - // ]]] end generated region [Post-ActivateL initializations] - -} - + */ +void CSymbian_ua_guiContainer::ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + if ( aParent == NULL ) + { + CreateWindowL(); + } + else + { + SetContainerWindowL( *aParent ); + } + iFocusControl = NULL; + iCommandObserver = aCommandObserver; + InitializeControlsL(); + SetRect( aRect ); + ActivateL(); + // [[[ begin generated region: do not modify [Post-ActivateL initializations] + // ]]] end generated region [Post-ActivateL initializations] + + } + /** * Return the number of controls in the container (override) * @return count */ TInt CSymbian_ua_guiContainer::CountComponentControls() const -{ - return (int) ELastControl; -} - + { + return ( int ) ELastControl; + } + /** * Get the control with the given index (override) * @param aIndex Control index [0...n) (limited by #CountComponentControls) * @return Pointer to control */ -CCoeControl* CSymbian_ua_guiContainer::ComponentControl (TInt aIndex) const -{ - // [[[ begin generated region: do not modify [Generated Contents] - switch (aIndex) { - - case ELabel1: - return iLabel1; - - case EEd_url: - return iEd_url; - - case EEd_info: - return iEd_info; - } - - // ]]] end generated region [Generated Contents] - - // handle any user controls here... - - return NULL; -} - +CCoeControl* CSymbian_ua_guiContainer::ComponentControl( TInt aIndex ) const + { + // [[[ begin generated region: do not modify [Generated Contents] + switch ( aIndex ) + { + case ELabel1: + return iLabel1; + case EEd_url: + return iEd_url; + case EEd_info: + return iEd_info; + } + // ]]] end generated region [Generated Contents] + + // handle any user controls here... + + return NULL; + } + /** * Handle resizing of the container. This implementation will lay out * full-sized controls like list boxes for any screen size, and will layout * labels, editors, etc. to the size they were given in the UI designer. * This code will need to be modified to adjust arbitrary controls to * any screen size. - */ + */ void CSymbian_ua_guiContainer::SizeChanged() -{ - CCoeControl::SizeChanged(); - LayoutControls(); - // [[[ begin generated region: do not modify [Generated Contents] - - // ]]] end generated region [Generated Contents] - -} - + { + CCoeControl::SizeChanged(); + LayoutControls(); + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + } + // [[[ begin generated function: do not modify /** * Layout components as specified in the UI Designer */ void CSymbian_ua_guiContainer::LayoutControls() -{ - iLabel1->SetExtent (TPoint (2, 23), TSize (32, 28)); - iEd_url->SetExtent (TPoint (49, 25), TSize (197, 28)); - iEd_info->SetExtent (TPoint (3, 78), TSize (235, 143)); -} - + { + iLabel1->SetExtent( TPoint( 2, 23 ), TSize( 32, 28 ) ); + iEd_url->SetExtent( TPoint( 49, 25 ), TSize( 197, 28 ) ); + iEd_info->SetExtent( TPoint( 3, 78 ), TSize( 235, 143 ) ); + } // ]]] end generated function /** * Handle key events. - */ -TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL ( - const TKeyEvent& aKeyEvent, - TEventCode aType) -{ - // [[[ begin generated region: do not modify [Generated Contents] - - // ]]] end generated region [Generated Contents] - - if (iFocusControl != NULL - && iFocusControl->OfferKeyEventL (aKeyEvent, aType) == EKeyWasConsumed) { - return EKeyWasConsumed; - } - - return CCoeControl::OfferKeyEventL (aKeyEvent, aType); -} - + */ +TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + if ( iFocusControl != NULL + && iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) + { + return EKeyWasConsumed; + } + return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); + } + // [[[ begin generated function: do not modify /** * Initialize each control upon creation. - */ + */ void CSymbian_ua_guiContainer::InitializeControlsL() -{ - iLabel1 = new (ELeave) CEikLabel; - iLabel1->SetContainerWindowL (*this); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1); - iLabel1->ConstructFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - - iEd_url = new (ELeave) CEikEdwin; - iEd_url->SetContainerWindowL (*this); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL); - iEd_url->ConstructFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2); - iEd_url->SetTextL (text); - CleanupStack::PopAndDestroy (text); - } - - iEd_info = new (ELeave) CEikEdwin; - iEd_info->SetContainerWindowL (*this); - { - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO); - iEd_info->ConstructFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - - { - HBufC* text = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2); - iEd_info->SetTextL (text); - CleanupStack::PopAndDestroy (text); - } - - iEd_url->SetFocus (ETrue); - iFocusControl = iEd_url; - -} - + { + iLabel1 = new ( ELeave ) CEikLabel; + iLabel1->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1 ); + iLabel1->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + iEd_url = new ( ELeave ) CEikEdwin; + iEd_url->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL ); + iEd_url->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2 ); + iEd_url->SetTextL( text ); + CleanupStack::PopAndDestroy( text ); + } + iEd_info = new ( ELeave ) CEikEdwin; + iEd_info->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO ); + iEd_info->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2 ); + iEd_info->SetTextL( text ); + CleanupStack::PopAndDestroy( text ); + } + + iEd_url->SetFocus( ETrue ); + iFocusControl = iEd_url; + + } // ]]] end generated function -/** +/** * Handle global resource changes, such as scalable UI or skin events (override) */ -void CSymbian_ua_guiContainer::HandleResourceChange (TInt aType) -{ - CCoeControl::HandleResourceChange (aType); - SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiContainerViewId))->ClientRect()); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - +void CSymbian_ua_guiContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiContainerViewId ) )->ClientRect() ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + /** * Draw container contents. - */ -void CSymbian_ua_guiContainer::Draw (const TRect& aRect) const -{ - // [[[ begin generated region: do not modify [Generated Contents] - CWindowGc& gc = SystemGc(); - gc.Clear (aRect); - - // ]]] end generated region [Generated Contents] - -} - + */ +void CSymbian_ua_guiContainer::Draw( const TRect& aRect ) const + { + // [[[ begin generated region: do not modify [Generated Contents] + CWindowGc& gc = SystemGc(); + gc.Clear( aRect ); + + // ]]] end generated region [Generated Contents] + + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp index a01d8f353c10d8e10622026ad2c9fcb7c0ee9973..661c210eac8ada40713cc3b7bbe0defd198b57e5 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiContainerView.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -39,111 +39,106 @@ // ]]] end generated region [Generated Constants] Csymbian_ua_guiContainerView *myinstance = NULL; -_LIT (KStCall, "Call"); -_LIT (KStHangUp, "Hang Up"); +_LIT(KStCall, "Call"); +_LIT(KStHangUp, "Hang Up"); -void on_info (const wchar_t* buf) +void on_info(const wchar_t* buf) { - TPtrC aBuf ( (const TUint16*) buf); - - if (myinstance) - myinstance->PutMessage (aBuf); + TPtrC aBuf((const TUint16*)buf); + + if (myinstance) + myinstance->PutMessage(aBuf); } -void on_incoming_call (const wchar_t* caller_disp, const wchar_t* caller_uri) +void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri) { - TBuf<512> buf; - TPtrC aDisp ( (const TUint16*) caller_disp); - TPtrC aUri ( (const TUint16*) caller_uri); - _LIT (KFormat, "Incoming call from %S, accept?"); - - buf.Format (KFormat, &aDisp); - - if (Csymbian_ua_guiContainerView::RunQry_accept_callL (&buf) == EAknSoftkeyYes) { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (cba != NULL) { - TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); - cba->DrawDeferred(); - } - - symbian_ua_answercall(); - } else { - symbian_ua_endcall(); - } + TBuf<512> buf; + TPtrC aDisp((const TUint16*)caller_disp); + TPtrC aUri((const TUint16*)caller_uri); + _LIT(KFormat, "Incoming call from %S, accept?"); + + buf.Format(KFormat, &aDisp); + if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes) + { + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); + cba->DrawDeferred(); + } + symbian_ua_answercall(); + } else { + symbian_ua_endcall(); + } } -void on_call_end (const wchar_t* reason) +void on_call_end(const wchar_t* reason) { - TPtrC aReason ( (const TUint16*) reason); - - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (cba != NULL) { - TRAPD (result, cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); - cba->DrawDeferred(); - } - - Csymbian_ua_guiContainerView::RunNote_infoL (&aReason); + TPtrC aReason((const TUint16*)reason); + + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); + cba->DrawDeferred(); + } + + Csymbian_ua_guiContainerView::RunNote_infoL(&aReason); } -void on_reg_state (bool success) +void on_reg_state(bool success) { - if (success) - Csymbian_ua_guiContainerView::RunNote_infoL(); - else - Csymbian_ua_guiContainerView::RunNote_warningL(); + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(); + else + Csymbian_ua_guiContainerView::RunNote_warningL(); } -void on_unreg_state (bool success) +void on_unreg_state(bool success) { - TPtrC st_success (_L ("Unregistration Success!")); - TPtrC st_failed (_L ("Unregistration Failed!")); - - if (success) - Csymbian_ua_guiContainerView::RunNote_infoL (&st_success); - else - Csymbian_ua_guiContainerView::RunNote_warningL (&st_failed); + TPtrC st_success(_L("Unregistration Success!")); + TPtrC st_failed(_L("Unregistration Failed!")); + + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(&st_success); + else + Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed); } -void Csymbian_ua_guiContainerView::PutMessage (const TDesC &msg) -{ - if (!iSymbian_ua_guiContainer) - return; - - CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_info); +void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg) + { + if (!iSymbian_ua_guiContainer) + return; + + CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info); - obj_info->SetTextL (&msg); - - obj_info->DrawDeferred(); -} + obj_info->SetTextL(&msg); + obj_info->DrawDeferred(); + } /** * First phase of Symbian two-phase construction. Should not contain any * code that could leave. */ Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - iSymbian_ua_guiContainer = NULL; - // ]]] end generated region [Generated Contents] - -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + } +/** * The view's destructor removes the container from the control * stack and destroys it. */ Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - delete iSymbian_ua_guiContainer; - iSymbian_ua_guiContainer = NULL; - // ]]] end generated region [Generated Contents] - - symbian_ua_set_info_callback (NULL); - myinstance = NULL; -} + { + // [[[ begin generated region: do not modify [Generated Contents] + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + symbian_ua_set_info_callback(NULL); + myinstance = NULL; + } /** * Symbian two-phase constructor. @@ -152,11 +147,11 @@ Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() * @return new instance of Csymbian_ua_guiContainerView */ Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() -{ - Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); - CleanupStack::Pop (self); - return self; -} + { + Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); + CleanupStack::Pop( self ); + return self; + } /** * Symbian two-phase constructor. @@ -165,266 +160,259 @@ Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() * @return new instance of Csymbian_ua_guiContainerView */ Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC() -{ - Csymbian_ua_guiContainerView* self = new (ELeave) Csymbian_ua_guiContainerView(); - CleanupStack::PushL (self); - self->ConstructL(); - return self; -} + { + Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } /** - * Second-phase constructor for view. + * Second-phase constructor for view. * Initialize contents from resource. - */ + */ void Csymbian_ua_guiContainerView::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Code] - BaseConstructL (R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW); - // ]]] end generated region [Generated Code] - - // add your own initialization code here - symbian_ua_info_cb_t cb; - Mem::FillZ (&cb, sizeof (cb)); - - cb.on_info = &on_info; - cb.on_incoming_call = &on_incoming_call; - cb.on_reg_state = &on_reg_state; - cb.on_unreg_state = &on_unreg_state; - cb.on_call_end = &on_call_end; - - symbian_ua_set_info_callback (&cb); - myinstance = this; -} - + { + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW ); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + symbian_ua_info_cb_t cb; + Mem::FillZ(&cb, sizeof(cb)); + + cb.on_info = &on_info; + cb.on_incoming_call = &on_incoming_call; + cb.on_reg_state = &on_reg_state; + cb.on_unreg_state = &on_unreg_state; + cb.on_call_end = &on_call_end; + + symbian_ua_set_info_callback(&cb); + myinstance = this; + } + /** * @return The UID for this view */ TUid Csymbian_ua_guiContainerView::Id() const -{ - return TUid::Uid (ESymbian_ua_guiContainerViewId); -} + { + return TUid::Uid( ESymbian_ua_guiContainerViewId ); + } /** * Handle a command for this view (override) * @param aCommand command id to be handled */ -void Csymbian_ua_guiContainerView::HandleCommandL (TInt aCommand) -{ - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - - switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here - - case ESymbian_ua_guiContainerViewControlPaneRightId: - commandHandled = CallSoftKeyPressedL (aCommand); - break; - - case ESymbian_ua_guiContainerViewSettingMenuItemCommand: - commandHandled = HandleSettingMenuItemSelectedL (aCommand); - break; - - default: - break; - } - - - if (!commandHandled) { - - if (aCommand == ESymbian_ua_guiContainerViewControlPaneRightId) { - AppUi()->HandleCommandL (EEikCmdExit); - } - - } - - // ]]] end generated region [Generated Code] - -} +void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AknView's menu and CBA commands is generated here + + case ESymbian_ua_guiContainerViewControlPaneRightId: + commandHandled = CallSoftKeyPressedL( aCommand ); + break; + case ESymbian_ua_guiContainerViewSettingMenuItemCommand: + commandHandled = HandleSettingMenuItemSelectedL( aCommand ); + break; + default: + break; + } + + + if ( !commandHandled ) + { + + if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId ) + { + AppUi()->HandleCommandL( EEikCmdExit ); + } + + } + // ]]] end generated region [Generated Code] + + } /** - * Handles user actions during activation of the view, + * Handles user actions during activation of the view, * such as initializing the content. */ -void Csymbian_ua_guiContainerView::DoActivateL ( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) -{ - // [[[ begin generated region: do not modify [Generated Contents] - SetupStatusPaneL(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (EFalse); - } - - if (iSymbian_ua_guiContainer == NULL) { - iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL (ClientRect(), NULL, this); - iSymbian_ua_guiContainer->SetMopParent (this); - AppUi()->AddToStackL (*this, iSymbian_ua_guiContainer); - } - - // ]]] end generated region [Generated Contents] - - cba = CEikButtonGroupContainer::Current(); - - if (cba != NULL) { - if (symbian_ua_anycall()) - cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); - else - cba->SetCommandL (ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); - } - -} +void Csymbian_ua_guiContainerView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( EFalse ); + } + + if ( iSymbian_ua_guiContainer == NULL ) + { + iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this ); + iSymbian_ua_guiContainer->SetMopParent( this ); + AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer ); + } + // ]]] end generated region [Generated Contents] + + cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + if (symbian_ua_anycall()) + cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); + else + cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); + } + + } /** */ void Csymbian_ua_guiContainerView::DoDeactivate() -{ - // [[[ begin generated region: do not modify [Generated Contents] - CleanupStatusPane(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (ETrue); - cba->DrawDeferred(); - } - - if (iSymbian_ua_guiContainer != NULL) { - AppUi()->RemoveFromViewStack (*this, iSymbian_ua_guiContainer); - delete iSymbian_ua_guiContainer; - iSymbian_ua_guiContainer = NULL; - } - - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( ETrue ); + cba->DrawDeferred(); + } + + if ( iSymbian_ua_guiContainer != NULL ) + { + AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer ); + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + } + // ]]] end generated region [Generated Contents] + + } // [[[ begin generated function: do not modify void Csymbian_ua_guiContainerView::SetupStatusPaneL() -{ - // reset the context pane - TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext); - CEikStatusPaneBase::TPaneCapabilities subPaneContext = - StatusPane()->PaneCapabilities (contextPaneUid); - - if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) { - CAknContextPane* context = static_cast< CAknContextPane* > ( - StatusPane()->ControlL (contextPaneUid)); - context->SetPictureToDefaultL(); - } - - // setup the title pane - TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle); - - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - StatusPane()->PaneCapabilities (titlePaneUid); - - if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) { - CAknTitlePane* title = static_cast< CAknTitlePane* > ( - StatusPane()->ControlL (titlePaneUid)); - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE); - title->SetFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - -} - + { + // reset the context pane + TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities( contextPaneUid ); + if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) + { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL( contextPaneUid ) ); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + + } // ]]] end generated function // [[[ begin generated function: do not modify void Csymbian_ua_guiContainerView::CleanupStatusPane() -{ -} - + { + } // ]]] end generated function -/** +/** * Handle status pane size change for this view (override) */ void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange() -{ - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TInt result; - TRAP (result, SetupStatusPaneL()); -} - -/** + { + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP( result, SetupStatusPaneL() ); + } + +/** * Handle the rightSoftKeyPressed event. * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL (TInt aCommand) -{ - CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl (iSymbian_ua_guiContainer->EEd_url); - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - - if (symbian_ua_anycall()) { - symbian_ua_endcall(); - return ETrue; - } - - PutMessage (_L ("Making call...")); - - if (cba != NULL) { - cba->SetCommandL (aCommand, KStHangUp); - cba->DrawDeferred(); - } - - - TUint8 url[256]; - - TPtr8 aUrl (url, 256); - - HBufC *buf = obj_url->GetTextInHBufL(); - CnvUtfConverter::ConvertFromUnicodeToUtf8 (aUrl, *buf); - delete buf; - - if (symbian_ua_makecall ( (char *) aUrl.PtrZ()) != 0) { - PutMessage (_L ("Making call failed!")); - - if (cba != NULL) { - cba->SetCommandL (aCommand, KStCall); - cba->DrawDeferred(); - } - } - - return ETrue; -} - -/** +TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand ) + { + CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url); + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + + if (symbian_ua_anycall()) { + symbian_ua_endcall(); + return ETrue; + } + + PutMessage(_L("Making call...")); + if ( cba != NULL ) { + cba->SetCommandL(aCommand, KStHangUp); + cba->DrawDeferred(); + } + + + TUint8 url[256]; + TPtr8 aUrl(url, 256); + + HBufC *buf = obj_url->GetTextInHBufL(); + CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf); + delete buf; + + if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) { + PutMessage(_L("Making call failed!")); + if ( cba != NULL ) { + cba->SetCommandL(aCommand, KStCall); + cba->DrawDeferred(); + } + } + + return ETrue; + } + +/** * Handle the selected event. * @param aCommand the command id invoked * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL (TInt aCommand) -{ - AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiSettingItemListViewId)); - return ETrue; -} - +TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand ) + { + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId)); + return ETrue; + } + // [[[ begin generated function: do not modify /** * Show the popup note for note_error * @param aOverrideText optional override text */ -void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText) -{ - CAknErrorNote* note = new (ELeave) CAknErrorNote(); - - if (aOverrideText == NULL) { - HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR); - note->ExecuteLD (*noteText); - CleanupStack::PopAndDestroy (noteText); - } else { - note->ExecuteLD (*aOverrideText); - } -} - +void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText ) + { + CAknErrorNote* note = new ( ELeave ) CAknErrorNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -432,19 +420,20 @@ void Csymbian_ua_guiContainerView::RunNote_errorL (const TDesC* aOverrideText) * Show the popup note for note_info * @param aOverrideText optional override text */ -void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText) -{ - CAknInformationNote* note = new (ELeave) CAknInformationNote(); - - if (aOverrideText == NULL) { - HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO); - note->ExecuteLD (*noteText); - CleanupStack::PopAndDestroy (noteText); - } else { - note->ExecuteLD (*aOverrideText); - } -} - +void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText ) + { + CAknInformationNote* note = new ( ELeave ) CAknInformationNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -452,19 +441,20 @@ void Csymbian_ua_guiContainerView::RunNote_infoL (const TDesC* aOverrideText) * Show the popup note for note_warning * @param aOverrideText optional override text */ -void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText) -{ - CAknWarningNote* note = new (ELeave) CAknWarningNote(); - - if (aOverrideText == NULL) { - HBufC* noteText = StringLoader::LoadLC (R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING); - note->ExecuteLD (*noteText); - CleanupStack::PopAndDestroy (noteText); - } else { - note->ExecuteLD (*aOverrideText); - } -} - +void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText ) + { + CAknWarningNote* note = new ( ELeave ) CAknWarningNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } // ]]] end generated function // [[[ begin generated function: do not modify @@ -473,17 +463,16 @@ void Csymbian_ua_guiContainerView::RunNote_warningL (const TDesC* aOverrideText) * @param aOverrideText optional override text * @return EAknSoftkeyYes (left soft key id) or 0 */ -TInt Csymbian_ua_guiContainerView::RunQry_accept_callL (const TDesC* aOverrideText) -{ - - CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); - - if (aOverrideText != NULL) { - queryDialog->SetPromptL (*aOverrideText); - } - - return queryDialog->ExecuteLD (R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL); -} - +TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText ) + { + + CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); + + if ( aOverrideText != NULL ) + { + queryDialog->SetPromptL( *aOverrideText ); + } + return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL ); + } // ]]] end generated function diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp index 209c9ebcec9f9a653241e1340be8fb8b382c2949..8eb54f8d74fed49b685ad511827c23256e1d61f4 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiDocument.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated User Includes] @@ -15,19 +15,19 @@ * @brief Constructs the document class for the application. * @param anApplication the application instance */ -Csymbian_ua_guiDocument::Csymbian_ua_guiDocument (CEikApplication& anApplication) - : CAknDocument (anApplication) -{ -} +Csymbian_ua_guiDocument::Csymbian_ua_guiDocument( CEikApplication& anApplication ) + : CAknDocument( anApplication ) + { + } /** - * @brief Completes the second phase of Symbian object construction. - * Put initialization code that could leave here. - */ + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ void Csymbian_ua_guiDocument::ConstructL() -{ -} - + { + } + /** * Symbian OS two-phase constructor. * @@ -37,21 +37,21 @@ void Csymbian_ua_guiDocument::ConstructL() * @param aApp the application instance * @return the new Csymbian_ua_guiDocument */ -Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL (CEikApplication& aApp) -{ - Csymbian_ua_guiDocument* self = new (ELeave) Csymbian_ua_guiDocument (aApp); - CleanupStack::PushL (self); - self->ConstructL(); - CleanupStack::Pop (self); - return self; -} +Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL( CEikApplication& aApp ) + { + Csymbian_ua_guiDocument* self = new ( ELeave ) Csymbian_ua_guiDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } /** * @brief Creates the application UI object for this document. * @return the new instance - */ + */ CEikAppUi* Csymbian_ua_guiDocument::CreateAppUiL() -{ - return new (ELeave) Csymbian_ua_guiAppUi; -} - + { + return new ( ELeave ) Csymbian_ua_guiAppUi; + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp index 15fba37ca33e2d2bcddce2b6c92a7d8e0621c144..27f3d6e5ce3c2793c376ae827d531342cea8e787 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiSettingItemList.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ @@ -22,7 +22,7 @@ #include <aknpopupfieldtext.h> #include <eikappui.h> #include <aknviewappui.h> -#include <akntextsettingpage.h> +#include <akntextsettingpage.h> #include <symbian_ua_gui.rsg> // ]]] end generated region [Generated System Includes] @@ -43,8 +43,8 @@ // ]]] end generated region [Generated Constants] -_LIT (KtxDicFileName ,"settings.ini"); - +_LIT(KtxDicFileName ,"settings.ini" ); + const TInt KRegistrar = 2; const TInt KUsername = 3; const TInt KPassword = 4; @@ -55,36 +55,36 @@ const TInt KIce = 7; /** * Construct the CSymbian_ua_guiSettingItemList instance * @param aCommandObserver command observer - */ -CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList ( - TSymbian_ua_guiSettingItemListSettings& aSettings, - MEikCommandObserver* aCommandObserver) - : iSettings (aSettings), iCommandObserver (aCommandObserver) -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - -/** + */ +CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList( + TSymbian_ua_guiSettingItemListSettings& aSettings, + MEikCommandObserver* aCommandObserver ) + : iSettings( aSettings ), iCommandObserver( aCommandObserver ) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } +/** * Destroy any instance variables */ CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList() -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } /** * Handle system notification that the container's size has changed. */ void CSymbian_ua_guiSettingItemList::SizeChanged() -{ - if (ListBox()) { - ListBox()->SetRect (Rect()); - } -} + { + if ( ListBox() ) + { + ListBox()->SetRect( Rect() ); + } + } /** * Create one setting item at a time, identified by id. @@ -93,73 +93,73 @@ void CSymbian_ua_guiSettingItemList::SizeChanged() * a reference to the underlying data, which EditItemL() uses * to edit and store the value. */ -CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL (TInt aId) -{ - switch (aId) { - // [[[ begin generated region: do not modify [Initializers] - - case ESymbian_ua_guiSettingItemListViewEd_registrar: { - CAknTextSettingItem* item = new (ELeave) - CAknTextSettingItem ( - aId, - iSettings.Ed_registrar()); - item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - - case ESymbian_ua_guiSettingItemListViewEd_user: { - CAknTextSettingItem* item = new (ELeave) - CAknTextSettingItem ( - aId, - iSettings.Ed_user()); - item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - - case ESymbian_ua_guiSettingItemListViewEd_password: { - CAknPasswordSettingItem* item = new (ELeave) - CAknPasswordSettingItem ( - aId, - CAknPasswordSettingItem::EAlpha, - iSettings.Ed_password()); - item->SetSettingPageFlags (CAknTextSettingPage::EZeroLengthAllowed); - return item; - } - - case ESymbian_ua_guiSettingItemListViewB_srtp: { - CAknBinaryPopupSettingItem* item = new (ELeave) - CAknBinaryPopupSettingItem ( - aId, - iSettings.B_srtp()); - item->SetHidden (ETrue); - return item; - } - - case ESymbian_ua_guiSettingItemListViewB_ice: { - CAknBinaryPopupSettingItem* item = new (ELeave) - CAknBinaryPopupSettingItem ( - aId, - iSettings.B_ice()); - item->SetHidden (ETrue); - return item; - } - - case ESymbian_ua_guiSettingItemListViewEd_stun_server: { - CAknTextSettingItem* item = new (ELeave) - CAknTextSettingItem ( - aId, - iSettings.Ed_stun_server()); - item->SetHidden (ETrue); - return item; - } - - // ]]] end generated region [Initializers] - - } - - return NULL; -} - +CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL( TInt aId ) + { + switch ( aId ) + { + // [[[ begin generated region: do not modify [Initializers] + case ESymbian_ua_guiSettingItemListViewEd_registrar: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_registrar() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_user: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_user() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_password: + { + CAknPasswordSettingItem* item = new ( ELeave ) + CAknPasswordSettingItem( + aId, + CAknPasswordSettingItem::EAlpha, + iSettings.Ed_password() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewB_srtp: + { + CAknBinaryPopupSettingItem* item = new ( ELeave ) + CAknBinaryPopupSettingItem( + aId, + iSettings.B_srtp() ); + item->SetHidden( ETrue ); + return item; + } + case ESymbian_ua_guiSettingItemListViewB_ice: + { + CAknBinaryPopupSettingItem* item = new ( ELeave ) + CAknBinaryPopupSettingItem( + aId, + iSettings.B_ice() ); + item->SetHidden( ETrue ); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_stun_server: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_stun_server() ); + item->SetHidden( ETrue ); + return item; + } + // ]]] end generated region [Initializers] + + } + + return NULL; + } + /** * Edit the setting item identified by the given id and store * the changes into the store. @@ -168,256 +168,256 @@ CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL (TInt aId) * always show the edit page and interactively edit the item; * false: change the item in place if possible, else show the edit page */ -void CSymbian_ua_guiSettingItemList::EditItemL (TInt aIndex, TBool aCalledFromMenu) -{ - CAknSettingItem* item = (*SettingItemArray()) [aIndex]; - - switch (item->Identifier()) { - // [[[ begin generated region: do not modify [Editing Started Invoker] - // ]]] end generated region [Editing Started Invoker] - - } - - CAknSettingItemList::EditItemL (aIndex, aCalledFromMenu); - - TBool storeValue = ETrue; - - switch (item->Identifier()) { - // [[[ begin generated region: do not modify [Editing Stopped Invoker] - // ]]] end generated region [Editing Stopped Invoker] - - } - - if (storeValue) { - item->StoreL(); - SaveSettingValuesL(); - } -} - +void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu ) + { + CAknSettingItem* item = ( *SettingItemArray() )[aIndex]; + switch ( item->Identifier() ) + { + // [[[ begin generated region: do not modify [Editing Started Invoker] + // ]]] end generated region [Editing Started Invoker] + + } + + CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); + + TBool storeValue = ETrue; + switch ( item->Identifier() ) + { + // [[[ begin generated region: do not modify [Editing Stopped Invoker] + // ]]] end generated region [Editing Stopped Invoker] + + } + + if ( storeValue ) + { + item->StoreL(); + SaveSettingValuesL(); + } + } /** * Handle the "Change" option on the Options menu. This is an * alternative to the Selection key that forces the settings page * to come up rather than changing the value in place (if possible). */ void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL() -{ - if (ListBox()->CurrentItemIndex() >= 0) { - EditItemL (ListBox()->CurrentItemIndex(), ETrue); - } -} + { + if ( ListBox()->CurrentItemIndex() >= 0 ) + { + EditItemL( ListBox()->CurrentItemIndex(), ETrue ); + } + } /** * Load the initial contents of the setting items. By default, * the setting items are populated with the default values from * the design. You can override those values here. * <p> - * Note: this call alone does not update the UI. + * Note: this call alone does not update the UI. * LoadSettingsL() must be called afterwards. */ void CSymbian_ua_guiSettingItemList::LoadSettingValuesL() -{ - // load values into iSettings + { + // load values into iSettings - TFileName path; - TFileName pathWithoutDrive; - CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive); + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); - // Extract drive letter into appDrive: + // Extract drive letter into appDrive: #ifdef __WINS__ - path.Copy (_L ("c:")); + path.Copy( _L("c:") ); #else - RProcess process; - path.Copy (process.FileName().Left (2)); + RProcess process; + path.Copy( process.FileName().Left(2) ); #endif - path.Append (pathWithoutDrive); - path.Append (KtxDicFileName); - - TFindFile AufFolder (CCoeEnv::Static()->FsSession()); - - if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) { - CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid (1)); - TUid FileUid; - - FileUid.iUid = KRegistrar; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_registrar(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KUsername; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_user(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KPassword; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_password(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KStunServer; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - in >> iSettings.Ed_stun_server(); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KSrtp; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - iSettings.SetB_srtp ( (TBool) in.ReadInt32L()); - CleanupStack::PopAndDestroy (1);// in - } - - FileUid.iUid = KIce; - - if (MyDStore->IsPresentL (FileUid)) { - RDictionaryReadStream in; - in.OpenLC (*MyDStore,FileUid); - iSettings.SetB_ice ( (TBool) in.ReadInt32L()); - CleanupStack::PopAndDestroy (1);// in - } - - CleanupStack::PopAndDestroy (1);// Store - } - -} - + path.Append( pathWithoutDrive ); + path.Append( KtxDicFileName ); + + TFindFile AufFolder(CCoeEnv::Static()->FsSession()); + if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) + { + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(1)); + TUid FileUid; + + FileUid.iUid = KRegistrar; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_registrar(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KUsername; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_user(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KPassword; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_password(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KStunServer; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_stun_server(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KSrtp; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + iSettings.SetB_srtp((TBool)in.ReadInt32L()); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KIce; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + iSettings.SetB_ice((TBool)in.ReadInt32L()); + CleanupStack::PopAndDestroy(1);// in + } + + CleanupStack::PopAndDestroy(1);// Store + } + + } + /** * Save the contents of the setting items. Note, this is called * whenever an item is changed and stored to the model, so it * may be called multiple times or not at all. */ void CSymbian_ua_guiSettingItemList::SaveSettingValuesL() -{ - // store values from iSettings + { + // store values from iSettings - TFileName path; - TFileName pathWithoutDrive; - CEikonEnv::Static()->FsSession().PrivatePath (pathWithoutDrive); + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); - // Extract drive letter into appDrive: + // Extract drive letter into appDrive: #ifdef __WINS__ - path.Copy (_L ("c:")); + path.Copy( _L("c:") ); #else - RProcess process; - path.Copy (process.FileName().Left (2)); - - if (path.Compare (_L ("c")) || path.Compare (_L ("C"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveC); - else if (path.Compare (_L ("e")) || path.Compare (_L ("E"))) - CEikonEnv::Static()->FsSession().CreatePrivatePath (EDriveE); - + RProcess process; + path.Copy( process.FileName().Left(2) ); + + if(path.Compare(_L("c")) || path.Compare(_L("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + else if(path.Compare(_L("e")) || path.Compare(_L("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); #endif - path.Append (pathWithoutDrive); - - path.Append (KtxDicFileName); - - TFindFile AufFolder (CCoeEnv::Static()->FsSession()); - - if (KErrNone == AufFolder.FindByDir (path, KNullDesC)) { - User::LeaveIfError (CCoeEnv::Static()->FsSession().Delete (AufFolder.File())); - } - - CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC (CCoeEnv::Static()->FsSession(),path, TUid::Uid (1)); - - TUid FileUid = {0x0}; - - FileUid.iUid = KRegistrar; - RDictionaryWriteStream out1; - out1.AssignLC (*MyDStore,FileUid); - out1 << iSettings.Ed_registrar(); - out1.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KUsername; - RDictionaryWriteStream out2; - out2.AssignLC (*MyDStore,FileUid); - out2 << iSettings.Ed_user(); - out2.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KPassword; - RDictionaryWriteStream out3; - out3.AssignLC (*MyDStore,FileUid); - out3 << iSettings.Ed_password(); - out3.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KStunServer; - RDictionaryWriteStream out4; - out4.AssignLC (*MyDStore,FileUid); - out4 << iSettings.Ed_stun_server(); - out4.CommitL(); - CleanupStack::PopAndDestroy (1);// out2 - - FileUid.iUid = KSrtp; - RDictionaryWriteStream out5; - out5.AssignLC (*MyDStore,FileUid); - out5.WriteInt32L (iSettings.B_srtp()); - out5.CommitL(); - CleanupStack::PopAndDestroy (1);// out1 - - FileUid.iUid = KIce; - RDictionaryWriteStream out6; - out6.AssignLC (*MyDStore,FileUid); - out6.WriteInt32L (iSettings.B_ice()); - out6.CommitL(); - CleanupStack::PopAndDestroy (1);// out1 - - MyDStore->CommitL(); - CleanupStack::PopAndDestroy (1);// Store - -} - - -/** + path.Append( pathWithoutDrive ); + path.Append( KtxDicFileName ); + + TFindFile AufFolder(CCoeEnv::Static()->FsSession()); + if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) + { + User::LeaveIfError(CCoeEnv::Static()->FsSession().Delete(AufFolder.File())); + } + + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),path, TUid::Uid(1)); + + TUid FileUid = {0x0}; + + FileUid.iUid = KRegistrar; + RDictionaryWriteStream out1; + out1.AssignLC(*MyDStore,FileUid); + out1 << iSettings.Ed_registrar(); + out1.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KUsername; + RDictionaryWriteStream out2; + out2.AssignLC(*MyDStore,FileUid); + out2 << iSettings.Ed_user(); + out2.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KPassword; + RDictionaryWriteStream out3; + out3.AssignLC(*MyDStore,FileUid); + out3 << iSettings.Ed_password(); + out3.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KStunServer; + RDictionaryWriteStream out4; + out4.AssignLC(*MyDStore,FileUid); + out4 << iSettings.Ed_stun_server(); + out4.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KSrtp; + RDictionaryWriteStream out5; + out5.AssignLC(*MyDStore,FileUid); + out5.WriteInt32L(iSettings.B_srtp()); + out5.CommitL(); + CleanupStack::PopAndDestroy(1);// out1 + + FileUid.iUid = KIce; + RDictionaryWriteStream out6; + out6.AssignLC(*MyDStore,FileUid); + out6.WriteInt32L(iSettings.B_ice()); + out6.CommitL(); + CleanupStack::PopAndDestroy(1);// out1 + + MyDStore->CommitL(); + CleanupStack::PopAndDestroy(1);// Store + + } + + +/** * Handle global resource changes, such as scalable UI or skin events (override) */ -void CSymbian_ua_guiSettingItemList::HandleResourceChange (TInt aType) -{ - CAknSettingItemList::HandleResourceChange (aType); - SetRect (iAvkonViewAppUi->View (TUid::Uid (ESymbian_ua_guiSettingItemListViewId))->ClientRect()); - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - -/** +void CSymbian_ua_guiSettingItemList::HandleResourceChange( TInt aType ) + { + CAknSettingItemList::HandleResourceChange( aType ); + SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiSettingItemListViewId ) )->ClientRect() ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** * Handle key event (override) * @param aKeyEvent key event * @param aType event code * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed */ -TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL ( - const TKeyEvent& aKeyEvent, - TEventCode aType) -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - - if (aKeyEvent.iCode == EKeyLeftArrow - || aKeyEvent.iCode == EKeyRightArrow) { - // allow the tab control to get the arrow keys - return EKeyWasNotConsumed; - } - - return CAknSettingItemList::OfferKeyEventL (aKeyEvent, aType); -} - +TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + if ( aKeyEvent.iCode == EKeyLeftArrow + || aKeyEvent.iCode == EKeyRightArrow ) + { + // allow the tab control to get the arrow keys + return EKeyWasNotConsumed; + } + + return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType ); + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp index 2a158b4bb501e994f02206f14f4330c86a027094..243ff994c57092b657a7f86bcee643b8393be22e 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp @@ -3,7 +3,7 @@ Name : symbian_ua_guiSettingItemListView.cpp Author : nanang Copyright : (c) 2008-2009 Teluu Inc. - Description : + Description : ======================================================================== */ // [[[ begin generated region: do not modify [Generated System Includes] @@ -36,22 +36,21 @@ * code that could leave. */ Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} - -/** + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } +/** * The view's destructor removes the container from the control * stack and destroys it. */ Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() -{ - // [[[ begin generated region: do not modify [Generated Contents] - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } /** * Symbian two-phase constructor. @@ -60,11 +59,11 @@ Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() * @return new instance of Csymbian_ua_guiSettingItemListView */ Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() -{ - Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); - CleanupStack::Pop (self); - return self; -} + { + Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); + CleanupStack::Pop( self ); + return self; + } /** * Symbian two-phase constructor. @@ -73,219 +72,214 @@ Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() * @return new instance of Csymbian_ua_guiSettingItemListView */ Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC() -{ - Csymbian_ua_guiSettingItemListView* self = new (ELeave) Csymbian_ua_guiSettingItemListView(); - CleanupStack::PushL (self); - self->ConstructL(); - return self; -} + { + Csymbian_ua_guiSettingItemListView* self = new ( ELeave ) Csymbian_ua_guiSettingItemListView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } /** - * Second-phase constructor for view. + * Second-phase constructor for view. * Initialize contents from resource. - */ + */ void Csymbian_ua_guiSettingItemListView::ConstructL() -{ - // [[[ begin generated region: do not modify [Generated Code] - BaseConstructL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW); - // ]]] end generated region [Generated Code] - - // add your own initialization code here -} - + { + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW ); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + } + /** * @return The UID for this view */ TUid Csymbian_ua_guiSettingItemListView::Id() const -{ - return TUid::Uid (ESymbian_ua_guiSettingItemListViewId); -} + { + return TUid::Uid( ESymbian_ua_guiSettingItemListViewId ); + } /** * Handle a command for this view (override) * @param aCommand command id to be handled */ -void Csymbian_ua_guiSettingItemListView::HandleCommandL (TInt aCommand) -{ - // [[[ begin generated region: do not modify [Generated Code] - TBool commandHandled = EFalse; - - switch (aCommand) { // code to dispatch to the AknView's menu and CBA commands is generated here - - case EAknSoftkeySave: - commandHandled = HandleControlPaneRightSoftKeyPressedL (aCommand); - break; - - case ESymbian_ua_guiSettingItemListViewMenuItem1Command: - commandHandled = HandleChangeSelectedSettingItemL (aCommand); - break; - - default: - break; - } - - - if (!commandHandled) { - - } - - // ]]] end generated region [Generated Code] - -} +void Csymbian_ua_guiSettingItemListView::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AknView's menu and CBA commands is generated here + + case EAknSoftkeySave: + commandHandled = HandleControlPaneRightSoftKeyPressedL( aCommand ); + break; + case ESymbian_ua_guiSettingItemListViewMenuItem1Command: + commandHandled = HandleChangeSelectedSettingItemL( aCommand ); + break; + default: + break; + } + + + if ( !commandHandled ) + { + + } + // ]]] end generated region [Generated Code] + + } /** - * Handles user actions during activation of the view, + * Handles user actions during activation of the view, * such as initializing the content. */ -void Csymbian_ua_guiSettingItemListView::DoActivateL ( - const TVwsViewId& /*aPrevViewId*/, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/) -{ - // [[[ begin generated region: do not modify [Generated Contents] - SetupStatusPaneL(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (EFalse); - } - - if (iSymbian_ua_guiSettingItemList == NULL) { - iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); - iSymbian_ua_guiSettingItemList = new (ELeave) CSymbian_ua_guiSettingItemList (*iSettings, this); - iSymbian_ua_guiSettingItemList->SetMopParent (this); - iSymbian_ua_guiSettingItemList->ConstructFromResourceL (R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST); - iSymbian_ua_guiSettingItemList->ActivateL(); - iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); - iSymbian_ua_guiSettingItemList->LoadSettingsL(); - AppUi()->AddToStackL (*this, iSymbian_ua_guiSettingItemList); - } - - // ]]] end generated region [Generated Contents] - -} +void Csymbian_ua_guiSettingItemListView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( EFalse ); + } + + if ( iSymbian_ua_guiSettingItemList == NULL ) + { + iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); + iSymbian_ua_guiSettingItemList = new ( ELeave ) CSymbian_ua_guiSettingItemList( *iSettings, this ); + iSymbian_ua_guiSettingItemList->SetMopParent( this ); + iSymbian_ua_guiSettingItemList->ConstructFromResourceL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST ); + iSymbian_ua_guiSettingItemList->ActivateL(); + iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); + iSymbian_ua_guiSettingItemList->LoadSettingsL(); + AppUi()->AddToStackL( *this, iSymbian_ua_guiSettingItemList ); + } + // ]]] end generated region [Generated Contents] + + } /** */ void Csymbian_ua_guiSettingItemListView::DoDeactivate() -{ - // [[[ begin generated region: do not modify [Generated Contents] - CleanupStatusPane(); - - CEikButtonGroupContainer* cba = AppUi()->Cba(); - - if (cba != NULL) { - cba->MakeVisible (ETrue); - cba->DrawDeferred(); - } - - if (iSymbian_ua_guiSettingItemList != NULL) { - AppUi()->RemoveFromStack (iSymbian_ua_guiSettingItemList); - delete iSymbian_ua_guiSettingItemList; - iSymbian_ua_guiSettingItemList = NULL; - delete iSettings; - iSettings = NULL; - } - - // ]]] end generated region [Generated Contents] - -} + { + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( ETrue ); + cba->DrawDeferred(); + } + + if ( iSymbian_ua_guiSettingItemList != NULL ) + { + AppUi()->RemoveFromStack( iSymbian_ua_guiSettingItemList ); + delete iSymbian_ua_guiSettingItemList; + iSymbian_ua_guiSettingItemList = NULL; + delete iSettings; + iSettings = NULL; + } + // ]]] end generated region [Generated Contents] + + } // [[[ begin generated function: do not modify void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL() -{ - // reset the context pane - TUid contextPaneUid = TUid::Uid (EEikStatusPaneUidContext); - CEikStatusPaneBase::TPaneCapabilities subPaneContext = - StatusPane()->PaneCapabilities (contextPaneUid); - - if (subPaneContext.IsPresent() && subPaneContext.IsAppOwned()) { - CAknContextPane* context = static_cast< CAknContextPane* > ( - StatusPane()->ControlL (contextPaneUid)); - context->SetPictureToDefaultL(); - } - - // setup the title pane - TUid titlePaneUid = TUid::Uid (EEikStatusPaneUidTitle); - - CEikStatusPaneBase::TPaneCapabilities subPaneTitle = - StatusPane()->PaneCapabilities (titlePaneUid); - - if (subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned()) { - CAknTitlePane* title = static_cast< CAknTitlePane* > ( - StatusPane()->ControlL (titlePaneUid)); - TResourceReader reader; - iEikonEnv->CreateResourceReaderLC (reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE); - title->SetFromResourceL (reader); - CleanupStack::PopAndDestroy(); // reader internal state - } - -} - + { + // reset the context pane + TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities( contextPaneUid ); + if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) + { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL( contextPaneUid ) ); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + + } // ]]] end generated function // [[[ begin generated function: do not modify void Csymbian_ua_guiSettingItemListView::CleanupStatusPane() -{ -} - + { + } // ]]] end generated function -/** +/** * Handle status pane size change for this view (override) */ void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange() -{ - CAknView::HandleStatusPaneSizeChange(); - - // this may fail, but we're not able to propagate exceptions here - TInt result; - TRAP (result, SetupStatusPaneL()); -} - -/** + { + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP( result, SetupStatusPaneL() ); + } + +/** * Handle the selected event. * @param aCommand the command id invoked * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL (TInt aCommand) -{ - iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); - return ETrue; -} - -/** +TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL( TInt aCommand ) + { + iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); + return ETrue; + } + +/** * Handle the rightSoftKeyPressed event. * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL (TInt aCommand) -{ - TUint8 domain[256] = {0}; - TPtr8 cDomain (domain, sizeof (domain)); - TUint8 user[64] = {0}; - TPtr8 cUser (user, sizeof (user)); - TUint8 pass[64] = {0}; - TPtr8 cPass (pass, sizeof (pass)); - - cDomain.Copy (iSettings->Ed_registrar()); - cUser.Copy (iSettings->Ed_user()); - cPass.Copy (iSettings->Ed_password()); - symbian_ua_set_account ( (char*) domain, (char*) user, (char*) pass, false, false); - - AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId)); - return ETrue; -} - -/** +TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL( TInt aCommand ) + { + TUint8 domain[256] = {0}; + TPtr8 cDomain(domain, sizeof(domain)); + TUint8 user[64] = {0}; + TPtr8 cUser(user, sizeof(user)); + TUint8 pass[64] = {0}; + TPtr8 cPass(pass, sizeof(pass)); + + cDomain.Copy(iSettings->Ed_registrar()); + cUser.Copy(iSettings->Ed_user()); + cPass.Copy(iSettings->Ed_password()); + symbian_ua_set_account((char*)domain, (char*)user, (char*)pass, false, false); + + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); + return ETrue; + } + +/** * Handle the selected event. * @param aCommand the command id invoked * @return ETrue if the command was handled, EFalse if not */ -TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL (TInt aCommand) -{ - AppUi()->ActivateLocalViewL (TUid::Uid (ESymbian_ua_guiContainerViewId)); - return ETrue; -} - +TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL( TInt aCommand ) + { + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); + return ETrue; + } + diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp index b4c95f7b078771a784a8736d538bfe58a9093931..b270fa71b2efca391ffd58cc25f9875f6252fd26 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/app_main.cpp @@ -1,5 +1,5 @@ /* $Id: app_main.cpp 2821 2009-06-30 13:37:26Z nanang $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pjmedia-audiodev/audiodev.h> #include <pjmedia/delaybuf.h> @@ -45,24 +45,24 @@ pj_pool_t *pool; pjmedia_delay_buf *delaybuf; /* Logging callback */ -static void log_writer (int level, const char *buf, unsigned len) +static void log_writer(int level, const char *buf, unsigned len) { static wchar_t buf16[PJ_LOG_MAX_SIZE]; - PJ_UNUSED_ARG (level); + PJ_UNUSED_ARG(level); - pj_ansi_to_unicode (buf, len, buf16, PJ_ARRAY_SIZE (buf16)); + pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); - TPtrC16 aBuf ( (const TUint16*) buf16, (TInt) len); - console->Write (aBuf); + TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); + console->Write(aBuf); } /* perror util */ -static void app_perror (const char *title, pj_status_t status) +static void app_perror(const char *title, pj_status_t status) { char errmsg[PJ_ERR_MSG_SIZE]; - pj_strerror (status, errmsg, sizeof (errmsg)); - PJ_LOG (1, (THIS_FILE, "Error: %s: %s", title, errmsg)); + pj_strerror(status, errmsg, sizeof(errmsg)); + PJ_LOG(1,(THIS_FILE, "Error: %s: %s", title, errmsg)); } /* Application init */ @@ -72,65 +72,59 @@ static pj_status_t app_init() pj_status_t status; /* Redirect log */ - pj_log_set_log_func ( (void (*) (int,const char*,int)) &log_writer); - pj_log_set_decor (PJ_LOG_HAS_NEWLINE); - pj_log_set_level (3); + pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer); + pj_log_set_decor(PJ_LOG_HAS_NEWLINE); + pj_log_set_level(3); /* Init pjlib */ status = pj_init(); - if (status != PJ_SUCCESS) { - app_perror ("pj_init()", status); - return status; + app_perror("pj_init()", status); + return status; } - pj_caching_pool_init (&cp, NULL, 0); + pj_caching_pool_init(&cp, NULL, 0); /* Init sound subsystem */ - status = pjmedia_aud_subsys_init (&cp.factory); - + status = pjmedia_aud_subsys_init(&cp.factory); if (status != PJ_SUCCESS) { - app_perror ("pjmedia_snd_init()", status); - pj_caching_pool_destroy (&cp); - pj_shutdown(); - return status; + app_perror("pjmedia_snd_init()", status); + pj_caching_pool_destroy(&cp); + pj_shutdown(); + return status; } count = pjmedia_aud_dev_count(); - - PJ_LOG (3, (THIS_FILE, "Device count: %d", count)); - + PJ_LOG(3,(THIS_FILE, "Device count: %d", count)); for (i=0; i<count; ++i) { - pjmedia_aud_dev_info info; - pj_status_t status; - - status = pjmedia_aud_dev_get_info (i, &info); - pj_assert (status == PJ_SUCCESS); - PJ_LOG (3, (THIS_FILE, "%d: %s %d/%d %dHz", - i, info.name, info.input_count, info.output_count, - info.default_samples_per_sec)); + pjmedia_aud_dev_info info; + pj_status_t status; + + status = pjmedia_aud_dev_get_info(i, &info); + pj_assert(status == PJ_SUCCESS); + PJ_LOG(3, (THIS_FILE, "%d: %s %d/%d %dHz", + i, info.name, info.input_count, info.output_count, + info.default_samples_per_sec)); } /* Create pool */ - pool = pj_pool_create (&cp.factory, THIS_FILE, 512, 512, NULL); - + pool = pj_pool_create(&cp.factory, THIS_FILE, 512, 512, NULL); if (pool == NULL) { - app_perror ("pj_pool_create()", status); - pj_caching_pool_destroy (&cp); - pj_shutdown(); - return status; + app_perror("pj_pool_create()", status); + pj_caching_pool_destroy(&cp); + pj_shutdown(); + return status; } /* Init delay buffer */ - status = pjmedia_delay_buf_create (pool, THIS_FILE, CLOCK_RATE, - SAMPLES_PER_FRAME, CHANNEL_COUNT, - 0, 0, &delaybuf); - + status = pjmedia_delay_buf_create(pool, THIS_FILE, CLOCK_RATE, + SAMPLES_PER_FRAME, CHANNEL_COUNT, + 0, 0, &delaybuf); if (status != PJ_SUCCESS) { - app_perror ("pjmedia_delay_buf_create()", status); + app_perror("pjmedia_delay_buf_create()", status); //pj_caching_pool_destroy(&cp); - //pj_shutdown(); - //return status; + //pj_shutdown(); + //return status; } return PJ_SUCCESS; @@ -138,30 +132,29 @@ static pj_status_t app_init() /* Sound capture callback */ -static pj_status_t rec_cb (void *user_data, - pjmedia_frame *frame) +static pj_status_t rec_cb(void *user_data, + pjmedia_frame *frame) { - PJ_UNUSED_ARG (user_data); + PJ_UNUSED_ARG(user_data); - pjmedia_delay_buf_put (delaybuf, (pj_int16_t*) frame->buf); + pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)frame->buf); if (frame->size != SAMPLES_PER_FRAME*2) { - PJ_LOG (3, (THIS_FILE, "Size captured = %u", - frame->size)); + PJ_LOG(3, (THIS_FILE, "Size captured = %u", + frame->size)); } ++rec_cnt; - return PJ_SUCCESS; } /* Play cb */ -static pj_status_t play_cb (void *user_data, - pjmedia_frame *frame) +static pj_status_t play_cb(void *user_data, + pjmedia_frame *frame) { - PJ_UNUSED_ARG (user_data); + PJ_UNUSED_ARG(user_data); - pjmedia_delay_buf_get (delaybuf, (pj_int16_t*) frame->buf); + pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)frame->buf); frame->size = SAMPLES_PER_FRAME*2; frame->type = PJMEDIA_FRAME_TYPE_AUDIO; @@ -170,43 +163,39 @@ static pj_status_t play_cb (void *user_data, } /* Start sound */ -static pj_status_t snd_start (unsigned flag) +static pj_status_t snd_start(unsigned flag) { pjmedia_aud_param param; pj_status_t status; if (strm != NULL) { - app_perror ("snd already open", PJ_EINVALIDOP); - return PJ_EINVALIDOP; + app_perror("snd already open", PJ_EINVALIDOP); + return PJ_EINVALIDOP; } - pjmedia_aud_dev_default_param (0, ¶m); - + pjmedia_aud_dev_default_param(0, ¶m); param.channel_count = CHANNEL_COUNT; param.clock_rate = CLOCK_RATE; param.samples_per_frame = SAMPLES_PER_FRAME; param.dir = (pjmedia_dir) flag; - status = pjmedia_aud_stream_create (¶m, &rec_cb, &play_cb, NULL, &strm); - + status = pjmedia_aud_stream_create(¶m, &rec_cb, &play_cb, NULL, &strm); if (status != PJ_SUCCESS) { - app_perror ("snd open", status); - return status; + app_perror("snd open", status); + return status; } rec_cnt = play_cnt = 0; + pj_gettimeofday(&t_start); - pj_gettimeofday (&t_start); - - pjmedia_delay_buf_reset (delaybuf); - - status = pjmedia_aud_stream_start (strm); + pjmedia_delay_buf_reset(delaybuf); + status = pjmedia_aud_stream_start(strm); if (status != PJ_SUCCESS) { - app_perror ("snd start", status); - pjmedia_aud_stream_destroy (strm); - strm = NULL; - return status; + app_perror("snd start", status); + pjmedia_aud_stream_destroy(strm); + strm = NULL; + return status; } return PJ_SUCCESS; @@ -219,26 +208,23 @@ static pj_status_t snd_stop() pj_status_t status; if (strm == NULL) { - app_perror ("snd not open", PJ_EINVALIDOP); - return PJ_EINVALIDOP; + app_perror("snd not open", PJ_EINVALIDOP); + return PJ_EINVALIDOP; } - status = pjmedia_aud_stream_stop (strm); - + status = pjmedia_aud_stream_stop(strm); if (status != PJ_SUCCESS) { - app_perror ("snd failed to stop", status); + app_perror("snd failed to stop", status); } - - status = pjmedia_aud_stream_destroy (strm); - + status = pjmedia_aud_stream_destroy(strm); strm = NULL; - pj_gettimeofday (&now); - PJ_TIME_VAL_SUB (now, t_start); + pj_gettimeofday(&now); + PJ_TIME_VAL_SUB(now, t_start); - PJ_LOG (3, (THIS_FILE, "Duration: %d.%03d", now.sec, now.msec)); - PJ_LOG (3, (THIS_FILE, "Captured: %d", rec_cnt)); - PJ_LOG (3, (THIS_FILE, "Played: %d", play_cnt)); + PJ_LOG(3,(THIS_FILE, "Duration: %d.%03d", now.sec, now.msec)); + PJ_LOG(3,(THIS_FILE, "Captured: %d", rec_cnt)); + PJ_LOG(3,(THIS_FILE, "Played: %d", play_cnt)); return status; } @@ -247,16 +233,12 @@ static pj_status_t snd_stop() static void app_fini() { if (strm) - snd_stop(); + snd_stop(); pjmedia_aud_subsys_shutdown(); - - pjmedia_delay_buf_destroy (delaybuf); - - pj_pool_release (pool); - - pj_caching_pool_destroy (&cp); - + pjmedia_delay_buf_destroy(delaybuf); + pj_pool_release(pool); + pj_caching_pool_destroy(&cp); pj_shutdown(); } @@ -269,38 +251,37 @@ static void app_fini() class ConsoleUI : public CActive { +public: + ConsoleUI(CConsoleBase *con); - public: - ConsoleUI (CConsoleBase *con); - - // Run console UI - void Run(); + // Run console UI + void Run(); - // Stop - void Stop(); + // Stop + void Stop(); - protected: - // Cancel asynchronous read. - void DoCancel(); +protected: + // Cancel asynchronous read. + void DoCancel(); - // Implementation: called when read has completed. - void RunL(); + // Implementation: called when read has completed. + void RunL(); - private: - CConsoleBase *con_; +private: + CConsoleBase *con_; }; -ConsoleUI::ConsoleUI (CConsoleBase *con) - : CActive (EPriorityUserInput), con_ (con) +ConsoleUI::ConsoleUI(CConsoleBase *con) +: CActive(EPriorityUserInput), con_(con) { - CActiveScheduler::Add (this); + CActiveScheduler::Add(this); } // Run console UI void ConsoleUI::Run() { - con_->Read (iStatus); + con_->Read(iStatus); SetActive(); } @@ -318,13 +299,13 @@ void ConsoleUI::DoCancel() static void PrintMenu() { - PJ_LOG (3, (THIS_FILE, "\n\n" - "Menu:\n" - " a Start bidir sound\n" - " t Start recorder\n" - " p Start player\n" - " d Stop & close sound\n" - " w Quit\n")); + PJ_LOG(3, (THIS_FILE, "\n\n" + "Menu:\n" + " a Start bidir sound\n" + " t Start recorder\n" + " p Start player\n" + " d Stop & close sound\n" + " w Quit\n")); } // Implementation: called when read has completed. @@ -334,39 +315,33 @@ void ConsoleUI::RunL() pj_bool_t reschedule = PJ_TRUE; switch (kc) { - - case 'w': - snd_stop(); - CActiveScheduler::Stop(); - reschedule = PJ_FALSE; - break; - - case 'a': - snd_start (PJMEDIA_DIR_CAPTURE_PLAYBACK); - break; - - case 't': - snd_start (PJMEDIA_DIR_CAPTURE); - break; - - case 'p': - snd_start (PJMEDIA_DIR_PLAYBACK); - break; - - case 'd': - snd_stop(); - break; - - default: - PJ_LOG (3, (THIS_FILE, "Keycode '%c' (%d) is pressed", - kc, kc)); - break; + case 'w': + snd_stop(); + CActiveScheduler::Stop(); + reschedule = PJ_FALSE; + break; + case 'a': + snd_start(PJMEDIA_DIR_CAPTURE_PLAYBACK); + break; + case 't': + snd_start(PJMEDIA_DIR_CAPTURE); + break; + case 'p': + snd_start(PJMEDIA_DIR_PLAYBACK); + break; + case 'd': + snd_stop(); + break; + default: + PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", + kc, kc)); + break; } PrintMenu(); if (reschedule) - Run(); + Run(); } @@ -377,18 +352,16 @@ int app_main() return -1; // Run the UI - ConsoleUI *con = new ConsoleUI (console); + ConsoleUI *con = new ConsoleUI(console); con->Run(); PrintMenu(); - CActiveScheduler::Start(); delete con; app_fini(); - return 0; } diff --git a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp index 6b1a92f6b3f19f6f3cfa135ebfcadf8331c2f61d..5ed4eb83ee1f7cd6a95611455129221fb5f881a9 100644 --- a/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp +++ b/sflphone-common/libs/pjproject/pjsip-apps/src/symsndtest/main_symbian.cpp @@ -1,5 +1,5 @@ /* $Id: main_symbian.cpp 2506 2009-03-12 18:11:37Z bennylp $ */ -/* +/* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> * @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <e32std.h> @@ -29,7 +29,7 @@ CConsoleBase* console; // Needed by APS -TPtrC APP_UID = _L ("A000000E"); +TPtrC APP_UID = _L("A000000E"); int app_main(); @@ -39,13 +39,13 @@ int app_main(); LOCAL_C void DoStartL() { CActiveScheduler *scheduler = new (ELeave) CActiveScheduler; - CleanupStack::PushL (scheduler); - CActiveScheduler::Install (scheduler); + CleanupStack::PushL(scheduler); + CActiveScheduler::Install(scheduler); app_main(); - CActiveScheduler::Install (NULL); - CleanupStack::Pop (scheduler); + CActiveScheduler::Install(NULL); + CleanupStack::Pop(scheduler); delete scheduler; } @@ -62,25 +62,22 @@ GLDEF_C TInt E32Main() CTrapCleanup* cleanup = CTrapCleanup::New(); // Create output console - TRAPD (createError, console = Console::NewL (_L ("Console"), TSize (KConsFullScreen,KConsFullScreen))); - + TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen))); if (createError) return createError; - TRAPD (startError, DoStartL()); + TRAPD(startError, DoStartL()); //console->Printf(_L("[press any key to close]\n")); //console->Getch(); delete console; - delete cleanup; CloseSTDLIB(); // Mark end of heap usage, detect memory leaks __UHEAP_MARKEND; - return KErrNone; } diff --git a/sflphone-common/libs/pjproject/pjsip/build/Makefile b/sflphone-common/libs/pjproject/pjsip/build/Makefile index fe5937d0a3f9374681f50d22e40c06e368138bf5..d825db83bbce5cdadf8b6556d3aa077440ec4ab2 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/Makefile +++ b/sflphone-common/libs/pjproject/pjsip/build/Makefile @@ -8,15 +8,15 @@ include $(PJDIR)/build/common.mak RULES_MAK := $(PJDIR)/build/rules.mak -PJLIB_LIB:=../../pjlib/lib/libpj-sfl-$(TARGET_NAME)$(LIBEXT) -PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-sfl-$(TARGET_NAME)$(LIBEXT) -PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-sfl-$(TARGET_NAME)$(LIBEXT) +PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) +PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) +PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) -export PJSIP_LIB:=../lib/libpjsip-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSIP_UA_LIB:=../lib/libpjsip-ua-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSIP_SIMPLE_LIB:=../lib/libpjsip-simple-sfl-$(TARGET_NAME)$(LIBEXT) -export PJSUA_LIB_LIB=../lib/libpjsua-sfl-$(TARGET_NAME)$(LIBEXT) +export PJSIP_LIB:=../lib/libpjsip-$(TARGET_NAME)$(LIBEXT) +export PJSIP_UA_LIB:=../lib/libpjsip-ua-$(TARGET_NAME)$(LIBEXT) +export PJSIP_SIMPLE_LIB:=../lib/libpjsip-simple-$(TARGET_NAME)$(LIBEXT) +export PJSUA_LIB_LIB=../lib/libpjsua-$(TARGET_NAME)$(LIBEXT) ############################################################################### @@ -41,7 +41,7 @@ export PJSIP_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ sip_endpoint.o sip_util.o sip_util_proxy.o \ sip_resolve.o sip_transport.o sip_transport_loop.o \ sip_transport_udp.o sip_transport_tcp.o \ - sip_transport_tls_ossl.o sip_auth_aka.o sip_auth_client.o \ + sip_transport_tls.o sip_auth_aka.o sip_auth_client.o \ sip_auth_msg.o sip_auth_parser.o \ sip_auth_server.o \ sip_transaction.o sip_util_statefull.o \ @@ -64,7 +64,7 @@ export PJSIP_UA_CFLAGS += $(_CFLAGS) export PJSIP_SIMPLE_SRCDIR = ../src/pjsip-simple export PJSIP_SIMPLE_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ errno.o evsub.o evsub_msg.o iscomposing.o \ - pidf.o presence.o presence_body.o publishc.o \ + mwi.o pidf.o presence.o presence_body.o publishc.o \ rpid.o xpidf.o export PJSIP_SIMPLE_CFLAGS += $(_CFLAGS) diff --git a/sflphone-common/libs/pjproject/pjsip/build/os-auto.mak b/sflphone-common/libs/pjproject/pjsip/build/os-auto.mak deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp index 4a5389b510f6db03391a2a52adad97e0b197eeb0..b29e69ec0990cf8b35baf5bd96b159cf85adeeb1 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.dsp @@ -156,7 +156,12 @@ SOURCE=..\src\pjsip\sip_transport_tcp.c # End Source File # Begin Source File +SOURCE=..\src\pjsip\sip_transport_tls.c +# End Source File +# Begin Source File + SOURCE=..\src\pjsip\sip_transport_tls_ossl.c +# PROP Exclude_From_Build 1 # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj index 2aef6d4c2ec649aa6046eade53444587bd3836bb..8d0228a52b3817235cb74c52620704bd4f4e3040 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_core.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -72,7 +72,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -92,10 +92,10 @@ </Configuration> <Configuration Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -114,9 +114,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -130,7 +130,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -158,10 +158,10 @@ </Configuration> <Configuration Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -180,9 +180,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -196,7 +196,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -223,12 +223,11 @@ /> </Configuration> <Configuration - Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -247,8 +246,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -262,7 +262,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -274,18 +274,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -304,9 +312,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -320,7 +328,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -347,11 +355,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -370,9 +378,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -386,7 +394,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -413,12 +421,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -437,8 +444,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -452,7 +460,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -464,18 +472,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -494,9 +511,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -510,7 +526,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -522,26 +538,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -560,9 +568,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -576,7 +584,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -603,12 +611,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -627,8 +634,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -642,7 +650,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -654,18 +662,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -684,9 +700,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -700,7 +716,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -727,11 +743,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -750,9 +766,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -766,7 +782,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -793,12 +809,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -817,8 +832,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -832,7 +848,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -844,18 +860,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -874,9 +898,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -890,7 +914,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -917,11 +941,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -940,9 +965,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -956,7 +980,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -968,27 +992,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1007,8 +1022,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1022,7 +1038,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1034,18 +1050,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1064,9 +1088,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1080,7 +1104,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1107,11 +1131,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1130,9 +1154,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1146,7 +1170,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1173,11 +1197,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1196,9 +1220,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1212,7 +1236,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1239,11 +1263,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1262,9 +1286,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1278,7 +1302,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1305,11 +1329,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1328,9 +1352,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1344,7 +1368,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1371,11 +1395,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1394,9 +1419,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1410,7 +1434,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1422,26 +1446,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1460,9 +1476,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1476,7 +1492,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1503,11 +1519,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1526,9 +1542,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1542,7 +1558,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1569,11 +1585,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1592,9 +1608,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1608,7 +1624,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1635,11 +1651,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1658,9 +1674,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1674,7 +1690,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1701,11 +1717,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1724,9 +1740,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1740,7 +1756,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1767,11 +1783,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1790,9 +1806,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1806,7 +1822,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1833,11 +1849,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1856,9 +1873,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1872,7 +1888,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1884,26 +1900,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1922,9 +1930,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1938,7 +1946,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1965,11 +1973,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1988,9 +1996,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2004,7 +2012,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2031,11 +2039,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2054,9 +2062,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2070,7 +2078,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2097,11 +2105,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2120,9 +2128,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2136,7 +2144,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2163,11 +2171,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2186,9 +2194,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2202,7 +2210,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2229,11 +2237,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2252,9 +2260,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2268,7 +2276,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2295,11 +2303,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2318,9 +2327,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2334,7 +2342,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2346,26 +2354,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2384,9 +2384,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2400,7 +2400,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2427,11 +2427,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2450,9 +2450,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2466,7 +2466,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2493,11 +2493,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2516,9 +2516,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2532,7 +2532,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2559,11 +2559,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2582,9 +2582,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2598,7 +2598,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2625,11 +2625,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2648,9 +2648,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2664,7 +2664,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2692,10 +2692,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2714,9 +2714,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib/include,../../pjlib-util/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2730,7 +2730,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-core-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -3479,11 +3479,16 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjsip\sip_transport_tls.c" + > + </File> <File RelativePath="..\src\pjsip\sip_transport_tls_ossl.c" > <FileConfiguration Name="Release|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3493,6 +3498,7 @@ </FileConfiguration> <FileConfiguration Name="Debug|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3500,8 +3506,17 @@ PreprocessorDefinitions="" /> </FileConfiguration> + <FileConfiguration + Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" + ExcludedFromBuild="true" + > + <Tool + Name="VCCLCompilerTool" + /> + </FileConfiguration> <FileConfiguration Name="Debug-Static|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3511,6 +3526,7 @@ </FileConfiguration> <FileConfiguration Name="Release-Dynamic|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3520,6 +3536,7 @@ </FileConfiguration> <FileConfiguration Name="Debug-Dynamic|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -3529,6 +3546,7 @@ </FileConfiguration> <FileConfiguration Name="Release-Static|Win32" + ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp index 82554d7de56923ff39e0eb777e9fda24eed72f2a..8b584a97bb04d191be99818e077ef1fc76a4ee32 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.dsp @@ -103,6 +103,10 @@ SOURCE="..\src\pjsip-simple\iscomposing.c" # End Source File # Begin Source File +SOURCE="..\src\pjsip-simple\mwi.c" +# End Source File +# Begin Source File + SOURCE="..\src\pjsip-simple\pidf.c" # End Source File # Begin Source File @@ -147,6 +151,10 @@ SOURCE="..\include\pjsip-simple\iscomposing.h" # End Source File # Begin Source File +SOURCE="..\include\pjsip-simple\mwi.h" +# End Source File +# Begin Source File + SOURCE="..\include\pjsip-simple\pidf.h" # End Source File # Begin Source File diff --git a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj index 76d1d07b2bd0617cd8f5022066592972561ee675..f2504c824ebd52babeaad0d9f5df21f6785d1cd6 100644 --- a/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj +++ b/sflphone-common/libs/pjproject/pjsip/build/pjsip_simple.vcproj @@ -34,11 +34,11 @@ <Configurations> <Configuration Name="Debug|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -57,8 +57,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -72,7 +72,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -92,10 +92,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -114,9 +114,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -130,7 +130,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -158,10 +158,10 @@ </Configuration> <Configuration Name="Debug|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -180,9 +180,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -196,7 +196,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -223,12 +223,11 @@ /> </Configuration> <Configuration - Name="Release|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Pocket PC 2003 (ARMV4)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -247,8 +246,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -262,7 +262,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -274,18 +274,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -304,9 +312,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -320,7 +328,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -347,11 +355,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -370,9 +378,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -386,7 +394,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -413,12 +421,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -437,8 +444,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -452,7 +460,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -464,18 +472,27 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -494,9 +511,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -510,7 +526,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -522,26 +538,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -560,9 +568,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -576,7 +584,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -603,12 +611,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -627,8 +634,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -642,7 +650,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -654,18 +662,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -684,9 +700,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -700,7 +716,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -727,11 +743,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -750,9 +766,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -766,7 +782,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -793,12 +809,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -817,8 +832,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -832,7 +848,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -844,18 +860,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -874,9 +898,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -890,7 +914,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -917,11 +941,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -940,9 +965,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -956,7 +980,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -968,27 +992,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Win32" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="2" + Name="Debug-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" - UseOfMFC="0" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1007,8 +1022,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" + ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1022,7 +1038,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1034,18 +1050,26 @@ Name="VCBscMakeTool" /> <Tool - Name="VCFxCopTool" + Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> + <DeploymentTool + ForceDirty="-1" + RemoteDirectory="" + RegisterOutput="0" + AdditionalFiles="" + /> + <DebuggerTool + /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1064,9 +1088,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1080,7 +1104,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1107,11 +1131,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1130,9 +1154,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1146,7 +1170,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1173,11 +1197,11 @@ /> </Configuration> <Configuration - Name="Debug|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1196,9 +1220,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1212,7 +1236,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1239,11 +1263,11 @@ /> </Configuration> <Configuration - Name="Release|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1262,9 +1286,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1278,7 +1302,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1305,11 +1329,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1328,9 +1352,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1344,7 +1368,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1371,11 +1395,12 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1394,9 +1419,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1410,7 +1434,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1422,26 +1446,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1460,9 +1476,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1476,7 +1492,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1503,11 +1519,11 @@ /> </Configuration> <Configuration - Name="Release-Static|Pocket PC 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1526,9 +1542,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1542,7 +1558,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1569,11 +1585,11 @@ /> </Configuration> <Configuration - Name="Debug|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1592,9 +1608,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1608,7 +1624,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1635,11 +1651,11 @@ /> </Configuration> <Configuration - Name="Release|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1658,9 +1674,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1674,7 +1690,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1701,11 +1717,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1724,9 +1740,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1740,7 +1756,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1767,11 +1783,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1790,9 +1806,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1806,7 +1822,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1833,11 +1849,12 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-common-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -1856,9 +1873,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1872,7 +1888,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1884,26 +1900,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Release-Static|Smartphone 2003 (ARMV4)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1922,9 +1930,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -1938,7 +1946,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -1965,11 +1973,11 @@ /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -1988,9 +1996,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2004,7 +2012,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2031,11 +2039,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2054,9 +2062,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2070,7 +2078,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2097,11 +2105,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2120,9 +2128,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2136,7 +2144,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2163,11 +2171,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2186,9 +2194,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2202,7 +2210,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2229,11 +2237,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2252,9 +2260,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2268,7 +2276,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2295,11 +2303,12 @@ /> </Configuration> <Configuration - Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Win32" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-win32-release-defaults.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" > <Tool Name="VCPreBuildEventTool" @@ -2318,9 +2327,8 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" - ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2334,7 +2342,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-$(PlatformName)-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2346,26 +2354,18 @@ Name="VCBscMakeTool" /> <Tool - Name="VCCodeSignTool" + Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> - <DeploymentTool - ForceDirty="-1" - RemoteDirectory="" - RegisterOutput="0" - AdditionalFiles="" - /> - <DebuggerTool - /> </Configuration> <Configuration - Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Standard SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2384,9 +2384,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2400,7 +2400,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6std-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2427,11 +2427,11 @@ /> </Configuration> <Configuration - Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 6 Professional SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm6-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2450,9 +2450,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2466,7 +2466,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm6pro-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2493,11 +2493,11 @@ /> </Configuration> <Configuration - Name="Debug-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Pocket PC 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2516,9 +2516,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2532,7 +2532,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2559,11 +2559,11 @@ /> </Configuration> <Configuration - Name="Release-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Smartphone 2003 (ARMV4)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm2003-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2582,9 +2582,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2598,7 +2598,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm2003sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2625,11 +2625,11 @@ /> </Configuration> <Configuration - Name="Debug-Dynamic|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-debug-dynamic-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-common-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" + Name="Release-Static|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2648,9 +2648,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2664,7 +2664,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5ppc-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2692,10 +2692,10 @@ </Configuration> <Configuration Name="Release-Static|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" - InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" - ATLMinimizesCRunTimeLibraryUsage="false" - CharacterSet="1" ConfigurationType="4" + InheritedPropertySheets="..\..\build\vs\pjproject-vs8-release-static-defaults.vsprops;..\..\build\vs\pjproject-vs8-wm5-release-defaults.vsprops" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="1" > <Tool Name="VCPreBuildEventTool" @@ -2714,9 +2714,9 @@ /> <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="_LIB;" ExecutionBucket="7" AdditionalIncludeDirectories="../include,../../pjlib-util/include,../../pjlib/include" + PreprocessorDefinitions="_LIB;" PrecompiledHeaderFile="" /> <Tool @@ -2730,7 +2730,7 @@ /> <Tool Name="VCLibrarianTool" - OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" + OutputFile="..\lib\pjsip-simple-$(TargetCPU)-wm5sp-vc$(VSVer)-$(ConfigurationName).lib" /> <Tool Name="VCALinkTool" @@ -2996,6 +2996,10 @@ /> </FileConfiguration> </File> + <File + RelativePath="..\src\pjsip-simple\mwi.c" + > + </File> <File RelativePath="..\src\pjsip-simple\pidf.c" > @@ -3311,6 +3315,10 @@ RelativePath="..\include\pjsip-simple\iscomposing.h" > </File> + <File + RelativePath="..\include\pjsip-simple\mwi.h" + > + </File> <File RelativePath="..\include\pjsip-simple\pidf.h" > diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/mwi.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/mwi.h new file mode 100644 index 0000000000000000000000000000000000000000..351bbbea4fed96cb272f7c376ed72c4adaaacd02 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/mwi.h @@ -0,0 +1,208 @@ +/* $Id: mwi.h 2968 2009-10-26 11:21:37Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __PJSIP_SIMPLE_MWI_H__ +#define __PJSIP_SIMPLE_MWI_H__ + +/** + * @file mwi.h + * @brief SIP Extension for MWI (RFC 3842) + */ +#include <pjsip-simple/evsub.h> +#include <pjsip/sip_msg.h> + + +PJ_BEGIN_DECL + + +/** + * @defgroup mwi SIP Message Summary and Message Waiting Indication (RFC 3842) + * @ingroup PJSIP_SIMPLE + * @brief Support for SIP MWI Extension (RFC 3842) + * @{ + * + * This module implements RFC 3842: A Message Summary and Message Waiting + * Indication Event Package for the Session Initiation Protocol (SIP). + * It uses the SIP Event Notification framework (evsub.h) and extends the + * framework by implementing "message-summary" event package. + */ + + +/** + * Initialize the MWI module and register it as endpoint module and + * package to the event subscription module. + * + * @param endpt The endpoint instance. + * @param mod_evsub The event subscription module instance. + * + * @return PJ_SUCCESS if the module is successfully + * initialized and registered to both endpoint + * and the event subscription module. + */ +PJ_DECL(pj_status_t) pjsip_mwi_init_module(pjsip_endpoint *endpt, + pjsip_module *mod_evsub); + +/** + * Get the MWI module instance. + * + * @return The MWI module instance. + */ +PJ_DECL(pjsip_module*) pjsip_mwi_instance(void); + +/** + * Create MWI client subscription session. + * + * @param dlg The underlying dialog to use. + * @param user_cb Pointer to callbacks to receive MWI subscription + * events. + * @param options Option flags. Currently only PJSIP_EVSUB_NO_EVENT_ID + * is recognized. + * @param p_evsub Pointer to receive the MWI subscription + * session. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_create_uac( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + unsigned options, + pjsip_evsub **p_evsub ); + +/** + * Create MWI server subscription session. + * + * @param dlg The underlying dialog to use. + * @param user_cb Pointer to callbacks to receive MWI subscription + * events. + * @param rdata The incoming SUBSCRIBE request that creates the event + * subscription. + * @param p_evsub Pointer to receive the MWI subscription + * session. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_create_uas( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + pjsip_rx_data *rdata, + pjsip_evsub **p_evsub ); + +/** + * Forcefully destroy the MWI subscription. This function should only + * be called on special condition, such as when the subscription + * initialization has failed. For other conditions, application MUST terminate + * the subscription by sending the appropriate un(SUBSCRIBE) or NOTIFY. + * + * @param sub The MWI subscription. + * @param notify Specify whether the state notification callback + * should be called. + * + * @return PJ_SUCCESS if subscription session has been destroyed. + */ +PJ_DECL(pj_status_t) pjsip_mwi_terminate( pjsip_evsub *sub, + pj_bool_t notify ); + +/** + * Call this function to create request to initiate MWI subscription, to + * refresh subcription, or to request subscription termination. + * + * @param sub Client subscription instance. + * @param expires Subscription expiration. If the value is set to zero, + * this will request unsubscription. + * @param p_tdata Pointer to receive the request. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_initiate( pjsip_evsub *sub, + pj_int32_t expires, + pjsip_tx_data **p_tdata); + +/** + * Accept the incoming subscription request by sending 2xx response to + * incoming SUBSCRIBE request. + * + * @param sub Server subscription instance. + * @param rdata The incoming subscription request message. + * @param st_code Status code, which MUST be final response. + * @param hdr_list Optional list of headers to be added in the response. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_accept( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int st_code, + const pjsip_hdr *hdr_list ); + +/** + * For notifier, create NOTIFY request to subscriber, and set the state + * of the subscription. + * + * @param sub The server subscription (notifier) instance. + * @param state New state to set. + * @param state_str The state string name, if state contains value other + * than active, pending, or terminated. Otherwise this + * argument is ignored. + * @param reason Specify reason if new state is terminated, otherwise + * put NULL. + * @param mime_type MIME type/content type of the message body. + * @param body Message body to be included in the NOTIFY request. + * @param p_tdata Pointer to receive the request. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_notify( pjsip_evsub *sub, + pjsip_evsub_state state, + const pj_str_t *state_str, + const pj_str_t *reason, + const pjsip_media_type *mime_type, + const pj_str_t *body, + pjsip_tx_data **p_tdata); + +/** + * Create NOTIFY request containing message body from the last NOITFY + * message created. + * + * @param sub Server subscription object. + * @param p_tdata Pointer to receive request. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_current_notify( pjsip_evsub *sub, + pjsip_tx_data **p_tdata ); + + +/** + * Send request message that was previously created with initiate(), notify(), + * or current_notify(). Application may also send request created with other + * functions, e.g. authentication. But the request MUST be either request + * that creates/refresh subscription or NOTIFY request. + * + * @param sub The subscription object. + * @param tdata Request message to be sent. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_mwi_send_request( pjsip_evsub *sub, + pjsip_tx_data *tdata ); + +/** + * @} + */ + +PJ_END_DECL + + +#endif /* __PJSIP_SIMPLE_MWI_H__ */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h index 23ab5e04828032f7e7d64f396dad49c98a0be2a1..36147c4b0f9f8a145d9972cf24625e769e320d46 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip-simple/publish.h @@ -1,4 +1,4 @@ -/* $Id: publish.h 2661 2009-04-28 22:19:49Z bennylp $ */ +/* $Id: publish.h 2940 2009-10-12 07:44:14Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -65,6 +65,25 @@ extern const pjsip_method pjsip_publish_method; typedef struct pjsip_publishc pjsip_publishc; +/** + * Client publication options. Application should initialize this structure + * with its default values by calling #pjsip_publishc_opt_default() + */ +typedef struct pjsip_publishc_opt +{ + /** + * Specify whether the client publication session should queue the + * PUBLISH request should there be another PUBLISH transaction still + * pending. If this is set to false, the client will return error + * on the PUBLISH request if there is another PUBLISH transaction still + * in progress. + * + * Default: PJSIP_PUBLISHC_QUEUE_REQUEST + */ + pj_bool_t queue_request; + +} pjsip_publishc_opt; + /** Structure to hold parameters when calling application's callback. * The application's callback is called when the client publication process @@ -88,6 +107,14 @@ struct pjsip_publishc_cbparam typedef void pjsip_publishc_cb(struct pjsip_publishc_cbparam *param); +/** + * Initialize client publication session option with default values. + * + * @param opt The option. + */ +PJ_DECL(void) pjsip_publishc_opt_default(pjsip_publishc_opt *opt); + + /** * Initialize client publication module. * @@ -98,12 +125,11 @@ typedef void pjsip_publishc_cb(struct pjsip_publishc_cbparam *param); PJ_DECL(pj_status_t) pjsip_publishc_init_module(pjsip_endpoint *endpt); - /** * Create client publication structure. * * @param endpt Endpoint, used to allocate pool from. - * @param options Option flags. + * @param opt Options, or NULL to specify default options. * @param token Opaque data to be associated with the client publication. * @param cb Pointer to callback function to receive publication status. * @param p_pubc Pointer to receive client publication structure. @@ -111,7 +137,7 @@ PJ_DECL(pj_status_t) pjsip_publishc_init_module(pjsip_endpoint *endpt); * @return PJ_SUCCESS on success. */ PJ_DECL(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt, - unsigned options, + const pjsip_publishc_opt *opt, void *token, pjsip_publishc_cb *cb, pjsip_publishc **p_pubc); @@ -269,10 +295,23 @@ PJ_DECL(pj_status_t) pjsip_publishc_update_expires(pjsip_publishc *pubc, * and application will be notified via the callback when the process * completes. * + * If the session has another PUBLISH request outstanding, the behavior + * depends on whether request queueing is enabled in the session (this was + * set by setting \a queue_request field of #pjsip_publishc_opt to true + * when calling #pjsip_publishc_create(). Default is true). If request + * queueing is enabled, the request will be queued and the function will + * return PJ_EPENDING. One the outstanding request is complete, the queued + * request will be sent automatically. If request queueing is disabled, the + * function will reject the request and return PJ_EBUSY. + * * @param pubc The client publication structure. * @param tdata Transmit data. * - * @return PJ_SUCCESS on success. + * @return - PJ_SUCCESS on success, or + * - PJ_EPENDING if request is queued, or + * - PJ_EBUSY if request is rejected because another PUBLISH + * request is in progress, or + * - other status code to indicate the error. */ PJ_DECL(pj_status_t) pjsip_publishc_send(pjsip_publishc *pubc, pjsip_tx_data *tdata); diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h deleted file mode 100644 index cf154f5ec0e6b07e4202816984acf53b5c69c5be..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* pjsip/include/pjsip/sip_autoconf.h. Generated from sip_autoconf.h.in by configure. */ -/* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __PJSIP_SIP_AUTOCONF_H__ -#define __PJSIP_SIP_AUTOCONF_H__ - -/** - * @file sip_autoconf.h - * @brief Describes operating system specifics (automatically detected by - * autoconf) - */ - -/** - * Enable/disable TLS transport, as configured by autoconf. - * But only do this if user doesn't explicitly configure in pj/config_site.h. - */ -#ifndef PJSIP_HAS_TLS_TRANSPORT -#define PJSIP_HAS_TLS_TRANSPORT 1 -#endif - - -#endif /* __PJSIP_SIP_AUTOCONF_H__ */ - diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in index cb753905e54ae072b4a0558ba531f35d9ef6ee43..2b9a6d0ca9055ac972c07c8adfce1d4072c7cef9 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_autoconf.h.in @@ -1,4 +1,4 @@ -/* $Id: sip_autoconf.h.in 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_autoconf.h.in 2973 2009-10-28 06:09:15Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -26,14 +26,14 @@ * autoconf) */ -/** +/* * Enable/disable TLS transport, as configured by autoconf. * But only do this if user doesn't explicitly configure in pj/config_site.h. */ -#ifndef PJSIP_HAS_TLS_TRANSPORT -#undef PJSIP_HAS_TLS_TRANSPORT -#endif - +/* Since 1.5, the default setting will follow PJ_HAS_SSL_SOCK setting. */ +//#ifndef PJSIP_HAS_TLS_TRANSPORT +//#undef PJSIP_HAS_TLS_TRANSPORT +//#endif #endif /* __PJSIP_SIP_AUTOCONF_H__ */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h index 0fa12a8be7705b196a1c1b1c612f512910f40504..0250fb8e96556a96a658e2596950444102aa70f0 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_config.h @@ -1,4 +1,4 @@ -/* $Id: sip_config.h 2859 2009-08-11 16:26:20Z nanang $ */ +/* $Id: sip_config.h 3019 2009-11-20 04:18:27Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -213,7 +213,7 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) * This mainly affects the size of mod_data array in various components. */ #ifndef PJSIP_MAX_MODULE -# define PJSIP_MAX_MODULE 16 +# define PJSIP_MAX_MODULE 32 #endif @@ -513,10 +513,10 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) * Enable TLS SIP transport support. For most systems this means that * OpenSSL must be installed. * - * Default: 0 (for now) + * Default: follow PJ_HAS_SSL_SOCK setting, which is 0 (disabled) by default. */ #ifndef PJSIP_HAS_TLS_TRANSPORT -# define PJSIP_HAS_TLS_TRANSPORT 0 +# define PJSIP_HAS_TLS_TRANSPORT PJ_HAS_SSL_SOCK #endif @@ -896,6 +896,20 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) #endif +/** + * Specify whether the client publication session should queue the + * PUBLISH request should there be another PUBLISH transaction still + * pending. If this is set to false, the client will return error + * on the PUBLISH request if there is another PUBLISH transaction still + * in progress. + * + * Default: 1 (yes) + */ +#ifndef PJSIP_PUBLISHC_QUEUE_REQUEST +# define PJSIP_PUBLISHC_QUEUE_REQUEST 1 +#endif + + PJ_END_DECL /** diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h index b1dc2c04c5345d1072d05ef6637393254b0fc565..51e970c0dac4d51c3d0ff460f5793c957a162f11 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_msg.h @@ -1,4 +1,4 @@ -/* $Id: sip_msg.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_msg.h 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -511,6 +511,18 @@ typedef struct pjsip_media_type pj_str_t param; /**< Media type parameters (concatenated). */ } pjsip_media_type; + +/** + * Copy SIP media type to another. + * + * @param pool Pool to duplicate strings. + * @param dst Destination structure. + * @param src Source structure. + */ +PJ_DECL(void) pjsip_media_type_cp(pj_pool_t *pool, + pjsip_media_type *dst, + const pjsip_media_type *src); + /** * @} */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h index 25d142fdbce829ff050be43cd368a4207c13881c..ed52cf670d65e13ec45a737354e2d86a227556ea 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport.h @@ -1,4 +1,4 @@ -/* $Id: sip_transport.h 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sip_transport.h 2985 2009-11-04 13:17:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -27,6 +27,7 @@ #include <pjsip/sip_msg.h> #include <pjsip/sip_parser.h> +#include <pjsip/sip_resolve.h> #include <pj/sock.h> #include <pj/list.h> #include <pj/ioqueue.h> @@ -384,9 +385,16 @@ struct pjsip_rx_data /** Content-length header. */ pjsip_clen_hdr *clen; - /** The first Require header. */ + /** "Require" header containing aggregates of all Require + * headers found in the message, or NULL. + */ pjsip_require_hdr *require; + /** "Supported" header containing aggregates of all Supported + * headers found in the message, or NULL. + */ + pjsip_supported_hdr *supported; + /** The list of error generated by the parser when parsing this message. */ @@ -522,6 +530,26 @@ struct pjsip_tx_data /** Callback to be called when this tx_data has been transmitted. */ void (*cb)(void*, pjsip_tx_data*, pj_ssize_t); + /** Destination information, to be used to determine the network address + * of the message. For a request, this information is initialized when + * the request is sent with #pjsip_endpt_send_request_stateless() and + * network address is resolved. For CANCEL request, this information + * will be copied from the original INVITE to make sure that the CANCEL + * request goes to the same physical network address as the INVITE + * request. + */ + struct + { + /** Server addresses resolved. + */ + pjsip_server_addresses addr; + + /** Current server address being tried. + */ + unsigned cur_addr; + + } dest_info; + /** Transport information, only valid during on_tx_request() and * on_tx_response() callback. */ diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h index 5fe5a52e100dd4354d1c05675a34714b6fe37b10..d2fc6536262cdc1696bd9fd3619a32becf1988fb 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tcp.h @@ -1,4 +1,4 @@ -/* $Id: sip_transport_tcp.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_transport_tcp.h 2966 2009-10-25 09:02:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -26,6 +26,7 @@ */ #include <pjsip/sip_transport.h> +#include <pj/sock_qos.h> /* Only declare the API if PJ_HAS_TCP is true */ @@ -43,6 +44,74 @@ PJ_BEGIN_DECL * the transport to the framework. */ +/** + * Settings to be specified when creating the TCP transport. Application + * should initialize this structure with its default values by calling + * pjsip_tcp_transport_cfg_default(). + */ +typedef struct pjsip_tcp_transport_cfg +{ + /** + * Address family to use. Valid values are pj_AF_INET() and + * pj_AF_INET6(). Default is pj_AF_INET(). + */ + int af; + + /** + * Optional address to bind the socket to. Default is to bind to + * PJ_INADDR_ANY and to any available port. + */ + pj_sockaddr bind_addr; + + /** + * Optional published address, which is the address to be + * advertised as the address of this SIP transport. + * By default the bound address will be used as the published address. + */ + pjsip_host_port addr_name; + + /** + * Number of simultaneous asynchronous accept() operations to be + * supported. It is recommended that the number here corresponds to + * the number of processors in the system (or the number of SIP + * worker threads). + * + * Default: 1 + */ + unsigned async_cnt; + + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default is QoS not set. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * Default is QoS not set. + */ + pj_qos_params qos_params; + +} pjsip_tcp_transport_cfg; + + +/** + * Initialize pjsip_tcp_transport_cfg structure with default values for + * the specifed address family. + * + * @param cfg The structure to initialize. + * @param af Address family to be used. + */ +PJ_DECL(void) pjsip_tcp_transport_cfg_default(pjsip_tcp_transport_cfg *cfg, + int af); + + /** * Register support for SIP TCP transport by creating TCP listener on * the specified address and port. This function will create an @@ -110,6 +179,24 @@ PJ_DECL(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, unsigned async_cnt, pjsip_tpfactory **p_factory); +/** + * Another variant of #pjsip_tcp_transport_start(). + * + * @param endpt The SIP endpoint. + * @param cfg TCP transport settings. Application should initialize + * this setting with #pjsip_tcp_transport_cfg_default(). + * @param p_factory Optional pointer to receive the instance of the + * SIP TCP transport factory just created. + * + * @return PJ_SUCCESS when the transport has been successfully + * started and registered to transport manager, or + * the appropriate error code. + */ +PJ_DECL(pj_status_t) pjsip_tcp_transport_start3( + pjsip_endpoint *endpt, + const pjsip_tcp_transport_cfg *cfg, + pjsip_tpfactory **p_factory + ); PJ_END_DECL diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h index 4c5d1b6a67c97235d093ed14f10a267fbed25826..a9210b43c37390f5a7f6a5d9e805376b3639e00b 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_transport_tls.h @@ -1,4 +1,4 @@ -/* $Id: sip_transport_tls.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_transport_tls.h 2998 2009-11-09 08:51:34Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -27,6 +27,7 @@ #include <pjsip/sip_transport.h> #include <pj/string.h> +#include <pj/sock_qos.h> PJ_BEGIN_DECL @@ -160,6 +161,33 @@ typedef struct pjsip_tls_setting */ pj_time_val timeout; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default value is PJ_QOS_TYPE_BEST_EFFORT. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * By default all settings in this structure are disabled. + */ + pj_qos_params qos_params; + + /** + * Specify if the transport should ignore any errors when setting the QoS + * traffic type/parameters. + * + * Default: PJ_TRUE + */ + pj_bool_t qos_ignore_error; + + } pjsip_tls_setting; @@ -171,6 +199,8 @@ typedef struct pjsip_tls_setting PJ_INLINE(void) pjsip_tls_setting_default(pjsip_tls_setting *tls_opt) { pj_memset(tls_opt, 0, sizeof(*tls_opt)); + tls_opt->qos_type = PJ_QOS_TYPE_BEST_EFFORT; + tls_opt->qos_ignore_error = PJ_TRUE; } @@ -193,6 +223,11 @@ PJ_INLINE(void) pjsip_tls_setting_copy(pj_pool_t *pool, pj_strdup_with_null(pool, &dst->ciphers, &src->ciphers); } +PJ_DEF(pj_status_t) pjsip_tls_listener_update_settings(pjsip_endpoint *endpt, + pj_pool_t *pool, + pjsip_tpmgr *mgr, + pjsip_tpfactory *factory, + const pjsip_tls_setting *opt); /** * Register support for SIP TLS transport by creating TLS listener on diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h index da8efa55c7fbc152b1ba7e2b9cad884bdc760b73..43a9cab21394d7d97e8671e16bced6350066ccb5 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip/sip_util.h @@ -1,4 +1,4 @@ -/* $Id: sip_util.h 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: sip_util.h 2932 2009-10-09 12:11:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -451,14 +451,6 @@ typedef struct pjsip_send_state */ pjsip_tx_data *tdata; - /** Server addresses resolved. - */ - pjsip_server_addresses addr; - - /** Current server address being tried. - */ - unsigned cur_addr; - /** Current transport being used. */ pjsip_transport *cur_transport; diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h b/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h index f1f925f322f08a465ed43a034be06675d3af6604..f9fb8643b9c6cc646d5a56d05213a25cdd6e7887 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsip_simple.h @@ -1,4 +1,4 @@ -/* $Id: pjsip_simple.h 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: pjsip_simple.h 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -35,7 +35,9 @@ #define __PJSIP_SIMPLE_H__ #include <pjsip-simple/evsub.h> +#include <pjsip-simple/evsub_msg.h> #include <pjsip-simple/iscomposing.h> +#include <pjsip-simple/mwi.h> #include <pjsip-simple/presence.h> #include <pjsip-simple/pidf.h> #include <pjsip-simple/publish.h> diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h index cb8125bf0a62a6ab054d52d9a37748639b262e7f..6821f60aa8a54f579a73ace990aca27753f53500 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua.h @@ -1,4 +1,4 @@ -/* $Id: pjsua.h 2864 2009-08-12 11:03:23Z bennylp $ */ +/* $Id: pjsua.h 3021 2009-11-20 23:33:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -378,6 +378,17 @@ PJ_DECL(void) pjsua_logging_config_dup(pj_pool_t *pool, const pjsua_logging_config *src); +/** + * Structure to be passed on MWI callback. + */ +typedef struct pjsua_mwi_info +{ + pjsip_evsub *evsub; /**< Event subscription session, for + reference. */ + pjsip_rx_data *rdata; /**< The received NOTIFY request. */ +} pjsua_mwi_info; + + /** * This structure describes application callback to receive various event * notification from PJSUA-API. All of these callbacks are OPTIONAL, @@ -821,6 +832,17 @@ typedef struct pjsua_callback const pjsip_uri *target, const pjsip_event *e); + /** + * This callback is called when a NOTIFY request for message summary / + * message waiting indication is received. + * + * @param acc_id The account ID. + * @param mwi_info Structure containing details of the event, + * including the received NOTIFY request in the + * \a rdata field. + */ + void (*on_mwi_info)(pjsua_acc_id acc_id, pjsua_mwi_info *mwi_info); + } pjsua_callback; @@ -979,6 +1001,21 @@ typedef struct pjsua_config */ pj_bool_t require_timer; + /** + * Handle unsolicited NOTIFY requests containing message waiting + * indication (MWI) info. Unsolicited MWI is incoming NOTIFY requests + * which are not requested by client with SUBSCRIBE request. + * + * If this is enabled, the library will respond 200/OK to the NOTIFY + * request and forward the request to \a on_mwi_info() callback. + * + * See also \a mwi_enabled field #on pjsua_acc_config. + * + * Default: PJ_TRUE + * + */ + pj_bool_t enable_unsolicited_mwi; + /** * Specify Session Timer settings, see #pjsip_timer_setting. * Note that this setting can be further customized in account @@ -1396,6 +1433,32 @@ PJ_DECL(pj_status_t) pjsua_cancel_stun_resolution(void *token, PJ_DECL(pj_status_t) pjsua_verify_sip_url(const char *url); +/** + * Schedule a timer entry. Note that the timer callback may be executed + * by different thread, depending on whether worker thread is enabled or + * not. + * + * @param entry Timer heap entry. + * @param delay The interval to expire. + * + * @return PJ_SUCCESS on success, or the appropriate error code. + * + * @see pjsip_endpt_schedule_timer() + */ +PJ_DECL(pj_status_t) pjsua_schedule_timer(pj_timer_entry *entry, + const pj_time_val *delay); + + +/** + * Cancel the previously scheduled timer. + * + * @param entry Timer heap entry. + * + * @see pjsip_endpt_cancel_timer() + */ +PJ_DECL(void) pjsua_cancel_timer(pj_timer_entry *entry); + + /** * This is a utility function to display error message for the specified * error code. The error message will be sent to the log. @@ -1491,6 +1554,24 @@ typedef struct pjsua_transport_config */ pjsip_tls_setting tls_setting; + /** + * QoS traffic type to be set on this transport. When application wants + * to apply QoS tagging to the transport, it's preferable to set this + * field rather than \a qos_param fields since this is more portable. + * + * Default is QoS not set. + */ + pj_qos_type qos_type; + + /** + * Set the low level QoS parameters to the transport. This is a lower + * level operation than setting the \a qos_type field and may not be + * supported on all platforms. + * + * Default is QoS not set. + */ + pj_qos_params qos_params; + } pjsua_transport_config; @@ -1724,6 +1805,17 @@ PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, #endif +/** + * Default maximum time to wait for account unregistration transactions to + * complete during library shutdown sequence. + * + * Default: 4000 (4 seconds) + */ +#ifndef PJSUA_UNREG_TIMEOUT +# define PJSUA_UNREG_TIMEOUT 4000 +#endif + + /** * Default PUBLISH expiration */ @@ -1750,6 +1842,22 @@ PJ_DECL(pj_status_t) pjsua_transport_close( pjsua_transport_id id, #endif +/** + * Maximum time to wait for unpublication transaction(s) to complete + * during shutdown process, before sending unregistration. The library + * tries to wait for the unpublication (un-PUBLISH) to complete before + * sending REGISTER request to unregister the account, during library + * shutdown process. If the value is set too short, it is possible that + * the unregistration is sent before unpublication completes, causing + * unpublication request to fail. + * + * Default: 2000 (2 seconds) + */ +#ifndef PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC +# define PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC 2000 +#endif + + /** * This structure describes account configuration to be specified when * adding a new account with #pjsua_acc_add(). Application MUST initialize @@ -1788,6 +1896,15 @@ typedef struct pjsua_acc_config */ pj_str_t reg_uri; + /** + * Subscribe to message waiting indication events (RFC 3842). + * + * See also \a enable_unsolicited_mwi field on #pjsua_config. + * + * Default: no + */ + pj_bool_t mwi_enabled; + /** * If this flag is set, the presence information of this account will * be PUBLISH-ed to the server where the account belongs. @@ -1796,6 +1913,24 @@ typedef struct pjsua_acc_config */ pj_bool_t publish_enabled; + /** + * Event publication options. + */ + pjsip_publishc_opt publish_opt; + + /** + * Maximum time to wait for unpublication transaction(s) to complete + * during shutdown process, before sending unregistration. The library + * tries to wait for the unpublication (un-PUBLISH) to complete before + * sending REGISTER request to unregister the account, during library + * shutdown process. If the value is set too short, it is possible that + * the unregistration is sent before unpublication completes, causing + * unpublication request to fail. + * + * Default: PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC + */ + unsigned unpublish_max_wait_time_msec; + /** * Authentication preference. */ @@ -1885,6 +2020,14 @@ typedef struct pjsua_acc_config */ unsigned reg_timeout; + /** + * Specify the maximum time to wait for unregistration requests to + * complete during library shutdown sequence. + * + * Default: PJSUA_UNREG_TIMEOUT + */ + unsigned unreg_timeout; + /** * Number of credentials in the credential array. */ @@ -2958,9 +3101,12 @@ PJ_DECL(pj_status_t) pjsua_call_dump(pjsua_call_id call_id, /** - * This specifies how long the library should retry resending SUBSCRIBE - * if the previous SUBSCRIBE failed. This also controls the duration - * before failed PUBLISH request will be retried. + * This specifies how long the library should wait before retrying failed + * SUBSCRIBE request, and there is no rule to automatically resubscribe + * (for example, no "retry-after" parameter in Subscription-State header). + * + * This also controls the duration before failed PUBLISH request will be + * retried. * * Default: 300 seconds */ @@ -3075,7 +3221,16 @@ typedef struct pjsua_buddy_info const char *sub_state_name; /** - * Specifies the last presence subscription terminatino reason. If + * Specifies the last presence subscription termination code. This would + * return the last status of the SUBSCRIBE request. If the subscription + * is terminated with NOTIFY by the server, this value will be set to + * 200, and subscription termination reason will be given in the + * \a sub_term_reason field. + */ + unsigned sub_term_code; + + /** + * Specifies the last presence subscription termination reason. If * presence subscription is currently active, the value will be empty. */ pj_str_t sub_term_reason; diff --git a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h index e5c82e3e3faa496b6b6202dde1638cc8f4370d1e..86e8815cba4d5dc5ab2951377f51c5e7694bcfd8 100644 --- a/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h +++ b/sflphone-common/libs/pjproject/pjsip/include/pjsua-lib/pjsua_internal.h @@ -1,4 +1,4 @@ -/* $Id: pjsua_internal.h 2874 2009-08-13 15:55:47Z bennylp $ */ +/* $Id: pjsua_internal.h 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -82,6 +82,9 @@ typedef struct pjsua_call pjmedia_transport *med_orig; /**< Original media transport */ pj_bool_t med_tp_auto_del; /**< May delete media transport */ pjsua_med_tp_st med_tp_st; /**< Media transport state */ + pj_sockaddr med_rtp_addr; /**< Current RTP source address + (used to update ICE default + address) */ pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */ pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */ @@ -141,6 +144,8 @@ typedef struct pjsua_acc pjsip_publishc *publish_sess; /**< Client publication session. */ pj_bool_t publish_state; /**< Last published online status */ + pjsip_evsub *mwi_sub; /**< MWI client subscription */ + pjsip_dialog *mwi_dlg; /**< Dialog for MWI sub. */ } pjsua_acc; @@ -182,9 +187,10 @@ typedef struct pjsua_buddy pj_bool_t monitor; /**< Should we monitor? */ pjsip_dialog *dlg; /**< The underlying dialog. */ pjsip_evsub *sub; /**< Buddy presence subscription */ + unsigned term_code; /**< Subscription termination code */ pj_str_t term_reason;/**< Subscription termination reason */ pjsip_pres_status status; /**< Buddy presence status. */ - + pj_timer_entry timer; /**< Resubscription timer */ } pjsua_buddy; @@ -447,6 +453,11 @@ void pjsua_pres_delete_acc(int acc_id); */ pj_status_t pjsua_im_init(void); +/** + * Start MWI subscription + */ +void pjsua_start_mwi(pjsua_acc *acc); + /** * Init call subsystem. */ diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/mwi.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/mwi.c new file mode 100644 index 0000000000000000000000000000000000000000..c8ae4645fcf96d228aee1d67d075428b4d41f5d5 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/mwi.c @@ -0,0 +1,599 @@ +/* $Id: mwi.c 2968 2009-10-26 11:21:37Z bennylp $ */ +/* + * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include <pjsip-simple/mwi.h> +#include <pjsip-simple/errno.h> +#include <pjsip-simple/evsub_msg.h> +#include <pjsip/sip_module.h> +#include <pjsip/sip_endpoint.h> +#include <pjsip/sip_dialog.h> +#include <pj/assert.h> +#include <pj/guid.h> +#include <pj/log.h> +#include <pj/os.h> +#include <pj/pool.h> +#include <pj/string.h> + + +#define THIS_FILE "mwi.c" +#define MWI_DEFAULT_EXPIRES 3600 + + /* + * MWI module (mod-mdi) + */ +static struct pjsip_module mod_mwi = +{ + NULL, NULL, /* prev, next. */ + { "mod-mwi", 7 }, /* Name. */ + -1, /* Id */ + PJSIP_MOD_PRIORITY_DIALOG_USAGE,/* Priority */ + NULL, /* load() */ + NULL, /* start() */ + NULL, /* stop() */ + NULL, /* unload() */ + NULL, /* on_rx_request() */ + NULL, /* on_rx_response() */ + NULL, /* on_tx_request. */ + NULL, /* on_tx_response() */ + NULL, /* on_tsx_state() */ +}; + + +/* + * This structure describe an mwi agent (both client and server) + */ +typedef struct pjsip_mwi +{ + pjsip_evsub *sub; /**< Event subscribtion record. */ + pjsip_dialog *dlg; /**< The dialog. */ + pjsip_evsub_user user_cb; /**< The user callback. */ + + /* These are for server subscriptions */ + pj_pool_t *body_pool; /**< Pool to save message body */ + pjsip_media_type mime_type; /**< MIME type of last msg body */ + pj_str_t body; /**< Last sent message body */ +} pjsip_mwi; + + +/* + * Forward decl for evsub callbacks. + */ +static void mwi_on_evsub_state( pjsip_evsub *sub, pjsip_event *event); +static void mwi_on_evsub_tsx_state( pjsip_evsub *sub, pjsip_transaction *tsx, + pjsip_event *event); +static void mwi_on_evsub_rx_refresh( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body); +static void mwi_on_evsub_rx_notify( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body); +static void mwi_on_evsub_client_refresh(pjsip_evsub *sub); +static void mwi_on_evsub_server_timeout(pjsip_evsub *sub); + + +/* + * Event subscription callback for mwi. + */ +static pjsip_evsub_user mwi_user = +{ + &mwi_on_evsub_state, + &mwi_on_evsub_tsx_state, + &mwi_on_evsub_rx_refresh, + &mwi_on_evsub_rx_notify, + &mwi_on_evsub_client_refresh, + &mwi_on_evsub_server_timeout, +}; + + +/* + * Some static constants. + */ +static const pj_str_t STR_EVENT = { "Event", 5 }; +static const pj_str_t STR_MWI = { "message-summary", 15 }; +static const pj_str_t STR_APP_SIMPLE_SMS = { "application/simple-message-summary", 34}; + +/* + * Init mwi module. + */ +PJ_DEF(pj_status_t) pjsip_mwi_init_module( pjsip_endpoint *endpt, + pjsip_module *mod_evsub) +{ + pj_status_t status; + pj_str_t accept[1]; + + /* Check arguments. */ + PJ_ASSERT_RETURN(endpt && mod_evsub, PJ_EINVAL); + + /* Must have not been registered */ + PJ_ASSERT_RETURN(mod_mwi.id == -1, PJ_EINVALIDOP); + + /* Register to endpoint */ + status = pjsip_endpt_register_module(endpt, &mod_mwi); + if (status != PJ_SUCCESS) + return status; + + accept[0] = STR_APP_SIMPLE_SMS; + + /* Register event package to event module. */ + status = pjsip_evsub_register_pkg( &mod_mwi, &STR_MWI, + MWI_DEFAULT_EXPIRES, + PJ_ARRAY_SIZE(accept), accept); + if (status != PJ_SUCCESS) { + pjsip_endpt_unregister_module(endpt, &mod_mwi); + return status; + } + + return PJ_SUCCESS; +} + + +/* + * Get mwi module instance. + */ +PJ_DEF(pjsip_module*) pjsip_mwi_instance(void) +{ + return &mod_mwi; +} + + +/* + * Create client subscription. + */ +PJ_DEF(pj_status_t) pjsip_mwi_create_uac( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + unsigned options, + pjsip_evsub **p_evsub ) +{ + pj_status_t status; + pjsip_mwi *mwi; + pjsip_evsub *sub; + + PJ_ASSERT_RETURN(dlg && p_evsub, PJ_EINVAL); + + PJ_UNUSED_ARG(options); + + pjsip_dlg_inc_lock(dlg); + + /* Create event subscription */ + status = pjsip_evsub_create_uac( dlg, &mwi_user, &STR_MWI, + options, &sub); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create mwi */ + mwi = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_mwi); + mwi->dlg = dlg; + mwi->sub = sub; + if (user_cb) + pj_memcpy(&mwi->user_cb, user_cb, sizeof(pjsip_evsub_user)); + + /* Attach to evsub */ + pjsip_evsub_set_mod_data(sub, mod_mwi.id, mwi); + + *p_evsub = sub; + +on_return: + pjsip_dlg_dec_lock(dlg); + return status; +} + + +/* + * Create server subscription. + */ +PJ_DEF(pj_status_t) pjsip_mwi_create_uas( pjsip_dialog *dlg, + const pjsip_evsub_user *user_cb, + pjsip_rx_data *rdata, + pjsip_evsub **p_evsub ) +{ + pjsip_accept_hdr *accept; + pjsip_event_hdr *event; + pjsip_evsub *sub; + pjsip_mwi *mwi; + char obj_name[PJ_MAX_OBJ_NAME]; + pj_status_t status; + + /* Check arguments */ + PJ_ASSERT_RETURN(dlg && rdata && p_evsub, PJ_EINVAL); + + /* Must be request message */ + PJ_ASSERT_RETURN(rdata->msg_info.msg->type == PJSIP_REQUEST_MSG, + PJSIP_ENOTREQUESTMSG); + + /* Check that request is SUBSCRIBE */ + PJ_ASSERT_RETURN(pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, + &pjsip_subscribe_method)==0, + PJSIP_SIMPLE_ENOTSUBSCRIBE); + + /* Check that Event header contains "mwi" */ + event = (pjsip_event_hdr*) + pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &STR_EVENT, NULL); + if (!event) { + return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST); + } + if (pj_stricmp(&event->event_type, &STR_MWI) != 0) { + return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_EVENT); + } + + /* Check that request contains compatible Accept header. */ + accept = (pjsip_accept_hdr*) + pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_ACCEPT, NULL); + if (accept) { + unsigned i; + for (i=0; i<accept->count; ++i) { + if (pj_stricmp(&accept->values[i], &STR_APP_SIMPLE_SMS)==0) { + break; + } + } + + if (i==accept->count) { + /* Nothing is acceptable */ + return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE); + } + + } else { + /* No Accept header. + * Assume client supports "application/simple-message-summary" + */ + } + + /* Lock dialog */ + pjsip_dlg_inc_lock(dlg); + + + /* Create server subscription */ + status = pjsip_evsub_create_uas( dlg, &mwi_user, rdata, 0, &sub); + if (status != PJ_SUCCESS) + goto on_return; + + /* Create server mwi subscription */ + mwi = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_mwi); + mwi->dlg = dlg; + mwi->sub = sub; + if (user_cb) + pj_memcpy(&mwi->user_cb, user_cb, sizeof(pjsip_evsub_user)); + + pj_ansi_snprintf(obj_name, PJ_MAX_OBJ_NAME, "mwibd%p", dlg->pool); + mwi->body_pool = pj_pool_create(dlg->pool->factory, obj_name, + 512, 512, NULL); + + /* Attach to evsub */ + pjsip_evsub_set_mod_data(sub, mod_mwi.id, mwi); + + /* Done: */ + *p_evsub = sub; + +on_return: + pjsip_dlg_dec_lock(dlg); + return status; +} + + +/* + * Forcefully terminate mwi. + */ +PJ_DEF(pj_status_t) pjsip_mwi_terminate( pjsip_evsub *sub, + pj_bool_t notify ) +{ + return pjsip_evsub_terminate(sub, notify); +} + +/* + * Create SUBSCRIBE + */ +PJ_DEF(pj_status_t) pjsip_mwi_initiate( pjsip_evsub *sub, + pj_int32_t expires, + pjsip_tx_data **p_tdata) +{ + return pjsip_evsub_initiate(sub, &pjsip_subscribe_method, expires, + p_tdata); +} + + +/* + * Accept incoming subscription. + */ +PJ_DEF(pj_status_t) pjsip_mwi_accept( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int st_code, + const pjsip_hdr *hdr_list ) +{ + return pjsip_evsub_accept( sub, rdata, st_code, hdr_list ); +} + +/* + * Create message body and attach it to the (NOTIFY) request. + */ +static pj_status_t mwi_create_msg_body( pjsip_mwi *mwi, + pjsip_tx_data *tdata) +{ + pjsip_msg_body *body; + pj_str_t dup_text; + + PJ_ASSERT_RETURN(mwi->mime_type.type.slen && mwi->body.slen, PJ_EINVALIDOP); + + /* Clone the message body and mime type */ + pj_strdup(tdata->pool, &dup_text, &mwi->body); + + /* Create the message body */ + body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body); + pjsip_media_type_cp(tdata->pool, &body->content_type, &mwi->mime_type); + body->data = dup_text.ptr; + body->len = (unsigned)dup_text.slen; + body->print_body = &pjsip_print_text_body; + body->clone_data = &pjsip_clone_text_data; + + /* Attach to tdata */ + tdata->msg->body = body; + + return PJ_SUCCESS; +} + + +/* + * Create NOTIFY + */ +PJ_DEF(pj_status_t) pjsip_mwi_notify( pjsip_evsub *sub, + pjsip_evsub_state state, + const pj_str_t *state_str, + const pj_str_t *reason, + const pjsip_media_type *mime_type, + const pj_str_t *body, + pjsip_tx_data **p_tdata) +{ + pjsip_mwi *mwi; + pjsip_tx_data *tdata; + pj_status_t status; + + /* Check arguments. */ + PJ_ASSERT_RETURN(sub && mime_type && body && p_tdata, PJ_EINVAL); + + /* Get the mwi object. */ + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_RETURN(mwi != NULL, PJ_EINVALIDOP); + + /* Lock object. */ + pjsip_dlg_inc_lock(mwi->dlg); + + /* Create the NOTIFY request. */ + status = pjsip_evsub_notify( sub, state, state_str, reason, &tdata); + if (status != PJ_SUCCESS) + goto on_return; + + /* Update the cached message body */ + if (mime_type || body) + pj_pool_reset(mwi->body_pool); + if (mime_type) + pjsip_media_type_cp(mwi->body_pool, &mwi->mime_type, mime_type); + if (body) + pj_strdup(mwi->body_pool, &mwi->body, body); + + /* Create message body */ + status = mwi_create_msg_body( mwi, tdata ); + if (status != PJ_SUCCESS) + goto on_return; + + /* Done. */ + *p_tdata = tdata; + +on_return: + pjsip_dlg_dec_lock(mwi->dlg); + return status; +} + + +/* + * Create NOTIFY that reflect current state. + */ +PJ_DEF(pj_status_t) pjsip_mwi_current_notify( pjsip_evsub *sub, + pjsip_tx_data **p_tdata ) +{ + pjsip_mwi *mwi; + pjsip_tx_data *tdata; + pj_status_t status; + + /* Check arguments. */ + PJ_ASSERT_RETURN(sub && p_tdata, PJ_EINVAL); + + /* Get the mwi object. */ + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_RETURN(mwi != NULL, PJ_EINVALIDOP); + + /* Lock object. */ + pjsip_dlg_inc_lock(mwi->dlg); + + /* Create the NOTIFY request. */ + status = pjsip_evsub_current_notify( sub, &tdata); + if (status != PJ_SUCCESS) + goto on_return; + + + /* Create message body to reflect the mwi status. */ + status = mwi_create_msg_body( mwi, tdata ); + if (status != PJ_SUCCESS) + goto on_return; + + /* Done. */ + *p_tdata = tdata; + +on_return: + pjsip_dlg_dec_lock(mwi->dlg); + return status; +} + + +/* + * Send request. + */ +PJ_DEF(pj_status_t) pjsip_mwi_send_request( pjsip_evsub *sub, + pjsip_tx_data *tdata ) +{ + return pjsip_evsub_send_request(sub, tdata); +} + +/* + * This callback is called by event subscription when subscription + * state has changed. + */ +static void mwi_on_evsub_state( pjsip_evsub *sub, pjsip_event *event) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_evsub_state) + (*mwi->user_cb.on_evsub_state)(sub, event); + + if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { + if (mwi->body_pool) { + pj_pool_release(mwi->body_pool); + mwi->body_pool = NULL; + } + } +} + +/* + * Called when transaction state has changed. + */ +static void mwi_on_evsub_tsx_state( pjsip_evsub *sub, pjsip_transaction *tsx, + pjsip_event *event) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_tsx_state) + (*mwi->user_cb.on_tsx_state)(sub, tsx, event); +} + + +/* + * Called when SUBSCRIBE is received. + */ +static void mwi_on_evsub_rx_refresh( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_rx_refresh) { + (*mwi->user_cb.on_rx_refresh)(sub, rdata, p_st_code, p_st_text, + res_hdr, p_body); + + } else { + /* Implementors MUST send NOTIFY if it implements on_rx_refresh */ + pjsip_tx_data *tdata; + pj_str_t timeout = { "timeout", 7}; + pj_status_t status; + + if (pjsip_evsub_get_state(sub)==PJSIP_EVSUB_STATE_TERMINATED) { + status = pjsip_mwi_notify( sub, PJSIP_EVSUB_STATE_TERMINATED, + NULL, &timeout, NULL, NULL, &tdata); + } else { + status = pjsip_mwi_current_notify(sub, &tdata); + } + + if (status == PJ_SUCCESS) + pjsip_mwi_send_request(sub, tdata); + } +} + + +/* + * Called when NOTIFY is received. + */ +static void mwi_on_evsub_rx_notify( pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + /* Just notify application. */ + if (mwi->user_cb.on_rx_notify) { + (*mwi->user_cb.on_rx_notify)(sub, rdata, p_st_code, p_st_text, + res_hdr, p_body); + } +} + +/* + * Called when it's time to send SUBSCRIBE. + */ +static void mwi_on_evsub_client_refresh(pjsip_evsub *sub) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_client_refresh) { + (*mwi->user_cb.on_client_refresh)(sub); + } else { + pj_status_t status; + pjsip_tx_data *tdata; + + status = pjsip_mwi_initiate(sub, -1, &tdata); + if (status == PJ_SUCCESS) + pjsip_mwi_send_request(sub, tdata); + } +} + +/* + * Called when no refresh is received after the interval. + */ +static void mwi_on_evsub_server_timeout(pjsip_evsub *sub) +{ + pjsip_mwi *mwi; + + mwi = (pjsip_mwi*) pjsip_evsub_get_mod_data(sub, mod_mwi.id); + PJ_ASSERT_ON_FAIL(mwi!=NULL, {return;}); + + if (mwi->user_cb.on_server_timeout) { + (*mwi->user_cb.on_server_timeout)(sub); + } else { + pj_status_t status; + pjsip_tx_data *tdata; + pj_str_t reason = { "timeout", 7 }; + + status = pjsip_mwi_notify(sub, PJSIP_EVSUB_STATE_TERMINATED, + NULL, &reason, NULL, NULL, &tdata); + if (status == PJ_SUCCESS) + pjsip_mwi_send_request(sub, tdata); + } +} + diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c index fe245bd4ead525a3ef63d55f8c101230289414e2..a6069594b468d07aca398cc68ec38d4354a8b9d7 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/presence_body.c @@ -1,4 +1,4 @@ -/* $Id: presence_body.c 2877 2009-08-13 16:17:51Z bennylp $ */ +/* $Id: presence_body.c 3045 2010-01-05 15:23:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -124,7 +124,7 @@ PJ_DEF(pj_status_t) pjsip_pres_create_pidf( pj_pool_t *pool, tslen = pj_ansi_snprintf(buf, sizeof(buf), "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", - pt.year, pt.mon, pt.day, + pt.year, pt.mon+1, pt.day, pt.hour, pt.min, pt.sec, pt.msec); if (tslen > 0 && tslen < sizeof(buf)) { pj_str_t time = pj_str(buf); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c index 4dcb0f5027c858d9c62d935dca85a6cd3b0db2cf..d4a7f8271e4e9c3fe60761a439b3c56c768d639a 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/publishc.c @@ -1,4 +1,4 @@ -/* $Id: publishc.c 2754 2009-06-05 16:10:36Z bennylp $ */ +/* $Id: publishc.c 2940 2009-10-12 07:44:14Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -56,6 +56,15 @@ const pjsip_method pjsip_publish_method = }; +/** + * Pending request list. + */ +typedef struct pending_publish +{ + PJ_DECL_LIST_MEMBER(pjsip_tx_data); +} pending_publish; + + /** * SIP client publication structure. */ @@ -65,7 +74,9 @@ struct pjsip_publishc pjsip_endpoint *endpt; pj_bool_t _delete_flag; int pending_tsx; + pj_mutex_t *mutex; + pjsip_publishc_opt opt; void *token; pjsip_publishc_cb *cb; @@ -91,9 +102,18 @@ struct pjsip_publishc pj_time_val last_refresh; pj_time_val next_refresh; pj_timer_entry timer; + + /* Pending PUBLISH request */ + pending_publish pending_reqs; }; +PJ_DEF(void) pjsip_publishc_opt_default(pjsip_publishc_opt *opt) +{ + pj_bzero(opt, sizeof(*opt)); + opt->queue_request = PJSIP_PUBLISHC_QUEUE_REQUEST; +} + /* * Initialize client publication module. @@ -127,20 +147,18 @@ PJ_DEF(pj_status_t) pjsip_publishc_init_module(pjsip_endpoint *endpt) PJ_DEF(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt, - unsigned options, + const pjsip_publishc_opt *opt, void *token, pjsip_publishc_cb *cb, pjsip_publishc **p_pubc) { pj_pool_t *pool; pjsip_publishc *pubc; + pjsip_publishc_opt default_opt; pj_status_t status; /* Verify arguments. */ PJ_ASSERT_RETURN(endpt && cb && p_pubc, PJ_EINVAL); - PJ_ASSERT_RETURN(options == 0, PJ_EINVAL); - - PJ_UNUSED_ARG(options); pool = pjsip_endpt_create_pool(endpt, "pubc%p", 1024, 1024); PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); @@ -153,9 +171,25 @@ PJ_DEF(pj_status_t) pjsip_publishc_create( pjsip_endpoint *endpt, pubc->cb = cb; pubc->expires = PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED; + if (!opt) { + pjsip_publishc_opt_default(&default_opt); + opt = &default_opt; + } + pj_memcpy(&pubc->opt, opt, sizeof(*opt)); + pj_list_init(&pubc->pending_reqs); + + status = pj_mutex_create_recursive(pubc->pool, "pubc%p", &pubc->mutex); + if (status != PJ_SUCCESS) { + pj_pool_release(pool); + return status; + } + status = pjsip_auth_clt_init(&pubc->auth_sess, endpt, pubc->pool, 0); - if (status != PJ_SUCCESS) + if (status != PJ_SUCCESS) { + pj_mutex_destroy(pubc->mutex); + pj_pool_release(pool); return status; + } pj_list_init(&pubc->route_set); pj_list_init(&pubc->usr_hdr); @@ -174,6 +208,14 @@ PJ_DEF(pj_status_t) pjsip_publishc_destroy(pjsip_publishc *pubc) pubc->_delete_flag = 1; pubc->cb = NULL; } else { + /* Cancel existing timer, if any */ + if (pubc->timer.id != 0) { + pjsip_endpt_cancel_timer(pubc->endpt, &pubc->timer); + pubc->timer.id = 0; + } + + if (pubc->mutex) + pj_mutex_destroy(pubc->mutex); pjsip_endpt_release_pool(pubc->endpt, pubc->pool); } @@ -570,6 +612,12 @@ static void tsx_callback(void *token, pjsip_event *event) if (pubc->auto_refresh && expiration!=0 && expiration!=0xFFFF) { pj_time_val delay = { 0, 0}; + /* Cancel existing timer, if any */ + if (pubc->timer.id != 0) { + pjsip_endpt_cancel_timer(pubc->endpt, &pubc->timer); + pubc->timer.id = 0; + } + delay.sec = expiration - DELAY_BEFORE_REFRESH; if (pubc->expires != PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED && delay.sec > (pj_int32_t)pubc->expires) @@ -607,6 +655,22 @@ static void tsx_callback(void *token, pjsip_event *event) rdata, expiration); --pubc->pending_tsx; + + /* If we have pending request(s), send them now */ + pj_mutex_lock(pubc->mutex); + while (!pj_list_empty(&pubc->pending_reqs)) { + pjsip_tx_data *tdata = pubc->pending_reqs.next; + pj_list_erase(tdata); + status = pjsip_publishc_send(pubc, tdata); + if (status == PJ_EPENDING) { + pj_assert(!"Not expected"); + pj_list_erase(tdata); + pjsip_tx_data_dec_ref(tdata); + } else if (status == PJ_SUCCESS) { + break; + } + } + pj_mutex_unlock(pubc->mutex); } /* Delete the record if user destroy pubc during the callback. */ @@ -623,13 +687,26 @@ PJ_DEF(pj_status_t) pjsip_publishc_send(pjsip_publishc *pubc, pjsip_cseq_hdr *cseq_hdr; pj_uint32_t cseq; + PJ_ASSERT_RETURN(pubc && tdata, PJ_EINVAL); + /* Make sure we don't have pending transaction. */ + pj_mutex_lock(pubc->mutex); if (pubc->pending_tsx) { - PJ_LOG(4,(THIS_FILE, "Unable to send request, pubc has another " - "transaction pending")); - pjsip_tx_data_dec_ref( tdata ); - return PJSIP_EBUSY; + if (pubc->opt.queue_request) { + pj_list_push_back(&pubc->pending_reqs, tdata); + pj_mutex_unlock(pubc->mutex); + PJ_LOG(4,(THIS_FILE, "Request is queued, pubc has another " + "transaction pending")); + return PJ_EPENDING; + } else { + pjsip_tx_data_dec_ref(tdata); + pj_mutex_unlock(pubc->mutex); + PJ_LOG(4,(THIS_FILE, "Unable to send request, pubc has another " + "transaction pending")); + return PJ_EBUSY; + } } + pj_mutex_unlock(pubc->mutex); /* Invalidate message buffer. */ pjsip_tx_data_invalidate_msg(tdata); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c index 615d3915a3b3b3cd35211224208c24d00c03df1e..0ec9d260b5f542ea301274327c2c2076ceeae3b6 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-simple/rpid.c @@ -1,4 +1,4 @@ -/* $Id: rpid.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: rpid.c 2935 2009-10-09 13:17:56Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -21,6 +21,7 @@ #include <pjsip-simple/errno.h> #include <pj/assert.h> #include <pj/guid.h> +#include <pj/pool.h> #include <pj/string.h> @@ -146,7 +147,16 @@ PJ_DEF(pj_status_t) pjrpid_add_element(pjpidf_pres *pres, attr = pj_xml_attr_new(pool, &ID, &elem->id); } else { pj_str_t person_id; - pj_create_unique_string(pool, &person_id); + /* xs:ID must start with letter */ + //pj_create_unique_string(pool, &person_id); + person_id.ptr = (char*)pj_pool_alloc(pool, PJ_GUID_STRING_LENGTH+2); + person_id.ptr += 2; + pj_generate_unique_string(&person_id); + person_id.ptr -= 2; + person_id.ptr[0] = 'p'; + person_id.ptr[1] = 'j'; + person_id.slen += 2; + attr = pj_xml_attr_new(pool, &ID, &person_id); } pj_xml_add_attr(nd_person, attr); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c index 3adfe72daeb0d8007caaa2d73f192cb8115cb2a8..9aba3bbcd1e918a4069752842e0493ae02c42ac4 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_inv.c @@ -1,4 +1,4 @@ -/* $Id: sip_inv.c 2879 2009-08-14 13:23:22Z nanang $ */ +/* $Id: sip_inv.c 2951 2009-10-16 06:28:56Z nanang $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -108,6 +108,10 @@ static pj_status_t process_answer( pjsip_inv_session *inv, pjsip_tx_data *tdata, const pjmedia_sdp_session *local_sdp); +static pj_status_t handle_timer_response(pjsip_inv_session *inv, + const pjsip_rx_data *rdata, + pj_bool_t end_sess_on_failure); + static void (*inv_state_handler[])( pjsip_inv_session *inv, pjsip_event *e) = { &inv_on_state_null, @@ -477,6 +481,29 @@ static pj_bool_t mod_inv_on_rx_request(pjsip_rx_data *rdata) return PJ_FALSE; } +/* This function will process Session Timer headers in received + * 2xx or 422 response of INVITE/UPDATE request. + */ +static pj_status_t handle_timer_response(pjsip_inv_session *inv, + const pjsip_rx_data *rdata, + pj_bool_t end_sess_on_failure) +{ + pjsip_status_code st_code; + pj_status_t status; + + status = pjsip_timer_process_resp(inv, rdata, &st_code); + if (status != PJ_SUCCESS && end_sess_on_failure) { + pjsip_tx_data *tdata; + pj_status_t status2; + + status2 = pjsip_inv_end_session(inv, st_code, NULL, &tdata); + if (tdata && status2 == PJ_SUCCESS) + pjsip_inv_send_msg(inv, tdata); + } + + return status; +} + /* * Module on_rx_response(). * @@ -490,8 +517,6 @@ static pj_bool_t mod_inv_on_rx_response(pjsip_rx_data *rdata) pjsip_dialog *dlg; pjsip_inv_session *inv; pjsip_msg *msg = rdata->msg_info.msg; - pj_status_t status; - pjsip_status_code st_code; dlg = pjsip_rdata_get_dlg(rdata); @@ -519,22 +544,6 @@ static pj_bool_t mod_inv_on_rx_response(pjsip_rx_data *rdata) } - /* Pass response to timer session module */ - status = pjsip_timer_process_resp(inv, rdata, &st_code); - if (status != PJ_SUCCESS) { - pjsip_event e; - pjsip_tx_data *tdata; - - PJSIP_EVENT_INIT_RX_MSG(e, rdata); - inv_send_ack(inv, &e); - - status = pjsip_inv_end_session(inv, st_code, NULL, &tdata); - if (tdata && status == PJ_SUCCESS) - pjsip_inv_send_msg(inv, tdata); - - return PJ_TRUE; - } - /* No other processing needs to be done here. */ return PJ_FALSE; } @@ -2774,8 +2783,8 @@ static void inv_handle_update_response( pjsip_inv_session *inv, /* Handle 401/407 challenge. */ if (tsx->state == PJSIP_TSX_STATE_COMPLETED && - (tsx->status_code == 401 || tsx->status_code == 407)) { - + (tsx->status_code == 401 || tsx->status_code == 407)) + { pjsip_tx_data *tdata; status = pjsip_auth_clt_reinit_req( &inv->dlg->auth_sess, @@ -2798,17 +2807,30 @@ static void inv_handle_update_response( pjsip_inv_session *inv, /* Re-send request. */ status = pjsip_inv_send_msg(inv, tdata); } + } + + /* Process 422 response */ + else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + tsx->status_code == 422) + { + status = handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_FALSE); + } /* Process 2xx response */ - } else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && tsx->status_code/100 == 2 && e->body.tsx_state.src.rdata->msg_info.msg->body) { + status = handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_FALSE); status = inv_check_sdp_in_incoming_msg(inv, tsx, - e->body.tsx_state.src.rdata); - - } else { - /* Get/attach invite session's transaction data */ + e->body.tsx_state.src.rdata); + } + + /* Get/attach invite session's transaction data */ + else + { tsx_inv_data = (struct tsx_inv_data*)tsx->mod_data[mod_inv.mod.id]; if (tsx_inv_data == NULL) { tsx_inv_data=PJ_POOL_ZALLOC_T(tsx->pool, struct tsx_inv_data); @@ -2974,6 +2996,7 @@ static void inv_on_state_null( pjsip_inv_session *inv, pjsip_event *e) * Generic UAC transaction handler: * - resend request on 401 or 407 response. * - terminate dialog on 408 and 481 response. + * - resend request on 422 response. */ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv, pjsip_event *e) @@ -3054,6 +3077,16 @@ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv, } return PJ_TRUE; /* Handled */ + } + + /* Handle session timer 422 response. */ + else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + tsx->status_code == PJSIP_SC_SESSION_TIMER_TOO_SMALL) + { + handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_FALSE); + + return PJ_TRUE; /* Handled */ } else { return PJ_FALSE; /* Unhandled */ @@ -3141,6 +3174,15 @@ static void handle_uac_call_rejection(pjsip_inv_session *inv, pjsip_event *e) status = pjsip_inv_send_msg(inv, tdata); } + } else if (tsx->state == PJSIP_TSX_STATE_COMPLETED && + tsx->status_code == PJSIP_SC_SESSION_TIMER_TOO_SMALL) + { + /* Handle session timer 422 response: + * Resend the request with requested session timer setting. + */ + status = handle_timer_response(inv, e->body.tsx_state.src.rdata, + PJ_TRUE); + } else if (PJSIP_IS_STATUS_IN_CLASS(tsx->status_code, 600)) { /* Global error */ goto terminate_session; @@ -3212,11 +3254,19 @@ static void inv_on_state_calling( pjsip_inv_session *inv, pjsip_event *e) case PJSIP_TSX_STATE_COMPLETED: if (tsx->status_code/100 == 2) { - + /* This should not happen. * When transaction receives 2xx, it should be terminated */ pj_assert(0); + + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); inv_check_sdp_in_incoming_msg(inv, tsx, @@ -3235,6 +3285,13 @@ static void inv_on_state_calling( pjsip_inv_session *inv, pjsip_event *e) if (tsx->status_code/100 == 2) { /* This must be receipt of 2xx response */ + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + /* Set state to CONNECTING */ inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); @@ -3386,6 +3443,15 @@ static void inv_on_state_early( pjsip_inv_session *inv, pjsip_event *e) if (tsx->status_code/100 == 2) { inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { + pj_status_t status; + + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); } @@ -3417,6 +3483,15 @@ static void inv_on_state_early( pjsip_inv_session *inv, pjsip_event *e) inv_set_state(inv, PJSIP_INV_STATE_CONNECTING, e); if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { + pj_status_t status; + + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + break; + inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); } @@ -3885,9 +3960,17 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) } else if (tsx->state == PJSIP_TSX_STATE_TERMINATED && tsx->status_code/100 == 2) { + pj_status_t status; /* Re-INVITE was accepted. */ + /* Process session timer response. */ + status = handle_timer_response(inv, + e->body.tsx_state.src.rdata, + PJ_TRUE); + if (status != PJ_SUCCESS) + return; + /* Process SDP */ inv_check_sdp_in_incoming_msg(inv, tsx, e->body.tsx_state.src.rdata); @@ -3945,7 +4028,7 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e) } else if (tsx->role == PJSIP_ROLE_UAC) { /* - * Handle 401/407/408/481 response + * Handle 401/407/408/481/422 response */ handle_uac_tsx_response(inv, e); } @@ -3992,7 +4075,7 @@ static void inv_on_state_disconnected( pjsip_inv_session *inv, pjsip_event *e) } else if (tsx->role == PJSIP_ROLE_UAC) { /* - * Handle 401/407/408/481 response + * Handle 401/407/408/481/422 response */ handle_uac_tsx_response(inv, e); } diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c index a677c24ad9eb01c741a091c7173ce31c355215dc..715585a39faafe780cb0ff5432558b183c5a0dc6 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip-ua/sip_timer.c @@ -1,4 +1,4 @@ -/* $Id: sip_timer.c 2893 2009-08-17 15:56:18Z nanang $ */ +/* $Id: sip_timer.c 2934 2009-10-09 12:31:59Z nanang $ */ /* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * @@ -791,11 +791,26 @@ PJ_DEF(pj_status_t) pjsip_timer_process_resp(pjsip_inv_session *inv, if (se_hdr && se_hdr->sess_expires < inv->timer->setting.min_se) { - if (st_code) - *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL; - pjsip_timer_end_session(inv); - return PJSIP_ERRNO_FROM_SIP_STATUS( - PJSIP_SC_SESSION_TIMER_TOO_SMALL); + /* See ticket #954, instead of returning non-PJ_SUCCESS (which + * may cause disconnecting call/dialog), let's just accept the + * SE and update our local SE, as long as it isn't less than 90s. + */ + if (se_hdr->sess_expires >= ABS_MIN_SE) { + PJ_LOG(3, (inv->pool->obj_name, + "Peer responds with bad Session-Expires, %ds, " + "which is less than Min-SE specified in request, " + "%ds. Well, let's just accept and use it.", + se_hdr->sess_expires, inv->timer->setting.min_se)); + + inv->timer->setting.sess_expires = se_hdr->sess_expires; + inv->timer->setting.min_se = se_hdr->sess_expires; + } + + //if (st_code) + // *st_code = PJSIP_SC_SESSION_TIMER_TOO_SMALL; + //pjsip_timer_end_session(inv); + //return PJSIP_ERRNO_FROM_SIP_STATUS( + // PJSIP_SC_SESSION_TIMER_TOO_SMALL); } /* Update SE. Session-Expires in response cannot be lower than Min-SE. diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c index ea0b8e471ef90d3a5299a6b9aadb0213e0770330..fc734f7a153efbdeaf6b87754937a737cdc44498 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_client.c @@ -1,4 +1,4 @@ -/* $Id: sip_auth_client.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_auth_client.c 2988 2009-11-06 04:16:36Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -322,8 +322,33 @@ static void update_digest_session( pj_pool_t *ses_pool, pjsip_cached_auth *cached_auth, const pjsip_www_authenticate_hdr *hdr ) { - if (hdr->challenge.digest.qop.slen == 0) + if (hdr->challenge.digest.qop.slen == 0) { +#if PJSIP_AUTH_AUTO_SEND_NEXT!=0 + if (!cached_auth->last_chal || pj_stricmp2(&hdr->scheme, "digest")) { + cached_auth->last_chal = (pjsip_www_authenticate_hdr*) + pjsip_hdr_clone(ses_pool, hdr); + } else { + /* Only update if the new challenge is "significantly different" + * than the one in the cache, to reduce memory usage. + */ + const pjsip_digest_challenge *d1 = + &cached_auth->last_chal->challenge.digest; + const pjsip_digest_challenge *d2 = &hdr->challenge.digest; + + if (pj_strcmp(&d1->domain, &d2->domain) || + pj_strcmp(&d1->realm, &d2->realm) || + pj_strcmp(&d1->nonce, &d2->nonce) || + pj_strcmp(&d1->opaque, &d2->opaque) || + pj_strcmp(&d1->algorithm, &d2->algorithm) || + pj_strcmp(&d1->qop, &d2->qop)) + { + cached_auth->last_chal = (pjsip_www_authenticate_hdr*) + pjsip_hdr_clone(ses_pool, hdr); + } + } +#endif return; + } /* Initialize cnonce and qop if not present. */ if (cached_auth->cnonce.slen == 0) { diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp index c308a758b482c6e3032087ae2971a704fe227fa9..0f58a977e0261ad97c7dd6a369e9d6bf0f20803a 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_auth_parser_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_auth_parser_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c index 4584d75d5fff5bcb7680a60fa88216ea0e9565ee..1d2de50fdb51275c78e98b67e91f1dfb998ba4da 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog.c @@ -1,4 +1,4 @@ -/* $Id: sip_dialog.c 2860 2009-08-11 18:10:15Z nanang $ */ +/* $Id: sip_dialog.c 3031 2009-12-10 05:16:23Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -854,6 +854,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_try_inc_lock(pjsip_dialog *dlg) */ PJ_DEF(void) pjsip_dlg_dec_lock(pjsip_dialog *dlg) { + PJ_ASSERT_ON_FAIL(dlg!=NULL, return); + PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d", dlg->sess_count)); @@ -1532,7 +1534,18 @@ void pjsip_dlg_on_rx_request( pjsip_dialog *dlg, pjsip_rx_data *rdata ) rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) { status = pjsip_tsx_create_uas(dlg->ua, rdata, &tsx); - PJ_ASSERT_ON_FAIL(status==PJ_SUCCESS,{goto on_return;}); + if (status != PJ_SUCCESS) { + /* Once case for this is when re-INVITE contains same + * Via branch value as previous INVITE (ticket #965). + */ + char errmsg[PJ_ERR_MSG_SIZE]; + pj_str_t reason; + + reason = pj_strerror(status, errmsg, sizeof(errmsg)); + pjsip_endpt_respond_stateless(dlg->endpt, rdata, 500, &reason, + NULL, NULL); + goto on_return; + } /* Put this dialog in the transaction data. */ tsx->mod_data[dlg->ua->id] = dlg; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp index 9f2080f5ba268a07dbea12913cf15489ebcd3557..1dee2f2cc88dc343cefd477751ec884e764b8a7e 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_dialog_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_dialog_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp index 1689f7961b6918c42bd91553930fe239b714c0a7..55b157aee113a918c838e31cc782c38f3b84572f 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_endpoint_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_endpoint_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c index 249b9940d65118398265c8d5cfd45a2f099637b9..97dc6c34eca40cc34f51597c0dc93f6312eac20c 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_msg.c @@ -1,4 +1,4 @@ -/* $Id: sip_msg.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sip_msg.c 2968 2009-10-26 11:21:37Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -21,6 +21,7 @@ #include <pjsip/sip_parser.h> #include <pjsip/print_util.h> #include <pjsip/sip_errno.h> +#include <pj/ctype.h> #include <pj/string.h> #include <pj/pool.h> #include <pj/assert.h> @@ -597,6 +598,20 @@ PJ_DEF(const pj_str_t*) pjsip_get_status_text(int code) &status_phrase[code] : &status_phrase[0]; } +/////////////////////////////////////////////////////////////////////////////// +/* + * Media type + */ +PJ_DEF(void) pjsip_media_type_cp( pj_pool_t *pool, + pjsip_media_type *dst, + const pjsip_media_type *src) +{ + PJ_ASSERT_ON_FAIL(pool && dst && src, return); + pj_strdup(pool, &dst->type, &src->type); + pj_strdup(pool, &dst->subtype, &src->subtype); + pj_strdup(pool, &dst->param, &src->param); +} + /////////////////////////////////////////////////////////////////////////////// /* * Generic pjsip_hdr_names/hvalue header. @@ -1718,6 +1733,7 @@ PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_init( pj_pool_t *pool, init_hdr(hdr, PJSIP_H_RETRY_AFTER, &retry_after_hdr_vptr); hdr->ivalue = value; + hdr->comment.slen = 0; pj_list_init(&hdr->param); return hdr; } @@ -1903,7 +1919,14 @@ static int pjsip_via_hdr_print( pjsip_via_hdr *hdr, /* SIP/2.0/transport host:port */ pj_memcpy(buf, sip_ver.ptr, sip_ver.slen); buf += sip_ver.slen; - pj_memcpy(buf, hdr->transport.ptr, hdr->transport.slen); + //pj_memcpy(buf, hdr->transport.ptr, hdr->transport.slen); + /* Convert transport type to UPPERCASE (some endpoints want that) */ + { + int i; + for (i=0; i<hdr->transport.slen; ++i) { + buf[i] = (char)pj_toupper(hdr->transport.ptr[i]); + } + } buf += hdr->transport.slen; *buf++ = ' '; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c index 15fda1d43021aa413bbbdf4432ea15b59f0374a3..1212c0abba0d4b859aba5cc26bbac5ece5342cd5 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser.c @@ -1,4 +1,4 @@ -/* $Id: sip_parser.c 2695 2009-05-12 15:55:09Z bennylp $ */ +/* $Id: sip_parser.c 3003 2009-11-10 05:09:44Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1007,11 +1007,17 @@ parse_headers: if (handler) { hdr = (*handler)(ctx); + /* Note: + * hdr MAY BE NULL, if parsing does not yield a new header + * instance, e.g. the values have been added to existing + * header. See http://trac.pjsip.org/repos/ticket/940 + */ + /* Check if we've just parsed a Content-Type header. * We will check for a message body if we've got Content-Type * header. */ - if (hdr->type == PJSIP_H_CONTENT_TYPE) { + if (hdr && hdr->type == PJSIP_H_CONTENT_TYPE) { ctype_hdr = (pjsip_ctype_hdr*)hdr; } @@ -1027,7 +1033,8 @@ parse_headers: * different Contact headers. * So here we must insert list instead of just insert one header. */ - pj_list_insert_nodes_before(&msg->hdr, hdr); + if (hdr) + pj_list_insert_nodes_before(&msg->hdr, hdr); /* Parse until EOF or an empty line is found. */ } while (!pj_scan_is_eof(scanner) && !IS_NEWLINE(*scanner->curptr)); @@ -1639,7 +1646,14 @@ static void parse_generic_array_hdr( pjsip_generic_array_hdr *hdr, goto end; } - pj_scan_get( scanner, &pconst.pjsip_NOT_COMMA_OR_NEWLINE, &hdr->values[0]); + if (hdr->count >= PJ_ARRAY_SIZE(hdr->values)) { + /* Too many elements */ + on_syntax_error(scanner); + return; + } + + pj_scan_get( scanner, &pconst.pjsip_NOT_COMMA_OR_NEWLINE, + &hdr->values[hdr->count]); hdr->count++; while (*scanner->curptr == ',') { @@ -1917,13 +1931,21 @@ static pjsip_hdr* parse_hdr_from( pjsip_parse_ctx *ctx ) /* Parse Require: header. */ static pjsip_hdr* parse_hdr_require( pjsip_parse_ctx *ctx ) { - pjsip_require_hdr *hdr = pjsip_require_hdr_create(ctx->pool); - parse_generic_array_hdr(hdr, ctx->scanner); + pjsip_require_hdr *hdr; + pj_bool_t new_hdr = (ctx->rdata==NULL || + ctx->rdata->msg_info.require == NULL); + + if (ctx->rdata && ctx->rdata->msg_info.require) { + hdr = ctx->rdata->msg_info.require; + } else { + hdr = pjsip_require_hdr_create(ctx->pool); + if (ctx->rdata) + ctx->rdata->msg_info.require = hdr; + } - if (ctx->rdata && ctx->rdata->msg_info.require == NULL) - ctx->rdata->msg_info.require = hdr; + parse_generic_array_hdr(hdr, ctx->scanner); - return (pjsip_hdr*)hdr; + return new_hdr ? (pjsip_hdr*)hdr : NULL; } /* Parse Retry-After: header. */ @@ -1960,12 +1982,22 @@ static pjsip_hdr* parse_hdr_retry_after(pjsip_parse_ctx *ctx) /* Parse Supported: header. */ static pjsip_hdr* parse_hdr_supported(pjsip_parse_ctx *ctx) { - pjsip_supported_hdr *hdr = pjsip_supported_hdr_create(ctx->pool); + pjsip_supported_hdr *hdr; + pj_bool_t new_hdr = (ctx->rdata==NULL || + ctx->rdata->msg_info.supported == NULL); + + if (ctx->rdata && ctx->rdata->msg_info.supported) { + hdr = ctx->rdata->msg_info.supported; + } else { + hdr = pjsip_supported_hdr_create(ctx->pool); + if (ctx->rdata) + ctx->rdata->msg_info.supported = hdr; + } + parse_generic_array_hdr(hdr, ctx->scanner); - return (pjsip_hdr*)hdr; + return new_hdr ? (pjsip_hdr*)hdr : NULL; } - /* Parse To: header. */ static pjsip_hdr* parse_hdr_to( pjsip_parse_ctx *ctx ) { diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp index 95f2ca7a4fe860427acfa2ef36be84e13d369bd6..e27cd0429802382394649228f3da524bfb0d0c98 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_parser_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_parser_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c index a7293f688f66104db2b7bc92fce8e2dbcfe497f9..746506d606c993d7f3f055cd8101747f9cfcf174 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_resolve.c @@ -1,4 +1,4 @@ -/* $Id: sip_resolve.c 2394 2008-12-23 17:27:53Z bennylp $ */ +/* $Id: sip_resolve.c 3053 2010-01-08 17:12:05Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -198,7 +198,7 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, } else { /* No type or explicit port is specified, and the address is * not IP address. - * In this case, full resolution must be performed. + * In this case, full NAPTR resolution must be performed. * But we don't support it (yet). */ #if PJ_HAS_TCP @@ -225,63 +225,71 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, * we can just finish the resolution now using pj_gethostbyname() */ if (ip_addr_ver || resolver->res == NULL) { - - char ip_addr[PJ_INET6_ADDRSTRLEN]; - int af; - pj_addrinfo ai; - unsigned count; + char addr_str[PJ_INET6_ADDRSTRLEN+10]; pj_uint16_t srv_port; - if (!ip_addr_ver) { - PJ_LOG(5,(THIS_FILE, + if (ip_addr_ver != 0) { + /* Target is an IP address, no need to resolve */ + if (ip_addr_ver == 4) { + pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, + NULL, 0); + pj_inet_aton(&target->addr.host, + &svr_addr.entry[0].addr.ipv4.sin_addr); + } else { + pj_sockaddr_init(pj_AF_INET6(), &svr_addr.entry[0].addr, + NULL, 0); + pj_inet_pton(pj_AF_INET6(), &target->addr.host, + &svr_addr.entry[0].addr.ipv6.sin6_addr); + } + } else { + pj_addrinfo ai; + unsigned count; + int af; + + PJ_LOG(5,(THIS_FILE, "DNS resolver not available, target '%.*s:%d' type=%s " - "will be resolved with gethostbyname()", + "will be resolved with getaddrinfo()", target->addr.host.slen, target->addr.host.ptr, target->addr.port, pjsip_transport_get_type_name(target->type))); + + if (type & PJSIP_TRANSPORT_IPV6) { + af = pj_AF_INET6(); + } else { + af = pj_AF_INET(); + } + + /* Resolve */ + count = 1; + status = pj_getaddrinfo(af, &target->addr.host, &count, &ai); + if (status != PJ_SUCCESS) + goto on_error; + + svr_addr.entry[0].addr.addr.sa_family = (pj_uint16_t)af; + pj_memcpy(&svr_addr.entry[0].addr, &ai.ai_addr, + sizeof(pj_sockaddr)); } - /* Set the port number if not specified. */ + /* Set the port number */ if (target->addr.port == 0) { srv_port = (pj_uint16_t) pjsip_transport_get_default_port_for_type(type); } else { srv_port = (pj_uint16_t)target->addr.port; } - - if (type & PJSIP_TRANSPORT_IPV6) { - af = pj_AF_INET6(); - } else { - af = pj_AF_INET(); - } - - /* Resolve */ - count = 1; - status = pj_getaddrinfo(af, &target->addr.host, &count, &ai); - if (status != PJ_SUCCESS) - goto on_error; - - svr_addr.entry[0].addr.addr.sa_family = (pj_uint16_t)af; - pj_memcpy(&svr_addr.entry[0].addr, &ai.ai_addr, sizeof(pj_sockaddr)); - - if (af == pj_AF_INET6()) { - svr_addr.entry[0].addr.ipv6.sin6_port = pj_htons(srv_port); - } else { - svr_addr.entry[0].addr.ipv4.sin_port = pj_htons(srv_port); - } + pj_sockaddr_set_port(&svr_addr.entry[0].addr, srv_port); /* Call the callback. */ PJ_LOG(5,(THIS_FILE, "Target '%.*s:%d' type=%s resolved to " - "'%s:%d' type=%s (%s)", + "'%s' type=%s (%s)", (int)target->addr.host.slen, target->addr.host.ptr, target->addr.port, pjsip_transport_get_type_name(target->type), - pj_inet_ntop2(af, pj_sockaddr_get_addr(&svr_addr.entry[0].addr), - ip_addr, sizeof(ip_addr)), - srv_port, + pj_sockaddr_print(&svr_addr.entry[0].addr, addr_str, + sizeof(addr_str), 3), pjsip_transport_get_type_name(type), pjsip_transport_get_type_desc(type))); svr_addr.count = 1; @@ -361,21 +369,14 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, if (query->query_type == PJ_DNS_TYPE_SRV) { - unsigned option = PJ_TRUE; - if (type & PJSIP_TRANSPORT_IPV6) { - option |= PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV6; - } else { - option |= PJ_DNS_SRV_FALLBACK_GETADDRINFO_IPV4; - } - - status = pj_dns_srv_resolve(&query->naptr[0].name, - &query->naptr[0].res_type, - query->req.def_port, pool, resolver->res, - option, query, &srv_resolver_cb, NULL); + status = pj_dns_srv_resolve(&query->naptr[0].name, + &query->naptr[0].res_type, + query->req.def_port, pool, resolver->res, + PJ_TRUE, query, &srv_resolver_cb, NULL); } else if (query->query_type == PJ_DNS_TYPE_A) { - status = pj_dns_resolver_start_query(resolver->res, + status = pj_dns_resolver_start_query(resolver->res, &query->naptr[0].name, PJ_DNS_TYPE_A, 0, &dns_a_callback, diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp index fc1f818e8b33be3cc592295667691061378b722c..f82281a3231d07b532bb308357b8e6bc7b69a325 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_tel_uri_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_tel_uri_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c index a21fe753f590a83e12433ec3079abfa8463bbf20..79b0866bafe9f12e084e9343b1fc0aff97411f15 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transaction.c @@ -1,4 +1,4 @@ -/* $Id: sip_transaction.c 2857 2009-08-11 12:36:49Z nanang $ */ +/* $Id: sip_transaction.c 2936 2009-10-10 13:36:43Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -545,10 +545,15 @@ static pj_status_t mod_tsx_layer_register_tsx( pjsip_transaction *tsx) * Do not use PJ_ASSERT_RETURN since it evaluates the expression * twice! */ - pj_assert(pj_hash_get( mod_tsx_layer.htable, - tsx->transaction_key.ptr, - tsx->transaction_key.slen, - NULL) == NULL); + if(pj_hash_get(mod_tsx_layer.htable, + tsx->transaction_key.ptr, + tsx->transaction_key.slen, + NULL)) + { + pj_mutex_unlock(mod_tsx_layer.mutex); + PJ_LOG(2,(THIS_FILE, "Unable to register transaction (key exists)")); + return PJ_EEXISTS; + } TSX_TRACE_((THIS_FILE, "Transaction %p registered with hkey=0x%p and key=%.*s", @@ -1344,6 +1349,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, status = pjsip_tsx_create_key(tsx->pool, &tsx->transaction_key, PJSIP_ROLE_UAS, &tsx->method, rdata); if (status != PJ_SUCCESS) { + unlock_tsx(tsx, &lck); tsx_destroy(tsx); return status; } @@ -1371,6 +1377,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, /* Get response address. */ status = pjsip_get_response_addr( tsx->pool, rdata, &tsx->res_addr ); if (status != PJ_SUCCESS) { + unlock_tsx(tsx, &lck); tsx_destroy(tsx); return status; } @@ -1393,6 +1400,7 @@ PJ_DEF(pj_status_t) pjsip_tsx_create_uas( pjsip_module *tsx_user, /* Register the transaction. */ status = mod_tsx_layer_register_tsx(tsx); if (status != PJ_SUCCESS) { + unlock_tsx(tsx, &lck); tsx_destroy(tsx); return status; } @@ -1626,6 +1634,7 @@ static void send_msg_callback( pjsip_send_state *send_state, pj_ssize_t sent, pj_bool_t *cont ) { pjsip_transaction *tsx = (pjsip_transaction*) send_state->token; + pjsip_tx_data *tdata = send_state->tdata; struct tsx_lock_data lck; lock_tsx(tsx, &lck); @@ -1644,9 +1653,9 @@ static void send_msg_callback( pjsip_send_state *send_state, pjsip_transport_add_ref(tsx->transport); /* Update remote address. */ - tsx->addr_len = send_state->addr.entry[send_state->cur_addr].addr_len; + tsx->addr_len = tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr_len; pj_memcpy(&tsx->addr, - &send_state->addr.entry[send_state->cur_addr].addr, + &tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr, tsx->addr_len); /* Update is_reliable flag. */ @@ -2840,6 +2849,15 @@ static pj_status_t tsx_on_state_completed_uas( pjsip_transaction *tsx, /* Process incoming ACK request. */ + /* Verify that this is an INVITE transaction */ + if (tsx->method.id != PJSIP_INVITE_METHOD) { + PJ_LOG(2, (tsx->obj_name, + "Received illegal ACK for %.*s transaction", + (int)tsx->method.name.slen, + tsx->method.name.ptr)); + return PJSIP_EINVALIDMETHOD; + } + /* Cease retransmission. */ if (tsx->retransmit_timer.id != 0) { pjsip_endpt_cancel_timer(tsx->endpt, &tsx->retransmit_timer); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c index df1f896e2f6d5f3a3ab11e71d38366e8d5d12c40..a26d3c3f532f666b689cf140b621422d9ef38180 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport.c @@ -1,4 +1,4 @@ -/* $Id: sip_transport.c 2724 2009-05-29 13:04:03Z bennylp $ */ +/* $Id: sip_transport.c 2915 2009-09-22 17:56:44Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -1439,6 +1439,14 @@ PJ_DEF(pj_ssize_t) pjsip_tpmgr_receive_packet( pjsip_tpmgr *mgr, if (rdata->msg_info.via->rport_param == 0) { rdata->msg_info.via->rport_param = rdata->pkt_info.src_port; } + } else { + /* Drop malformed responses */ + if (rdata->msg_info.msg->line.status.code < 100 || + rdata->msg_info.msg->line.status.code >= 700) + { + mgr->on_rx_msg(mgr->endpt, PJSIP_EINVALIDSTATUS, rdata); + goto finish_process_fragment; + } } /* Drop response message if it has more than one Via. diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c index bb5ade9652456e86e7836ee5687f7b5121c76e47..030cc8a427f08e217cad8ab91dfc93cd4d0812fc 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tcp.c @@ -1,4 +1,4 @@ -/* $Id: sip_transport_tcp.c 2781 2009-06-22 14:06:40Z nanang $ */ +/* $Id: sip_transport_tcp.c 3035 2009-12-22 13:00:22Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -57,6 +57,8 @@ struct tcp_listener pjsip_endpoint *endpt; pjsip_tpmgr *tpmgr; pj_activesock_t *asock; + pj_qos_type qos_type; + pj_qos_params qos_params; }; @@ -164,6 +166,17 @@ static void sockaddr_to_host_port( pj_pool_t *pool, host_port->port = pj_sockaddr_get_port(addr); } +/* + * Initialize pjsip_tcp_transport_cfg structure with default values. + */ +PJ_DEF(void) pjsip_tcp_transport_cfg_default(pjsip_tcp_transport_cfg *cfg, + int af) +{ + pj_bzero(cfg, sizeof(*cfg)); + cfg->af = af; + pj_sockaddr_init(cfg->af, &cfg->bind_addr, NULL, 0); + cfg->async_cnt = 1; +} /**************************************************************************** @@ -174,32 +187,33 @@ static void sockaddr_to_host_port( pj_pool_t *pool, * This is the public API to create, initialize, register, and start the * TCP listener. */ -PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, - const pj_sockaddr_in *local, - const pjsip_host_port *a_name, - unsigned async_cnt, - pjsip_tpfactory **p_factory) +PJ_DEF(pj_status_t) pjsip_tcp_transport_start3( + pjsip_endpoint *endpt, + const pjsip_tcp_transport_cfg *cfg, + pjsip_tpfactory **p_factory + ) { pj_pool_t *pool; pj_sock_t sock = PJ_INVALID_SOCKET; struct tcp_listener *listener; pj_activesock_cfg asock_cfg; pj_activesock_cb listener_cb; - pj_sockaddr_in *listener_addr; + pj_sockaddr *listener_addr; int addr_len; pj_status_t status; /* Sanity check */ - PJ_ASSERT_RETURN(endpt && async_cnt, PJ_EINVAL); + PJ_ASSERT_RETURN(endpt && cfg->async_cnt, PJ_EINVAL); /* Verify that address given in a_name (if any) is valid */ - if (a_name && a_name->host.slen) { - pj_sockaddr_in tmp; - - status = pj_sockaddr_in_init(&tmp, &a_name->host, - (pj_uint16_t)a_name->port); - if (status != PJ_SUCCESS || tmp.sin_addr.s_addr == PJ_INADDR_ANY || - tmp.sin_addr.s_addr == PJ_INADDR_NONE) + if (cfg->addr_name.host.slen) { + pj_sockaddr tmp; + + status = pj_sockaddr_init(cfg->af, &tmp, &cfg->addr_name.host, + (pj_uint16_t)cfg->addr_name.port); + if (status != PJ_SUCCESS || !pj_sockaddr_has_addr(&tmp) || + (cfg->af==pj_AF_INET() && + tmp.ipv4.sin_addr.s_addr==PJ_INADDR_NONE)) { /* Invalid address */ return PJ_EINVAL; @@ -217,6 +231,9 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, listener->factory.type_name = "tcp"; listener->factory.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TCP); + listener->qos_type = cfg->qos_type; + pj_memcpy(&listener->qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); pj_ansi_strcpy(listener->factory.obj_name, "tcplis"); @@ -226,24 +243,27 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, goto on_error; - /* Create and bind socket */ - status = pj_sock_socket(pj_AF_INET(), pj_SOCK_STREAM(), 0, &sock); + /* Create socket */ + status = pj_sock_socket(cfg->af, pj_SOCK_STREAM(), 0, &sock); if (status != PJ_SUCCESS) goto on_error; - listener_addr = (pj_sockaddr_in*)&listener->factory.local_addr; - if (local) { - pj_memcpy(listener_addr, local, sizeof(pj_sockaddr_in)); - } else { - pj_sockaddr_in_init(listener_addr, NULL, 0); - } + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, cfg->qos_type, &cfg->qos_params, + 2, listener->factory.obj_name, + "SIP TCP listener socket"); - status = pj_sock_bind(sock, listener_addr, sizeof(pj_sockaddr_in)); + /* Bind socket */ + listener_addr = &listener->factory.local_addr; + pj_sockaddr_cp(listener_addr, &cfg->bind_addr); + + status = pj_sock_bind(sock, listener_addr, + pj_sockaddr_get_len(listener_addr)); if (status != PJ_SUCCESS) goto on_error; /* Retrieve the bound address */ - addr_len = sizeof(pj_sockaddr_in); + addr_len = pj_sockaddr_get_len(listener_addr); status = pj_sock_getsockname(sock, listener_addr, &addr_len); if (status != PJ_SUCCESS) goto on_error; @@ -251,12 +271,12 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, /* If published host/IP is specified, then use that address as the * listener advertised address. */ - if (a_name && a_name->host.slen) { + if (cfg->addr_name.host.slen) { /* Copy the address */ - listener->factory.addr_name = *a_name; + listener->factory.addr_name = cfg->addr_name; pj_strdup(listener->factory.pool, &listener->factory.addr_name.host, - &a_name->host); - listener->factory.addr_name.port = a_name->port; + &cfg->addr_name.host); + listener->factory.addr_name.port = cfg->addr_name.port; } else { /* No published address is given, use the bound address */ @@ -264,24 +284,27 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, /* If the address returns 0.0.0.0, use the default * interface address as the transport's address. */ - if (listener_addr->sin_addr.s_addr == 0) { + if (!pj_sockaddr_has_addr(listener_addr)) { pj_sockaddr hostip; status = pj_gethostip(pj_AF_INET(), &hostip); if (status != PJ_SUCCESS) goto on_error; - listener_addr->sin_addr.s_addr = hostip.ipv4.sin_addr.s_addr; + pj_memcpy(pj_sockaddr_get_addr(listener_addr), + pj_sockaddr_get_addr(&hostip), + pj_sockaddr_get_addr_len(&hostip)); } /* Save the address name */ sockaddr_to_host_port(listener->factory.pool, - &listener->factory.addr_name, listener_addr); + &listener->factory.addr_name, + (pj_sockaddr_in*)listener_addr); } /* If port is zero, get the bound port */ if (listener->factory.addr_name.port == 0) { - listener->factory.addr_name.port = pj_ntohs(listener_addr->sin_port); + listener->factory.addr_name.port = pj_sockaddr_get_port(listener_addr); } pj_ansi_snprintf(listener->factory.obj_name, @@ -296,9 +319,11 @@ PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, /* Create active socket */ - if (async_cnt > MAX_ASYNC_CNT) async_cnt = MAX_ASYNC_CNT; pj_activesock_cfg_default(&asock_cfg); - asock_cfg.async_cnt = async_cnt; + if (cfg->async_cnt > MAX_ASYNC_CNT) + asock_cfg.async_cnt = MAX_ASYNC_CNT; + else + asock_cfg.async_cnt = cfg->async_cnt; pj_bzero(&listener_cb, sizeof(listener_cb)); listener_cb.on_accept_complete = &on_accept_complete; @@ -344,6 +369,35 @@ on_error: } +/* + * This is the public API to create, initialize, register, and start the + * TCP listener. + */ +PJ_DEF(pj_status_t) pjsip_tcp_transport_start2(pjsip_endpoint *endpt, + const pj_sockaddr_in *local, + const pjsip_host_port *a_name, + unsigned async_cnt, + pjsip_tpfactory **p_factory) +{ + pjsip_tcp_transport_cfg cfg; + + pjsip_tcp_transport_cfg_default(&cfg, pj_AF_INET()); + + if (local) + pj_sockaddr_cp(&cfg.bind_addr, local); + else + pj_sockaddr_init(cfg.af, &cfg.bind_addr, NULL, 0); + + if (a_name) + pj_memcpy(&cfg.addr_name, a_name, sizeof(*a_name)); + + if (async_cnt) + cfg.async_cnt = async_cnt; + + return pjsip_tcp_transport_start3(endpt, &cfg, p_factory); +} + + /* * This is the public API to create, initialize, register, and start the * TCP listener. @@ -774,6 +828,12 @@ static pj_status_t lis_create_transport(pjsip_tpfactory *factory, if (status != PJ_SUCCESS) return status; + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, listener->qos_type, + &listener->qos_params, + 2, listener->factory.obj_name, + "outgoing SIP TCP socket"); + /* Bind to any port */ status = pj_sock_bind_in(sock, 0, 0); if (status != PJ_SUCCESS) { @@ -878,6 +938,12 @@ static pj_bool_t on_accept_complete(pj_activesock_t *asock, pj_sockaddr_print(src_addr, addr, sizeof(addr), 3), sock)); + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, listener->qos_type, + &listener->qos_params, + 2, listener->factory.obj_name, + "incoming SIP TCP socket"); + /* * Incoming connection! * Create TCP transport for the new socket. @@ -1214,7 +1280,9 @@ static pj_bool_t on_connect_complete(pj_activesock_t *asock, if (pj_sock_getsockname(tcp->sock, &addr, &addrlen)==PJ_SUCCESS) { pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr; - if (tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) { + if (pj_sockaddr_has_addr(&addr) && + tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) + { tp_addr->sin_addr.s_addr = addr.sin_addr.s_addr; tp_addr->sin_port = addr.sin_port; sockaddr_to_host_port(tcp->base.pool, &tcp->base.local_name, diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls.c new file mode 100644 index 0000000000000000000000000000000000000000..0c16f88c3ce6fe783e2a321f31810c788a05e358 --- /dev/null +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls.c @@ -0,0 +1,1405 @@ +/* $Id: sip_transport_tls.c 3039 2009-12-30 06:35:20Z nanang $ */ +/* + * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include <pjsip/sip_transport_tls.h> +#include <pjsip/sip_endpoint.h> +#include <pjsip/sip_errno.h> +#include <pj/compat/socket.h> +#include <pj/addr_resolv.h> +#include <pj/ssl_sock.h> +#include <pj/assert.h> +#include <pj/lock.h> +#include <pj/log.h> +#include <pj/os.h> +#include <pj/pool.h> +#include <pj/string.h> + +#include <stdio.h> + +#if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 + +#define THIS_FILE "sip_transport_tls.c" + +#define MAX_ASYNC_CNT 16 +#define POOL_LIS_INIT 512 +#define POOL_LIS_INC 512 +#define POOL_TP_INIT 512 +#define POOL_TP_INC 512 + +struct tls_listener; +struct tls_transport; + +/* + * Definition of TLS/SSL transport listener, and it's descendant of + * pjsip_tpfactory. + */ +struct tls_listener +{ + pjsip_tpfactory factory; + pj_bool_t is_registered; + pjsip_endpoint *endpt; + pjsip_tpmgr *tpmgr; + pj_ssl_sock_t *ssock; + pj_ssl_cert_t *cert; + pjsip_tls_setting tls_setting; +}; + + +/* + * This structure is used to keep delayed transmit operation in a list. + * A delayed transmission occurs when application sends tx_data when + * the TLS connect/establishment is still in progress. These delayed + * transmission will be "flushed" once the socket is connected (either + * successfully or with errors). + */ +struct delayed_tdata +{ + PJ_DECL_LIST_MEMBER(struct delayed_tdata); + pjsip_tx_data_op_key *tdata_op_key; +}; + + +/* + * TLS/SSL transport, and it's descendant of pjsip_transport. + */ +struct tls_transport +{ + pjsip_transport base; + pj_bool_t is_server; + + pj_bool_t is_registered; + pj_bool_t is_closing; + pj_status_t close_reason; + pj_ssl_sock_t *ssock; + pj_bool_t has_pending_connect; + + /* Keep-alive timer. */ + pj_timer_entry ka_timer; + pj_time_val last_activity; + pjsip_tx_data_op_key ka_op_key; + pj_str_t ka_pkt; + + /* TLS transport can only have one rdata! + * Otherwise chunks of incoming PDU may be received on different + * buffer. + */ + pjsip_rx_data rdata; + + /* Pending transmission list. */ + struct delayed_tdata delayed_list; +}; + + +/**************************************************************************** + * PROTOTYPES + */ + +/* This callback is called when pending accept() operation completes. */ +static pj_bool_t on_accept_complete(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *new_ssock, + const pj_sockaddr_t *src_addr, + int src_addr_len); + +/* Callback on incoming data */ +static pj_bool_t on_data_read(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder); + +/* Callback when packet is sent */ +static pj_bool_t on_data_sent(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *send_key, + pj_ssize_t sent); + +/* This callback is called by transport manager to destroy listener */ +static pj_status_t lis_destroy(pjsip_tpfactory *factory); + +/* This callback is called by transport manager to create transport */ +static pj_status_t lis_create_transport(pjsip_tpfactory *factory, + pjsip_tpmgr *mgr, + pjsip_endpoint *endpt, + const pj_sockaddr *rem_addr, + int addr_len, + pjsip_transport **transport); + +/* Common function to create and initialize transport */ +static pj_status_t tls_create(struct tls_listener *listener, + pj_pool_t *pool, + pj_ssl_sock_t *ssock, + pj_bool_t is_server, + const pj_sockaddr_in *local, + const pj_sockaddr_in *remote, + struct tls_transport **p_tls); + + +static void tls_perror(const char *sender, const char *title, + pj_status_t status) +{ + char errmsg[PJ_ERR_MSG_SIZE]; + + pj_strerror(status, errmsg, sizeof(errmsg)); + + PJ_LOG(1,(sender, "%s: %s [code=%d]", title, errmsg, status)); +} + + +static void sockaddr_to_host_port( pj_pool_t *pool, + pjsip_host_port *host_port, + const pj_sockaddr_in *addr ) +{ + host_port->host.ptr = (char*) pj_pool_alloc(pool, PJ_INET6_ADDRSTRLEN+4); + pj_sockaddr_print(addr, host_port->host.ptr, PJ_INET6_ADDRSTRLEN+4, 2); + host_port->host.slen = pj_ansi_strlen(host_port->host.ptr); + host_port->port = pj_sockaddr_get_port(addr); +} + + + +/**************************************************************************** + * The TLS listener/transport factory. + */ + +PJ_DEF(pj_status_t) pjsip_tls_listener_update_settings(pjsip_endpoint *endpt, + pj_pool_t *pool, + pjsip_tpmgr *mgr, + pjsip_tpfactory *factory, + const pjsip_tls_setting *opt) { + + struct tls_listener *listener; + pjsip_transport_type_e type = PJSIP_TRANSPORT_TLS; + + /* + * Find the tls factory. + */ + listener = (struct tls_listener*)factory; + listener->tls_setting; + + pjsip_tls_setting_copy(pool, &(listener->tls_setting), opt); + + return PJ_SUCCESS; +} + + + +/* + * This is the public API to create, initialize, register, and start the + * TLS listener. + */ +PJ_DEF(pj_status_t) pjsip_tls_transport_start (pjsip_endpoint *endpt, + const pjsip_tls_setting *opt, + const pj_sockaddr_in *local, + const pjsip_host_port *a_name, + unsigned async_cnt, + pjsip_tpfactory **p_factory) +{ + pj_pool_t *pool; + struct tls_listener *listener; + pj_ssl_sock_param ssock_param; + pj_sockaddr_in *listener_addr; + pj_bool_t has_listener; + pj_status_t status; + + /* Sanity check */ + PJ_ASSERT_RETURN(endpt && async_cnt, PJ_EINVAL); + + /* Verify that address given in a_name (if any) is valid */ + if (a_name && a_name->host.slen) { + pj_sockaddr_in tmp; + + status = pj_sockaddr_in_init(&tmp, &a_name->host, + (pj_uint16_t)a_name->port); + if (status != PJ_SUCCESS || tmp.sin_addr.s_addr == PJ_INADDR_ANY || + tmp.sin_addr.s_addr == PJ_INADDR_NONE) + { + /* Invalid address */ + return PJ_EINVAL; + } + } + + pool = pjsip_endpt_create_pool(endpt, "tlslis", POOL_LIS_INIT, + POOL_LIS_INC); + PJ_ASSERT_RETURN(pool, PJ_ENOMEM); + + listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener); + listener->factory.pool = pool; + listener->factory.type = PJSIP_TRANSPORT_TLS; + listener->factory.type_name = "tls"; + listener->factory.flag = + pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); + + pj_ansi_strcpy(listener->factory.obj_name, "tlslis"); + + if (opt) + pjsip_tls_setting_copy(pool, &listener->tls_setting, opt); + else + pjsip_tls_setting_default(&listener->tls_setting); + + status = pj_lock_create_recursive_mutex(pool, "tlslis", + &listener->factory.lock); + if (status != PJ_SUCCESS) + goto on_error; + + if (async_cnt > MAX_ASYNC_CNT) + async_cnt = MAX_ASYNC_CNT; + + /* Build SSL socket param */ + pj_ssl_sock_param_default(&ssock_param); + ssock_param.cb.on_accept_complete = &on_accept_complete; + ssock_param.cb.on_data_read = &on_data_read; + ssock_param.cb.on_data_sent = &on_data_sent; + ssock_param.async_cnt = async_cnt; + ssock_param.ioqueue = pjsip_endpt_get_ioqueue(endpt); + ssock_param.require_client_cert = listener->tls_setting.require_client_cert; + ssock_param.server_name = listener->tls_setting.server_name; + ssock_param.timeout = listener->tls_setting.timeout; + ssock_param.user_data = listener; + ssock_param.verify_peer = listener->tls_setting.verify_client; + if (ssock_param.send_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.send_buffer_size = PJSIP_MAX_PKT_LEN; + if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN; + ssock_param.qos_type = listener->tls_setting.qos_type; + ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error; + pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params, + sizeof(ssock_param.qos_params)); + + has_listener = PJ_FALSE; + + switch(listener->tls_setting.method) { + case PJSIP_TLSV1_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_TLS1; + break; + case PJSIP_SSLV2_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL2; + break; + case PJSIP_SSLV3_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL3; + break; + case PJSIP_SSLV23_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL23; + break; + default: + ssock_param.proto = PJ_SSL_SOCK_PROTO_DEFAULT; + break; + } + + /* Create SSL socket */ + status = pj_ssl_sock_create(pool, &ssock_param, &listener->ssock); + if (status != PJ_SUCCESS) + goto on_error; + + listener_addr = (pj_sockaddr_in*)&listener->factory.local_addr; + if (local) { + pj_sockaddr_cp((pj_sockaddr_t*)listener_addr, + (const pj_sockaddr_t*)local); + } else { + pj_sockaddr_in_init(listener_addr, NULL, 0); + } + + /* Check if certificate/CA list for SSL socket is set */ + if (listener->tls_setting.cert_file.slen || + listener->tls_setting.ca_list_file.slen) + { + status = pj_ssl_cert_load_from_files(pool, + &listener->tls_setting.ca_list_file, + &listener->tls_setting.cert_file, + &listener->tls_setting.privkey_file, + &listener->tls_setting.password, + &listener->cert); + if (status != PJ_SUCCESS) + goto on_error; + + status = pj_ssl_sock_set_certificate(listener->ssock, pool, + listener->cert); + if (status != PJ_SUCCESS) + goto on_error; + } + + /* Start accepting incoming connections. Note that some TLS/SSL backends + * may not support for SSL socket server. + */ + has_listener = PJ_FALSE; + + status = pj_ssl_sock_start_accept(listener->ssock, pool, + (pj_sockaddr_t*)listener_addr, + pj_sockaddr_get_len((pj_sockaddr_t*)listener_addr)); + if (status == PJ_SUCCESS || status == PJ_EPENDING) { + pj_ssl_sock_info info; + has_listener = PJ_TRUE; + + /* Retrieve the bound address */ + status = pj_ssl_sock_get_info(listener->ssock, &info); + if (status == PJ_SUCCESS) + pj_sockaddr_cp(listener_addr, (pj_sockaddr_t*)&info.local_addr); + } else if (status != PJ_ENOTSUP) { + goto on_error; + } + + /* If published host/IP is specified, then use that address as the + * listener advertised address. + */ + if (a_name && a_name->host.slen) { + /* Copy the address */ + listener->factory.addr_name = *a_name; + pj_strdup(listener->factory.pool, &listener->factory.addr_name.host, + &a_name->host); + listener->factory.addr_name.port = a_name->port; + + } else { + /* No published address is given, use the bound address */ + + /* If the address returns 0.0.0.0, use the default + * interface address as the transport's address. + */ + if (listener_addr->sin_addr.s_addr == 0) { + pj_sockaddr hostip; + + status = pj_gethostip(pj_AF_INET(), &hostip); + if (status != PJ_SUCCESS) + goto on_error; + + listener_addr->sin_addr.s_addr = hostip.ipv4.sin_addr.s_addr; + } + + /* Save the address name */ + sockaddr_to_host_port(listener->factory.pool, + &listener->factory.addr_name, listener_addr); + } + + /* If port is zero, get the bound port */ + if (listener->factory.addr_name.port == 0) { + listener->factory.addr_name.port = pj_ntohs(listener_addr->sin_port); + } + + pj_ansi_snprintf(listener->factory.obj_name, + sizeof(listener->factory.obj_name), + "tlslis:%d", listener->factory.addr_name.port); + + /* Register to transport manager */ + listener->endpt = endpt; + listener->tpmgr = pjsip_endpt_get_tpmgr(endpt); + listener->factory.create_transport = lis_create_transport; + listener->factory.destroy = lis_destroy; + listener->is_registered = PJ_TRUE; + status = pjsip_tpmgr_register_tpfactory(listener->tpmgr, + &listener->factory); + if (status != PJ_SUCCESS) { + listener->is_registered = PJ_FALSE; + goto on_error; + } + + if (has_listener) { + PJ_LOG(4,(listener->factory.obj_name, + "SIP TLS listener is ready for incoming connections " + "at %.*s:%d", + (int)listener->factory.addr_name.host.slen, + listener->factory.addr_name.host.ptr, + listener->factory.addr_name.port)); + } else { + PJ_LOG(4,(listener->factory.obj_name, "SIP TLS is ready " + "(client only)")); + } + + /* Return the pointer to user */ + if (p_factory) *p_factory = &listener->factory; + + return PJ_SUCCESS; + +on_error: + lis_destroy(&listener->factory); + return status; +} + + +/* This callback is called by transport manager to destroy listener */ +static pj_status_t lis_destroy(pjsip_tpfactory *factory) +{ + struct tls_listener *listener = (struct tls_listener *)factory; + + if (listener->is_registered) { + pjsip_tpmgr_unregister_tpfactory(listener->tpmgr, &listener->factory); + listener->is_registered = PJ_FALSE; + } + + if (listener->ssock) { + pj_ssl_sock_close(listener->ssock); + listener->ssock = NULL; + } + + if (listener->factory.lock) { + pj_lock_destroy(listener->factory.lock); + listener->factory.lock = NULL; + } + + if (listener->factory.pool) { + pj_pool_t *pool = listener->factory.pool; + + PJ_LOG(4,(listener->factory.obj_name, "SIP TLS listener destroyed")); + + listener->factory.pool = NULL; + pj_pool_release(pool); + } + + return PJ_SUCCESS; +} + + +/***************************************************************************/ +/* + * TLS Transport + */ + +/* + * Prototypes. + */ +/* Called by transport manager to send message */ +static pj_status_t tls_send_msg(pjsip_transport *transport, + pjsip_tx_data *tdata, + const pj_sockaddr_t *rem_addr, + int addr_len, + void *token, + pjsip_transport_callback callback); + +/* Called by transport manager to shutdown */ +static pj_status_t tls_shutdown(pjsip_transport *transport); + +/* Called by transport manager to destroy transport */ +static pj_status_t tls_destroy_transport(pjsip_transport *transport); + +/* Utility to destroy transport */ +static pj_status_t tls_destroy(pjsip_transport *transport, + pj_status_t reason); + +/* Callback when connect completes */ +static pj_bool_t on_connect_complete(pj_ssl_sock_t *ssock, + pj_status_t status); + +/* TLS keep-alive timer callback */ +static void tls_keep_alive_timer(pj_timer_heap_t *th, pj_timer_entry *e); + +/* + * Common function to create TLS transport, called when pending accept() and + * pending connect() complete. + */ +static pj_status_t tls_create( struct tls_listener *listener, + pj_pool_t *pool, + pj_ssl_sock_t *ssock, + pj_bool_t is_server, + const pj_sockaddr_in *local, + const pj_sockaddr_in *remote, + struct tls_transport **p_tls) +{ + struct tls_transport *tls; + const pj_str_t ka_pkt = PJSIP_TCP_KEEP_ALIVE_DATA; + pj_status_t status; + + + PJ_ASSERT_RETURN(listener && ssock && local && remote && p_tls, PJ_EINVAL); + + + if (pool == NULL) { + pool = pjsip_endpt_create_pool(listener->endpt, "tls", + POOL_TP_INIT, POOL_TP_INC); + PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); + } + + /* + * Create and initialize basic transport structure. + */ + tls = PJ_POOL_ZALLOC_T(pool, struct tls_transport); + tls->is_server = is_server; + pj_list_init(&tls->delayed_list); + tls->base.pool = pool; + + pj_ansi_snprintf(tls->base.obj_name, PJ_MAX_OBJ_NAME, + (is_server ? "tlss%p" :"tlsc%p"), tls); + + status = pj_atomic_create(pool, 0, &tls->base.ref_cnt); + if (status != PJ_SUCCESS) { + goto on_error; + } + + status = pj_lock_create_recursive_mutex(pool, "tls", &tls->base.lock); + if (status != PJ_SUCCESS) { + goto on_error; + } + + tls->base.key.type = PJSIP_TRANSPORT_TLS; + pj_memcpy(&tls->base.key.rem_addr, remote, sizeof(pj_sockaddr_in)); + tls->base.type_name = "tls"; + tls->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); + + tls->base.info = (char*) pj_pool_alloc(pool, 64); + pj_ansi_snprintf(tls->base.info, 64, "TLS to %s:%d", + pj_inet_ntoa(remote->sin_addr), + (int)pj_ntohs(remote->sin_port)); + + tls->base.addr_len = sizeof(pj_sockaddr_in); + + /* Set initial local address */ + if (!pj_sockaddr_has_addr(local)) { + pj_sockaddr_cp(&tls->base.local_addr, + &listener->factory.local_addr); + } else { + pj_sockaddr_cp(&tls->base.local_addr, local); + } + + sockaddr_to_host_port(pool, &tls->base.local_name, + (pj_sockaddr_in*)&tls->base.local_addr); + sockaddr_to_host_port(pool, &tls->base.remote_name, remote); + + tls->base.endpt = listener->endpt; + tls->base.tpmgr = listener->tpmgr; + tls->base.send_msg = &tls_send_msg; + tls->base.do_shutdown = &tls_shutdown; + tls->base.destroy = &tls_destroy_transport; + + tls->ssock = ssock; + + /* Register transport to transport manager */ + status = pjsip_transport_register(listener->tpmgr, &tls->base); + if (status != PJ_SUCCESS) { + goto on_error; + } + + tls->is_registered = PJ_TRUE; + + /* Initialize keep-alive timer */ + tls->ka_timer.user_data = (void*)tls; + tls->ka_timer.cb = &tls_keep_alive_timer; + pj_ioqueue_op_key_init(&tls->ka_op_key.key, sizeof(pj_ioqueue_op_key_t)); + pj_strdup(tls->base.pool, &tls->ka_pkt, &ka_pkt); + + /* Done setting up basic transport. */ + *p_tls = tls; + + PJ_LOG(4,(tls->base.obj_name, "TLS %s transport created", + (tls->is_server ? "server" : "client"))); + + return PJ_SUCCESS; + +on_error: + tls_destroy(&tls->base, status); + return status; +} + + +/* Flush all delayed transmision once the socket is connected. */ +static void tls_flush_pending_tx(struct tls_transport *tls) +{ + pj_lock_acquire(tls->base.lock); + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pjsip_tx_data *tdata; + pj_ioqueue_op_key_t *op_key; + pj_ssize_t size; + pj_status_t status; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + tdata = pending_tx->tdata_op_key->tdata; + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + /* send! */ + size = tdata->buf.cur - tdata->buf.start; + status = pj_ssl_sock_send(tls->ssock, op_key, tdata->buf.start, + &size, 0); + + if (status != PJ_EPENDING) { + on_data_sent(tls->ssock, op_key, size); + } + } + pj_lock_release(tls->base.lock); +} + + +/* Called by transport manager to destroy transport */ +static pj_status_t tls_destroy_transport(pjsip_transport *transport) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + + /* Transport would have been unregistered by now since this callback + * is called by transport manager. + */ + tls->is_registered = PJ_FALSE; + + return tls_destroy(transport, tls->close_reason); +} + + +/* Destroy TLS transport */ +static pj_status_t tls_destroy(pjsip_transport *transport, + pj_status_t reason) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + + if (tls->close_reason == 0) + tls->close_reason = reason; + + if (tls->is_registered) { + tls->is_registered = PJ_FALSE; + pjsip_transport_destroy(transport); + + /* pjsip_transport_destroy will recursively call this function + * again. + */ + return PJ_SUCCESS; + } + + /* Mark transport as closing */ + tls->is_closing = PJ_TRUE; + + /* Stop keep-alive timer. */ + if (tls->ka_timer.id) { + pjsip_endpt_cancel_timer(tls->base.endpt, &tls->ka_timer); + tls->ka_timer.id = PJ_FALSE; + } + + /* Cancel all delayed transmits */ + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pj_ioqueue_op_key_t *op_key; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + on_data_sent(tls->ssock, op_key, -reason); + } + + if (tls->rdata.tp_info.pool) { + pj_pool_release(tls->rdata.tp_info.pool); + tls->rdata.tp_info.pool = NULL; + } + + if (tls->ssock) { + pj_ssl_sock_close(tls->ssock); + tls->ssock = NULL; + } + if (tls->base.lock) { + pj_lock_destroy(tls->base.lock); + tls->base.lock = NULL; + } + + if (tls->base.ref_cnt) { + pj_atomic_destroy(tls->base.ref_cnt); + tls->base.ref_cnt = NULL; + } + + if (tls->base.pool) { + pj_pool_t *pool; + + if (reason != PJ_SUCCESS) { + char errmsg[PJ_ERR_MSG_SIZE]; + + pj_strerror(reason, errmsg, sizeof(errmsg)); + PJ_LOG(4,(tls->base.obj_name, + "TLS transport destroyed with reason %d: %s", + reason, errmsg)); + + } else { + + PJ_LOG(4,(tls->base.obj_name, + "TLS transport destroyed normally")); + + } + + pool = tls->base.pool; + tls->base.pool = NULL; + pj_pool_release(pool); + } + + return PJ_SUCCESS; +} + + +/* + * This utility function creates receive data buffers and start + * asynchronous recv() operations from the socket. It is called after + * accept() or connect() operation complete. + */ +static pj_status_t tls_start_read(struct tls_transport *tls) +{ + pj_pool_t *pool; + pj_ssize_t size; + pj_sockaddr_in *rem_addr; + void *readbuf[1]; + pj_status_t status; + + /* Init rdata */ + pool = pjsip_endpt_create_pool(tls->base.endpt, + "rtd%p", + PJSIP_POOL_RDATA_LEN, + PJSIP_POOL_RDATA_INC); + if (!pool) { + tls_perror(tls->base.obj_name, "Unable to create pool", PJ_ENOMEM); + return PJ_ENOMEM; + } + + tls->rdata.tp_info.pool = pool; + + tls->rdata.tp_info.transport = &tls->base; + tls->rdata.tp_info.tp_data = tls; + tls->rdata.tp_info.op_key.rdata = &tls->rdata; + pj_ioqueue_op_key_init(&tls->rdata.tp_info.op_key.op_key, + sizeof(pj_ioqueue_op_key_t)); + + tls->rdata.pkt_info.src_addr = tls->base.key.rem_addr; + tls->rdata.pkt_info.src_addr_len = sizeof(pj_sockaddr_in); + rem_addr = (pj_sockaddr_in*) &tls->base.key.rem_addr; + pj_ansi_strcpy(tls->rdata.pkt_info.src_name, + pj_inet_ntoa(rem_addr->sin_addr)); + tls->rdata.pkt_info.src_port = pj_ntohs(rem_addr->sin_port); + + size = sizeof(tls->rdata.pkt_info.packet); + readbuf[0] = tls->rdata.pkt_info.packet; + status = pj_ssl_sock_start_read2(tls->ssock, tls->base.pool, size, + readbuf, 0); + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + PJ_LOG(4, (tls->base.obj_name, + "pj_ssl_sock_start_read() error, status=%d", + status)); + return status; + } + + return PJ_SUCCESS; +} + + +/* This callback is called by transport manager for the TLS factory + * to create outgoing transport to the specified destination. + */ +static pj_status_t lis_create_transport(pjsip_tpfactory *factory, + pjsip_tpmgr *mgr, + pjsip_endpoint *endpt, + const pj_sockaddr *rem_addr, + int addr_len, + pjsip_transport **p_transport) +{ + struct tls_listener *listener; + struct tls_transport *tls; + pj_pool_t *pool; + pj_ssl_sock_t *ssock; + pj_ssl_sock_param ssock_param; + pj_sockaddr_in local_addr; + pj_status_t status; + + /* Sanity checks */ + PJ_ASSERT_RETURN(factory && mgr && endpt && rem_addr && + addr_len && p_transport, PJ_EINVAL); + + /* Check that address is a sockaddr_in */ + PJ_ASSERT_RETURN(rem_addr->addr.sa_family == pj_AF_INET() && + addr_len == sizeof(pj_sockaddr_in), PJ_EINVAL); + + + listener = (struct tls_listener*)factory; + + pool = pjsip_endpt_create_pool(listener->endpt, "tls", + POOL_TP_INIT, POOL_TP_INC); + PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM); + + /* Build SSL socket param */ + pj_ssl_sock_param_default(&ssock_param); + ssock_param.cb.on_connect_complete = &on_connect_complete; + ssock_param.cb.on_data_read = &on_data_read; + ssock_param.cb.on_data_sent = &on_data_sent; + ssock_param.async_cnt = 1; + ssock_param.ioqueue = pjsip_endpt_get_ioqueue(listener->endpt); + PJ_TODO(set_proper_servername_based_on_target); + PJ_TODO(synchronize_tls_cipher_type_with_ssl_sock_cipher_type); + ssock_param.server_name = listener->tls_setting.server_name; + ssock_param.timeout = listener->tls_setting.timeout; + ssock_param.user_data = NULL; /* pending, must be set later */ + ssock_param.verify_peer = listener->tls_setting.verify_server; + if (ssock_param.send_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.send_buffer_size = PJSIP_MAX_PKT_LEN; + if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN) + ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN; + ssock_param.qos_type = listener->tls_setting.qos_type; + ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error; + pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params, + sizeof(ssock_param.qos_params)); + + switch(listener->tls_setting.method) { + case PJSIP_TLSV1_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_TLS1; + break; + case PJSIP_SSLV2_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL2; + break; + case PJSIP_SSLV3_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL3; + break; + case PJSIP_SSLV23_METHOD: + ssock_param.proto = PJ_SSL_SOCK_PROTO_SSL23; + break; + default: + ssock_param.proto = PJ_SSL_SOCK_PROTO_DEFAULT; + break; + } + + status = pj_ssl_sock_create(pool, &ssock_param, &ssock); + if (status != PJ_SUCCESS) + return status; + + /* Apply SSL certificate */ + if (listener->cert) { + status = pj_ssl_sock_set_certificate(ssock, pool, listener->cert); + if (status != PJ_SUCCESS) + return status; + } + + /* Initially set bind address to PJ_INADDR_ANY port 0 */ + pj_sockaddr_in_init(&local_addr, NULL, 0); + + /* Create the transport descriptor */ + status = tls_create(listener, pool, ssock, PJ_FALSE, &local_addr, + (pj_sockaddr_in*)rem_addr, &tls); + if (status != PJ_SUCCESS) + return status; + + /* Set the "pending" SSL socket user data */ + pj_ssl_sock_set_user_data(tls->ssock, tls); + + /* Start asynchronous connect() operation */ + tls->has_pending_connect = PJ_TRUE; + status = pj_ssl_sock_start_connect(tls->ssock, tls->base.pool, + (pj_sockaddr_t*)&local_addr, + (pj_sockaddr_t*)rem_addr, + addr_len); + if (status == PJ_SUCCESS) { + on_connect_complete(tls->ssock, PJ_SUCCESS); + } else if (status != PJ_EPENDING) { + tls_destroy(&tls->base, status); + return status; + } + + if (tls->has_pending_connect) { + pj_ssl_sock_info info; + + /* Update local address, just in case local address currently set is + * different now that asynchronous connect() is started. + */ + + /* Retrieve the bound address */ + status = pj_ssl_sock_get_info(tls->ssock, &info); + if (status == PJ_SUCCESS) { + pj_uint16_t new_port; + + new_port = pj_sockaddr_get_port((pj_sockaddr_t*)&info.local_addr); + + if (pj_sockaddr_has_addr((pj_sockaddr_t*)&info.local_addr)) { + /* Update sockaddr */ + pj_sockaddr_cp((pj_sockaddr_t*)&tls->base.local_addr, + (pj_sockaddr_t*)&info.local_addr); + } else if (new_port && new_port != pj_sockaddr_get_port( + (pj_sockaddr_t*)&tls->base.local_addr)) + { + /* Update port only */ + pj_sockaddr_set_port(&tls->base.local_addr, + new_port); + } + + sockaddr_to_host_port(tls->base.pool, &tls->base.local_name, + (pj_sockaddr_in*)&tls->base.local_addr); + } + + PJ_LOG(4,(tls->base.obj_name, + "TLS transport %.*s:%d is connecting to %.*s:%d...", + (int)tls->base.local_name.host.slen, + tls->base.local_name.host.ptr, + tls->base.local_name.port, + (int)tls->base.remote_name.host.slen, + tls->base.remote_name.host.ptr, + tls->base.remote_name.port)); + } + + /* Done */ + *p_transport = &tls->base; + + return PJ_SUCCESS; +} + + +/* + * This callback is called by SSL socket when pending accept() operation + * has completed. + */ +static pj_bool_t on_accept_complete(pj_ssl_sock_t *ssock, + pj_ssl_sock_t *new_ssock, + const pj_sockaddr_t *src_addr, + int src_addr_len) +{ + struct tls_listener *listener; + struct tls_transport *tls; + char addr[PJ_INET6_ADDRSTRLEN+10]; + pj_status_t status; + + PJ_UNUSED_ARG(src_addr_len); + + listener = (struct tls_listener*) pj_ssl_sock_get_user_data(ssock); + + PJ_ASSERT_RETURN(new_ssock, PJ_TRUE); + + PJ_LOG(4,(listener->factory.obj_name, + "TLS listener %.*s:%d: got incoming TLS connection " + "from %s, sock=%d", + (int)listener->factory.addr_name.host.slen, + listener->factory.addr_name.host.ptr, + listener->factory.addr_name.port, + pj_sockaddr_print(src_addr, addr, sizeof(addr), 3), + new_ssock)); + + /* + * Incoming connection! + * Create TLS transport for the new socket. + */ + status = tls_create( listener, NULL, new_ssock, PJ_TRUE, + (const pj_sockaddr_in*)&listener->factory.local_addr, + (const pj_sockaddr_in*)src_addr, &tls); + + if (status == PJ_SUCCESS) { + /* Set the "pending" SSL socket user data */ + pj_ssl_sock_set_user_data(new_ssock, tls); + + status = tls_start_read(tls); + if (status != PJ_SUCCESS) { + PJ_LOG(3,(tls->base.obj_name, "New transport cancelled")); + tls_destroy(&tls->base, status); + } else { + /* Start keep-alive timer */ + if (PJSIP_TCP_KEEP_ALIVE_INTERVAL) { + pj_time_val delay = {PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0}; + pjsip_endpt_schedule_timer(listener->endpt, + &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; + pj_gettimeofday(&tls->last_activity); + } + } + } + + return PJ_TRUE; +} + + +/* + * Callback from ioqueue when packet is sent. + */ +static pj_bool_t on_data_sent(pj_ssl_sock_t *ssock, + pj_ioqueue_op_key_t *op_key, + pj_ssize_t bytes_sent) +{ + struct tls_transport *tls = (struct tls_transport*) + pj_ssl_sock_get_user_data(ssock); + pjsip_tx_data_op_key *tdata_op_key = (pjsip_tx_data_op_key*)op_key; + + /* Note that op_key may be the op_key from keep-alive, thus + * it will not have tdata etc. + */ + + tdata_op_key->tdata = NULL; + + if (tdata_op_key->callback) { + /* + * Notify sip_transport.c that packet has been sent. + */ + if (bytes_sent == 0) + bytes_sent = -PJ_RETURN_OS_ERROR(OSERR_ENOTCONN); + + tdata_op_key->callback(&tls->base, tdata_op_key->token, bytes_sent); + + /* Mark last activity time */ + pj_gettimeofday(&tls->last_activity); + + } + + /* Check for error/closure */ + if (bytes_sent <= 0) { + pj_status_t status; + + PJ_LOG(5,(tls->base.obj_name, "TLS send() error, sent=%d", + bytes_sent)); + + status = (bytes_sent == 0) ? PJ_RETURN_OS_ERROR(OSERR_ENOTCONN) : + -bytes_sent; + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + + return PJ_FALSE; + } + + return PJ_TRUE; +} + + +/* + * This callback is called by transport manager to send SIP message + */ +static pj_status_t tls_send_msg(pjsip_transport *transport, + pjsip_tx_data *tdata, + const pj_sockaddr_t *rem_addr, + int addr_len, + void *token, + pjsip_transport_callback callback) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + pj_ssize_t size; + pj_bool_t delayed = PJ_FALSE; + pj_status_t status = PJ_SUCCESS; + + /* Sanity check */ + PJ_ASSERT_RETURN(transport && tdata, PJ_EINVAL); + + /* Check that there's no pending operation associated with the tdata */ + PJ_ASSERT_RETURN(tdata->op_key.tdata == NULL, PJSIP_EPENDINGTX); + + /* Check the address is supported */ + PJ_ASSERT_RETURN(rem_addr && addr_len==sizeof(pj_sockaddr_in), PJ_EINVAL); + + + + /* Init op key. */ + tdata->op_key.tdata = tdata; + tdata->op_key.token = token; + tdata->op_key.callback = callback; + + /* If asynchronous connect() has not completed yet, just put the + * transmit data in the pending transmission list since we can not + * use the socket yet. + */ + if (tls->has_pending_connect) { + + /* + * Looks like connect() is still in progress. Check again (this time + * with holding the lock) to be sure. + */ + pj_lock_acquire(tls->base.lock); + + if (tls->has_pending_connect) { + struct delayed_tdata *delayed_tdata; + + /* + * connect() is still in progress. Put the transmit data to + * the delayed list. + */ + delayed_tdata = PJ_POOL_ALLOC_T(tdata->pool, + struct delayed_tdata); + delayed_tdata->tdata_op_key = &tdata->op_key; + + pj_list_push_back(&tls->delayed_list, delayed_tdata); + status = PJ_EPENDING; + + /* Prevent pj_ioqueue_send() to be called below */ + delayed = PJ_TRUE; + } + + pj_lock_release(tls->base.lock); + } + + if (!delayed) { + /* + * Transport is ready to go. Send the packet to ioqueue to be + * sent asynchronously. + */ + size = tdata->buf.cur - tdata->buf.start; + status = pj_ssl_sock_send(tls->ssock, + (pj_ioqueue_op_key_t*)&tdata->op_key, + tdata->buf.start, &size, 0); + + if (status != PJ_EPENDING) { + /* Not pending (could be immediate success or error) */ + tdata->op_key.tdata = NULL; + + /* Shutdown transport on closure/errors */ + if (size <= 0) { + + PJ_LOG(5,(tls->base.obj_name, "TLS send() error, sent=%d", + size)); + + if (status == PJ_SUCCESS) + status = PJ_RETURN_OS_ERROR(OSERR_ENOTCONN); + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + } + } + } + + return status; +} + + +/* + * This callback is called by transport manager to shutdown transport. + */ +static pj_status_t tls_shutdown(pjsip_transport *transport) +{ + struct tls_transport *tls = (struct tls_transport*)transport; + + /* Stop keep-alive timer. */ + if (tls->ka_timer.id) { + pjsip_endpt_cancel_timer(tls->base.endpt, &tls->ka_timer); + tls->ka_timer.id = PJ_FALSE; + } + + return PJ_SUCCESS; +} + + +/* + * Callback from ioqueue that an incoming data is received from the socket. + */ +static pj_bool_t on_data_read(pj_ssl_sock_t *ssock, + void *data, + pj_size_t size, + pj_status_t status, + pj_size_t *remainder) +{ + enum { MAX_IMMEDIATE_PACKET = 10 }; + struct tls_transport *tls; + pjsip_rx_data *rdata; + + PJ_UNUSED_ARG(data); + + tls = (struct tls_transport*) pj_ssl_sock_get_user_data(ssock); + rdata = &tls->rdata; + + /* Don't do anything if transport is closing. */ + if (tls->is_closing) { + tls->is_closing++; + return PJ_FALSE; + } + + /* Houston, we have packet! Report the packet to transport manager + * to be parsed. + */ + if (status == PJ_SUCCESS) { + pj_size_t size_eaten; + + /* Mark this as an activity */ + pj_gettimeofday(&tls->last_activity); + + pj_assert((void*)rdata->pkt_info.packet == data); + + /* Init pkt_info part. */ + rdata->pkt_info.len = size; + rdata->pkt_info.zero = 0; + pj_gettimeofday(&rdata->pkt_info.timestamp); + + /* Report to transport manager. + * The transport manager will tell us how many bytes of the packet + * have been processed (as valid SIP message). + */ + size_eaten = + pjsip_tpmgr_receive_packet(rdata->tp_info.transport->tpmgr, + rdata); + + pj_assert(size_eaten <= (pj_size_t)rdata->pkt_info.len); + + /* Move unprocessed data to the front of the buffer */ + *remainder = size - size_eaten; + if (*remainder > 0 && *remainder != size) { + pj_memmove(rdata->pkt_info.packet, + rdata->pkt_info.packet + size_eaten, + *remainder); + } + + } else { + + /* Transport is closed */ + PJ_LOG(4,(tls->base.obj_name, "TLS connection closed")); + + /* We can not destroy the transport since high level objects may + * still keep reference to this transport. So we can only + * instruct transport manager to gracefully start the shutdown + * procedure for this transport. + */ + if (tls->close_reason==PJ_SUCCESS) + tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + + return PJ_FALSE; + + } + + /* Reset pool. */ + pj_pool_reset(rdata->tp_info.pool); + + return PJ_TRUE; +} + + +/* + * Callback from ioqueue when asynchronous connect() operation completes. + */ +static pj_bool_t on_connect_complete(pj_ssl_sock_t *ssock, + pj_status_t status) +{ + struct tls_transport *tls; + pj_ssl_sock_info info; + + tls = (struct tls_transport*) pj_ssl_sock_get_user_data(ssock); + + /* Check connect() status */ + if (status != PJ_SUCCESS) { + + tls_perror(tls->base.obj_name, "TLS connect() error", status); + + /* Cancel all delayed transmits */ + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pj_ioqueue_op_key_t *op_key; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + on_data_sent(tls->ssock, op_key, -status); + } + + /* We can not destroy the transport since high level objects may + * still keep reference to this transport. So we can only + * instruct transport manager to gracefully start the shutdown + * procedure for this transport. + */ + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + return PJ_FALSE; + } + + /* Update (again) local address, just in case local address currently + * set is different now that the socket is connected (could happen + * on some systems, like old Win32 probably?). + */ + + /* Retrieve the bound address */ + status = pj_ssl_sock_get_info(tls->ssock, &info); + if (status == PJ_SUCCESS) { + pj_sockaddr_in addr; + pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tls->base.local_addr; + + pj_sockaddr_cp((pj_sockaddr_t*)&addr, (pj_sockaddr_t*)&info.local_addr); + if (tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) { + tp_addr->sin_addr.s_addr = addr.sin_addr.s_addr; + tp_addr->sin_port = addr.sin_port; + sockaddr_to_host_port(tls->base.pool, &tls->base.local_name, + tp_addr); + } + } + + PJ_LOG(4,(tls->base.obj_name, + "TLS transport %.*s:%d is connected to %.*s:%d", + (int)tls->base.local_name.host.slen, + tls->base.local_name.host.ptr, + tls->base.local_name.port, + (int)tls->base.remote_name.host.slen, + tls->base.remote_name.host.ptr, + tls->base.remote_name.port)); + + /* Mark that pending connect() operation has completed. */ + tls->has_pending_connect = PJ_FALSE; + + /* Start pending read */ + status = tls_start_read(tls); + if (status != PJ_SUCCESS) { + /* We can not destroy the transport since high level objects may + * still keep reference to this transport. So we can only + * instruct transport manager to gracefully start the shutdown + * procedure for this transport. + */ + if (tls->close_reason==PJ_SUCCESS) tls->close_reason = status; + pjsip_transport_shutdown(&tls->base); + return PJ_FALSE; + } + + /* Flush all pending send operations */ + tls_flush_pending_tx(tls); + + /* Start keep-alive timer */ + if (PJSIP_TCP_KEEP_ALIVE_INTERVAL) { + pj_time_val delay = { PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0 }; + pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; + pj_gettimeofday(&tls->last_activity); + } + + return PJ_TRUE; +} + + +/* Transport keep-alive timer callback */ +static void tls_keep_alive_timer(pj_timer_heap_t *th, pj_timer_entry *e) +{ + struct tls_transport *tls = (struct tls_transport*) e->user_data; + pj_time_val delay; + pj_time_val now; + pj_ssize_t size; + pj_status_t status; + + PJ_UNUSED_ARG(th); + + tls->ka_timer.id = PJ_TRUE; + + pj_gettimeofday(&now); + PJ_TIME_VAL_SUB(now, tls->last_activity); + + if (now.sec > 0 && now.sec < PJSIP_TCP_KEEP_ALIVE_INTERVAL) { + /* There has been activity, so don't send keep-alive */ + delay.sec = PJSIP_TCP_KEEP_ALIVE_INTERVAL - now.sec; + delay.msec = 0; + + pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; + return; + } + + PJ_LOG(5,(tls->base.obj_name, "Sending %d byte(s) keep-alive to %.*s:%d", + (int)tls->ka_pkt.slen, (int)tls->base.remote_name.host.slen, + tls->base.remote_name.host.ptr, + tls->base.remote_name.port)); + + /* Send the data */ + size = tls->ka_pkt.slen; + status = pj_ssl_sock_send(tls->ssock, &tls->ka_op_key.key, + tls->ka_pkt.ptr, &size, 0); + + if (status != PJ_SUCCESS && status != PJ_EPENDING) { + tls_perror(tls->base.obj_name, + "Error sending keep-alive packet", status); + pjsip_transport_shutdown(&tls->base); + return; + } + + /* Register next keep-alive */ + delay.sec = PJSIP_TCP_KEEP_ALIVE_INTERVAL; + delay.msec = 0; + + pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, + &delay); + tls->ka_timer.id = PJ_TRUE; +} + +#endif /* PJSIP_HAS_TLS_TRANSPORT */ diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c index d9ea1994119352bb9c95fdbbe64b693e4d36dd81..cb815fc169edab9ae54b80a01a72fda59a2324c2 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_tls_ossl.c @@ -225,6 +225,8 @@ static pj_status_t tls_create(struct tls_listener *listener, struct tls_transport **p_tls); + + /**************************************************************************** * SSL FUNCTIONS */ @@ -959,7 +961,7 @@ PJ_DEF(pj_status_t) pjsip_tls_transport_start( pjsip_endpoint *endpt, listener = PJ_POOL_ZALLOC_T(pool, struct tls_listener); listener->factory.pool = pool; listener->factory.type = PJSIP_TRANSPORT_TLS; - listener->factory.type_name = "TLS"; + listener->factory.type_name = "tls"; listener->factory.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); listener->sock = PJ_INVALID_SOCKET; @@ -1270,7 +1272,7 @@ static pj_status_t tls_create( struct tls_listener *listener, tls->base.key.type = PJSIP_TRANSPORT_TLS; pj_memcpy(&tls->base.key.rem_addr, remote, sizeof(pj_sockaddr_in)); - tls->base.type_name = "TLS"; + tls->base.type_name = "tls"; tls->base.flag = pjsip_transport_get_flag_from_type(PJSIP_TRANSPORT_TLS); tls->base.info = (char*) pj_pool_alloc(pool, 64); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp index d8501b89ed21f8a397da67215b2a363614110a92..7fc80e2b170b2f3e136fc11d5c2c9f13b2a78fdc 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_transport_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_transport_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c index 7577a8f446100cd91ef26fbb68dcf5ba10ce3332..421a3771c2cc45186262ff5b645cdf40e95596f8 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util.c @@ -1,4 +1,4 @@ -/* $Id: sip_util.c 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: sip_util.c 2932 2009-10-09 12:11:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -754,6 +754,18 @@ PJ_DEF(pj_status_t) pjsip_endpt_create_cancel( pjsip_endpoint *endpt, break; } + /* Must also copy the saved strict route header, otherwise CANCEL will be + * sent with swapped Route and request URI! + */ + if (req_tdata->saved_strict_route) { + cancel_tdata->saved_strict_route = (pjsip_route_hdr*) + pjsip_hdr_clone(cancel_tdata->pool, req_tdata->saved_strict_route); + } + + /* Finally copy the destination info from the original request */ + pj_memcpy(&cancel_tdata->dest_info, &req_tdata->dest_info, + sizeof(req_tdata->dest_info)); + /* Done. * Return the transmit buffer containing the CANCEL request. */ @@ -1057,7 +1069,7 @@ static void stateless_send_transport_cb( void *token, * (2) Failure (i.e. sent <= 0) */ cont = (sent > 0) ? PJ_FALSE : - (stateless_data->cur_addr<stateless_data->addr.count-1); + (tdata->dest_info.cur_addr<tdata->dest_info.addr.count-1); if (stateless_data->app_cb) { (*stateless_data->app_cb)(stateless_data, sent, &cont); } else { @@ -1084,11 +1096,11 @@ static void stateless_send_transport_cb( void *token, * first invocation. */ if (sent != -PJ_EPENDING) { - stateless_data->cur_addr++; + tdata->dest_info.cur_addr++; } /* Have next address? */ - if (stateless_data->cur_addr >= stateless_data->addr.count) { + if (tdata->dest_info.cur_addr >= tdata->dest_info.addr.count) { /* This only happens when a rather buggy application has * sent 'cont' to PJ_TRUE when the initial value was PJ_FALSE. * In this case just stop the processing; we don't need to @@ -1100,9 +1112,9 @@ static void stateless_send_transport_cb( void *token, } /* Keep current server address information handy. */ - cur_addr = &stateless_data->addr.entry[stateless_data->cur_addr].addr; - cur_addr_type = stateless_data->addr.entry[stateless_data->cur_addr].type; - cur_addr_len = stateless_data->addr.entry[stateless_data->cur_addr].addr_len; + cur_addr = &tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr; + cur_addr_type = tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].type; + cur_addr_len = tdata->dest_info.addr.entry[tdata->dest_info.cur_addr].addr_len; /* Acquire transport. */ status = pjsip_endpt_acquire_transport( stateless_data->endpt, @@ -1178,6 +1190,7 @@ stateless_send_resolver_callback( pj_status_t status, const struct pjsip_server_addresses *addr) { pjsip_send_state *stateless_data = (pjsip_send_state*) token; + pjsip_tx_data *tdata = stateless_data->tdata; /* Fail on server resolution. */ if (status != PJ_SUCCESS) { @@ -1185,12 +1198,16 @@ stateless_send_resolver_callback( pj_status_t status, pj_bool_t cont = PJ_FALSE; (*stateless_data->app_cb)(stateless_data, -status, &cont); } - pjsip_tx_data_dec_ref(stateless_data->tdata); + pjsip_tx_data_dec_ref(tdata); return; } /* Copy server addresses */ - pj_memcpy( &stateless_data->addr, addr, sizeof(pjsip_server_addresses)); + if (addr && addr != &tdata->dest_info.addr) { + pj_memcpy( &tdata->dest_info.addr, addr, + sizeof(pjsip_server_addresses)); + } + pj_assert(tdata->dest_info.addr.count != 0); #if !defined(PJSIP_DONT_SWITCH_TO_TCP) || PJSIP_DONT_SWITCH_TO_TCP==0 /* RFC 3261 section 18.1.1: @@ -1199,29 +1216,33 @@ stateless_send_resolver_callback( pj_status_t status, * using an RFC 2914 [43] congestion controlled transport protocol, such * as TCP. */ - if (stateless_data->tdata->msg->type == PJSIP_REQUEST_MSG && - addr->count > 0 && - addr->entry[0].type == PJSIP_TRANSPORT_UDP) + if (tdata->msg->type == PJSIP_REQUEST_MSG && + tdata->dest_info.addr.count > 0 && + tdata->dest_info.addr.entry[0].type == PJSIP_TRANSPORT_UDP) { int len; /* Encode the request */ - status = pjsip_tx_data_encode(stateless_data->tdata); + status = pjsip_tx_data_encode(tdata); if (status != PJ_SUCCESS) { if (stateless_data->app_cb) { pj_bool_t cont = PJ_FALSE; (*stateless_data->app_cb)(stateless_data, -status, &cont); } - pjsip_tx_data_dec_ref(stateless_data->tdata); + pjsip_tx_data_dec_ref(tdata); return; } /* Check if request message is larger than 1300 bytes. */ - len = stateless_data->tdata->buf.cur - - stateless_data->tdata->buf.start; + len = tdata->buf.cur - tdata->buf.start; if (len >= PJSIP_UDP_SIZE_THRESHOLD) { int i; - int count = stateless_data->addr.count; + int count = tdata->dest_info.addr.count; + + PJ_LOG(5,(THIS_FILE, "%s exceeds UDP size threshold (%u), " + "sending with TCP", + pjsip_tx_data_get_info(tdata), + PJSIP_UDP_SIZE_THRESHOLD)); /* Insert "TCP version" of resolved UDP addresses at the * beginning. @@ -1229,19 +1250,18 @@ stateless_send_resolver_callback( pj_status_t status, if (count * 2 > PJSIP_MAX_RESOLVED_ADDRESSES) count = PJSIP_MAX_RESOLVED_ADDRESSES / 2; for (i = 0; i < count; ++i) { - pj_memcpy(&stateless_data->addr.entry[i+count], - &stateless_data->addr.entry[i], - sizeof(stateless_data->addr.entry[0])); - stateless_data->addr.entry[i].type = PJSIP_TRANSPORT_TCP; + pj_memcpy(&tdata->dest_info.addr.entry[i+count], + &tdata->dest_info.addr.entry[i], + sizeof(tdata->dest_info.addr.entry[0])); + tdata->dest_info.addr.entry[i].type = PJSIP_TRANSPORT_TCP; } - stateless_data->addr.count = count * 2; + tdata->dest_info.addr.count = count * 2; } } #endif /* !PJSIP_DONT_SWITCH_TO_TCP */ /* Process the addresses. */ - stateless_send_transport_cb( stateless_data, stateless_data->tdata, - -PJ_EPENDING); + stateless_send_transport_cb( stateless_data, tdata, -PJ_EPENDING); } /* @@ -1275,11 +1295,22 @@ PJ_DEF(pj_status_t) pjsip_endpt_send_request_stateless(pjsip_endpoint *endpt, stateless_data->tdata = tdata; stateless_data->app_cb = cb; - /* Resolve destination host. - * The processing then resumed when the resolving callback is called. + /* If destination info has not been initialized (this applies for most + * all requests except CANCEL), resolve destination host. The processing + * then resumed when the resolving callback is called. For CANCEL, the + * destination info must have been copied from the original INVITE so + * proceed to sending the request directly. */ - pjsip_endpt_resolve( endpt, tdata->pool, &dest_info, stateless_data, - &stateless_send_resolver_callback); + if (tdata->dest_info.addr.count == 0) { + pjsip_endpt_resolve( endpt, tdata->pool, &dest_info, stateless_data, + &stateless_send_resolver_callback); + } else { + PJ_LOG(5,(THIS_FILE, "%s: skipping target resolution because " + "address is already set", + pjsip_tx_data_get_info(tdata))); + stateless_send_resolver_callback(PJ_SUCCESS, stateless_data, + &tdata->dest_info.addr); + } return PJ_SUCCESS; } @@ -1590,7 +1621,7 @@ static void send_response_resolver_cb( pj_status_t status, void *token, } /* Update address in send_state. */ - send_state->addr = *addr; + pj_memcpy(&send_state->tdata->dest_info.addr, addr, sizeof(*addr)); /* Send response using the transoprt. */ status = pjsip_transport_send( send_state->cur_transport, diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp index caa9f9f73fceb8e9166919fccb709a4edf516222..0e394ee4f6f80a717f879ddba901477970e572b4 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_proxy_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_util_proxy_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp index b27a511a2c0e88c077f880c0da7117f9038ab99f..06a93441903cd22f55b1a4d6110ccd41e45c0728 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsip/sip_util_wrap.cpp @@ -1,5 +1,5 @@ /* $Id: sip_util_wrap.cpp 2873 2009-08-13 11:54:35Z nanang $ */ -/* +/* * Copyright (C) 2009 Teluu Inc. (http://www.teluu.com) * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c index 4c9d6088dd7f302ba86ccab66ef5820a63bb5de5..26db69e35ab35feb5652eac79e31adf66e3793cb 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_acc.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_acc.c 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: pjsua_acc.c 3032 2009-12-14 11:13:45Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -328,7 +328,11 @@ PJ_DEF(pj_status_t) pjsua_acc_add( const pjsua_acc_config *cfg, /* If accounts has registration enabled, start registration */ if (pjsua_var.acc[id].cfg.reg_uri.slen) pjsua_acc_set_registration(id, PJ_TRUE); - + else { + /* Otherwise subscribe to MWI, if it's enabled */ + if (pjsua_var.acc[id].cfg.mwi_enabled) + pjsua_start_mwi(&pjsua_var.acc[id]); + } return PJ_SUCCESS; } @@ -683,6 +687,19 @@ static pj_bool_t acc_check_nat_addr(pjsua_acc *acc, return PJ_FALSE; } + /* Also don't switch if only the port number part is different, and + * the Via received address is private. + * See http://trac.pjsip.org/repos/ticket/864 + */ + if (acc->cfg.allow_contact_rewrite != 2 && + pj_sockaddr_cmp(&contact_addr, &recv_addr)==0 && + is_private_ip(via_addr)) + { + /* Don't switch */ + pj_pool_release(pool); + return PJ_FALSE; + } + PJ_LOG(3,(THIS_FILE, "IP address change detected for account %d " "(%.*s:%d --> %.*s:%d). Updating registration..", acc->index, @@ -739,16 +756,9 @@ static pj_bool_t acc_check_nat_addr(pjsua_acc *acc, pj_strdup2_with_null(acc->pool, &acc->contact, tmp); } - /* For UDP transport, if STUN is enabled then update the transport's - * published name as well. - */ - if (tp->key.type==PJSIP_TRANSPORT_UDP && - (pjsua_var.ua_cfg.stun_domain.slen != 0 || - pjsua_var.ua_cfg.stun_host.slen != 0)) - { - pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); - tp->local_name.port = rport; - } + /* Always update, by http://trac.pjsip.org/repos/ticket/864. */ + pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); + tp->local_name.port = rport; /* Perform new registration */ pjsua_acc_set_registration(acc->index, PJ_TRUE); @@ -1056,6 +1066,10 @@ static void regc_cb(struct pjsip_regc_cbparam *param) /* Send initial PUBLISH if it is enabled */ if (acc->cfg.publish_enabled && acc->publish_sess==NULL) pjsua_pres_init_publish_acc(acc->index); + + /* Subscribe to MWI, if it's enabled */ + if (acc->cfg.mwi_enabled) + pjsua_start_mwi(acc); } } else { @@ -1597,7 +1611,17 @@ PJ_DEF(pj_status_t) pjsua_acc_create_request(pjsua_acc_id acc_id, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, r)); r = r->next; } - + + /* If account is locked to specific transport, then set that transport to + * the transmit data. + */ + if (pjsua_var.acc[acc_id].cfg.transport_id != PJSUA_INVALID_ID) { + pjsip_tpselector tp_sel; + + pjsua_init_tpselector(acc->cfg.transport_id, &tp_sel); + pjsip_tx_data_set_transport(tdata, &tp_sel); + } + /* Done */ *p_tdata = tdata; return PJ_SUCCESS; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c index 9729899cedb96ab29ff3321499ba64911578fe51..4f882c531c3586c3cd7b3c541405a73305c324cd 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_call.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_call.c 2869 2009-08-12 17:53:47Z bennylp $ */ +/* $Id: pjsua_call.c 3013 2009-11-11 00:33:00Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -133,6 +133,11 @@ pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg) /* Copy config */ pjsua_config_dup(pjsua_var.pool, &pjsua_var.ua_cfg, cfg); + /* Verify settings */ + if (pjsua_var.ua_cfg.max_calls >= PJSUA_MAX_CALLS) { + pjsua_var.ua_cfg.max_calls = PJSUA_MAX_CALLS; + } + /* Check the route URI's and force loose route if required */ for (i=0; i<pjsua_var.ua_cfg.outbound_proxy_cnt; ++i) { status = normalize_route_uri(pjsua_var.pool, @@ -384,13 +389,16 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, call_id = alloc_call_id(); if (call_id == PJSUA_INVALID_ID) { - pjsua_perror(THIS_FILE, "Error making file", PJ_ETOOMANY); + pjsua_perror(THIS_FILE, "Error making call", PJ_ETOOMANY); PJSUA_UNLOCK(); return PJ_ETOOMANY; } call = &pjsua_var.calls[call_id]; + /* Associate session with account */ + call->acc_id = acc_id; + /* Create temporary pool */ tmp_pool = pjsua_pool_create("tmpcall10", 512, 256); @@ -499,7 +507,6 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, } /* Create and associate our data in the session. */ - call->acc_id = acc_id; call->inv = inv; dlg->mod_data[pjsua_var.mod.id] = call; @@ -645,6 +652,14 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) if (dlg || tsx) return PJ_FALSE; + /* Don't want to accept the call if shutdown is in progress */ + if (pjsua_var.thread_quit_flag) { + pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, + PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, + NULL, NULL); + return PJ_TRUE; + } + PJSUA_LOCK(); /* Find free call slot. */ @@ -2821,11 +2836,11 @@ PJ_DEF(pj_status_t) pjsua_call_dump( pjsua_call_id call_id, *p = '\0'; } - /* Get SRTP status */ + /* Get and ICE SRTP status */ pjmedia_transport_info_init(&tp_info); pjmedia_transport_get_info(call->med_tp, &tp_info); if (tp_info.specific_info_cnt > 0) { - int i; + unsigned i; for (i = 0; i < tp_info.specific_info_cnt; ++i) { if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP) { @@ -2842,7 +2857,23 @@ PJ_DEF(pj_status_t) pjsua_call_dump( pjsua_call_id call_id, *p++ = '\n'; *p = '\0'; } - break; + } else if (tp_info.spc_info[i].type==PJMEDIA_TRANSPORT_TYPE_ICE) { + const pjmedia_ice_transport_info *ii; + + ii = (const pjmedia_ice_transport_info*) + tp_info.spc_info[i].buffer; + + len = pj_ansi_snprintf(p, end-p, + "%s ICE role: %s, state: %s, comp_cnt: %u", + indent, + pj_ice_sess_role_name(ii->role), + pj_ice_strans_state_name(ii->sess_state), + ii->comp_cnt); + if (len > 0 && len < end-p) { + p += len; + *p++ = '\n'; + *p = '\0'; + } } } } @@ -2942,18 +2973,18 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv, ev_state = PJSIP_EVSUB_STATE_ACTIVE; break; + case PJSIP_INV_STATE_CONFIRMED: #if 0 /* We don't need this, as we've terminated the subscription in * CONNECTING state. */ - case PJSIP_INV_STATE_CONFIRMED: /* When state is confirmed, send the final 200/OK and terminate * subscription. */ st_code = e->body.tsx_state.tsx->status_code; ev_state = PJSIP_EVSUB_STATE_TERMINATED; - break; #endif + break; case PJSIP_INV_STATE_DISCONNECTED: st_code = e->body.tsx_state.tsx->status_code; diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c index e8d2fd9767924921ad65ba0e6ce1b62d73a048a1..7974c536c3ccda7bfc49c5906e4356634d1b2f7d 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_core.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_core.c 2895 2009-08-17 16:30:04Z nanang $ */ +/* $Id: pjsua_core.c 3021 2009-11-20 23:33:07Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -101,6 +101,7 @@ PJ_DEF(void) pjsua_config_default(pjsua_config *cfg) cfg->nat_type_in_sdp = 1; cfg->stun_ignore_failure = PJ_TRUE; cfg->force_lr = PJ_TRUE; + cfg->enable_unsolicited_mwi = PJ_TRUE; #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) cfg->use_srtp = PJSUA_DEFAULT_USE_SRTP; cfg->srtp_secure_signaling = PJSUA_DEFAULT_SRTP_SECURE_SIGNALING; @@ -161,6 +162,9 @@ PJ_DEF(void) pjsua_acc_config_default(pjsua_acc_config *cfg) pj_bzero(cfg, sizeof(*cfg)); cfg->reg_timeout = PJSUA_REG_INTERVAL; + cfg->unreg_timeout = PJSUA_UNREG_TIMEOUT; + pjsip_publishc_opt_default(&cfg->publish_opt); + cfg->unpublish_max_wait_time_msec = PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC; cfg->transport_id = PJSUA_INVALID_ID; cfg->allow_contact_rewrite = PJ_TRUE; cfg->require_100rel = pjsua_var.ua_cfg.require_100rel; @@ -303,6 +307,14 @@ static pj_bool_t options_on_rx_request(pjsip_rx_data *rdata) return PJ_FALSE; } + /* Don't want to handle if shutdown is in progress */ + if (pjsua_var.thread_quit_flag) { + pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, + PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, + NULL, NULL); + return PJ_TRUE; + } + /* Create basic response. */ status = pjsip_endpt_create_response(pjsua_var.endpt, rdata, 200, NULL, &tdata); @@ -809,6 +821,9 @@ PJ_DEF(pj_status_t) pjsua_init( const pjsua_config *ua_cfg, status = pjsip_pres_init_module( pjsua_var.endpt, pjsip_evsub_instance()); PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); + /* Initialize MWI support */ + status = pjsip_mwi_init_module(pjsua_var.endpt, pjsip_evsub_instance()); + /* Init PUBLISH module */ pjsip_publishc_init_module(pjsua_var.endpt); @@ -1227,6 +1242,10 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) } if (pjsua_var.endpt) { + unsigned max_wait; + + PJ_LOG(4,(THIS_FILE, "Shutting down...")); + /* Terminate all calls. */ pjsua_call_hangup_all(); @@ -1241,6 +1260,45 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) /* Terminate all presence subscriptions. */ pjsua_pres_shutdown(); + /* Destroy media (to shutdown media transports etc) */ + pjsua_media_subsys_destroy(); + + /* Wait for sometime until all publish client sessions are done + * (ticket #364) + */ + /* First stage, get the maximum wait time */ + max_wait = 100; + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (!pjsua_var.acc[i].valid) + continue; + if (pjsua_var.acc[i].cfg.unpublish_max_wait_time_msec > max_wait) + max_wait = pjsua_var.acc[i].cfg.unpublish_max_wait_time_msec; + } + + /* Second stage, wait for unpublications to complete */ + for (i=0; i<(int)(max_wait/50); ++i) { + unsigned j; + for (j=0; j<PJ_ARRAY_SIZE(pjsua_var.acc); ++j) { + if (!pjsua_var.acc[j].valid) + continue; + + if (pjsua_var.acc[j].publish_sess) + break; + } + if (j != PJ_ARRAY_SIZE(pjsua_var.acc)) + busy_sleep(50); + else + break; + } + + /* Third stage, forcefully destroy unfinished unpublications */ + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (pjsua_var.acc[i].publish_sess) { + pjsip_publishc_destroy(pjsua_var.acc[i].publish_sess); + pjsua_var.acc[i].publish_sess = NULL; + } + } + /* Unregister all accounts */ for (i=0; i<(int)PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { if (!pjsua_var.acc[i].valid) @@ -1250,10 +1308,6 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) pjsua_acc_set_registration(i, PJ_FALSE); } } - } - - /* Destroy endpoint. */ - if (pjsua_var.endpt) { /* Terminate any pending STUN resolution */ if (!pj_list_empty(&pjsua_var.stun_res)) { @@ -1265,23 +1319,40 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) } } + /* Wait until all unregistrations are done (ticket #364) */ + /* First stage, get the maximum wait time */ + max_wait = 100; + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (!pjsua_var.acc[i].valid) + continue; + if (pjsua_var.acc[i].cfg.unreg_timeout > max_wait) + max_wait = pjsua_var.acc[i].cfg.unreg_timeout; + } + + /* Second stage, wait for unregistrations to complete */ + for (i=0; i<(int)(max_wait/50); ++i) { + unsigned j; + for (j=0; j<PJ_ARRAY_SIZE(pjsua_var.acc); ++j) { + if (!pjsua_var.acc[j].valid) + continue; + + if (pjsua_var.acc[j].regc) + break; + } + if (j != PJ_ARRAY_SIZE(pjsua_var.acc)) + busy_sleep(50); + else + break; + } + /* Note variable 'i' is used below */ + /* Wait for some time to allow unregistration and ICE/TURN * transports shutdown to complete: - */ - PJ_LOG(4,(THIS_FILE, "Shutting down...")); - busy_sleep(1000); - - PJ_LOG(4,(THIS_FILE, "Destroying...")); - - /* Terminate all calls again, just in case there's new call - * picked up during busy_sleep() */ - pjsua_call_hangup_all(); + if (i < 20) + busy_sleep(1000 - i*50); - /* Destroy media after all polling is done, as there may be - * incoming request that needs handling (e.g. OPTIONS) - */ - pjsua_media_subsys_destroy(); + PJ_LOG(4,(THIS_FILE, "Destroying...")); /* Must destroy endpoint first before destroying pools in * buddies or accounts, since shutting down transaction layer @@ -1306,9 +1377,6 @@ PJ_DEF(pj_status_t) pjsua_destroy(void) pjsua_var.acc[i].pool = NULL; } } - } else { - /* Destroy media */ - pjsua_media_subsys_destroy(); } /* Destroy mutex */ @@ -1462,12 +1530,12 @@ static const char *addr_string(const pj_sockaddr_t *addr) * address via STUN, depending on config). */ static pj_status_t create_sip_udp_sock(int af, - const pj_str_t *bind_param, - int port, + const pjsua_transport_config *cfg, pj_sock_t *p_sock, pj_sockaddr *p_pub_addr) { char stun_ip_addr[PJ_INET6_ADDRSTRLEN]; + unsigned port = cfg->port; pj_str_t stun_srv; pj_sock_t sock; pj_sockaddr bind_addr; @@ -1481,8 +1549,8 @@ static pj_status_t create_sip_udp_sock(int af, } /* Initialize bound address */ - if (bind_param->slen) { - status = pj_sockaddr_init(af, &bind_addr, bind_param, + if (cfg->bound_addr.slen) { + status = pj_sockaddr_init(af, &bind_addr, &cfg->bound_addr, (pj_uint16_t)port); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, @@ -1494,12 +1562,19 @@ static pj_status_t create_sip_udp_sock(int af, pj_sockaddr_init(af, &bind_addr, NULL, (pj_uint16_t)port); } + /* Create socket */ status = pj_sock_socket(af, pj_SOCK_DGRAM(), 0, &sock); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "socket() error", status); return status; } + /* Apply QoS, if specified */ + status = pj_sock_apply_qos2(sock, cfg->qos_type, + &cfg->qos_params, + 2, THIS_FILE, "SIP UDP socket"); + + /* Bind socket */ status = pj_sock_bind(sock, &bind_addr, pj_sockaddr_get_len(&bind_addr)); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "bind() error", status); @@ -1647,8 +1722,7 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, * (only when public address is not specified). */ status = create_sip_udp_sock(pjsip_transport_type_get_af(type), - &cfg->bound_addr, cfg->port, - &sock, &pub_addr); + cfg, &sock, &pub_addr); if (status != PJ_SUCCESS) goto on_return; @@ -1679,9 +1753,10 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, * Create TCP transport. */ pjsua_transport_config config; - pjsip_host_port a_name; pjsip_tpfactory *tcp; - pj_sockaddr_in local_addr; + pjsip_tcp_transport_cfg tcp_cfg; + + pjsip_tcp_transport_cfg_default(&tcp_cfg, pj_AF_INET()); /* Supply default config if it's not specified */ if (cfg == NULL) { @@ -1689,14 +1764,14 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, cfg = &config; } - /* Init local address */ - pj_sockaddr_in_init(&local_addr, 0, 0); - + /* Configure bind address */ if (cfg->port) - local_addr.sin_port = pj_htons((pj_uint16_t)cfg->port); + pj_sockaddr_set_port(&tcp_cfg.bind_addr, (pj_uint16_t)cfg->port); if (cfg->bound_addr.slen) { - status = pj_sockaddr_in_set_str_addr(&local_addr,&cfg->bound_addr); + status = pj_sockaddr_set_str_addr(tcp_cfg.af, + &tcp_cfg.bind_addr, + &cfg->bound_addr); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Unable to resolve transport bound address", @@ -1705,14 +1780,17 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, } } - /* Init published name */ - pj_bzero(&a_name, sizeof(pjsip_host_port)); + /* Set published name */ if (cfg->public_addr.slen) - a_name.host = cfg->public_addr; + tcp_cfg.addr_name.host = cfg->public_addr; + + /* Copy the QoS settings */ + tcp_cfg.qos_type = cfg->qos_type; + pj_memcpy(&tcp_cfg.qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); /* Create the TCP transport */ - status = pjsip_tcp_transport_start2(pjsua_var.endpt, &local_addr, - &a_name, 1, &tcp); + status = pjsip_tcp_transport_start3(pjsua_var.endpt, &tcp_cfg, &tcp); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error creating SIP TCP listener", @@ -2254,6 +2332,23 @@ PJ_DEF(pj_status_t) pjsua_verify_sip_url(const char *c_url) return p ? 0 : -1; } +/* + * Schedule a timer entry. + */ +PJ_DEF(pj_status_t) pjsua_schedule_timer( pj_timer_entry *entry, + const pj_time_val *delay) +{ + return pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, delay); +} + +/* + * Cancel the previously scheduled timer. + * + */ +PJ_DEF(void) pjsua_cancel_timer(pj_timer_entry *entry) +{ + pjsip_endpt_cancel_timer(pjsua_var.endpt, entry); +} /** * Normalize route URI (check for ";lr" and append one if it doesn't @@ -2314,6 +2409,7 @@ pj_status_t normalize_route_uri(pj_pool_t *pool, pj_str_t *uri) /* Clone the URI */ pj_strdup_with_null(pool, uri, &tmp_uri); + pj_pool_release(tmp_pool); return PJ_SUCCESS; } diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c index 76d57618425f6acb21af0550399cf23bffd709da..9ccf0b02f9cccf54ac219c6d1b3c89e2a1cb8f7b 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_im.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_im.c 2855 2009-08-05 18:41:23Z nanang $ */ +/* $Id: pjsua_im.c 2923 2009-10-01 14:17:49Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -380,6 +380,9 @@ static void im_callback(void *token, pjsip_event *e) /* Must duplicate im_data */ im_data2 = pjsua_im_data_dup(tdata->pool, im_data); + /* Increment CSeq */ + PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq++; + /* Re-send request */ status = pjsip_endpt_send_request( pjsua_var.endpt, tdata, -1, im_data2, &im_callback); @@ -479,6 +482,9 @@ static void typing_callback(void *token, pjsip_event *e) /* Must duplicate im_data */ im_data2 = pjsua_im_data_dup(tdata->pool, im_data); + /* Increment CSeq */ + PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq++; + /* Re-send request */ status = pjsip_endpt_send_request( pjsua_var.endpt, tdata, -1, im_data2, &typing_callback); diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c index e3f57bc3b2eac529ed527301f5c89eb18d12a62a..c07cc9a1b0c09b84d96dde48a879405f30ea2ac3 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_media.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_media.c 2869 2009-08-12 17:53:47Z bennylp $ */ +/* $Id: pjsua_media.c 3041 2010-01-04 13:08:31Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -334,9 +334,6 @@ pj_status_t pjsua_media_subsys_init(const pjsua_media_config *cfg) } #endif - /* Perform NAT detection */ - pjsua_detect_nat_type(); - return PJ_SUCCESS; } @@ -384,13 +381,19 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg, /* Loop retry to bind RTP and RTCP sockets. */ for (i=0; i<RTP_RETRY; ++i, next_rtp_port += 2) { - /* Create and bind RTP socket. */ + /* Create RTP socket. */ status = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock[0]); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "socket() error", status); return status; } + /* Apply QoS to RTP socket, if specified */ + status = pj_sock_apply_qos2(sock[0], cfg->qos_type, + &cfg->qos_params, + 2, THIS_FILE, "RTP socket"); + + /* Bind RTP socket */ status=pj_sock_bind_in(sock[0], pj_ntohl(bound_addr.sin_addr.s_addr), next_rtp_port); if (status != PJ_SUCCESS) { @@ -399,7 +402,7 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg, continue; } - /* Create and bind RTCP socket. */ + /* Create RTCP socket. */ status = pj_sock_socket(pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock[1]); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "socket() error", status); @@ -407,6 +410,12 @@ static pj_status_t create_rtp_rtcp_sock(const pjsua_transport_config *cfg, return status; } + /* Apply QoS to RTCP socket, if specified */ + status = pj_sock_apply_qos2(sock[1], cfg->qos_type, + &cfg->qos_params, + 2, THIS_FILE, "RTCP socket"); + + /* Bind RTCP socket */ status=pj_sock_bind_in(sock[1], pj_ntohl(bound_addr.sin_addr.s_addr), (pj_uint16_t)(next_rtp_port+1)); if (status != PJ_SUCCESS) { @@ -629,6 +638,9 @@ pj_status_t pjsua_media_subsys_start(void) pj_timer_entry_init(&pjsua_var.snd_idle_timer, PJ_FALSE, NULL, &close_snd_timer_cb); + /* Perform NAT detection */ + pjsua_detect_nat_type(); + return PJ_SUCCESS; } @@ -640,6 +652,8 @@ pj_status_t pjsua_media_subsys_destroy(void) { unsigned i; + PJ_LOG(4,(THIS_FILE, "Shutting down media..")); + close_snd_dev(); if (pjsua_var.mconf) { @@ -819,6 +833,33 @@ static void on_ice_complete(pjmedia_transport *tp, if (pjsua_var.ua_cfg.cb.on_call_media_state) { pjsua_var.ua_cfg.cb.on_call_media_state(id); } + } else { + /* Send UPDATE if default transport address is different than + * what was advertised (ticket #881) + */ + pjmedia_transport_info tpinfo; + pjmedia_ice_transport_info *ii = NULL; + unsigned i; + + pjmedia_transport_info_init(&tpinfo); + pjmedia_transport_get_info(tp, &tpinfo); + for (i=0; i<tpinfo.specific_info_cnt; ++i) { + if (tpinfo.spc_info[i].type==PJMEDIA_TRANSPORT_TYPE_ICE) { + ii = (pjmedia_ice_transport_info*) + tpinfo.spc_info[i].buffer; + break; + } + } + + if (ii && ii->role==PJ_ICE_SESS_ROLE_CONTROLLING && + pj_sockaddr_cmp(&tpinfo.sock_info.rtp_addr_name, + &pjsua_var.calls[id].med_rtp_addr)) + { + PJ_LOG(4,(THIS_FILE, + "ICE default transport address has changed for " + "call %d, sending UPDATE", id)); + pjsua_call_update(id, 0, NULL); + } } break; } @@ -852,7 +893,7 @@ static pj_status_t parse_host_port(const pj_str_t *host_port, } /* Create ICE media transports (when ice is enabled) */ -static pj_status_t create_ice_media_transports(void) +static pj_status_t create_ice_media_transports(pjsua_transport_config *cfg) { char stunip[PJ_INET6_ADDRSTRLEN]; pj_ice_strans_cfg ice_cfg; @@ -886,6 +927,11 @@ static pj_status_t create_ice_media_transports(void) if (pjsua_var.media_cfg.ice_max_host_cands >= 0) ice_cfg.stun.max_host_cands = pjsua_var.media_cfg.ice_max_host_cands; + /* Copy QoS setting to STUN setting */ + ice_cfg.stun.cfg.qos_type = cfg->qos_type; + pj_memcpy(&ice_cfg.stun.cfg.qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); + /* Configure TURN settings */ if (pjsua_var.media_cfg.enable_turn) { status = parse_host_port(&pjsua_var.media_cfg.turn_server, @@ -901,6 +947,11 @@ static pj_status_t create_ice_media_transports(void) pj_memcpy(&ice_cfg.turn.auth_cred, &pjsua_var.media_cfg.turn_auth_cred, sizeof(ice_cfg.turn.auth_cred)); + + /* Copy QoS setting to TURN setting */ + ice_cfg.turn.cfg.qos_type = cfg->qos_type; + pj_memcpy(&ice_cfg.turn.cfg.qos_params, &cfg->qos_params, + sizeof(cfg->qos_params)); } /* Create each media transport */ @@ -996,7 +1047,7 @@ PJ_DEF(pj_status_t) pjsua_media_transports_create( /* Create the transports */ if (pjsua_var.media_cfg.enable_ice) { - status = create_ice_media_transports(); + status = create_ice_media_transports(&cfg); } else { status = create_udp_media_transports(&cfg); } @@ -1318,6 +1369,10 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, return status; } + /* Update currently advertised RTP source address */ + pj_memcpy(&call->med_rtp_addr, &tpinfo.sock_info.rtp_addr_name, + sizeof(pj_sockaddr)); + *p_sdp = sdp; return PJ_SUCCESS; } @@ -1337,8 +1392,9 @@ static void stop_media_session(pjsua_call_id call_id) if (call->session) { pjmedia_rtcp_stat stat; - if (pjmedia_session_get_stream_stat(call->session, 0, &stat) - == PJ_SUCCESS) + if ((call->media_dir & PJMEDIA_DIR_ENCODING) && + (pjmedia_session_get_stream_stat(call->session, 0, &stat) + == PJ_SUCCESS)) { /* Save RTP timestamp & sequence, so when media session is * restarted, those values will be restored as the initial @@ -1480,7 +1536,7 @@ pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, pjmedia_transport_info_init(&tp_info); pjmedia_transport_get_info(call->med_tp, &tp_info); if (tp_info.specific_info_cnt > 0) { - int i; + unsigned i; for (i = 0; i < tp_info.specific_info_cnt; ++i) { if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP) { diff --git a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c index a743cbc53db66d04788c5c85d694acadeb45be2b..0f661da5cdc035f5578ba547b5d97131d72ec49e 100644 --- a/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c +++ b/sflphone-common/libs/pjproject/pjsip/src/pjsua-lib/pjsua_pres.c @@ -1,4 +1,4 @@ -/* $Id: pjsua_pres.c 2824 2009-06-30 13:53:47Z bennylp $ */ +/* $Id: pjsua_pres.c 3031 2009-12-10 05:16:23Z bennylp $ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> @@ -24,13 +24,14 @@ #define THIS_FILE "pjsua_pres.c" -static void subscribe_buddy_presence(unsigned index); +static void subscribe_buddy_presence(pjsua_buddy_id buddy_id); +static void unsubscribe_buddy_presence(pjsua_buddy_id buddy_id); /* * Find buddy. */ -static pjsua_buddy_id pjsua_find_buddy(const pjsip_uri *uri) +static pjsua_buddy_id find_buddy(const pjsip_uri *uri) { const pjsip_sip_uri *sip_uri; unsigned i; @@ -60,6 +61,87 @@ static pjsua_buddy_id pjsua_find_buddy(const pjsip_uri *uri) return PJSUA_INVALID_ID; } +#define LOCK_DIALOG 1 +#define LOCK_PJSUA 2 +#define LOCK_ALL (LOCK_DIALOG | LOCK_PJSUA) + +/* Buddy lock object */ +struct buddy_lock +{ + pjsua_buddy *buddy; + pjsip_dialog *dlg; + pj_uint8_t flag; +}; + +/* Acquire lock to the specified buddy_id */ +pj_status_t lock_buddy(const char *title, + pjsua_buddy_id buddy_id, + struct buddy_lock *lck, + unsigned _unused_) +{ + enum { MAX_RETRY=50 }; + pj_bool_t has_pjsua_lock = PJ_FALSE; + unsigned retry; + + PJ_UNUSED_ARG(_unused_); + + pj_bzero(lck, sizeof(*lck)); + + for (retry=0; retry<MAX_RETRY; ++retry) { + + if (PJSUA_TRY_LOCK() != PJ_SUCCESS) { + pj_thread_sleep(retry/10); + continue; + } + + has_pjsua_lock = PJ_TRUE; + lck->flag = LOCK_PJSUA; + lck->buddy = &pjsua_var.buddy[buddy_id]; + + if (lck->buddy->dlg == NULL) + return PJ_SUCCESS; + + if (pjsip_dlg_try_inc_lock(lck->buddy->dlg) != PJ_SUCCESS) { + lck->flag = 0; + lck->buddy = NULL; + has_pjsua_lock = PJ_FALSE; + PJSUA_UNLOCK(); + pj_thread_sleep(retry/10); + continue; + } + + lck->dlg = lck->buddy->dlg; + lck->flag = LOCK_DIALOG; + PJSUA_UNLOCK(); + + break; + } + + if (lck->flag == 0) { + if (has_pjsua_lock == PJ_FALSE) + PJ_LOG(1,(THIS_FILE, "Timed-out trying to acquire PJSUA mutex " + "(possibly system has deadlocked) in %s", + title)); + else + PJ_LOG(1,(THIS_FILE, "Timed-out trying to acquire dialog mutex " + "(possibly system has deadlocked) in %s", + title)); + return PJ_ETIMEDOUT; + } + + return PJ_SUCCESS; +} + +/* Release buddy lock */ +static void unlock_buddy(struct buddy_lock *lck) +{ + if (lck->flag & LOCK_DIALOG) + pjsip_dlg_dec_lock(lck->dlg); + + if (lck->flag & LOCK_PJSUA) + PJSUA_UNLOCK(); +} + /* * Get total number of buddies. @@ -86,8 +168,11 @@ PJ_DEF(pjsua_buddy_id) pjsua_buddy_find(const pj_str_t *uri_str) uri = pjsip_parse_uri(pool, input.ptr, input.slen, 0); if (!uri) buddy_id = PJSUA_INVALID_ID; - else - buddy_id = pjsua_find_buddy(uri); + else { + PJSUA_LOCK(); + buddy_id = find_buddy(uri); + PJSUA_UNLOCK(); + } pj_pool_release(pool); @@ -139,20 +224,22 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, pjsua_buddy_info *info) { unsigned total=0; + struct buddy_lock lck; pjsua_buddy *buddy; + pj_status_t status; - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); - - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); pj_bzero(info, sizeof(pjsua_buddy_info)); - buddy = &pjsua_var.buddy[buddy_id]; + status = lock_buddy("pjsua_buddy_get_info()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; + + buddy = lck.buddy; info->id = buddy->index; if (pjsua_var.buddy[buddy_id].uri.slen == 0) { - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -186,13 +273,19 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, } else { info->status = PJSUA_BUDDY_STATUS_OFFLINE; - info->status_text = pj_str("Offline"); + info->rpid = buddy->status.info[0].rpid; + + if (info->rpid.note.slen) + info->status_text = info->rpid.note; + else + info->status_text = pj_str("Offline"); } /* monitor pres */ info->monitor_pres = buddy->monitor; /* subscription state and termination reason */ + info->sub_term_code = buddy->term_code; if (buddy->sub) { info->sub_state = pjsip_evsub_get_state(buddy->sub); info->sub_state_name = pjsip_evsub_get_state_name(buddy->sub); @@ -218,7 +311,7 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, info->sub_term_reason = pj_str(""); } - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -228,15 +321,18 @@ PJ_DEF(pj_status_t) pjsua_buddy_get_info( pjsua_buddy_id buddy_id, PJ_DEF(pj_status_t) pjsua_buddy_set_user_data( pjsua_buddy_id buddy_id, void *user_data) { - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); + struct buddy_lock lck; + pj_status_t status; - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); + + status = lock_buddy("pjsua_buddy_set_user_data()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; pjsua_var.buddy[buddy_id].user_data = user_data; - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -247,17 +343,19 @@ PJ_DEF(pj_status_t) pjsua_buddy_set_user_data( pjsua_buddy_id buddy_id, */ PJ_DEF(void*) pjsua_buddy_get_user_data(pjsua_buddy_id buddy_id) { + struct buddy_lock lck; + pj_status_t status; void *user_data; - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - NULL); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), NULL); - PJSUA_LOCK(); + status = lock_buddy("pjsua_buddy_get_user_data()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return NULL; user_data = pjsua_var.buddy[buddy_id].user_data; - PJSUA_UNLOCK(); + unlock_buddy(&lck); return user_data; } @@ -382,6 +480,9 @@ PJ_DEF(pj_status_t) pjsua_buddy_add( const pjsua_buddy_config *cfg, */ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) { + struct buddy_lock lck; + pj_status_t status; + PJ_ASSERT_RETURN(buddy_id>=0 && buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), PJ_EINVAL); @@ -390,11 +491,13 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) return PJ_SUCCESS; } + status = lock_buddy("pjsua_buddy_del()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; + /* Unsubscribe presence */ pjsua_buddy_subscribe_pres(buddy_id, PJ_FALSE); - PJSUA_LOCK(); - /* Not interested with further events for this buddy */ if (pjsua_var.buddy[buddy_id].sub) { pjsip_evsub_set_mod_data(pjsua_var.buddy[buddy_id].sub, @@ -405,10 +508,16 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) pjsua_var.buddy[buddy_id].uri.slen = 0; pjsua_var.buddy_cnt--; + /* Clear timer */ + if (pjsua_var.buddy[buddy_id].timer.id) { + pjsua_cancel_timer(&pjsua_var.buddy[buddy_id].timer); + pjsua_var.buddy[buddy_id].timer.id = PJ_FALSE; + } + /* Reset buddy struct */ reset_buddy(buddy_id); - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -419,21 +528,20 @@ PJ_DEF(pj_status_t) pjsua_buddy_del(pjsua_buddy_id buddy_id) PJ_DEF(pj_status_t) pjsua_buddy_subscribe_pres( pjsua_buddy_id buddy_id, pj_bool_t subscribe) { - pjsua_buddy *buddy; - - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); + struct buddy_lock lck; + pj_status_t status; - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); - buddy = &pjsua_var.buddy[buddy_id]; - buddy->monitor = subscribe; + status = lock_buddy("pjsua_buddy_subscribe_pres()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; - PJSUA_UNLOCK(); + lck.buddy->monitor = subscribe; - pjsua_pres_refresh(); + pjsua_buddy_update_pres(buddy_id); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -443,32 +551,32 @@ PJ_DEF(pj_status_t) pjsua_buddy_subscribe_pres( pjsua_buddy_id buddy_id, */ PJ_DEF(pj_status_t) pjsua_buddy_update_pres(pjsua_buddy_id buddy_id) { - pjsua_buddy *buddy; - - PJ_ASSERT_RETURN(buddy_id>=0 && - buddy_id<(int)PJ_ARRAY_SIZE(pjsua_var.buddy), - PJ_EINVAL); + struct buddy_lock lck; + pj_status_t status; - PJSUA_LOCK(); + PJ_ASSERT_RETURN(pjsua_buddy_is_valid(buddy_id), PJ_EINVAL); - buddy = &pjsua_var.buddy[buddy_id]; + status = lock_buddy("pjsua_buddy_update_pres()", buddy_id, &lck, 0); + if (status != PJ_SUCCESS) + return status; - /* Return error if buddy's presence monitoring is not enabled */ - if (!buddy->monitor) { - PJSUA_UNLOCK(); - return PJ_EINVALIDOP; + /* Is this an unsubscribe request? */ + if (!lck.buddy->monitor) { + unsubscribe_buddy_presence(buddy_id); + unlock_buddy(&lck); + return PJ_SUCCESS; } /* Ignore if presence is already active for the buddy */ - if (buddy->sub) { - PJSUA_UNLOCK(); + if (lck.buddy->sub) { + unlock_buddy(&lck); return PJ_SUCCESS; } /* Initiate presence subscription */ subscribe_buddy_presence(buddy_id); - PJSUA_UNLOCK(); + unlock_buddy(&lck); return PJ_SUCCESS; } @@ -682,6 +790,14 @@ static pj_bool_t pres_on_rx_request(pjsip_rx_data *rdata) /* Incoming SUBSCRIBE: */ + /* Don't want to accept the request if shutdown is in progress */ + if (pjsua_var.thread_quit_flag) { + pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, + PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL, + NULL, NULL); + return PJ_TRUE; + } + PJSUA_LOCK(); /* Find which account for the incoming request. */ @@ -797,7 +913,7 @@ static pj_bool_t pres_on_rx_request(pjsip_rx_data *rdata) if (pjsua_var.ua_cfg.cb.on_incoming_subscribe) { pjsua_buddy_id buddy_id; - buddy_id = pjsua_find_buddy(rdata->msg_info.from->uri); + buddy_id = find_buddy(rdata->msg_info.from->uri); (*pjsua_var.ua_cfg.cb.on_incoming_subscribe)(acc_id, uapres, buddy_id, &dlg->remote.info_str, @@ -943,7 +1059,7 @@ PJ_DEF(pj_status_t) pjsua_pres_notify( pjsua_acc_id acc_id, /* Subscribe to buddy's presence if we're not subscribed */ - buddy_id = pjsua_find_buddy(srv_pres->dlg->remote.info->uri); + buddy_id = find_buddy(srv_pres->dlg->remote.info->uri); if (buddy_id != PJSUA_INVALID_ID) { pjsua_buddy *b = &pjsua_var.buddy[buddy_id]; if (b->monitor && b->sub == NULL) { @@ -992,7 +1108,7 @@ static void publish_cb(struct pjsip_publishc_cbparam *param) } } else { - if (param->expiration == -1) { + if (param->expiration < 1) { /* Could happen if server "forgot" to include Expires header * in the response. We will not renew, so destroy the pubc. */ @@ -1073,7 +1189,10 @@ static pj_status_t send_publish(int acc_id, pj_bool_t active) /* Send the PUBLISH request */ status = pjsip_publishc_send(acc->publish_sess, tdata); - if (status != PJ_SUCCESS) { + if (status == PJ_EPENDING) { + PJ_LOG(3,(THIS_FILE, "Previous request is in progress, " + "PUBLISH request is queued")); + } else if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Error sending PUBLISH request", status); goto on_error; } @@ -1102,7 +1221,8 @@ pj_status_t pjsua_pres_init_publish_acc(int acc_id) if (acc_cfg->publish_enabled) { /* Create client publication */ - status = pjsip_publishc_create(pjsua_var.endpt, 0, acc, &publish_cb, + status = pjsip_publishc_create(pjsua_var.endpt, &acc_cfg->publish_opt, + acc, &publish_cb, &acc->publish_sess); if (status != PJ_SUCCESS) { acc->publish_sess = NULL; @@ -1197,10 +1317,13 @@ void pjsua_pres_delete_acc(int acc_id) if (acc->publish_sess) { acc->online_status = PJ_FALSE; send_publish(acc_id, PJ_FALSE); + /* By ticket #364, don't destroy the session yet (let the callback + destroy it) if (acc->publish_sess) { pjsip_publishc_destroy(acc->publish_sess); acc->publish_sess = NULL; } + */ acc_cfg->publish_enabled = PJ_FALSE; } } @@ -1265,6 +1388,46 @@ void pjsua_pres_update_acc(int acc_id, pj_bool_t force) * Client subscription. */ +static void buddy_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry) +{ + pjsua_buddy *buddy = (pjsua_buddy*)entry->user_data; + + PJ_UNUSED_ARG(th); + + entry->id = PJ_FALSE; + pjsua_buddy_update_pres(buddy->index); +} + +/* Reschedule subscription refresh timer or terminate the subscription + * refresh timer for the specified buddy. + */ +static void buddy_resubscribe(pjsua_buddy *buddy, pj_bool_t resched, + unsigned msec_interval) +{ + if (buddy->timer.id) { + pjsua_cancel_timer(&buddy->timer); + buddy->timer.id = PJ_FALSE; + } + + if (resched) { + pj_time_val delay; + + PJ_LOG(4,(THIS_FILE, + "Resubscribing buddy id %u in %u ms (reason: %.*s)", + buddy->index, msec_interval, + (int)buddy->term_reason.slen, + buddy->term_reason.ptr)); + + pj_timer_entry_init(&buddy->timer, 0, buddy, &buddy_timer_cb); + delay.sec = 0; + delay.msec = msec_interval; + pj_time_val_normalize(&delay); + + if (pjsua_schedule_timer(&buddy->timer, &delay)==PJ_SUCCESS) + buddy->timer.id = PJ_TRUE; + } +} + /* Callback called when *client* subscription state has changed. */ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) { @@ -1272,8 +1435,10 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) PJ_UNUSED_ARG(event); - PJSUA_LOCK(); - + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); if (buddy) { PJ_LOG(4,(THIS_FILE, @@ -1283,6 +1448,8 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) pjsip_evsub_get_state_name(sub))); if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { + int resub_delay = -1; + if (buddy->term_reason.ptr == NULL) { buddy->term_reason.ptr = (char*) pj_pool_alloc(buddy->pool, @@ -1291,7 +1458,95 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) pj_strncpy(&buddy->term_reason, pjsip_evsub_get_termination_reason(sub), PJSUA_BUDDY_SUB_TERM_REASON_LEN); + + buddy->term_code = 200; + + /* Determine whether to resubscribe automatically */ + if (event && event->type==PJSIP_EVENT_TSX_STATE) { + const pjsip_transaction *tsx = event->body.tsx_state.tsx; + if (pjsip_method_cmp(&tsx->method, + &pjsip_subscribe_method)==0) + { + buddy->term_code = tsx->status_code; + switch (tsx->status_code) { + case PJSIP_SC_CALL_TSX_DOES_NOT_EXIST: + /* 481: we refreshed too late? resubscribe + * immediately. + */ + /* But this must only happen when the 481 is received + * on subscription refresh request. We MUST NOT try to + * resubscribe automatically if the 481 is received + * on the initial SUBSCRIBE (if server returns this + * response for some reason). + */ + if (buddy->dlg->remote.contact) + resub_delay = 500; + break; + } + } else if (pjsip_method_cmp(&tsx->method, + &pjsip_notify_method)==0) + { + if (pj_stricmp2(&buddy->term_reason, "deactivated")==0 || + pj_stricmp2(&buddy->term_reason, "timeout")==0) { + /* deactivated: The subscription has been terminated, + * but the subscriber SHOULD retry immediately with + * a new subscription. + */ + /* timeout: The subscription has been terminated + * because it was not refreshed before it expired. + * Clients MAY re-subscribe immediately. The + * "retry-after" parameter has no semantics for + * "timeout". + */ + resub_delay = 500; + } + else if (pj_stricmp2(&buddy->term_reason, "probation")==0|| + pj_stricmp2(&buddy->term_reason, "giveup")==0) { + /* probation: The subscription has been terminated, + * but the client SHOULD retry at some later time. + * If a "retry-after" parameter is also present, the + * client SHOULD wait at least the number of seconds + * specified by that parameter before attempting to re- + * subscribe. + */ + /* giveup: The subscription has been terminated because + * the notifier could not obtain authorization in a + * timely fashion. If a "retry-after" parameter is + * also present, the client SHOULD wait at least the + * number of seconds specified by that parameter before + * attempting to re-subscribe; otherwise, the client + * MAY retry immediately, but will likely get put back + * into pending state. + */ + const pjsip_sub_state_hdr *sub_hdr; + pj_str_t sub_state = { "Subscription-State", 18 }; + const pjsip_msg *msg; + + msg = event->body.tsx_state.src.rdata->msg_info.msg; + sub_hdr = (const pjsip_sub_state_hdr*) + pjsip_msg_find_hdr_by_name(msg, &sub_state, + NULL); + if (sub_hdr && sub_hdr->retry_after > 0) + resub_delay = sub_hdr->retry_after * 1000; + } + + } + } + + /* For other cases of subscription termination, if resubscribe + * timer is not set, schedule with default expiration (plus minus + * some random value, to avoid sending SUBSCRIBEs all at once) + */ + if (resub_delay == -1) { + pj_assert(PJSUA_PRES_TIMER >= 3); + resub_delay = PJSUA_PRES_TIMER*1000 - 2500 + (pj_rand()%5000); + } + + buddy_resubscribe(buddy, PJ_TRUE, resub_delay); + } else { + /* This will clear the last termination code/reason */ + buddy->term_code = 0; buddy->term_reason.slen = 0; } @@ -1303,11 +1558,10 @@ static void pjsua_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { buddy->sub = NULL; buddy->status.info_cnt = 0; + buddy->dlg = NULL; pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); } } - - PJSUA_UNLOCK(); } @@ -1319,11 +1573,12 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, pjsua_buddy *buddy; pjsip_contact_hdr *contact_hdr; - PJSUA_LOCK(); - + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); if (!buddy) { - PJSUA_UNLOCK(); return; } @@ -1332,7 +1587,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, */ if (buddy->contact.slen != 0) { /* Contact already set */ - PJSUA_UNLOCK(); return; } @@ -1342,7 +1596,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, event->type != PJSIP_EVENT_RX_MSG || pjsip_method_cmp(&tsx->method, pjsip_get_subscribe_method())!=0) { - PJSUA_UNLOCK(); return; } @@ -1351,7 +1604,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, pjsip_msg_find_hdr(event->body.rx_msg.rdata->msg_info.msg, PJSIP_H_CONTACT, NULL); if (!contact_hdr) { - PJSUA_UNLOCK(); return; } @@ -1363,8 +1615,6 @@ static void pjsua_evsub_on_tsx_state(pjsip_evsub *sub, PJSIP_MAX_URL_SIZE); if (buddy->contact.slen < 0) buddy->contact.slen = 0; - - PJSUA_UNLOCK(); } @@ -1378,8 +1628,10 @@ static void pjsua_evsub_on_rx_notify(pjsip_evsub *sub, { pjsua_buddy *buddy; - PJSUA_LOCK(); - + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ buddy = (pjsua_buddy*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); if (buddy) { /* Update our info. */ @@ -1394,8 +1646,6 @@ static void pjsua_evsub_on_rx_notify(pjsip_evsub *sub, PJ_UNUSED_ARG(p_st_text); PJ_UNUSED_ARG(res_hdr); PJ_UNUSED_ARG(p_body); - - PJSUA_UNLOCK(); } @@ -1421,7 +1671,7 @@ static pjsip_evsub_user pres_callback = /* It does what it says.. */ -static void subscribe_buddy_presence(unsigned index) +static void subscribe_buddy_presence(pjsua_buddy_id buddy_id) { pj_pool_t *tmp_pool = NULL; pjsua_buddy *buddy; @@ -1431,13 +1681,13 @@ static void subscribe_buddy_presence(unsigned index) pjsip_tx_data *tdata; pj_status_t status; - buddy = &pjsua_var.buddy[index]; + buddy = &pjsua_var.buddy[buddy_id]; acc_id = pjsua_acc_find_for_outgoing(&buddy->uri); acc = &pjsua_var.acc[acc_id]; PJ_LOG(4,(THIS_FILE, "Using account %d for buddy %d subscription", - acc_id, index)); + acc_id, buddy_id)); /* Generate suitable Contact header unless one is already set in * the account @@ -1478,13 +1728,13 @@ static void subscribe_buddy_presence(unsigned index) status = pjsip_pres_create_uac( buddy->dlg, &pres_callback, PJSIP_EVSUB_NO_EVENT_ID, &buddy->sub); if (status != PJ_SUCCESS) { - pjsua_var.buddy[index].sub = NULL; + buddy->sub = NULL; pjsua_perror(THIS_FILE, "Unable to create presence client", status); /* This should destroy the dialog since there's no session * referencing it */ - pjsip_dlg_dec_lock(buddy->dlg); + if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); if (tmp_pool) pj_pool_release(tmp_pool); return; } @@ -1517,7 +1767,7 @@ static void subscribe_buddy_presence(unsigned index) status = pjsip_pres_initiate(buddy->sub, -1, &tdata); if (status != PJ_SUCCESS) { - pjsip_dlg_dec_lock(buddy->dlg); + if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); if (buddy->sub) { pjsip_pres_terminate(buddy->sub, PJ_FALSE); } @@ -1532,7 +1782,7 @@ static void subscribe_buddy_presence(unsigned index) status = pjsip_pres_send_request(buddy->sub, tdata); if (status != PJ_SUCCESS) { - pjsip_dlg_dec_lock(buddy->dlg); + if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); if (buddy->sub) { pjsip_pres_terminate(buddy->sub, PJ_FALSE); } @@ -1549,19 +1799,19 @@ static void subscribe_buddy_presence(unsigned index) /* It does what it says... */ -static void unsubscribe_buddy_presence(unsigned index) +static void unsubscribe_buddy_presence(pjsua_buddy_id buddy_id) { pjsua_buddy *buddy; pjsip_tx_data *tdata; pj_status_t status; - buddy = &pjsua_var.buddy[index]; + buddy = &pjsua_var.buddy[buddy_id]; if (buddy->sub == NULL) return; if (pjsip_evsub_get_state(buddy->sub) == PJSIP_EVSUB_STATE_TERMINATED) { - pjsua_var.buddy[index].sub = NULL; + buddy->sub = NULL; return; } @@ -1579,39 +1829,22 @@ static void unsubscribe_buddy_presence(unsigned index) } } - -/* Lock all buddies */ -#define LOCK_BUDDIES unsigned cnt_ = 0; \ - pjsip_dialog *dlg_list_[PJSUA_MAX_BUDDIES]; \ - unsigned i_; \ - for (i_=0; i_<PJ_ARRAY_SIZE(pjsua_var.buddy);++i_) { \ - if (pjsua_var.buddy[i_].sub) { \ - dlg_list_[cnt_++] = pjsua_var.buddy[i_].dlg; \ - pjsip_dlg_inc_lock(pjsua_var.buddy[i_].dlg); \ - } \ - } \ - PJSUA_LOCK(); - -/* Unlock all buddies */ -#define UNLOCK_BUDDIES PJSUA_UNLOCK(); \ - for (i_=0; i_<cnt_; ++i_) { \ - pjsip_dlg_dec_lock(dlg_list_[i_]); \ - } - - - /* It does what it says.. */ -static void refresh_client_subscriptions(void) +static pj_status_t refresh_client_subscriptions(void) { unsigned i; - - LOCK_BUDDIES; + pj_status_t status; for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.buddy); ++i) { + struct buddy_lock lck; - if (!pjsua_var.buddy[i].uri.slen) + if (!pjsua_buddy_is_valid(i)) continue; + status = lock_buddy("refresh_client_subscriptions()", i, &lck, 0); + if (status != PJ_SUCCESS) + return status; + if (pjsua_var.buddy[i].monitor && !pjsua_var.buddy[i].sub) { subscribe_buddy_presence(i); @@ -1619,11 +1852,318 @@ static void refresh_client_subscriptions(void) unsubscribe_buddy_presence(i); } + + unlock_buddy(&lck); + } + + return PJ_SUCCESS; +} + +/*************************************************************************** + * MWI + */ +/* Callback called when *client* subscription state has changed. */ +static void mwi_evsub_on_state( pjsip_evsub *sub, pjsip_event *event) +{ + pjsua_acc *acc; + + PJ_UNUSED_ARG(event); + + /* Note: #937: no need to acuire PJSUA_LOCK here. Since the buddy has + * a dialog attached to it, lock_buddy() will use the dialog + * lock, which we are currently holding! + */ + acc = (pjsua_acc*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); + if (!acc) + return; + + PJ_LOG(4,(THIS_FILE, + "MWI subscription for %.*s is %s", + (int)acc->cfg.id.slen, acc->cfg.id.ptr, + pjsip_evsub_get_state_name(sub))); + + if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) { + /* Clear subscription */ + acc->mwi_dlg = NULL; + acc->mwi_sub = NULL; + pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); + + } +} + +/* Callback called when we receive NOTIFY */ +static void mwi_evsub_on_rx_notify(pjsip_evsub *sub, + pjsip_rx_data *rdata, + int *p_st_code, + pj_str_t **p_st_text, + pjsip_hdr *res_hdr, + pjsip_msg_body **p_body) +{ + pjsua_mwi_info mwi_info; + pjsua_acc *acc; + + PJ_UNUSED_ARG(p_st_code); + PJ_UNUSED_ARG(p_st_text); + PJ_UNUSED_ARG(res_hdr); + PJ_UNUSED_ARG(p_body); + + acc = (pjsua_acc*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id); + if (!acc) + return; + + /* Construct mwi_info */ + pj_bzero(&mwi_info, sizeof(mwi_info)); + mwi_info.evsub = sub; + mwi_info.rdata = rdata; + + /* Call callback */ + if (pjsua_var.ua_cfg.cb.on_mwi_info) { + (*pjsua_var.ua_cfg.cb.on_mwi_info)(acc->index, &mwi_info); + } +} + + +/* Event subscription callback. */ +static pjsip_evsub_user mwi_cb = +{ + &mwi_evsub_on_state, + NULL, /* on_tsx_state: not interested */ + NULL, /* on_rx_refresh: don't care about SUBSCRIBE refresh, unless + * we want to authenticate + */ + + &mwi_evsub_on_rx_notify, + + NULL, /* on_client_refresh: Use default behaviour, which is to + * refresh client subscription. */ + + NULL, /* on_server_timeout: Use default behaviour, which is to send + * NOTIFY to terminate. + */ +}; + +void pjsua_start_mwi(pjsua_acc *acc) +{ + pj_pool_t *tmp_pool = NULL; + pj_str_t contact; + pjsip_tx_data *tdata; + pj_status_t status; + + if (!acc->cfg.mwi_enabled) { + if (acc->mwi_sub) { + /* Terminate MWI subscription */ + pjsip_tx_data *tdata; + pjsip_evsub *sub = acc->mwi_sub; + + /* Detach sub from this account */ + acc->mwi_sub = NULL; + acc->mwi_dlg = NULL; + pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL); + + /* Unsubscribe */ + status = pjsip_mwi_initiate(acc->mwi_sub, 0, &tdata); + if (status == PJ_SUCCESS) { + status = pjsip_mwi_send_request(acc->mwi_sub, tdata); + } + } + return; + } + + if (acc->mwi_sub) { + /* Subscription is already active */ + return; + } - UNLOCK_BUDDIES; + /* Generate suitable Contact header unless one is already set in + * the account + */ + if (acc->contact.slen) { + contact = acc->contact; + } else { + tmp_pool = pjsua_pool_create("tmpmwi", 512, 256); + status = pjsua_acc_create_uac_contact(tmp_pool, &contact, + acc->index, &acc->cfg.id); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Unable to generate Contact header", + status); + pj_pool_release(tmp_pool); + return; + } + } + + /* Create UAC dialog */ + status = pjsip_dlg_create_uac( pjsip_ua_instance(), + &acc->cfg.id, + &contact, + &acc->cfg.id, + NULL, &acc->mwi_dlg); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Unable to create dialog", status); + if (tmp_pool) pj_pool_release(tmp_pool); + return; + } + + /* Increment the dialog's lock otherwise when presence session creation + * fails the dialog will be destroyed prematurely. + */ + pjsip_dlg_inc_lock(acc->mwi_dlg); + + /* Create UAC subscription */ + status = pjsip_mwi_create_uac(acc->mwi_dlg, &mwi_cb, + PJSIP_EVSUB_NO_EVENT_ID, &acc->mwi_sub); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating MWI subscription", status); + if (tmp_pool) pj_pool_release(tmp_pool); + if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); + return; + } + + /* If account is locked to specific transport, then lock dialog + * to this transport too. + */ + if (acc->cfg.transport_id != PJSUA_INVALID_ID) { + pjsip_tpselector tp_sel; + + pjsua_init_tpselector(acc->cfg.transport_id, &tp_sel); + pjsip_dlg_set_transport(acc->mwi_dlg, &tp_sel); + } + + /* Set route-set */ + if (!pj_list_empty(&acc->route_set)) { + pjsip_dlg_set_route_set(acc->mwi_dlg, &acc->route_set); + } + + /* Set credentials */ + if (acc->cred_cnt) { + pjsip_auth_clt_set_credentials( &acc->mwi_dlg->auth_sess, + acc->cred_cnt, acc->cred); + } + + /* Set authentication preference */ + pjsip_auth_clt_set_prefs(&acc->mwi_dlg->auth_sess, &acc->cfg.auth_pref); + + pjsip_evsub_set_mod_data(acc->mwi_sub, pjsua_var.mod.id, acc); + + status = pjsip_mwi_initiate(acc->mwi_sub, -1, &tdata); + if (status != PJ_SUCCESS) { + if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); + if (acc->mwi_sub) { + pjsip_pres_terminate(acc->mwi_sub, PJ_FALSE); + } + acc->mwi_sub = NULL; + acc->mwi_dlg = NULL; + pjsua_perror(THIS_FILE, "Unable to create initial MWI SUBSCRIBE", + status); + if (tmp_pool) pj_pool_release(tmp_pool); + return; + } + + pjsua_process_msg_data(tdata, NULL); + + status = pjsip_pres_send_request(acc->mwi_sub, tdata); + if (status != PJ_SUCCESS) { + if (acc->mwi_dlg) pjsip_dlg_dec_lock(acc->mwi_dlg); + if (acc->mwi_sub) { + pjsip_pres_terminate(acc->mwi_sub, PJ_FALSE); + } + acc->mwi_sub = NULL; + acc->mwi_dlg = NULL; + pjsua_perror(THIS_FILE, "Unable to send initial MWI SUBSCRIBE", + status); + if (tmp_pool) pj_pool_release(tmp_pool); + return; + } + + pjsip_dlg_dec_lock(acc->mwi_dlg); + if (tmp_pool) pj_pool_release(tmp_pool); + +} + + +/*************************************************************************** + * Unsolicited MWI + */ +static pj_bool_t unsolicited_mwi_on_rx_request(pjsip_rx_data *rdata) +{ + pjsip_msg *msg = rdata->msg_info.msg; + pj_str_t EVENT_HDR = { "Event", 5 }; + pj_str_t MWI = { "message-summary", 15 }; + pjsip_event_hdr *eh; + + if (pjsip_method_cmp(&msg->line.req.method, &pjsip_notify_method)!=0) { + /* Only interested with NOTIFY request */ + return PJ_FALSE; + } + + eh = (pjsip_event_hdr*) pjsip_msg_find_hdr_by_name(msg, &EVENT_HDR, NULL); + if (!eh) { + /* Something wrong with the request, it has no Event hdr */ + return PJ_FALSE; + } + + if (pj_stricmp(&eh->event_type, &MWI) != 0) { + /* Not MWI event */ + return PJ_FALSE; + } + + /* Got unsolicited MWI request, respond with 200/OK first */ + pjsip_endpt_respond(pjsua_get_pjsip_endpt(), NULL, rdata, 200, NULL, + NULL, NULL, NULL); + + + /* Call callback */ + if (pjsua_var.ua_cfg.cb.on_mwi_info) { + pjsua_acc_id acc_id; + pjsua_mwi_info mwi_info; + + acc_id = pjsua_acc_find_for_incoming(rdata); + + pj_bzero(&mwi_info, sizeof(mwi_info)); + mwi_info.rdata = rdata; + + (*pjsua_var.ua_cfg.cb.on_mwi_info)(acc_id, &mwi_info); + } + + + return PJ_TRUE; +} + +/* The module instance. */ +static pjsip_module pjsua_unsolicited_mwi_mod = +{ + NULL, NULL, /* prev, next. */ + { "mod-unsolicited-mwi", 19 }, /* Name. */ + -1, /* Id */ + PJSIP_MOD_PRIORITY_APPLICATION, /* Priority */ + NULL, /* load() */ + NULL, /* start() */ + NULL, /* stop() */ + NULL, /* unload() */ + &unsolicited_mwi_on_rx_request, /* on_rx_request() */ + NULL, /* on_rx_response() */ + NULL, /* on_tx_request. */ + NULL, /* on_tx_response() */ + NULL, /* on_tsx_state() */ +}; + +static pj_status_t enable_unsolicited_mwi(void) +{ + pj_status_t status; + + status = pjsip_endpt_register_module(pjsua_get_pjsip_endpt(), + &pjsua_unsolicited_mwi_mod); + if (status != PJ_SUCCESS) + pjsua_perror(THIS_FILE, "Error registering unsolicited MWI module", + status); + + return status; } + + +/***************************************************************************/ + /* Timer callback to re-create client subscription */ static void pres_timer_cb(pj_timer_heap_t *th, pj_timer_entry *entry) @@ -1631,15 +2171,25 @@ static void pres_timer_cb(pj_timer_heap_t *th, unsigned i; pj_time_val delay = { PJSUA_PRES_TIMER, 0 }; - /* Retry failed PUBLISH requests */ + entry->id = PJ_FALSE; + + /* Retry failed PUBLISH and MWI SUBSCRIBE requests */ for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { pjsua_acc *acc = &pjsua_var.acc[i]; + + /* Retry PUBLISH */ if (acc->cfg.publish_enabled && acc->publish_sess==NULL) pjsua_pres_init_publish_acc(acc->index); + + /* Re-subscribe MWI subscription if it's terminated prematurely */ + if (acc->cfg.mwi_enabled && !acc->mwi_sub) + pjsua_start_mwi(acc); } - entry->id = PJ_FALSE; - refresh_client_subscriptions(); + /* #937: No need to do bulk client refresh, as buddies have their + * own individual timer now. + */ + //refresh_client_subscriptions(); pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, &delay); entry->id = PJ_TRUE; @@ -1687,23 +2237,13 @@ pj_status_t pjsua_pres_start(void) pjsua_var.pres_timer.id = PJ_TRUE; } - return PJ_SUCCESS; -} - - -/* - * Refresh presence subscriptions - */ -void pjsua_pres_refresh() -{ - unsigned i; - - refresh_client_subscriptions(); - - for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { - if (pjsua_var.acc[i].valid) - pjsua_pres_update_acc(i, PJ_FALSE); + if (pjsua_var.ua_cfg.enable_unsolicited_mwi) { + pj_status_t status = enable_unsolicited_mwi(); + if (status != PJ_SUCCESS) + return status; } + + return PJ_SUCCESS; } @@ -1714,6 +2254,8 @@ void pjsua_pres_shutdown(void) { unsigned i; + PJ_LOG(4,(THIS_FILE, "Shutting down presence..")); + if (pjsua_var.pres_timer.id != 0) { pjsip_endpt_cancel_timer(pjsua_var.endpt, &pjsua_var.pres_timer); pjsua_var.pres_timer.id = PJ_FALSE; @@ -1729,5 +2271,10 @@ void pjsua_pres_shutdown(void) pjsua_var.buddy[i].monitor = 0; } - pjsua_pres_refresh(); + refresh_client_subscriptions(); + + for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { + if (pjsua_var.acc[i].valid) + pjsua_pres_update_acc(i, PJ_FALSE); + } } diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sendto/126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sendto/126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py new file mode 100644 index 0000000000000000000000000000000000000000..22e2b0f1a9a95658f2ffeb260a3c70dc7b3f04a6 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sendto/126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py @@ -0,0 +1,26 @@ +# $Id: 126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py 3011 2009-11-10 10:58:20Z nanang $ +import inc_sip as sip +import inc_sdp as sdp + +sdp = \ +""" +v=0 +o=- 0 0 IN IP4 127.0.0.1 +s=- +c=IN IP4 127.0.0.1 +t=0 0 +m=video 0 RTP/AVP 100 +m=audio 5000 RTP/AVP 0 +""" + +pjsua_args = "--null-audio --auto-answer 200" +extra_headers = "" +include = ["Content-Type: application/sdp", # response must include SDP + "m=video 0 RTP/AVP[\\s\\S]+m=audio [1-9]+[0-9]* RTP/AVP" + ] +exclude = [] + +sendto_cfg = sip.SendtoCfg("SDP media with port 0 and no rtpmap for dynamic PT", pjsua_args, sdp, 200, + extra_headers=extra_headers, + resp_inc=include, resp_exc=exclude) + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-bad-ack.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-bad-ack.xml new file mode 100644 index 0000000000000000000000000000000000000000..d93e30c51d6e33f7f583febab54c2045f62deac3 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-bad-ack.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<scenario name="UAC with bad ACK"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <!-- This delay can be customized by the -d command-line option --> + <!-- or by adding a 'milliseconds = "value"' option here. --> + <pause/> + + <!-- The 'crlf' option inserts a blank line in the statistics report. --> + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + <pause milliseconds="2000"/> + + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0790f6ef7dc912b6dcb1a8551ad8ad62d125ef0 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-inv-multiple-require.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="Multiple Require header fields"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Require: timer + Require: toto + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <recv response="200" rtd="true"> + </recv> + + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <pause/> + + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bK-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-options.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-options.xml new file mode 100644 index 0000000000000000000000000000000000000000..7b14884509b95fa28e7d6bfa3429c5659a495c61 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-options.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<scenario name="UAC OPTIONS"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + OPTIONS sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 OPTIONS + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: [len] + + ]]> + </send> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-bad-via-branch.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-bad-via-branch.xml new file mode 100644 index 0000000000000000000000000000000000000000..ed825c9faf493a6ac870aabe3c159114460e7f10 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-bad-via-branch.xml @@ -0,0 +1,173 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<!-- Re-INVITE with bad Via branch (it has the same branch as the + previous INVITE (ticket #965) will cause assertion +--> + + +<scenario name="UAC re-INVITE with bad Via branch"> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 123 IN IP4 127.0.0.1 + s=Tester + c=IN IP4 127.0.0.1 + t=0 0 + m=audio 17424 RTP/AVP 0 101 + a=rtpmap:101 telephone-event/8000 + a=sendrecv + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-2 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + + <!-- Re-INVITE with Via branch value the same as previous INVITE --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 124 IN IP4 127.0.0.1 + s=Tester + c=IN IP4 127.0.0.1 + t=0 0 + m=audio 17424 RTP/AVP 0 101 + a=rtpmap:101 telephone-event/8000 + + + ]]> + </send> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="500" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=z9hG4bKPj-1 + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + + <pause milliseconds="2000"/> + + + <!-- The 'crlf' option inserts a blank line in the statistics report. --> + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 3 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-port-0-bad-sdp.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-port-0-bad-sdp.xml new file mode 100644 index 0000000000000000000000000000000000000000..d1cc04f3c19c3a6607e9098c8db8394602ab53f9 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-reinvite-port-0-bad-sdp.xml @@ -0,0 +1,207 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<!-- Note: + For this test to work, PJSUA-LIB needs to add video line, with + this patch: + + pjsua_media.c:1253, after call to pjmedia_endpt_create_sdp(): + + if (1) { + pjmedia_sdp_media *m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); + m->desc.media = pj_str("video"); + m->desc.port = 3000; + m->desc.transport = pj_str("RTP/AVP"); + m->desc.fmt_count = 1; + m->desc.fmt[0] = pj_str("0"); + sdp->media[sdp->media_count++] = m; + } + +--> + + +<scenario name="UAC with bad ACK"> + <!-- UAC with bad ACK causes assertion with pjsip 1.4 --> + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 123 IN IP4 89.208.145.194 + s=Tester + c=IN IP4 89.208.145.194 + t=0 0 + m=audio 17424 RTP/AVP 111 0 18 101 + a=rtpmap:111 SPEEX/16000 + a=rtpmap:0 PCMU/8000 + a=rtpmap:18 G729/8000 + a=rtpmap:101 telephone-event/8000 + a=sendrecv + a=rtcp:17425 + m=video 11128 RTP/AVP 34 103 104 + a=rtpmap:34 H263/90000 + a=rtpmap:103 H263-1998/90000 + a=rtpmap:104 H264/90000 + a=sendrecv + a=rtcp:11129 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <!-- This delay can be customized by the -d command-line option --> + <!-- or by adding a 'milliseconds = "value"' option here. --> + <pause milliseconds="2000"/> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=Tester 234 124 IN IP4 89.208.145.194 + s=Tester + c=IN IP4 89.208.145.194 + t=0 0 + m=audio 17424 RTP/AVP 111 0 18 101 + a=rtpmap:111 SPEEX/16000 + a=rtpmap:0 PCMU/8000 + a=rtpmap:18 G729/8000 + a=rtpmap:101 telephone-event/8000 + a=sendrecv + a=rtcp:17425 + m=video 0 RTP/AVP 34 103 104 + a=sendrecv + + + ]]> + </send> + + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv response="200" rtd="true"> + </recv> + + <!-- Packet lost can be simulated in any send/recv message by --> + <!-- by adding the 'lost = "10"'. Value can be [1-100] percent. --> + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + + <pause milliseconds="2000"/> + + + <!-- The 'crlf' option inserts a blank line in the statistics report. --> + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 3 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-subscribe.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-subscribe.xml new file mode 100644 index 0000000000000000000000000000000000000000..c42e95143bd89f7312115a7d59d4c2b5365cc435 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uac-subscribe.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- --> + +<scenario name="UAC presence"> + <!-- UAC Presence --> + <send retrans="500"> + <![CDATA[ + + SUBSCRIBE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 SUBSCRIBE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Event: presence + Expires: 600 + Accept: application/pidf+xml, application/xpidf+xml + Allow-Events: presence, refer + Content-Length: 0 + + ]]> + </send> + + <recv response="200" rtd="true"> + </recv> + + <recv request="NOTIFY" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SUBSCRIBE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 2 SUBSCRIBE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Event: presence + Expires: 0 + Accept: application/pidf+xml, application/xpidf+xml + Allow-Events: presence, refer + Content-Length: 0 + + ]]> + </send> + + <recv response="200" rtd="true"> + </recv> + + <recv request="NOTIFY" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Content-Length: 0 + + ]]> + </send> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-422-then-200-bad-se.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-422-then-200-bad-se.xml new file mode 100644 index 0000000000000000000000000000000000000000..537f242bf5d221e4df78a2cdc6fc2bb0f6e002bb --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-422-then-200-bad-se.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Sipp default 'uas' scenario. --> +<!-- --> + +<scenario name="Basic UAS responder"> + <!-- By adding rrs="true" (Record Route Sets), the route sets --> + <!-- are saved and used for following messages sent. Useful to test --> + <!-- against stateful SIP proxies/B2BUAs. --> + <recv request="INVITE" crlf="true"> + </recv> + + <!-- The '[last_*]' keyword is replaced automatically by the --> + <!-- specified header if it was present in the last message received --> + <!-- (except if it was a retransmission). If the header was not --> + <!-- present or if no message has been received, the '[last_*]' --> + <!-- keyword is discarded, and all bytes until the end of the line --> + <!-- are also discarded. --> + <!-- --> + <!-- If the specified header was present several times in the --> + <!-- message, all occurences are concatenated (CRLF seperated) --> + <!-- to be used in place of the '[last_*]' keyword. --> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 422 Session Timer too small + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Min-SE: 5400 + Content-Length: 0 + + ]]> + </send> + + <recv request="ACK" + optional="true" + rtd="true" + crlf="true"> + </recv> + + + <recv request="INVITE" crlf="true"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER + Allow-Events: telephone-event + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Supported: replaces + Session-Expires: 3600;refresher=uas + Require: timer + Content-Type: application/sdp + Content-Disposition: session;handling=required + Content-Length: [len] + + v=0 + o=Some-UserAgent 68 210 IN IP4 [local_ip] + s=SIP Call + c=IN IP4 [local_ip] + t=0 0 + m=audio 17294 RTP/AVP 18 101 + c=IN IP4 [local_ip] + a=rtpmap:18 G729/8000 + a=fmtp:18 annexb=no + a=rtpmap:101 telephone-event/8000 + a=fmtp:101 0-16 + a=ptime:20 + + ]]> + </send> + + <recv request="ACK" + rtd="true" + crlf="true"> + </recv> + + + <!-- Keep the call open for a while in case the 200 is lost to be --> + <!-- able to retransmit it if we receive the BYE again. --> + <pause milliseconds="4000"/> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-auth.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-auth.xml new file mode 100644 index 0000000000000000000000000000000000000000..71da30f282ba4b6d6ec24c33abd593984ae189fb --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-auth.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Sipp default 'uas' scenario. --> +<!-- --> + +<scenario name="UAS authorization server"> + <recv request="REGISTER" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 401 Unauthorized + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + WWW-Authenticate: digest realm="test",stale=true + ]]> + </send> + + + <recv request="REGISTER" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Expires: 30 + ]]> + </send> + + + <pause milliseconds="1000"/> + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml new file mode 100644 index 0000000000000000000000000000000000000000..58f2bd480e39f6fa003d6e53c57e087a6a4eaac8 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi-0.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="MWI server with immediate final notify"> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 600 + ]]> + </send> + + <!-- initial notify is final notify --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: message-summary + Subscription-State: terminated;reason=goinghome + Content-Type: application/simple-message-summary + Content-Length: [len] + + Messages-Waiting: yes + Voice-Message: 4/8 (1/2) + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="5000"/> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi.xml new file mode 100644 index 0000000000000000000000000000000000000000..00e703718b5b07d8a6111334e7b9e8637468797a --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-mwi.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="MWI server"> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 600 + ]]> + </send> + + <!-- initial notify --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: message-summary + Subscription-State: active;expires=50 + Content-Type: application/simple-message-summary + Content-Length: [len] + + Messages-Waiting: yes + Voice-Message: 4/8 (1/2) + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="10000"/> + + + <!-- terminate subscription --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 2 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: message-summary + Subscription-State: terminated;reason=noresource + Content-Type: application/simple-message-summary + Content-Length: [len] + + Messages-Waiting: yes + Voice-Message: 4/8 (1/2) + + ]]> + </send> + + <recv response="200"> + </recv> + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f1165013c701e4a45de426bc3139419f773bcc3 --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-refresh-481.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="SUBSCRIBE tests"> + <!-- Establish subscription --> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 60 + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=z9hG4bKPj01 + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: presence + Subscription-State: active;expires=50 + Content-Type: application/pidf+xml + + <?xml version="1.0" encoding="UTF-8"?> + <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" entity="sip:moto_red@ptt.intra.genaker.net"> + <tuple id="17415d5738f332a64a2f1d8cfb4ab0a5"> + <status> + <basic>open</basic> + </status> + </tuple> + </presence> + ]]> + </send> + + <recv response="200"> + </recv> + + <!-- Subscription has been established at this point --> + + + <!-- ******* + + Wait for subscription refresh, reply with 481 + + --> + + <recv request="SUBSCRIBE" crlf="true"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 481 You should resubscribe mow + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + ]]> + </send> + + + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.xml b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.xml new file mode 100644 index 0000000000000000000000000000000000000000..4843cc37653b6fb48cf54885c86548a690ca526a --- /dev/null +++ b/sflphone-common/libs/pjproject/tests/pjsua/scripts-sipp/uas-subscribe-terminated-retry.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> +<!-- --> +<!-- Late NOTIFY scenario: --> +<!-- - UAC sends SUBSCRIBE, we reply with 200 --> +<!-- - we send NOTIFY, expect 200 --> +<!-- - UAC sends SUBSCRIBE, we ignore --> +<!-- - we send NOTIFY --> +<!-- See http://trac.pjsip.org/repos/ticket/911 --> +<!-- --> + +<scenario name="NOTIFY with terminated status with some reason code should cause UAC to retry"> + <!-- Establish subscription --> + <recv request="SUBSCRIBE" crlf="true"> + <action> + <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/> + <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/> + <assign assign_to="4" variable="5" /> + </action> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:sipp@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 60 + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 1 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: presence + Subscription-State: active;expires=50 + Content-Type: application/pidf+xml + + <?xml version="1.0" encoding="UTF-8"?> + <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" entity="sip:moto_red@ptt.intra.genaker.net"> + <tuple id="17415d5738f332a64a2f1d8cfb4ab0a5"> + <status> + <basic>open</basic> + </status> + </tuple> + </presence> + ]]> + </send> + + <recv response="200"> + </recv> + + <!-- Subscription has been established at this point --> + + + <pause milliseconds="4000"/> + + <!-- ******* + + Send NOTIFY termination + + --> + <send retrans="500"> + <![CDATA[ + NOTIFY sip:[$5] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: sipp <sip:sipp@[local_ip]>;tag=[call_number] + To[$3] + Call-ID: [call_id] + Cseq: 3 NOTIFY + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Event: presence + Subscription-State: terminated;reason=probation;retry-after=5 + Content-Length: 0 + ]]> + </send> + + <recv response="200"> + </recv> + + + + + + <!-- definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> + diff --git a/sflphone-common/libs/pjproject/third_party/build/portaudio/os-auto.mak b/sflphone-common/libs/pjproject/third_party/build/portaudio/os-auto.mak deleted file mode 100644 index 79022f6df192d1ccb21fc34000725dd8e694aa22..0000000000000000000000000000000000000000 --- a/sflphone-common/libs/pjproject/third_party/build/portaudio/os-auto.mak +++ /dev/null @@ -1,79 +0,0 @@ -# third_party/build/portaudio/os-auto.mak. Generated from os-auto.mak.in by configure. - -# Define the desired sound device backend -# Valid values are: -# - pa_unix: PortAudio on Unix (OSS or ALSA) -# - pa_darwinos: PortAudio on MacOSX (CoreAudio) -# - pa_old_darwinos: PortAudio on MacOSX (old CoreAudio, for OSX 10.2) -# - pa_win32: PortAudio on Win32 (WMME) -# -# There are other values below, but these are handled by PJMEDIA's Makefile -# - ds: Win32 DirectSound (dsound.c) -# - null: Null sound device (nullsound.c) -AC_PJMEDIA_SND=pa_unix - -# For Unix, specify if ALSA should be supported -AC_PA_USE_ALSA=1 - -# For Unix, specify if OSS should be supported -AC_PA_USE_OSS=1 - -# Additional PortAudio CFLAGS are in -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN - - -# -# PortAudio on Unix -# -ifeq ($(AC_PJMEDIA_SND),pa_unix) -# Host APIs and utils -export PORTAUDIO_OBJS += pa_unix_hostapis.o pa_unix_util.o - -# Include ALSA? -ifeq ($(AC_PA_USE_ALSA),1) -export CFLAGS += -DPA_USE_ALSA=1 -export PORTAUDIO_OBJS += pa_linux_alsa.o -endif - -export CFLAGS += -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN -endif - -# Include OSS? -ifeq ($(AC_PA_USE_OSS),1) -export CFLAGS += -DPA_USE_OSS=1 -export PORTAUDIO_OBJS += pa_unix_oss.o -endif - -# -# PortAudio on MacOS X (using current PortAudio) -# -ifeq ($(AC_PJMEDIA_SND),pa_darwinos) -export PORTAUDIO_OBJS +=pa_mac_hostapis.o \ - pa_unix_util.o \ - pa_mac_core.o \ - pa_mac_core_blocking.o \ - pa_mac_core_utilities.o \ - pa_ringbuffer.o -export CFLAGS += -DPA_USE_COREAUDIO=1 -export CFLAGS += -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN -endif - -# -# PortAudio on MacOS X (using old PortAudio, for MacOS X 10.2.x) -# -ifeq ($(AC_PJMEDIA_SND),pa_old_darwinos) -export PORTAUDIO_OBJS +=pa_mac_hostapis.o \ - pa_unix_util.o \ - pa_mac_core_old.o -export CFLAGS += -DPA_USE_COREAUDIO=1 -export CFLAGS += -DHAVE_SYS_SOUNDCARD_H -DHAVE_LINUX_SOUNDCARD_H -DPA_LITTLE_ENDIAN -endif - -# -# -# PortAudio on Win32 (WMME) -# -ifeq ($(AC_PJMEDIA_SND),pa_win32) -export PORTAUDIO_OBJS += pa_win_hostapis.o pa_win_util.o \ - pa_win_wmme.o pa_win_waveformat.o -export CFLAGS += -DPA_NO_ASIO -DPA_NO_DS -endif diff --git a/sflphone-common/libs/pjproject/third_party/build/speex/config.h b/sflphone-common/libs/pjproject/third_party/build/speex/config.h index e04c40be4f7383fdda6c17ec53d4369e70989492..ba7be7a6e21d233da490e2274094580c6d416459 100644 --- a/sflphone-common/libs/pjproject/third_party/build/speex/config.h +++ b/sflphone-common/libs/pjproject/third_party/build/speex/config.h @@ -4,7 +4,7 @@ #if !defined(PJ_HAS_FLOATING_POINT) || PJ_HAS_FLOATING_POINT==0 # define FIXED_POINT # define USE_KISS_FFT -#else +#else # define FLOATING_POINT # define USE_SMALLFT #endif @@ -12,7 +12,7 @@ #define EXPORT #if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ - (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) + (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0) # include "../../speex/win32/config.h" #else #define inline __inline diff --git a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c index 8c6e71dcbfbcc31334a07cbc07546f62ac40be52..028d06fe96ccc6de55fdc05ca9780a1121f4139e 100644 --- a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c +++ b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op.c @@ -1135,7 +1135,7 @@ LIBG7221_DEF(Word16) norm_s (Word16 var1) } else { - if (var1 == (UWord16)0xffff) + if ((UWord16)var1 == (UWord16)0xffff) { var_out = 15; } diff --git a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h index 8eba815ec643900b6ca186081aea3ae1900c7bd9..d6906237b100b75aef8dce6b5286979a94f4b645 100644 --- a/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h +++ b/sflphone-common/libs/pjproject/third_party/g7221/common/basic_op_i.h @@ -99,7 +99,7 @@ PJ_INLINE(Word16) saturate (Word32 L_var1) if (val16 == L_var1) return val16; - if (val16 > MAX_16) + if (L_var1 > MAX_16) return MAX_16; return MIN_16; } diff --git a/sflphone-common/libs/pjproject/third_party/g7221/common/config.h b/sflphone-common/libs/pjproject/third_party/g7221/common/config.h index 925a1dae5310185863c639be6722384f1bfa8fed..4faec787d79753bddee3567150bd1663ec6df8a5 100644 --- a/sflphone-common/libs/pjproject/third_party/g7221/common/config.h +++ b/sflphone-common/libs/pjproject/third_party/g7221/common/config.h @@ -4,12 +4,15 @@ #include <pj/config.h> /** - * Expand basic operation functions as inline. + * Expand all basic operation functions as inline. Even if this is set to + * zero, some critical functions would still be expanded as inline. Note + * also that enabling this may generate some warning messages about functions + * not being referenced (with gcc). * - * Default: 1 (yes) + * Default: 0 (no) */ #ifndef PJMEDIA_LIBG7221_FUNCS_INLINED -# define PJMEDIA_LIBG7221_FUNCS_INLINED 1 +# define PJMEDIA_LIBG7221_FUNCS_INLINED 0 #endif /* Declare/define a function that may be expanded as inline. */ diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt b/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt index 5364797db1e6485a8909b2e0614c4a9a63b0904f..b7d2f0beddb61e4f37e4b7efe1f7d62a7c5d1b2c 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt +++ b/sflphone-common/libs/pjproject/third_party/portaudio/build/msvc/readme.txt @@ -14,6 +14,8 @@ This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO) portaudio19svn\src\hostapi\asio\ASIOSDK\host\mac (not needed) You dont need "driver" + + To build without ASIO (or another Host API) see the "Building without ASIO support" section below. 2) *If you have Visual Studio 6.0*, please make sure you have it updated with the latest (and final) @@ -76,5 +78,32 @@ PaAsio_GetInputChannelName @53 PaAsio_GetOutputChannelName @54 PaUtil_SetLogPrintFunction @55 + +*** Building without ASIO support *** + +To build PortAudio without ASIO support you need to: + A. Make sure your project doesn't try to build any ASIO SDK files. + If you're using one of the shipped projects, remove the ASIO related files + from the project. + + B. Make sure your project doesn't try to build the PortAudio ASIO + implementation files: + src/hostapi/pa_asio.cpp src/hostapi/iasiothiscallresolver.cpp + If you're using one of the shipped projects remove them from the project. + + C. Define the PA_NO_ASIO preprocessor symbol in the project properties. + In VS2005 this can be added under + Project Properties > Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions + + Defining PA_NO_ASIO stops src/os/win/pa_win_hostapis.c + from trying to initialize the PA ASIO implementation. + + D. Remove PaAsio_* entry points from portaudio.def + +A similar procedure can be used to omit any of the other host APIs from the +build. The relevant preprocessor symbols used by pa_win_hostapis.c are: +PA_NO_WMME, PA_NO_DS, PA_NO_ASIO, PA_NO_WASAPI and PA_NO_WDMKS + + ----- David Viens, davidv@plogue.com \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/configure.in b/sflphone-common/libs/pjproject/third_party/portaudio/configure.in index 749e3a47b1ee0e344b91b76a6ab5246a06c9e86c..087ff712bad8c5d9622b88e9505ab900cc4f302a 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/configure.in +++ b/sflphone-common/libs/pjproject/third_party/portaudio/configure.in @@ -1,7 +1,7 @@ dnl dnl portaudio V19 configure.in script dnl -dnl Dominic Mazzoni, Arve Knudsen +dnl Dominic Mazzoni, Arve Knudsen, Stelios Bounanos dnl dnl Require autoconf >= 2.13 @@ -11,63 +11,87 @@ dnl Init autoconf and make sure configure is being called dnl from the right directory AC_INIT([include/portaudio.h]) +dnl Define build, build_cpu, build_vendor, build_os +AC_CANONICAL_BUILD +dnl Define host, host_cpu, host_vendor, host_os +AC_CANONICAL_HOST +dnl Define target, target_cpu, target_vendor, target_os +AC_CANONICAL_TARGET + dnl Specify options -AC_ARG_WITH(alsa, - [ --with-alsa (default=yes)], - with_alsa=$withval, with_alsa="yes") +AC_ARG_WITH(alsa, + AS_HELP_STRING([--with-alsa], [Enable support for ALSA @<:@autodetect@:>@]), + [with_alsa=$withval]) -AC_ARG_WITH(jack, - [ --with-jack (default=yes)], - with_jack=$withval, with_jack="yes") +AC_ARG_WITH(jack, + AS_HELP_STRING([--with-jack], [Enable support for JACK @<:@autodetect@:>@]), + [with_jack=$withval]) -AC_ARG_WITH(oss, - [ --with-oss (default=yes)], - with_oss=$withval, with_oss="yes") +AC_ARG_WITH(oss, + AS_HELP_STRING([--with-oss], [Enable support for OSS @<:@autodetect@:>@]), + [with_oss=$withval]) AC_ARG_WITH(asihpi, - [ --with-asihpi (default=auto)], - with_asihpi=$withval, with_asihpi="yes") - -AC_ARG_WITH(host_os, - [ --with-host_os (no default)], - host_os=$withval) + AS_HELP_STRING([--with-asihpi], [Enable support for ASIHPI @<:@autodetect@:>@]), + [with_asihpi=$withval]) AC_ARG_WITH(winapi, - [ --with-winapi ((wmme/directx/asio) default=wmme)], - with_winapi=$withval, with_winapi="wmme") - -dnl Mac API added for ASIO, can have other api's listed -AC_ARG_WITH(macapi, - [ --with-macapi ((asio/core/sm) default=core)], - with_macapi=$withval, with_macapi="core") + AS_HELP_STRING([--with-winapi], + [Select Windows API support (@<:@wmme|directx|asio|wdmks@:>@@<:@,...@:>@) @<:@wmme@:>@]), + [with_winapi=$withval], [with_winapi="wmme"]) +case "$target_os" in *mingw* | *cygwin*) + with_wmme=no + with_directx=no + with_asio=no + with_wdmks=no + for api in $(echo $with_winapi | sed 's/,/ /g'); do + case "$api" in + wmme|directx|asio|wdmks) + eval with_$api=yes + ;; + *) + AC_MSG_ERROR([unknown Windows API \"$api\" (do you need --help?)]) + ;; + esac + done + ;; +esac AC_ARG_WITH(asiodir, - [ --with-asiodir (default=/usr/local/asiosdk2)], + AS_HELP_STRING([--with-asiodir], [ASIO directory @<:@/usr/local/asiosdk2@:>@]), with_asiodir=$withval, with_asiodir="/usr/local/asiosdk2") AC_ARG_WITH(dxdir, - [ --with-dxdir (default=/usr/local/dx7sdk)], + AS_HELP_STRING([--with-dxdir], [DirectX directory @<:@/usr/local/dx7sdk@:>@]), with_dxdir=$withval, with_dxdir="/usr/local/dx7sdk") +debug_output=no AC_ARG_ENABLE(debug-output, - [ --enable-debug-output], - [if test x$enableval != xno ; then - AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) - fi - ]) + AS_HELP_STRING([--enable-debug-output], [Enable debug output @<:@no@:>@]), + [if test "x$enableval" != "xno" ; then + AC_DEFINE(PA_ENABLE_DEBUG_OUTPUT,,[Enable debugging messages]) + debug_output=yes + fi + ]) AC_ARG_ENABLE(cxx, - [ --enable-cxx (default=no)], - enable_cxx=$enableval, enable_cxx="no") + AS_HELP_STRING([--enable-cxx], [Enable C++ bindings @<:@no@:>@]), + enable_cxx=$enableval, enable_cxx="no") AC_ARG_ENABLE(mac-debug, - [ --enable-mac-debug (default=no)], - enable_mac_debug=$enableval, enable_mac_debug="no") + AS_HELP_STRING([--enable-mac-debug], [Enable Mac debug @<:@no@:>@]), + enable_mac_debug=$enableval, enable_mac_debug="no") AC_ARG_ENABLE(mac-universal, - [ --enable-mac-universal (default=yes)], - enable_mac_universal=$enableval, enable_mac_universal="yes") + AS_HELP_STRING([--enable-mac-universal], [Build Mac universal binaries @<:@yes@:>@]), + enable_mac_universal=$enableval, enable_mac_universal="yes") + +dnl Continue to accept --host_os for compatibility but do not document +dnl it (the correct way to change host_os is with --host=...). Moved +dnl here because the empty help string generates a blank line which we +dnl can use to separate PA options from libtool options. +AC_ARG_WITH(host_os, [], host_os=$withval) dnl Checks for programs. @@ -87,20 +111,27 @@ AC_C_BIGENDIAN dnl checks for various host APIs and arguments to configure that dnl turn them on or off -AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) -AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm) -AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no) - -dnl Determine the host description for the subsequent test. -dnl PKG_CHECK_MODULES seems to check and set the host variable also, but -dnl that then requires pkg-config availability which is not standard on -dnl MinGW systems and can be a pain to install. -dnl AC_CANONICAL_HOST - -PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) +have_alsa=no +if test "x$with_alsa" != "xno"; then + AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) +fi +have_asihpi=no +if test "x$with_asihpi" != "xno"; then + AC_CHECK_LIB(hpi, HPI_SubSysCreate, have_asihpi=yes, have_asihpi=no, -lm) +fi +have_libossaudio=no +have_oss=no +if test "x$with_oss" != "xno"; then + AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes]) + if test "x$have_oss" = "xyes"; then + AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no) + fi +fi +have_jack=no +if test "x$with_jack" != "xno"; then + PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no) +fi -dnl checks for header files -AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h]) dnl sizeof checks: we will need a 16-bit and a 32-bit type @@ -149,6 +180,13 @@ else CFLAGS="$CFLAGS -DPA_LITTLE_ENDIAN" fi +add_objects() +{ + for o in $@; do + test "${OTHER_OBJS#*${o}*}" = "${OTHER_OBJS}" && OTHER_OBJS="$OTHER_OBJS $o" + done +} + case "${host_os}" in darwin* ) dnl Mac OS X configuration @@ -176,81 +214,50 @@ case "${host_os}" in CFLAGS="-std=c99 $CFLAGS $mac_arches $mac_sysroot $mac_version_min" OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o" PADLL="libportaudio.dylib" - if [[ $with_macapi = "asio" ]] ; then - if [[ $with_asiodir ]] ; then - ASIODIR="$with_asiodir" - else - ASIODIR="/usr/local/asiosdk2" - fi - echo "ASIODIR: $ASIODIR" - - OTHER_OBJS="src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/host/asiodrivers.o $ASIODIR/common/asio.o $ASIODIR/host/mac/asioshlib.o" - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/mac -I$ASIODIR/common" - CXXFLAGS="$CFLAGS" - fi ;; mingw* ) dnl MingW configuration - echo "WINAPI: $with_winapi" - if [[ $with_winapi = "directx" ]] ; then - if [[ $with_dxdir ]] ; then - DXDIR="$with_dxdir" - else - DXDIR="/usr/local/dx7sdk" - fi - echo "DXDIR: $DXDIR" - OTHER_OBJS="src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o" + PADLL="portaudio.dll" + THREAD_CFLAGS="-mthreads" + SHARED_FLAGS="-shared" + CFLAGS="$CFLAGS -I\$(top_srcdir)/include -DPA_NO_WMME -DPA_NO_ASIO -DPA_NO_WDMKS -DPA_NO_DS" + + if [[ "x$with_directx" = "xyes" ]]; then + DXDIR="$with_dxdir" + add_objects src/hostapi/dsound/pa_win_ds.o src/hostapi/dsound/pa_win_ds_dynlink.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o LIBS="-lwinmm -lm -ldsound -lole32" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" - DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -ldsound -lole32" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -ldsound -lole32" #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" - CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I$DXDIR/include -DPA_NO_WMME -DPA_NO_ASIO" -DPA_NO_WDMKS - elif [[ $with_winapi = "asio" ]] ; then - if [[ $with_asiodir ]] ; then - ASIODIR="$with_asiodir" - else - ASIODIR="/usr/local/asiosdk2" - fi - echo "ASIODIR: $ASIODIR" - - - OTHER_OBJS="src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o" - LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" - DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lstdc++ -lole32 -luuid" - CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -DPA_NO_WMME -DPA_NO_DS -DPA_NO_WDMKS -DWINDOWS" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/win -I$DXDIR/include -UPA_NO_DS" + fi + + if [[ "x$with_asio" = "xyes" ]]; then + ASIODIR="$with_asiodir" + add_objects src/hostapi/asio/pa_asio.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/hostapi/asio/iasiothiscallresolver.o $ASIODIR/common/asio.o $ASIODIR/host/asiodrivers.o $ASIODIR/host/pc/asiolist.o + LIBS="-lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -lole32 -luuid" + CFLAGS="$CFLAGS -ffast-math -fomit-frame-pointer -I\$(top_srcdir)/src/common -I\$(top_srcdir)/src/hostapi/asio -I$ASIODIR/host/pc -I$ASIODIR/common -I$ASIODIR/host -UPA_NO_ASIO -DWINDOWS" CXXFLAGS="$CFLAGS" - elif [[ $with_winapi = "wdmks" ]] ; then - if [[ $with_dxdir ]] ; then - DXDIR="$with_dxdir" - else - DXDIR="/usr/local/dx7sdk" - fi - echo "DXDIR: $DXDIR" - OTHER_OBJS="src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o" + fi + + if [[ "x$with_wdmks" = "xyes" ]]; then + DXDIR="$with_dxdir" + add_objects src/hostapi/wdmks/pa_win_wdmks.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o LIBS="-lwinmm -lm -luuid -lsetupapi -lole32" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" - DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L./dx7sdk/lib -luuid -lsetupapi -lole32" + DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32" #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\"" #CFLAGS="$CFLAGS -I$VC98 -DPA_NO_WMME -DPA_NO_ASIO" - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -DPA_NO_WMME -DPA_NO_DS -DPA_NO_ASIO" - else # WMME default - OTHER_OBJS="src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o" - LIBS="-lwinmm -lm -lstdc++ -lole32 -luuid" - PADLL="portaudio.dll" - THREAD_CFLAGS="-mthreads" - SHARED_FLAGS="-shared" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -I$DXDIR/include -UPA_NO_WDMKS" + fi + + if [[ "x$with_wmme" = "xyes" ]]; then + add_objects src/hostapi/wmme/pa_win_wmme.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_waveformat.o + LIBS="-lwinmm -lm -lole32 -luuid" DLL_LIBS="${DLL_LIBS} -lwinmm" - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -DPA_NO_DS -DPA_NO_ASIO -DPA_NO_WDMKS" + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/common -UPA_NO_WMME" fi ;; @@ -298,30 +305,30 @@ case "${host_os}" in AC_CHECK_LIB(pthread, pthread_create,[have_pthread="yes"], AC_MSG_ERROR([libpthread not found!])) - if [[ $have_alsa = "yes" ] && [ $with_alsa != "no" ]] ; then + if [[ "$have_alsa" = "yes" ] && [ "$with_alsa" != "no" ]] ; then DLL_LIBS="$DLL_LIBS -lasound" LIBS="$LIBS -lasound" OTHER_OBJS="$OTHER_OBJS src/hostapi/alsa/pa_linux_alsa.o" AC_DEFINE(PA_USE_ALSA) fi - if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then + if [[ "$have_jack" = "yes" ] && [ "$with_jack" != "no" ]] ; then DLL_LIBS="$DLL_LIBS $JACK_LIBS" CFLAGS="$CFLAGS $JACK_CFLAGS" OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o" AC_DEFINE(PA_USE_JACK) fi - if [[ $with_oss != "no" ]] ; then + if [[ "$with_oss" != "no" ]] ; then OTHER_OBJS="$OTHER_OBJS src/hostapi/oss/pa_unix_oss.o" - if [[ $have_libossaudio = "yes" ]] ; then + if [[ "$have_libossaudio" = "yes" ]] ; then DLL_LIBS="$DLL_LIBS -lossaudio" LIBS="$LIBS -lossaudio" fi AC_DEFINE(PA_USE_OSS) fi - if [[ $have_asihpi = "yes" ] && [ $with_asihpi != "no" ]] ; then + if [[ "$have_asihpi" = "yes" ] && [ "$with_asihpi" != "no" ]] ; then LIBS="$LIBS -lhpi" DLL_LIBS="$DLL_LIBS -lhpi" OTHER_OBJS="$OTHER_OBJS src/hostapi/asihpi/pa_linux_asihpi.o" @@ -359,4 +366,52 @@ fi AC_SUBST(ENABLE_CXX_TRUE) AC_SUBST(ENABLE_CXX_FALSE) +if test "x$with_asio" = "xyes"; then + WITH_ASIO_TRUE="" + WITH_ASIO_FALSE="@ #" +else + WITH_ASIO_TRUE="@ #" + WITH_ASIO_FALSE="" +fi +AC_SUBST(WITH_ASIO_TRUE) +AC_SUBST(WITH_ASIO_FALSE) + AC_OUTPUT([Makefile portaudio-2.0.pc]) + +AC_MSG_RESULT([ +Configuration summary: + + Target ...................... $target + C++ bindings ................ $enable_cxx + Debug output ................ $debug_output]) + +case "$target_os" in *linux*) + AC_MSG_RESULT([ + ALSA ........................ $have_alsa + ASIHPI ...................... $have_asihpi]) + ;; +esac +case "$target_os" in + *mingw* | *cygwin*) + test "x$with_directx" = "xyes" && with_directx="$with_directx (${with_dxdir})" + test "x$with_wdmks" = "xyes" && with_wdmks="$with_wdmks (${with_dxdir})" + test "x$with_asio" = "xyes" && with_asio="$with_asio (${with_asiodir})" + AC_MSG_RESULT([ + WMME ........................ $with_wmme + DSound ...................... $with_directx + WDMKS ....................... $with_wdmks + ASIO ........................ $with_asio +]) + ;; + *darwin*) + AC_MSG_RESULT([ + Mac debug flags ............. $enable_mac_debug +]) + ;; + *) + AC_MSG_RESULT([ + OSS ......................... $have_oss + JACK ........................ $have_jack +]) + ;; +esac diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h index 363444ea509f8319602f543838da238110887da1..64d1bd4e7c3a5a20f9cf06d623269c9bf75e3376 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_asio.h @@ -1,7 +1,7 @@ #ifndef PA_ASIO_H #define PA_ASIO_H /* - * $Id: pa_asio.h 1337 2008-02-15 07:32:09Z rossb $ + * $Id: pa_asio.h 1400 2009-01-21 10:20:42Z rossb $ * PortAudio Portable Real-Time Audio Library * ASIO specific extensions * @@ -100,6 +100,19 @@ PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, const char** channelName ); +/** Set the sample rate of an open paASIO stream. + + @param stream The stream to operate on. + @param sampleRate The new sample rate. + + Note that this function may fail if the stream is alredy running and the + ASIO driver does not support switching the sample rate of a running stream. + + Returns paIncompatibleStreamHostApi if stream is not a paASIO stream. +*/ +PaError PaAsio_SetStreamSampleRate( PaStream* stream, double sampleRate ); + + #define paAsioUseChannelSelectors (0x01) typedef struct PaAsioStreamInfo{ diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h index 9d41e4882e61db2d1e74b4762543574d880853a4..de89ae9bff5c68ac99fcbe1b4cb1d3db88c4a6f5 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_linux_alsa.h @@ -2,7 +2,7 @@ #define PA_LINUX_ALSA_H /* - * $Id: pa_linux_alsa.h 1337 2008-02-15 07:32:09Z rossb $ + * $Id: pa_linux_alsa.h 1414 2009-05-24 17:02:10Z aknudsen $ * PortAudio Portable Real-Time Audio Library * ALSA-specific extensions * @@ -87,6 +87,11 @@ PaError PaAlsa_GetStreamOutputCard( PaStream *s, int *card ); */ PaError PaAlsa_SetNumPeriods( int numPeriods ); +/** Set the maximum number of times to retry opening busy device (sleeping for a + * short interval inbetween). + */ +PaError PaAlsa_SetRetriesBusy( int retries ); + #ifdef __cplusplus } #endif diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h index 63bf1c9587dafdd6d64358dd4e8eb33ac24d6bb5..dce18c0d9302eb65f964ada0be4a7a5a9069fa01 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_waveformat.h @@ -157,16 +157,34 @@ typedef struct{ #define PAWIN_INDEXOF_DWCHANNELMASK (PAWIN_SIZEOF_WAVEFORMATEX+2) #define PAWIN_INDEXOF_SUBFORMAT (PAWIN_SIZEOF_WAVEFORMATEX+6) + +/* + Valid values to pass for the waveFormatTag PaWin_InitializeWaveFormatEx and + PaWin_InitializeWaveFormatExtensible functions below. These must match + the standard Windows WAVE_FORMAT_* values. +*/ +#define PAWIN_WAVE_FORMAT_PCM (1) +#define PAWIN_WAVE_FORMAT_IEEE_FLOAT (3) +#define PAWIN_WAVE_FORMAT_DOLBY_AC3_SPDIF (0x0092) +#define PAWIN_WAVE_FORMAT_WMA_SPDIF (0x0164) + + +/* + returns PAWIN_WAVE_FORMAT_PCM or PAWIN_WAVE_FORMAT_IEEE_FLOAT + depending on the sampleFormat parameter. +*/ +int PaWin_SampleFormatToLinearWaveFormatTag( PaSampleFormat sampleFormat ); + /* Use the following two functions to initialize the waveformat structure. */ void PaWin_InitializeWaveFormatEx( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate ); + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate ); void PaWin_InitializeWaveFormatExtensible( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate, + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate, PaWinWaveFormatChannelMask channelMask ); diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h index 58b74e3da71c76fa23a379c5c9d12b0fa4585bf4..deffd1006fa953c679e88a43029d967afbd9946d 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/include/pa_win_wmme.h @@ -1,7 +1,7 @@ #ifndef PA_WIN_WMME_H #define PA_WIN_WMME_H /* - * $Id: pa_win_wmme.h 1337 2008-02-15 07:32:09Z rossb $ + * $Id: pa_win_wmme.h 1405 2009-03-08 08:10:55Z rossb $ * PortAudio Portable Real-Time Audio Library * MME specific extensions * @@ -53,6 +53,10 @@ extern "C" #endif /* __cplusplus */ +/* The following are flags which can be set in + PaWinMmeStreamInfo's flags field. +*/ + #define paWinMmeUseLowLevelLatencyParameters (0x01) #define paWinMmeUseMultipleDevices (0x02) /* use mme specific multiple device feature */ #define paWinMmeUseChannelMask (0x04) @@ -64,6 +68,11 @@ extern "C" */ #define paWinMmeDontThrottleOverloadedProcessingThread (0x08) +/* Flags for non-PCM spdif passthrough. +*/ +#define paWinMmeWaveFormatDolbyAc3Spdif (0x10) +#define paWinMmeWaveFormatWmaSpdif (0x20) + typedef struct PaWinMmeDeviceAndChannelCount{ PaDeviceIndex device; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c index 6f6c9a1a61431387e5fb4684ebb1504520cdd29b..7a1b13125b8912139c7a35e365a018a9bfed58d3 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.c @@ -1,5 +1,5 @@ /* - * $Id: pa_dither.c 1097 2006-08-26 08:27:53Z rossb $ + * $Id: pa_dither.c 1418 2009-10-12 21:00:53Z philburk $ * Portable Audio I/O Library triangular dither generator * * Based on the Open Source API proposed by Ross Bencina @@ -42,9 +42,14 @@ @brief Functions for generating dither noise */ - -#include "pa_dither.h" #include "pa_types.h" +#include "pa_dither.h" + + +/* Note that the linear congruential algorithm requires 32 bit integers + * because it uses arithmetic overflow. So use PaUint32 instead of + * unsigned long so it will work on 64 bit systems. + */ #define PA_DITHER_BITS_ (15) @@ -57,9 +62,9 @@ void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *st } -signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) +PaInt32 PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *state ) { - signed long current, highPass; + PaInt32 current, highPass; /* Generate two random numbers. */ state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; @@ -69,9 +74,10 @@ signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerato * Shift before adding to prevent overflow which would skew the distribution. * Also shift an extra bit for the high pass filter. */ -#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) - current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + - (((signed long)state->randSeed2)>>DITHER_SHIFT_); +#define DITHER_SHIFT_ ((sizeof(PaInt32)*8 - PA_DITHER_BITS_) + 1) + + current = (((PaInt32)state->randSeed1)>>DITHER_SHIFT_) + + (((PaInt32)state->randSeed2)>>DITHER_SHIFT_); /* High pass filter to reduce audibility. */ highPass = current - state->previous; @@ -86,7 +92,7 @@ static const float const_float_dither_scale_ = PA_FLOAT_DITHER_SCALE_; float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *state ) { - signed long current, highPass; + PaInt32 current, highPass; /* Generate two random numbers. */ state->randSeed1 = (state->randSeed1 * 196314165) + 907633515; @@ -96,9 +102,8 @@ float PaUtil_GenerateFloatTriangularDither( PaUtilTriangularDitherGenerator *sta * Shift before adding to prevent overflow which would skew the distribution. * Also shift an extra bit for the high pass filter. */ -#define DITHER_SHIFT_ ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1) - current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) + - (((signed long)state->randSeed2)>>DITHER_SHIFT_); + current = (((PaInt32)state->randSeed1)>>DITHER_SHIFT_) + + (((PaInt32)state->randSeed2)>>DITHER_SHIFT_); /* High pass filter to reduce audibility. */ highPass = current - state->previous; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h index e77ce470d2a3131684b68998e1678c48b8df61e6..a5131b27fa36cadcdaac26fd6365d299ec92292e 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_dither.h @@ -1,7 +1,7 @@ #ifndef PA_DITHER_H #define PA_DITHER_H /* - * $Id: pa_dither.h 1097 2006-08-26 08:27:53Z rossb $ + * $Id: pa_dither.h 1418 2009-10-12 21:00:53Z philburk $ * Portable Audio I/O Library triangular dither generator * * Based on the Open Source API proposed by Ross Bencina @@ -44,18 +44,24 @@ @brief Functions for generating dither noise */ +#include "pa_types.h" + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +/* Note that the linear congruential algorithm requires 32 bit integers + * because it uses arithmetic overflow. So use PaUint32 instead of + * unsigned long so it will work on 64 bit systems. + */ /** @brief State needed to generate a dither signal */ typedef struct PaUtilTriangularDitherGenerator{ - unsigned long previous; - unsigned long randSeed1; - unsigned long randSeed2; + PaUint32 previous; + PaUint32 randSeed1; + PaUint32 randSeed2; } PaUtilTriangularDitherGenerator; @@ -73,9 +79,9 @@ void PaUtil_InitializeTriangularDitherState( PaUtilTriangularDitherGenerator *di signed short out = (signed short)(((in>>1) + dither) >> 15); </pre> @return - A signed long with a range of +32767 to -32768 + A signed 32-bit integer with a range of +32767 to -32768 */ -signed long PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); +PaInt32 PaUtil_Generate16BitTriangularDither( PaUtilTriangularDitherGenerator *ditherState ); /** diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c index 3e9056093931cd1c42f2ee679b5ffde886c6b5cb..28f0c60e8d60fbfc56102d116c7efebea96d9419 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_front.c @@ -1,5 +1,5 @@ /* - * $Id: pa_front.c 1387 2008-06-28 18:28:07Z philburk $ + * $Id: pa_front.c 1396 2008-11-03 19:31:30Z philburk $ * Portable Audio I/O Library Multi-Host API front end * Validate function parameters and manage multiple host APIs. * @@ -1506,7 +1506,7 @@ const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ) result = 0; PA_LOGAPI(("Pa_GetStreamInfo returned:\n" )); - PA_LOGAPI(("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n", result, error, Pa_GetErrorText( error ) )); + PA_LOGAPI(("\tconst PaStreamInfo*: 0 [PaError error:%d ( %s )]\n", error, Pa_GetErrorText( error ) )); } else diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h index 5efeed2487ad5f42efbc56c5973341db10ddf859..f6896222010f6d6d48ce32e0660e828d173da668 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_memorybarrier.h @@ -98,7 +98,7 @@ # error Memory barriers are not defined on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed. # endif # endif -#elif (_MSC_VER >= 1400) +#elif (_MSC_VER >= 1400) && !defined(_WIN32_WCE) # include <intrin.h> # pragma intrinsic(_ReadWriteBarrier) # pragma intrinsic(_ReadBarrier) @@ -106,6 +106,10 @@ # define PaUtil_FullMemoryBarrier() _ReadWriteBarrier() # define PaUtil_ReadMemoryBarrier() _ReadBarrier() # define PaUtil_WriteMemoryBarrier() _WriteBarrier() +#elif defined(_WIN32_WCE) +# define PaUtil_FullMemoryBarrier() +# define PaUtil_ReadMemoryBarrier() +# define PaUtil_WriteMemoryBarrier() #elif defined(_MSC_VER) || defined(__BORLANDC__) # define PaUtil_FullMemoryBarrier() _asm { lock add [esp], 0 } # define PaUtil_ReadMemoryBarrier() _asm { lock add [esp], 0 } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c index 93f863caa64fd320cb1e40243a85cc8d799ebd8b..4770610b863460fb33df88b6da191e2878d7d686 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_process.c @@ -1,5 +1,5 @@ /* - * $Id: pa_process.c 1341 2008-02-15 11:43:43Z rossb $ + * $Id: pa_process.c 1408 2009-03-13 16:41:39Z rossb $ * Portable Audio I/O Library * streamCallback <-> host buffer processing adapter * @@ -997,7 +997,7 @@ static unsigned long AdaptingInputOnlyProcess( PaUtilBufferProcessor *bp, bp->framesPerUserBuffer, bp->timeInfo, bp->callbackStatusFlags, bp->userData ); - bp->timeInfo->inputBufferAdcTime += frameCount * bp->samplePeriod; + bp->timeInfo->inputBufferAdcTime += bp->framesPerUserBuffer * bp->samplePeriod; } bp->framesInTempInputBuffer = 0; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c index ad9e2ae56713006d6bf29bdc2c36f70d438f8e74..310d719f2c582f21849084fcc3630488b59c245a 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.c @@ -1,5 +1,5 @@ /* - * $Id: pa_ringbuffer.c 1346 2008-02-20 10:09:20Z rossb $ + * $Id: pa_ringbuffer.c 1421 2009-11-18 16:09:05Z bjornroche $ * Portable Audio I/O Library * Ring Buffer utility. * @@ -63,7 +63,7 @@ * Initialize FIFO. * elementCount must be power of 2, returns -1 if not. */ -long PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, long elementSizeBytes, long elementCount, void *dataPtr ) +ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ) { if( ((elementCount-1) & elementCount) != 0) return -1; /* Not Power of two. */ rbuf->bufferSize = elementCount; @@ -77,14 +77,14 @@ long PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, long elementSizeBytes, /*************************************************************************** ** Return number of elements available for reading. */ -long PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ) +ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ) { PaUtil_ReadMemoryBarrier(); return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); } /*************************************************************************** ** Return number of elements available for writing. */ -long PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ) +ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ) { /* Since we are calling PaUtil_GetRingBufferReadAvailable, we don't need an aditional MB */ return ( rbuf->bufferSize - PaUtil_GetRingBufferReadAvailable(rbuf)); @@ -103,19 +103,19 @@ void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf ) ** If non-contiguous, size2 will be the size of second region. ** Returns room available to be written or elementCount, whichever is smaller. */ -long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ) +ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ) { - long index; - long available = PaUtil_GetRingBufferWriteAvailable( rbuf ); + ring_buffer_size_t index; + ring_buffer_size_t available = PaUtil_GetRingBufferWriteAvailable( rbuf ); if( elementCount > available ) elementCount = available; /* Check to see if write is not contiguous. */ index = rbuf->writeIndex & rbuf->smallMask; if( (index + elementCount) > rbuf->bufferSize ) { /* Write data in two blocks that wrap the buffer. */ - long firstHalf = rbuf->bufferSize - index; + ring_buffer_size_t firstHalf = rbuf->bufferSize - index; *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes]; *sizePtr1 = firstHalf; *dataPtr2 = &rbuf->buffer[0]; @@ -134,7 +134,7 @@ long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount /*************************************************************************** */ -long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCount ) +ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ) { /* we need to ensure that previous writes are seen before we update the write index */ PaUtil_WriteMemoryBarrier(); @@ -147,19 +147,19 @@ long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCou ** If non-contiguous, size2 will be the size of second region. ** Returns room available to be written or elementCount, whichever is smaller. */ -long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ) +ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ) { - long index; - long available = PaUtil_GetRingBufferReadAvailable( rbuf ); + ring_buffer_size_t index; + ring_buffer_size_t available = PaUtil_GetRingBufferReadAvailable( rbuf ); if( elementCount > available ) elementCount = available; /* Check to see if read is not contiguous. */ index = rbuf->readIndex & rbuf->smallMask; if( (index + elementCount) > rbuf->bufferSize ) { /* Write data in two blocks that wrap the buffer. */ - long firstHalf = rbuf->bufferSize - index; + ring_buffer_size_t firstHalf = rbuf->bufferSize - index; *dataPtr1 = &rbuf->buffer[index*rbuf->elementSizeBytes]; *sizePtr1 = firstHalf; *dataPtr2 = &rbuf->buffer[0]; @@ -176,7 +176,7 @@ long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, } /*************************************************************************** */ -long PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, long elementCount ) +ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ) { /* we need to ensure that previous writes are always seen before updating the index. */ PaUtil_WriteMemoryBarrier(); @@ -185,9 +185,9 @@ long PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, long elementCoun /*************************************************************************** ** Return elements written. */ -long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elementCount ) +ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ) { - long size1, size2, numWritten; + ring_buffer_size_t size1, size2, numWritten; void *data1, *data2; numWritten = PaUtil_GetRingBufferWriteRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 ); if( size2 > 0 ) @@ -207,9 +207,9 @@ long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elem /*************************************************************************** ** Return elements read. */ -long PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, long elementCount ) +ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ) { - long size1, size2, numRead; + ring_buffer_size_t size1, size2, numRead; void *data1, *data2; numRead = PaUtil_GetRingBufferReadRegions( rbuf, elementCount, &data1, &size1, &data2, &size2 ); if( size2 > 0 ) diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h index fd92882a6d2b737adb4ff60718fec2218ea213fa..7efd1914d92c45b38929054ae33a7d1260bbaf51 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/common/pa_ringbuffer.h @@ -1,7 +1,7 @@ #ifndef PA_RINGBUFFER_H #define PA_RINGBUFFER_H /* - * $Id: pa_ringbuffer.h 1347 2008-02-21 04:54:36Z rossb $ + * $Id: pa_ringbuffer.h 1421 2009-11-18 16:09:05Z bjornroche $ * Portable Audio I/O Library * Ring Buffer utility. * @@ -67,6 +67,21 @@ the use of the ring buffer. */ +#if defined(__APPLE__) +#include <sys/types.h> +typedef int32_t ring_buffer_size_t; +#elif defined( __GNUC__ ) +typedef long ring_buffer_size_t; +#elif (_MSC_VER >= 1400) +typedef long ring_buffer_size_t; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef long ring_buffer_size_t; +#else +typedef long ring_buffer_size_t; +#endif + + + #ifdef __cplusplus extern "C" { @@ -74,12 +89,12 @@ extern "C" typedef struct PaUtilRingBuffer { - long bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ - long writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */ - long readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */ - long bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */ - long smallMask; /**< Used for fitting indices to buffer. */ - long elementSizeBytes; /**< Number of bytes per element. */ + ring_buffer_size_t bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */ + ring_buffer_size_t writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */ + ring_buffer_size_t readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */ + ring_buffer_size_t bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */ + ring_buffer_size_t smallMask; /**< Used for fitting indices to buffer. */ + ring_buffer_size_t elementSizeBytes; /**< Number of bytes per element. */ char *buffer; /**< Pointer to the buffer containing the actual data. */ }PaUtilRingBuffer; @@ -96,7 +111,7 @@ typedef struct PaUtilRingBuffer @return -1 if elementCount is not a power of 2, otherwise 0. */ -long PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, long elementSizeBytes, long elementCount, void *dataPtr ); +ring_buffer_size_t PaUtil_InitializeRingBuffer( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementSizeBytes, ring_buffer_size_t elementCount, void *dataPtr ); /** Clear buffer. Should only be called when buffer is NOT being read. @@ -110,7 +125,7 @@ void PaUtil_FlushRingBuffer( PaUtilRingBuffer *rbuf ); @return The number of elements available for writing. */ -long PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); +ring_buffer_size_t PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); /** Retrieve the number of elements available in the ring buffer for reading. @@ -118,7 +133,7 @@ long PaUtil_GetRingBufferWriteAvailable( PaUtilRingBuffer *rbuf ); @return The number of elements available for reading. */ -long PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); +ring_buffer_size_t PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); /** Write data to the ring buffer. @@ -130,7 +145,7 @@ long PaUtil_GetRingBufferReadAvailable( PaUtilRingBuffer *rbuf ); @return The number of elements written. */ -long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elementCount ); +ring_buffer_size_t PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, ring_buffer_size_t elementCount ); /** Read data from the ring buffer. @@ -142,7 +157,7 @@ long PaUtil_WriteRingBuffer( PaUtilRingBuffer *rbuf, const void *data, long elem @return The number of elements read. */ -long PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, long elementCount ); +ring_buffer_size_t PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, ring_buffer_size_t elementCount ); /** Get address of region(s) to which we can write data. @@ -164,9 +179,9 @@ long PaUtil_ReadRingBuffer( PaUtilRingBuffer *rbuf, void *data, long elementCoun @return The room available to be written or elementCount, whichever is smaller. */ -long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ); +ring_buffer_size_t PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ); /** Advance the write index to the next location to be written. @@ -176,7 +191,7 @@ long PaUtil_GetRingBufferWriteRegions( PaUtilRingBuffer *rbuf, long elementCount @return The new position. */ -long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCount ); +ring_buffer_size_t PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); /** Get address of region(s) from which we can write data. @@ -198,9 +213,9 @@ long PaUtil_AdvanceRingBufferWriteIndex( PaUtilRingBuffer *rbuf, long elementCou @return The number of elements available for reading. */ -long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, - void **dataPtr1, long *sizePtr1, - void **dataPtr2, long *sizePtr2 ); +ring_buffer_size_t PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount, + void **dataPtr1, ring_buffer_size_t *sizePtr1, + void **dataPtr2, ring_buffer_size_t *sizePtr2 ); /** Advance the read index to the next location to be read. @@ -210,7 +225,7 @@ long PaUtil_GetRingBufferReadRegions( PaUtilRingBuffer *rbuf, long elementCount, @return The new position. */ -long PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, long elementCount ); +ring_buffer_size_t PaUtil_AdvanceRingBufferReadIndex( PaUtilRingBuffer *rbuf, ring_buffer_size_t elementCount ); #ifdef __cplusplus } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c index 75b6204680f808b7b7a12f7b0dc3ea86fc66f5b3..224f4ff636aad211a311cbd4154706602116464f 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c @@ -1,11 +1,12 @@ /* - * $Id: pa_linux_alsa.c 1362 2008-02-28 21:43:57Z aknudsen $ + * $Id: pa_linux_alsa.c 1415 2009-06-03 18:57:56Z aknudsen $ * PortAudio Portable Real-Time Audio Library * Latest Version at: http://www.portaudio.com * ALSA implementation by Joshua Haberman and Arve Knudsen * * Copyright (c) 2002 Joshua Haberman <joshua@haberman.com> - * Copyright (c) 2005-2007 Arve Knudsen <aknuds-1@broadpark.no> + * Copyright (c) 2005-2009 Arve Knudsen <arve.knudsen@gmail.com> + * Copyright (c) 2008 Kevin Kofler <kevin.kofler@chello.at> * * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2002 Ross Bencina, Phil Burk @@ -99,6 +100,7 @@ static int aErr_; /* Used with ENSURE_ */ static int numPeriods_ = 4; +static int busyRetries_ = 100; int PaAlsa_SetNumPeriods( int numPeriods ) { @@ -118,6 +120,8 @@ typedef struct unsigned long framesPerBuffer; int numUserChannels, numHostChannels; int userInterleaved, hostInterleaved; + int canMmap; + void *nonMmapBuffer; PaDeviceIndex device; /* Keep the device index */ snd_pcm_t *pcm; @@ -321,7 +325,7 @@ static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) * and a suitable result returned. The device is closed before returning. */ static PaError GropeDevice( snd_pcm_t* pcm, int isPlug, StreamDirection mode, int openBlocking, - PaAlsaDeviceInfo* devInfo, int* canMmap ) + PaAlsaDeviceInfo* devInfo ) { PaError result = paNoError; snd_pcm_hw_params_t *hwParams; @@ -354,9 +358,6 @@ static PaError GropeDevice( snd_pcm_t* pcm, int isPlug, StreamDirection mode, in snd_pcm_hw_params_alloca( &hwParams ); snd_pcm_hw_params_any( pcm, hwParams ); - *canMmap = snd_pcm_hw_params_test_access( pcm, hwParams, SND_PCM_ACCESS_MMAP_INTERLEAVED ) >= 0 || - snd_pcm_hw_params_test_access( pcm, hwParams, SND_PCM_ACCESS_MMAP_NONINTERLEAVED ) >= 0; - if( defaultSr >= 0 ) { /* Could be that the device opened in one mode supports samplerates that the other mode wont have, @@ -539,7 +540,7 @@ static int IgnorePlugin( const char *pluginId ) **/ static int OpenPcm( snd_pcm_t **pcmp, const char *name, snd_pcm_stream_t stream, int mode, int waitOnBusy ) { - int tries = 0, maxTries = waitOnBusy ? 100 : 0; + int tries = 0, maxTries = waitOnBusy ? busyRetries_ : 0; int ret = snd_pcm_open( pcmp, name, stream, mode ); for( tries = 0; tries < maxTries && -EBUSY == ret; ++tries ) { @@ -566,7 +567,6 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d PaError result = 0; PaDeviceInfo *baseDeviceInfo = &devInfo->baseDeviceInfo; snd_pcm_t *pcm; - int canMmap = -1; PaUtilHostApiRepresentation *baseApi = &alsaApi->baseHostApiRep; /* Zero fields */ @@ -580,8 +580,7 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d OpenPcm( &pcm, deviceName->alsaName, SND_PCM_STREAM_CAPTURE, blocking, 0 ) >= 0 ) { - if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_In, blocking, devInfo, - &canMmap ) != paNoError ) + if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_In, blocking, devInfo ) != paNoError ) { /* Error */ PA_DEBUG(("%s: Failed groping %s for capture\n", __FUNCTION__, deviceName->alsaName)); @@ -594,8 +593,7 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d OpenPcm( &pcm, deviceName->alsaName, SND_PCM_STREAM_PLAYBACK, blocking, 0 ) >= 0 ) { - if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_Out, blocking, devInfo, - &canMmap ) != paNoError ) + if( GropeDevice( pcm, deviceName->isPlug, StreamDirection_Out, blocking, devInfo ) != paNoError ) { /* Error */ PA_DEBUG(("%s: Failed groping %s for playback\n", __FUNCTION__, deviceName->alsaName)); @@ -603,12 +601,6 @@ static PaError FillInDevInfo( PaAlsaHostApiRepresentation *alsaApi, HwDevInfo* d } } - if( 0 == canMmap ) - { - PA_DEBUG(("%s: Device %s doesn't support mmap\n", __FUNCTION__, deviceName->alsaName)); - goto end; - } - baseDeviceInfo->structVersion = 2; baseDeviceInfo->hostApi = alsaApi->hostApiIndex; baseDeviceInfo->name = deviceName->name; @@ -1197,6 +1189,8 @@ static PaError PaAlsaStreamComponent_Initialize( PaAlsaStreamComponent *self, Pa self->hostInterleaved = self->userInterleaved = !(userSampleFormat & paNonInterleaved); self->numUserChannels = params->channelCount; self->streamDir = streamDir; + self->canMmap = 0; + self->nonMmapBuffer = NULL; if( !callbackMode && !self->userInterleaved ) { @@ -1239,6 +1233,7 @@ static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *se PaError result = paNoError; snd_pcm_access_t accessMode, alternateAccessMode; + snd_pcm_access_t rwAccessMode, alternateRwAccessMode; int dir = 0; snd_pcm_t *pcm = self->pcm; double sr = *sampleRate; @@ -1258,32 +1253,40 @@ static PaError PaAlsaStreamComponent_InitialConfigure( PaAlsaStreamComponent *se if( self->userInterleaved ) { accessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + rwAccessMode = SND_PCM_ACCESS_RW_INTERLEAVED; alternateAccessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + alternateRwAccessMode = SND_PCM_ACCESS_RW_NONINTERLEAVED; } else { accessMode = SND_PCM_ACCESS_MMAP_NONINTERLEAVED; + rwAccessMode = SND_PCM_ACCESS_RW_NONINTERLEAVED; alternateAccessMode = SND_PCM_ACCESS_MMAP_INTERLEAVED; + alternateRwAccessMode = SND_PCM_ACCESS_RW_INTERLEAVED; } /* If requested access mode fails, try alternate mode */ + self->canMmap = 1; if( snd_pcm_hw_params_set_access( pcm, hwParams, accessMode ) < 0 ) { - int err = 0; - if( (err = snd_pcm_hw_params_set_access( pcm, hwParams, alternateAccessMode )) < 0) + if( snd_pcm_hw_params_set_access( pcm, hwParams, rwAccessMode ) >= 0 ) + self->canMmap = 0; + else { - result = paUnanticipatedHostError; - if( -EINVAL == err ) + if( snd_pcm_hw_params_set_access( pcm, hwParams, alternateAccessMode ) < 0 ) { - PaUtil_SetLastHostErrorInfo( paALSA, err, "PA ALSA requires that a device supports mmap access" ); - } - else - { - PaUtil_SetLastHostErrorInfo( paALSA, err, snd_strerror( err ) ); + int err = 0; + if( (err = snd_pcm_hw_params_set_access( pcm, hwParams, alternateRwAccessMode )) >= 0) + self->canMmap = 0; + else + { + result = paUnanticipatedHostError; + PaUtil_SetLastHostErrorInfo( paALSA, err, snd_strerror( err ) ); + goto error; + } } - goto error; + /* Flip mode */ + self->hostInterleaved = !self->userInterleaved; } - /* Flip mode */ - self->hostInterleaved = !self->userInterleaved; } ENSURE_( snd_pcm_hw_params_set_format( pcm, hwParams, self->nativeFormat ), paUnanticipatedHostError ); @@ -1361,7 +1364,7 @@ static PaError PaAlsaStreamComponent_FinishConfigure( PaAlsaStreamComponent *sel ENSURE_( snd_pcm_sw_params_set_avail_min( self->pcm, swParams, self->framesPerBuffer ), paUnanticipatedHostError ); ENSURE_( snd_pcm_sw_params_set_xfer_align( self->pcm, swParams, 1 ), paUnanticipatedHostError ); - ENSURE_( snd_pcm_sw_params_set_tstamp_mode( self->pcm, swParams, SND_PCM_TSTAMP_MMAP ), paUnanticipatedHostError ); + ENSURE_( snd_pcm_sw_params_set_tstamp_mode( self->pcm, swParams, SND_PCM_TSTAMP_ENABLE ), paUnanticipatedHostError ); /* Set the parameters! */ ENSURE_( snd_pcm_sw_params( self->pcm, swParams ), paUnanticipatedHostError ); @@ -1589,6 +1592,10 @@ static PaError PaAlsaStreamComponent_DetermineFramesPerBuffer( PaAlsaStreamCompo } } + /* non-mmap mode needs a reasonably-sized buffer or it'll stutter */ + if( !self->canMmap && framesPerHostBuffer < 2048 ) + framesPerHostBuffer = 2048; + assert( framesPerHostBuffer > 0 ); { snd_pcm_uframes_t min = 0, max = 0; @@ -1831,12 +1838,13 @@ static PaError PaAlsaStream_DetermineFramesPerBuffer( PaAlsaStream* self, double PA_UNLESS( framesPerHostBuffer != 0, paInternalError ); self->maxFramesPerHostBuffer = framesPerHostBuffer; - if( !accurate ) + if( !self->playback.canMmap || !accurate ) { /* Don't know the exact size per host buffer */ *hostBufferSizeMode = paUtilBoundedHostBufferSize; /* Raise upper bound */ - ++self->maxFramesPerHostBuffer; + if( !accurate ) + ++self->maxFramesPerHostBuffer; } error: @@ -1995,11 +2003,11 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* Ok, buffer processor is initialized, now we can deduce it's latency */ if( numInputChannels > 0 ) - stream->streamRepresentation.streamInfo.inputLatency = inputLatency + PaUtil_GetBufferProcessorInputLatency( - &stream->bufferProcessor ); + stream->streamRepresentation.streamInfo.inputLatency = inputLatency + (PaTime)( + PaUtil_GetBufferProcessorInputLatency( &stream->bufferProcessor ) / sampleRate); if( numOutputChannels > 0 ) - stream->streamRepresentation.streamInfo.outputLatency = outputLatency + PaUtil_GetBufferProcessorOutputLatency( - &stream->bufferProcessor ); + stream->streamRepresentation.streamInfo.outputLatency = outputLatency + (PaTime)( + PaUtil_GetBufferProcessorOutputLatency( &stream->bufferProcessor ) / sampleRate); *s = (PaStream*)stream; @@ -2059,9 +2067,11 @@ static PaError AlsaStart( PaAlsaStream *stream, int priming ) { /* Buffer isn't primed, so prepare and silence */ ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); - SilenceBuffer( stream ); + if( stream->playback.canMmap ) + SilenceBuffer( stream ); } - ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); + if( stream->playback.canMmap ) + ENSURE_( snd_pcm_start( stream->playback.pcm ), paUnanticipatedHostError ); } else ENSURE_( snd_pcm_prepare( stream->playback.pcm ), paUnanticipatedHostError ); @@ -2390,6 +2400,7 @@ static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) snd_pcm_status_t *st; PaTime now = PaUtil_GetTime(); snd_timestamp_t t; + int errplayback = 0, errcapture = 0; snd_pcm_status_alloca( &st ); @@ -2400,6 +2411,7 @@ static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) { snd_pcm_status_get_trigger_tstamp( st, &t ); self->underrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + errplayback = snd_pcm_recover( self->playback.pcm, -EPIPE, 0 ); } } if( self->capture.pcm ) @@ -2409,10 +2421,12 @@ static PaError PaAlsaStream_HandleXrun( PaAlsaStream *self ) { snd_pcm_status_get_trigger_tstamp( st, &t ); self->overrun = now * 1000 - ((PaTime) t.tv_sec * 1000 + (PaTime) t.tv_usec / 1000); + errcapture = snd_pcm_recover( self->capture.pcm, -EPIPE, 0 ); } } - PA_ENSURE( AlsaRestart( self ) ); + if( errplayback || errcapture ) + PA_ENSURE( AlsaRestart( self ) ); end: return result; @@ -2563,7 +2577,7 @@ static void CalculateTimeInfo( PaAlsaStream *stream, PaStreamCallbackTimeInfo *t static PaError PaAlsaStreamComponent_EndProcessing( PaAlsaStreamComponent *self, unsigned long numFrames, int *xrun ) { PaError result = paNoError; - int res; + int res = 0; /* @concern FullDuplex It is possible that only one direction is marked ready after polling, and processed * afterwards @@ -2571,7 +2585,34 @@ static PaError PaAlsaStreamComponent_EndProcessing( PaAlsaStreamComponent *self, if( !self->ready ) goto end; - res = snd_pcm_mmap_commit( self->pcm, self->offset, numFrames ); + if( !self->canMmap && StreamDirection_Out == self->streamDir ) + { + /* Play sound */ + if( self->hostInterleaved ) + res = snd_pcm_writei( self->pcm, self->nonMmapBuffer, numFrames ); + else + { + void *bufs[self->numHostChannels]; + int bufsize = snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ); + unsigned char *buffer = self->nonMmapBuffer; + int i; + for( i = 0; i < self->numHostChannels; ++i ) + { + bufs[i] = buffer; + buffer += bufsize; + } + res = snd_pcm_writen( self->pcm, bufs, numFrames ); + } + } + + if( self->canMmap ) + res = snd_pcm_mmap_commit( self->pcm, self->offset, numFrames ); + else + { + free( self->nonMmapBuffer ); + self->nonMmapBuffer = NULL; + } + if( res == -EPIPE || res == -ESTRPIPE ) { *xrun = 1; @@ -2611,7 +2652,7 @@ static PaError PaAlsaStreamComponent_DoChannelAdaption( PaAlsaStreamComponent *s if( self->hostInterleaved ) { int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); - unsigned char *buffer = ExtractAddress( self->channelAreas, self->offset ); + unsigned char *buffer = self->canMmap ? ExtractAddress( self->channelAreas, self->offset ) : self->nonMmapBuffer; /* Start after the last user channel */ p = buffer + self->numUserChannels * swidth; @@ -2991,13 +3032,23 @@ static PaError PaAlsaStreamComponent_RegisterChannels( PaAlsaStreamComponent* se goto end; } - ENSURE_( snd_pcm_mmap_begin( self->pcm, &areas, &self->offset, numFrames ), paUnanticipatedHostError ); + if( self->canMmap ) + { + ENSURE_( snd_pcm_mmap_begin( self->pcm, &areas, &self->offset, numFrames ), paUnanticipatedHostError ); + /* @concern ChannelAdaption Buffer address is recorded so we can do some channel adaption later */ + self->channelAreas = (snd_pcm_channel_area_t *)areas; + } + else + { + free( self->nonMmapBuffer ); + self->nonMmapBuffer = calloc( self->numHostChannels, snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ) ); + } if( self->hostInterleaved ) { int swidth = snd_pcm_format_size( self->nativeFormat, 1 ); - p = buffer = ExtractAddress( areas, self->offset ); + p = buffer = self->canMmap ? ExtractAddress( areas, self->offset ) : self->nonMmapBuffer; for( i = 0; i < self->numUserChannels; ++i ) { /* We're setting the channels up to userChannels, but the stride will be hostChannels samples */ @@ -3007,16 +3058,52 @@ static PaError PaAlsaStreamComponent_RegisterChannels( PaAlsaStreamComponent* se } else { - for( i = 0; i < self->numUserChannels; ++i ) + if( self->canMmap ) + for( i = 0; i < self->numUserChannels; ++i ) + { + area = areas + i; + buffer = ExtractAddress( area, self->offset ); + setChannel( bp, i, buffer, 1 ); + } + else { - area = areas + i; - buffer = ExtractAddress( area, self->offset ); - setChannel( bp, i, buffer, 1 ); + int bufsize = snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ); + buffer = self->nonMmapBuffer; + for( i = 0; i < self->numUserChannels; ++i ) + { + setChannel( bp, i, buffer, 1 ); + buffer += bufsize; + } } } - /* @concern ChannelAdaption Buffer address is recorded so we can do some channel adaption later */ - self->channelAreas = (snd_pcm_channel_area_t *)areas; + if( !self->canMmap && StreamDirection_In == self->streamDir ) + { + /* Read sound */ + int res; + if( self->hostInterleaved ) + res = snd_pcm_readi( self->pcm, self->nonMmapBuffer, *numFrames ); + else + { + void *bufs[self->numHostChannels]; + int bufsize = snd_pcm_format_size( self->nativeFormat, self->framesPerBuffer + 1 ); + unsigned char *buffer = self->nonMmapBuffer; + int i; + for( i = 0; i < self->numHostChannels; ++i ) + { + bufs[i] = buffer; + buffer += bufsize; + } + res = snd_pcm_readn( self->pcm, bufs, *numFrames ); + } + if( res == -EPIPE || res == -ESTRPIPE ) + { + *xrun = 1; + *numFrames = 0; + free( self->nonMmapBuffer ); + self->nonMmapBuffer = NULL; + } + } end: error: @@ -3584,3 +3671,9 @@ PaError PaAlsa_GetStreamOutputCard(PaStream* s, int* card) { error: return result; } + +PaError PaAlsa_SetRetriesBusy( int retries ) +{ + busyRetries_ = retries; + return paNoError; +} diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp index 1b4b33781f155d3eb78dbbfe53dba83bee14ac08..8dfefbd67b95ffc0d64194ab75ab7a05e1b1f72f 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp @@ -71,7 +71,7 @@ (IUnknown functions) 0 virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0; 4 virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0; - 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; + 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0; (IASIO functions) 12 virtual ASIOBool (*init)(void *sysHandle) = 0; @@ -128,7 +128,7 @@ with MSVC, and requires that you ship the OpenASIO DLL with your application. - + ACKNOWLEDGEMENTS Ross Bencina: worked out the thiscall details above, wrote the original @@ -186,7 +186,7 @@ extern IASIO* theAsioDriver; // The following macros define the inline assembler for BORLAND first then gcc -#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) +#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__) #define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\ @@ -277,7 +277,7 @@ extern IASIO* theAsioDriver; :"=a"(resultName) /* Output Operands */ \ :"c"(thisPtr) /* Input Operands */ \ ); \ - + #define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl %0\n\t" \ @@ -287,7 +287,7 @@ extern IASIO* theAsioDriver; :"r"(param1), /* Input Operands */ \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -297,7 +297,7 @@ extern IASIO* theAsioDriver; :"r"(param1), /* Input Operands */ \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 ) \ __asm__ __volatile__ ("pushl 4(%1)\n\t" \ @@ -310,7 +310,7 @@ extern IASIO* theAsioDriver; /* when using GCC 3.3.3, and maybe later versions*/\ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 ) \ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -322,7 +322,7 @@ extern IASIO* theAsioDriver; "r"(param1), \ "c"(thisPtr) \ ); \ - + #define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\ __asm__ __volatile__ ("pushl %1\n\t" \ @@ -338,7 +338,7 @@ extern IASIO* theAsioDriver; "r"(param1), \ "c"(thisPtr) \ ); \ - + #endif @@ -354,8 +354,8 @@ IASIOThiscallResolver::IASIOThiscallResolver() } // Constructor called from ASIOInit() below -IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that) - : that_ (that) +IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that) +: that_( that ) { } @@ -363,11 +363,11 @@ IASIOThiscallResolver::IASIOThiscallResolver (IASIO* that) // really a COM object, just a wrapper which will work with the ASIO SDK. // If you wanted to use ASIO without the SDK you might want to implement COM // aggregation in these methods. -HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, void **ppv) +HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv) { - (void) riid; // suppress unused variable warning + (void)riid; // suppress unused variable warning - assert (false); // this function should never be called by the ASIO SDK. + assert( false ); // this function should never be called by the ASIO SDK. *ppv = NULL; return E_NOINTERFACE; @@ -375,176 +375,176 @@ HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface (REFIID riid, vo ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef() { - assert (false); // this function should never be called by the ASIO SDK. + assert( false ); // this function should never be called by the ASIO SDK. return 1; } ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release() { - assert (false); // this function should never be called by the ASIO SDK. - + assert( false ); // this function should never be called by the ASIO SDK. + return 1; } // Implement the IASIO interface methods by performing the vptr manipulation // described above then delegating to the real implementation. -ASIOBool IASIOThiscallResolver::init (void *sysHandle) +ASIOBool IASIOThiscallResolver::init(void *sysHandle) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 12, sysHandle); + CALL_THISCALL_1( result, that_, 12, sysHandle ); return result; } -void IASIOThiscallResolver::getDriverName (char *name) +void IASIOThiscallResolver::getDriverName(char *name) { - CALL_VOID_THISCALL_1 (that_, 16, name); + CALL_VOID_THISCALL_1( that_, 16, name ); } long IASIOThiscallResolver::getDriverVersion() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 20); + CALL_THISCALL_0( result, that_, 20 ); return result; } -void IASIOThiscallResolver::getErrorMessage (char *string) +void IASIOThiscallResolver::getErrorMessage(char *string) { - CALL_VOID_THISCALL_1 (that_, 24, string); + CALL_VOID_THISCALL_1( that_, 24, string ); } ASIOError IASIOThiscallResolver::start() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 28); + CALL_THISCALL_0( result, that_, 28 ); return result; } ASIOError IASIOThiscallResolver::stop() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 32); + CALL_THISCALL_0( result, that_, 32 ); return result; } -ASIOError IASIOThiscallResolver::getChannels (long *numInputChannels, long *numOutputChannels) +ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 36, numInputChannels, numOutputChannels); + CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels ); return result; } -ASIOError IASIOThiscallResolver::getLatencies (long *inputLatency, long *outputLatency) +ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 40, inputLatency, outputLatency); + CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency ); return result; } -ASIOError IASIOThiscallResolver::getBufferSize (long *minSize, long *maxSize, +ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity) { ASIOBool result; - CALL_THISCALL_4 (result, that_, 44, minSize, maxSize, preferredSize, granularity); + CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity ); return result; } -ASIOError IASIOThiscallResolver::canSampleRate (ASIOSampleRate sampleRate) +ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate) { ASIOBool result; - CALL_THISCALL_1_DOUBLE (result, that_, 48, sampleRate); + CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate ); return result; } -ASIOError IASIOThiscallResolver::getSampleRate (ASIOSampleRate *sampleRate) +ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 52, sampleRate); + CALL_THISCALL_1( result, that_, 52, sampleRate ); return result; } -ASIOError IASIOThiscallResolver::setSampleRate (ASIOSampleRate sampleRate) -{ +ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate) +{ ASIOBool result; - CALL_THISCALL_1_DOUBLE (result, that_, 56, sampleRate); + CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate ); return result; } -ASIOError IASIOThiscallResolver::getClockSources (ASIOClockSource *clocks, long *numSources) +ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 60, clocks, numSources); + CALL_THISCALL_2( result, that_, 60, clocks, numSources ); return result; } -ASIOError IASIOThiscallResolver::setClockSource (long reference) +ASIOError IASIOThiscallResolver::setClockSource(long reference) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 64, reference); + CALL_THISCALL_1( result, that_, 64, reference ); return result; } -ASIOError IASIOThiscallResolver::getSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp) +ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 68, sPos, tStamp); + CALL_THISCALL_2( result, that_, 68, sPos, tStamp ); return result; } -ASIOError IASIOThiscallResolver::getChannelInfo (ASIOChannelInfo *info) +ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info) { ASIOBool result; - CALL_THISCALL_1 (result, that_, 72, info); + CALL_THISCALL_1( result, that_, 72, info ); return result; } -ASIOError IASIOThiscallResolver::createBuffers (ASIOBufferInfo *bufferInfos, +ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks) { ASIOBool result; - CALL_THISCALL_4 (result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks); + CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks ); return result; } ASIOError IASIOThiscallResolver::disposeBuffers() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 80); + CALL_THISCALL_0( result, that_, 80 ); return result; } ASIOError IASIOThiscallResolver::controlPanel() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 84); + CALL_THISCALL_0( result, that_, 84 ); return result; } -ASIOError IASIOThiscallResolver::future (long selector,void *opt) +ASIOError IASIOThiscallResolver::future(long selector,void *opt) { ASIOBool result; - CALL_THISCALL_2 (result, that_, 88, selector, opt); + CALL_THISCALL_2( result, that_, 88, selector, opt ); return result; } ASIOError IASIOThiscallResolver::outputReady() { ASIOBool result; - CALL_THISCALL_0 (result, that_, 92); + CALL_THISCALL_0( result, that_, 92 ); return result; } // Implement our substitute ASIOInit() method -ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info) +ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info) { // To ensure that our instance's vptr is correctly constructed, even if // ASIOInit is called prior to main(), we explicitly call its constructor // (potentially over the top of an existing instance). Note that this is // pretty ugly, and is only safe because IASIOThiscallResolver has no // destructor and contains no objects with destructors. - new ( (void*) &instance) IASIOThiscallResolver (theAsioDriver); + new((void*)&instance) IASIOThiscallResolver( theAsioDriver ); // Interpose between ASIO client code and the real driver. theAsioDriver = &instance; @@ -553,7 +553,7 @@ ASIOError IASIOThiscallResolver::ASIOInit (ASIODriverInfo *info) // real driver because theAsioDriver is reset to zero in ASIOExit(). // Delegate to the real ASIOInit - return ::ASIOInit (info); + return ::ASIOInit(info); } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp index cf54465cfa65c74901ed79159748ab6f2232d66f..84d1c5117946f2d2d9af24c5a1e1aa2e6afd9923 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/asio/pa_asio.cpp @@ -1,5 +1,5 @@ /* - * $Id: pa_asio.cpp 1386 2008-06-28 18:27:34Z philburk $ + * $Id: pa_asio.cpp 1416 2009-06-16 16:12:41Z rossb $ * Portable Audio I/O Library for ASIO Drivers * * Author: Stephane Letz @@ -29,13 +29,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -83,7 +83,7 @@ @todo review ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable - @todo review Blocking i/o latency computations in OpenStream(), changing ring + @todo review Blocking i/o latency computations in OpenStream(), changing ring buffer to a non-power-of-two structure could reduce blocking i/o latency. @todo implement IsFormatSupported @@ -171,8 +171,8 @@ /* external reference to ASIO SDK's asioDrivers. - This is a bit messy because we want to explicitly manage - allocation/deallocation of this structure, but some layers of the SDK + This is a bit messy because we want to explicitly manage + allocation/deallocation of this structure, but some layers of the SDK which we currently use (eg the implementation in asio.cpp) still use this global version. @@ -190,9 +190,9 @@ extern AsioDrivers* asioDrivers; /* prototypes for functions declared in this file */ -extern "C" PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex); -static void Terminate (struct PaUtilHostApiRepresentation *hostApi); -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, +extern "C" PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ); +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -200,109 +200,82 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData); -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, + void *userData ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate); -static PaError CloseStream (PaStream* stream); -static PaError StartStream (PaStream *stream); -static PaError StopStream (PaStream *stream); -static PaError AbortStream (PaStream *stream); -static PaError IsStreamStopped (PaStream *s); -static PaError IsStreamActive (PaStream *stream); -static PaTime GetStreamTime (PaStream *stream); -static double GetStreamCpuLoad (PaStream* stream); -static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames); -static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames); -static signed long GetStreamReadAvailable (PaStream* stream); -static signed long GetStreamWriteAvailable (PaStream* stream); + double sampleRate ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); /* Blocking i/o callback function. */ -static int BlockingIoPaCallback (const void *inputBuffer , - void *outputBuffer , - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo *timeInfo , - PaStreamCallbackFlags statusFlags , - void *userData); +static int BlockingIoPaCallback(const void *inputBuffer , + void *outputBuffer , + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo , + PaStreamCallbackFlags statusFlags , + void *userData ); /* our ASIO callback functions */ -static void bufferSwitch (long index, ASIOBool processNow); -static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool processNow); -static void sampleRateChanged (ASIOSampleRate sRate); -static long asioMessages (long selector, long value, void* message, double* opt); +static void bufferSwitch(long index, ASIOBool processNow); +static ASIOTime *bufferSwitchTimeInfo(ASIOTime *timeInfo, long index, ASIOBool processNow); +static void sampleRateChanged(ASIOSampleRate sRate); +static long asioMessages(long selector, long value, void* message, double* opt); -static ASIOCallbacks asioCallbacks_ = { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; +static ASIOCallbacks asioCallbacks_ = + { bufferSwitch, sampleRateChanged, asioMessages, bufferSwitchTimeInfo }; #define PA_ASIO_SET_LAST_HOST_ERROR( errorCode, errorText ) \ PaUtil_SetLastHostErrorInfo( paASIO, errorCode, errorText ) -static void PaAsio_SetLastSystemError (DWORD errorCode) +static void PaAsio_SetLastSystemError( DWORD errorCode ) { LPVOID lpMsgBuf; - FormatMessage ( + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); - PaUtil_SetLastHostErrorInfo (paASIO, errorCode, (const char*) lpMsgBuf); - LocalFree (lpMsgBuf); + PaUtil_SetLastHostErrorInfo( paASIO, errorCode, (const char*)lpMsgBuf ); + LocalFree( lpMsgBuf ); } #define PA_ASIO_SET_LAST_SYSTEM_ERROR( errorCode ) \ PaAsio_SetLastSystemError( errorCode ) -static const char* PaAsio_GetAsioErrorText (ASIOError asioError) +static const char* PaAsio_GetAsioErrorText( ASIOError asioError ) { const char *result; - switch (asioError) { - + switch( asioError ){ case ASE_OK: - - case ASE_SUCCESS: - result = "Success"; - break; - - case ASE_NotPresent: - result = "Hardware input or output is not present or available"; - break; - - case ASE_HWMalfunction: - result = "Hardware is malfunctioning"; - break; - - case ASE_InvalidParameter: - result = "Input parameter invalid"; - break; - - case ASE_InvalidMode: - result = "Hardware is in a bad mode or used in a bad mode"; - break; - - case ASE_SPNotAdvancing: - result = "Hardware is not running when sample position is inquired"; - break; - - case ASE_NoClock: - result = "Sample clock or rate cannot be determined or is not present"; - break; - - case ASE_NoMemory: - result = "Not enough memory for completing the request"; - break; - - default: - result = "Unknown ASIO error"; - break; + case ASE_SUCCESS: result = "Success"; break; + case ASE_NotPresent: result = "Hardware input or output is not present or available"; break; + case ASE_HWMalfunction: result = "Hardware is malfunctioning"; break; + case ASE_InvalidParameter: result = "Input parameter invalid"; break; + case ASE_InvalidMode: result = "Hardware is in a bad mode or used in a bad mode"; break; + case ASE_SPNotAdvancing: result = "Hardware is not running when sample position is inquired"; break; + case ASE_NoClock: result = "Sample clock or rate cannot be determined or is not present"; break; + case ASE_NoMemory: result = "Not enough memory for completing the request"; break; + default: result = "Unknown ASIO error"; break; } return result; @@ -317,45 +290,30 @@ static const char* PaAsio_GetAsioErrorText (ASIOError asioError) // Atomic increment and decrement operations #if MAC -/* need to be implemented on Mac */ -inline long PaAsio_AtomicIncrement (volatile long* v) -{ - return ++ (*const_cast<long*> (v)); -} - -inline long PaAsio_AtomicDecrement (volatile long* v) -{ - return -- (*const_cast<long*> (v)); -} - + /* need to be implemented on Mac */ + inline long PaAsio_AtomicIncrement(volatile long* v) {return ++(*const_cast<long*>(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return --(*const_cast<long*>(v));} #elif WINDOWS -inline long PaAsio_AtomicIncrement (volatile long* v) -{ - return InterlockedIncrement (const_cast<long*> (v)); -} - -inline long PaAsio_AtomicDecrement (volatile long* v) -{ - return InterlockedDecrement (const_cast<long*> (v)); -} - + inline long PaAsio_AtomicIncrement(volatile long* v) {return InterlockedIncrement(const_cast<long*>(v));} + inline long PaAsio_AtomicDecrement(volatile long* v) {return InterlockedDecrement(const_cast<long*>(v));} #endif -typedef struct PaAsioDriverInfo { +typedef struct PaAsioDriverInfo +{ ASIODriverInfo asioDriverInfo; long inputChannelCount, outputChannelCount; long bufferMinSize, bufferMaxSize, bufferPreferredSize, bufferGranularity; bool postOutput; } - PaAsioDriverInfo; /* PaAsioHostApiRepresentation - host api datastructure specific to this implementation */ -typedef struct { +typedef struct +{ PaUtilHostApiRepresentation inheritedHostApiRep; PaUtilStreamInterface callbackStreamInterface; PaUtilStreamInterface blockingStreamInterface; @@ -364,7 +322,7 @@ typedef struct { AsioDrivers *asioDrivers; void *systemSpecific; - + /* the ASIO C API only allows one ASIO driver to be open at a time, so we keep track of whether we have the driver open here, and use this information to return errors from OpenStream if the @@ -379,7 +337,6 @@ typedef struct { PaDeviceIndex openAsioDeviceIndex; PaAsioDriverInfo openAsioDriverInfo; } - PaAsioHostApiRepresentation; @@ -387,206 +344,117 @@ PaAsioHostApiRepresentation; Retrieve <driverCount> driver names from ASIO, returned in a char** allocated in <group>. */ -static char **GetAsioDriverNames (PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount) +static char **GetAsioDriverNames( PaAsioHostApiRepresentation *asioHostApi, PaUtilAllocationGroup *group, long driverCount ) { char **result = 0; int i; - result = (char**) PaUtil_GroupAllocateMemory ( - group, sizeof (char*) * driverCount); - - if (!result) + result =(char**)PaUtil_GroupAllocateMemory( + group, sizeof(char*) * driverCount ); + if( !result ) goto error; - result[0] = (char*) PaUtil_GroupAllocateMemory ( - group, 32 * driverCount); - - if (!result[0]) + result[0] = (char*)PaUtil_GroupAllocateMemory( + group, 32 * driverCount ); + if( !result[0] ) goto error; - for (i=0; i<driverCount; ++i) + for( i=0; i<driverCount; ++i ) result[i] = result[0] + (32 * i); - asioHostApi->asioDrivers->getDriverNames (result, driverCount); + asioHostApi->asioDrivers->getDriverNames( result, driverCount ); error: return result; } -static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat (ASIOSampleType type) +static PaSampleFormat AsioSampleTypeToPaNativeSampleFormat(ASIOSampleType type) { switch (type) { - case ASIOSTInt16MSB: - case ASIOSTInt16LSB: - return paInt16; + return paInt16; case ASIOSTFloat32MSB: - case ASIOSTFloat32LSB: - case ASIOSTFloat64MSB: - case ASIOSTFloat64LSB: - return paFloat32; + return paFloat32; case ASIOSTInt32MSB: - case ASIOSTInt32LSB: - case ASIOSTInt32MSB16: - case ASIOSTInt32LSB16: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32MSB24: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - case ASIOSTInt32LSB24: - return paInt32; + return paInt32; case ASIOSTInt24MSB: - case ASIOSTInt24LSB: - return paInt24; + return paInt24; default: - return paCustomFormat; + return paCustomFormat; } } -void AsioSampleTypeLOG (ASIOSampleType type) +void AsioSampleTypeLOG(ASIOSampleType type) { switch (type) { - - case ASIOSTInt16MSB: - PA_DEBUG ( ("ASIOSTInt16MSB\n")); - break; - - case ASIOSTInt16LSB: - PA_DEBUG ( ("ASIOSTInt16LSB\n")); - break; - - case ASIOSTFloat32MSB: - PA_DEBUG ( ("ASIOSTFloat32MSB\n")); - break; - - case ASIOSTFloat32LSB: - PA_DEBUG ( ("ASIOSTFloat32LSB\n")); - break; - - case ASIOSTFloat64MSB: - PA_DEBUG ( ("ASIOSTFloat64MSB\n")); - break; - - case ASIOSTFloat64LSB: - PA_DEBUG ( ("ASIOSTFloat64LSB\n")); - break; - - case ASIOSTInt32MSB: - PA_DEBUG ( ("ASIOSTInt32MSB\n")); - break; - - case ASIOSTInt32LSB: - PA_DEBUG ( ("ASIOSTInt32LSB\n")); - break; - - case ASIOSTInt32MSB16: - PA_DEBUG ( ("ASIOSTInt32MSB16\n")); - break; - - case ASIOSTInt32LSB16: - PA_DEBUG ( ("ASIOSTInt32LSB16\n")); - break; - - case ASIOSTInt32MSB18: - PA_DEBUG ( ("ASIOSTInt32MSB18\n")); - break; - - case ASIOSTInt32MSB20: - PA_DEBUG ( ("ASIOSTInt32MSB20\n")); - break; - - case ASIOSTInt32MSB24: - PA_DEBUG ( ("ASIOSTInt32MSB24\n")); - break; - - case ASIOSTInt32LSB18: - PA_DEBUG ( ("ASIOSTInt32LSB18\n")); - break; - - case ASIOSTInt32LSB20: - PA_DEBUG ( ("ASIOSTInt32LSB20\n")); - break; - - case ASIOSTInt32LSB24: - PA_DEBUG ( ("ASIOSTInt32LSB24\n")); - break; - - case ASIOSTInt24MSB: - PA_DEBUG ( ("ASIOSTInt24MSB\n")); - break; - - case ASIOSTInt24LSB: - PA_DEBUG ( ("ASIOSTInt24LSB\n")); - break; - - default: - PA_DEBUG ( ("Custom Format%d\n",type)); - break; + case ASIOSTInt16MSB: PA_DEBUG(("ASIOSTInt16MSB\n")); break; + case ASIOSTInt16LSB: PA_DEBUG(("ASIOSTInt16LSB\n")); break; + case ASIOSTFloat32MSB:PA_DEBUG(("ASIOSTFloat32MSB\n"));break; + case ASIOSTFloat32LSB:PA_DEBUG(("ASIOSTFloat32LSB\n"));break; + case ASIOSTFloat64MSB:PA_DEBUG(("ASIOSTFloat64MSB\n"));break; + case ASIOSTFloat64LSB:PA_DEBUG(("ASIOSTFloat64LSB\n"));break; + case ASIOSTInt32MSB: PA_DEBUG(("ASIOSTInt32MSB\n")); break; + case ASIOSTInt32LSB: PA_DEBUG(("ASIOSTInt32LSB\n")); break; + case ASIOSTInt32MSB16:PA_DEBUG(("ASIOSTInt32MSB16\n"));break; + case ASIOSTInt32LSB16:PA_DEBUG(("ASIOSTInt32LSB16\n"));break; + case ASIOSTInt32MSB18:PA_DEBUG(("ASIOSTInt32MSB18\n"));break; + case ASIOSTInt32MSB20:PA_DEBUG(("ASIOSTInt32MSB20\n"));break; + case ASIOSTInt32MSB24:PA_DEBUG(("ASIOSTInt32MSB24\n"));break; + case ASIOSTInt32LSB18:PA_DEBUG(("ASIOSTInt32LSB18\n"));break; + case ASIOSTInt32LSB20:PA_DEBUG(("ASIOSTInt32LSB20\n"));break; + case ASIOSTInt32LSB24:PA_DEBUG(("ASIOSTInt32LSB24\n"));break; + case ASIOSTInt24MSB: PA_DEBUG(("ASIOSTInt24MSB\n")); break; + case ASIOSTInt24LSB: PA_DEBUG(("ASIOSTInt24LSB\n")); break; + default: PA_DEBUG(("Custom Format%d\n",type));break; } } -static int BytesPerAsioSample (ASIOSampleType sampleType) +static int BytesPerAsioSample( ASIOSampleType sampleType ) { switch (sampleType) { - case ASIOSTInt16MSB: - case ASIOSTInt16LSB: return 2; case ASIOSTFloat64MSB: - case ASIOSTFloat64LSB: return 8; case ASIOSTFloat32MSB: - case ASIOSTFloat32LSB: - case ASIOSTInt32MSB: - case ASIOSTInt32LSB: - case ASIOSTInt32MSB16: - case ASIOSTInt32LSB16: - case ASIOSTInt32MSB18: - case ASIOSTInt32MSB20: - case ASIOSTInt32MSB24: - case ASIOSTInt32LSB18: - case ASIOSTInt32LSB20: - case ASIOSTInt32LSB24: return 4; case ASIOSTInt24MSB: - case ASIOSTInt24LSB: return 3; @@ -596,86 +464,93 @@ static int BytesPerAsioSample (ASIOSampleType sampleType) } -static void Swap16 (void *buffer, long shift, long count) +static void Swap16( void *buffer, long shift, long count ) { - unsigned short *p = (unsigned short*) buffer; + unsigned short *p = (unsigned short*)buffer; unsigned short temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { temp = *p; - *p++ = (unsigned short) ( (temp<<8) | (temp>>8)); + *p++ = (unsigned short)((temp<<8) | (temp>>8)); } } -static void Swap24 (void *buffer, long shift, long count) +static void Swap24( void *buffer, long shift, long count ) { - unsigned char *p = (unsigned char*) buffer; + unsigned char *p = (unsigned char*)buffer; unsigned char temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { temp = *p; - *p = * (p+2); - * (p+2) = temp; + *p = *(p+2); + *(p+2) = temp; p += 3; } } #define PA_SWAP32_( x ) ((x>>24) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24)); -static void Swap32 (void *buffer, long shift, long count) +static void Swap32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { temp = *p; - *p++ = PA_SWAP32_ (temp); + *p++ = PA_SWAP32_( temp); } } -static void SwapShiftLeft32 (void *buffer, long shift, long count) +static void SwapShiftLeft32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p; - temp = PA_SWAP32_ (temp); + temp = PA_SWAP32_( temp); *p++ = temp << shift; } } -static void ShiftRightSwap32 (void *buffer, long shift, long count) +static void ShiftRightSwap32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p >> shift; - *p++ = PA_SWAP32_ (temp); + *p++ = PA_SWAP32_( temp); } } -static void ShiftLeft32 (void *buffer, long shift, long count) +static void ShiftLeft32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p; *p++ = temp << shift; } } -static void ShiftRight32 (void *buffer, long shift, long count) +static void ShiftRight32( void *buffer, long shift, long count ) { - unsigned long *p = (unsigned long*) buffer; + unsigned long *p = (unsigned long*)buffer; unsigned long temp; - while (count--) { + while( count-- ) + { temp = *p; *p++ = temp >> shift; } @@ -683,63 +558,65 @@ static void ShiftRight32 (void *buffer, long shift, long count) #define PA_SWAP_( x, y ) temp=x; x = y; y = temp; -static void Swap64ConvertFloat64ToFloat32 (void *buffer, long shift, long count) +static void Swap64ConvertFloat64ToFloat32( void *buffer, long shift, long count ) { - double *in = (double*) buffer; - float *out = (float*) buffer; + double *in = (double*)buffer; + float *out = (float*)buffer; unsigned char *p; unsigned char temp; (void) shift; /* unused parameter */ - while (count--) { - p = (unsigned char*) in; - PA_SWAP_ (p[0], p[7]); - PA_SWAP_ (p[1], p[6]); - PA_SWAP_ (p[2], p[5]); - PA_SWAP_ (p[3], p[4]); + while( count-- ) + { + p = (unsigned char*)in; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); *out++ = (float) (*in++); } } -static void ConvertFloat64ToFloat32 (void *buffer, long shift, long count) +static void ConvertFloat64ToFloat32( void *buffer, long shift, long count ) { - double *in = (double*) buffer; - float *out = (float*) buffer; + double *in = (double*)buffer; + float *out = (float*)buffer; (void) shift; /* unused parameter */ - while (count--) + while( count-- ) *out++ = (float) (*in++); } -static void ConvertFloat32ToFloat64Swap64 (void *buffer, long shift, long count) +static void ConvertFloat32ToFloat64Swap64( void *buffer, long shift, long count ) { - float *in = ( (float*) buffer) + (count-1); - double *out = ( (double*) buffer) + (count-1); + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); unsigned char *p; unsigned char temp; (void) shift; /* unused parameter */ - while (count--) { + while( count-- ) + { *out = *in--; - p = (unsigned char*) out; - PA_SWAP_ (p[0], p[7]); - PA_SWAP_ (p[1], p[6]); - PA_SWAP_ (p[2], p[5]); - PA_SWAP_ (p[3], p[4]); + p = (unsigned char*)out; + PA_SWAP_( p[0], p[7] ); + PA_SWAP_( p[1], p[6] ); + PA_SWAP_( p[2], p[5] ); + PA_SWAP_( p[3], p[4] ); out--; } } -static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count) +static void ConvertFloat32ToFloat64( void *buffer, long shift, long count ) { - float *in = ( (float*) buffer) + (count-1); - double *out = ( (double*) buffer) + (count-1); + float *in = ((float*)buffer) + (count-1); + double *out = ((double*)buffer) + (count-1); (void) shift; /* unused parameter */ - while (count--) + while( count-- ) *out-- = *in--; } @@ -753,337 +630,302 @@ static void ConvertFloat32ToFloat64 (void *buffer, long shift, long count) #define PA_LSB_IS_NATIVE_ #endif -typedef void PaAsioBufferConverter (void *, long, long); +typedef void PaAsioBufferConverter( void *, long, long ); -static void SelectAsioToPaConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift) +static void SelectAsioToPaConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) { *shift = 0; *converter = 0; switch (type) { - case ASIOSTInt16MSB: /* dest: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTInt16LSB: /* dest: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTFloat32MSB: /* dest: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat32LSB: /* dest: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat64MSB: /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap64ConvertFloat64ToFloat32; -#else - *converter = ConvertFloat64ToFloat32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif break; - case ASIOSTFloat64LSB: /* dest: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap64ConvertFloat64ToFloat32; -#else - *converter = ConvertFloat64ToFloat32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap64ConvertFloat64ToFloat32; + #else + *converter = ConvertFloat64ToFloat32; + #endif break; - case ASIOSTInt32MSB: /* dest: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32LSB: /* dest: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32MSB16: /* dest: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 16; break; - case ASIOSTInt32MSB18: /* dest: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 14; break; - case ASIOSTInt32MSB20: /* dest: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 12; break; - case ASIOSTInt32MSB24: /* dest: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 8; break; - case ASIOSTInt32LSB16: /* dest: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 16; break; - case ASIOSTInt32LSB18: /* dest: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 14; break; - case ASIOSTInt32LSB20: /* dest: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 12; break; - case ASIOSTInt32LSB24: /* dest: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = SwapShiftLeft32; -#else - *converter = ShiftLeft32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = SwapShiftLeft32; + #else + *converter = ShiftLeft32; + #endif *shift = 8; break; - case ASIOSTInt24MSB: /* dest: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif break; - case ASIOSTInt24LSB: /* dest: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif break; } } -static void SelectPaToAsioConverter (ASIOSampleType type, PaAsioBufferConverter **converter, long *shift) +static void SelectPaToAsioConverter( ASIOSampleType type, PaAsioBufferConverter **converter, long *shift ) { *shift = 0; *converter = 0; switch (type) { - case ASIOSTInt16MSB: /* src: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTInt16LSB: /* src: paInt16, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap16; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap16; + #endif break; - case ASIOSTFloat32MSB: /* src: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat32LSB: /* src: paFloat32, no conversion necessary, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTFloat64MSB: /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ConvertFloat32ToFloat64Swap64; -#else - *converter = ConvertFloat32ToFloat64; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif break; - case ASIOSTFloat64LSB: /* src: paFloat32, in-place conversion to/from float32, possible byte swap*/ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ConvertFloat32ToFloat64Swap64; -#else - *converter = ConvertFloat32ToFloat64; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ConvertFloat32ToFloat64Swap64; + #else + *converter = ConvertFloat32ToFloat64; + #endif break; - case ASIOSTInt32MSB: /* src: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32LSB: /* src: paInt32, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap32; + #endif break; - case ASIOSTInt32MSB16: /* src: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 16; break; - case ASIOSTInt32MSB18: /* src: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 14; break; - case ASIOSTInt32MSB20: /* src: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 12; break; - case ASIOSTInt32MSB24: /* src: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 8; break; - case ASIOSTInt32LSB16: /* src: paInt32, 16 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 16; break; - case ASIOSTInt32LSB18: /* src: paInt32, 14 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 14; break; - case ASIOSTInt32LSB20: /* src: paInt32, 12 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 12; break; - case ASIOSTInt32LSB24: /* src: paInt32, 8 bit shift, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = ShiftRightSwap32; -#else - *converter = ShiftRight32; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = ShiftRightSwap32; + #else + *converter = ShiftRight32; + #endif *shift = 8; break; - case ASIOSTInt24MSB: /* src: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_LSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_LSB_IS_NATIVE_ + *converter = Swap24; + #endif break; - case ASIOSTInt24LSB: /* src: paInt24, no conversion necessary, possible byte swap */ -#ifdef PA_MSB_IS_NATIVE_ - *converter = Swap24; -#endif + #ifdef PA_MSB_IS_NATIVE_ + *converter = Swap24; + #endif break; } } -typedef struct PaAsioDeviceInfo { +typedef struct PaAsioDeviceInfo +{ PaDeviceInfo commonDeviceInfo; long minBufferSize; long maxBufferSize; @@ -1092,25 +934,26 @@ typedef struct PaAsioDeviceInfo { ASIOChannelInfo *asioChannelInfos; } - PaAsioDeviceInfo; -PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device, - long *minLatency, long *maxLatency, long *preferredLatency, long *granularity) +PaError PaAsio_GetAvailableLatencyValues( PaDeviceIndex device, + long *minLatency, long *maxLatency, long *preferredLatency, long *granularity ) { PaError result; PaUtilHostApiRepresentation *hostApi; PaDeviceIndex hostApiDevice; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); - if (result == paNoError) { - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); + if( result == paNoError ) + { + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); - if (result == paNoError) { + if( result == paNoError ) + { PaAsioDeviceInfo *asioDeviceInfo = - (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; *minLatency = asioDeviceInfo->minBufferSize; *maxLatency = asioDeviceInfo->maxBufferSize; @@ -1125,10 +968,10 @@ PaError PaAsio_GetAvailableLatencyValues (PaDeviceIndex device, /* Unload whatever we loaded in LoadAsioDriver(). Also balance the call to CoInitialize(0). */ -static void UnloadAsioDriver (void) +static void UnloadAsioDriver( void ) { - ASIOExit(); - CoUninitialize(); + ASIOExit(); + CoUninitialize(); } /* @@ -1137,63 +980,67 @@ static void UnloadAsioDriver (void) and must be closed by the called by calling UnloadAsioDriver() - if an error is returned the driver will already be unloaded. */ -static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const char *driverName, - PaAsioDriverInfo *driverInfo, void *systemSpecific) +static PaError LoadAsioDriver( PaAsioHostApiRepresentation *asioHostApi, const char *driverName, + PaAsioDriverInfo *driverInfo, void *systemSpecific ) { PaError result = paNoError; ASIOError asioError; int asioIsInitialized = 0; - /* - ASIO uses CoCreateInstance() to load a driver. That requires that - CoInitialize(0) be called for every thread that loads a driver. - It is OK to call CoInitialize(0) multiple times form one thread as long - as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver(). - - The V18 version called CoInitialize() starting on 2/19/02. - That was removed from PA V19 for unknown reasons. - Phil Burk added it back on 6/27/08 so that JSyn would work. + /* + ASIO uses CoCreateInstance() to load a driver. That requires that + CoInitialize(0) be called for every thread that loads a driver. + It is OK to call CoInitialize(0) multiple times form one thread as long + as it is balanced by a call to CoUninitialize(). See UnloadAsioDriver(). + + The V18 version called CoInitialize() starting on 2/19/02. + That was removed from PA V19 for unknown reasons. + Phil Burk added it back on 6/27/08 so that JSyn would work. */ - CoInitialize (0); + CoInitialize( 0 ); - if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (driverName))) { - /* If this returns an error then it might be because CoInitialize(0) was removed. - It should be called right before this. - */ + if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(driverName) ) ) + { + /* If this returns an error then it might be because CoInitialize(0) was removed. + It should be called right before this. + */ result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_HOST_ERROR (0, "Failed to load ASIO driver"); + PA_ASIO_SET_LAST_HOST_ERROR( 0, "Failed to load ASIO driver" ); goto error; } - memset (&driverInfo->asioDriverInfo, 0, sizeof (ASIODriverInfo)); - + memset( &driverInfo->asioDriverInfo, 0, sizeof(ASIODriverInfo) ); driverInfo->asioDriverInfo.asioVersion = 2; driverInfo->asioDriverInfo.sysRef = systemSpecific; - - if ( (asioError = ASIOInit (&driverInfo->asioDriverInfo)) != ASE_OK) { + if( (asioError = ASIOInit( &driverInfo->asioDriverInfo )) != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; - } else { + } + else + { asioIsInitialized = 1; } - if ( (asioError = ASIOGetChannels (&driverInfo->inputChannelCount, - &driverInfo->outputChannelCount)) != ASE_OK) { + if( (asioError = ASIOGetChannels(&driverInfo->inputChannelCount, + &driverInfo->outputChannelCount)) != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; } - if ( (asioError = ASIOGetBufferSize (&driverInfo->bufferMinSize, - &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, - &driverInfo->bufferGranularity)) != ASE_OK) { + if( (asioError = ASIOGetBufferSize(&driverInfo->bufferMinSize, + &driverInfo->bufferMaxSize, &driverInfo->bufferPreferredSize, + &driverInfo->bufferGranularity)) != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; } - if (ASIOOutputReady() == ASE_OK) + if( ASIOOutputReady() == ASE_OK ) driverInfo->postOutput = true; else driverInfo->postOutput = false; @@ -1201,29 +1048,27 @@ static PaError LoadAsioDriver (PaAsioHostApiRepresentation *asioHostApi, const c return result; error: - if (asioIsInitialized) { - ASIOExit(); - } - - CoUninitialize(); - + if( asioIsInitialized ) + { + ASIOExit(); + } + CoUninitialize(); return result; } #define PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_ 13 /* must be the same number of elements as in the array below */ static ASIOSampleRate defaultSampleRateSearchOrder_[] -= {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, - 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 - }; + = {44100.0, 48000.0, 32000.0, 24000.0, 22050.0, 88200.0, 96000.0, + 192000.0, 16000.0, 12000.0, 11025.0, 9600.0, 8000.0 }; /* we look up IsDebuggerPresent at runtime incase it isn't present (on Win95 for example) */ -typedef BOOL (WINAPI *IsDebuggerPresentPtr) (VOID); +typedef BOOL (WINAPI *IsDebuggerPresentPtr)(VOID); IsDebuggerPresentPtr IsDebuggerPresent_ = 0; //FARPROC IsDebuggerPresent_ = 0; // this is the current way to do it apparently according to davidv -PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) +PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) { PaError result = paNoError; int i, driverCount; @@ -1232,9 +1077,9 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex char **names; PaAsioDriverInfo paAsioDriverInfo; - asioHostApi = (PaAsioHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaAsioHostApiRepresentation)); - - if (!asioHostApi) { + asioHostApi = (PaAsioHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaAsioHostApiRepresentation) ); + if( !asioHostApi ) + { result = paInsufficientMemory; goto error; } @@ -1242,22 +1087,25 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex asioHostApi->asioDrivers = 0; /* avoid surprises in our error handler below */ asioHostApi->allocations = PaUtil_CreateAllocationGroup(); - - if (!asioHostApi->allocations) { + if( !asioHostApi->allocations ) + { result = paInsufficientMemory; goto error; } /* Allocate the AsioDrivers() driver list (class from ASIO SDK) */ - try { + try + { asioHostApi->asioDrivers = new AsioDrivers(); /* calls CoInitialize(0) */ - } catch (std::bad_alloc) { + } + catch (std::bad_alloc) + { asioHostApi->asioDrivers = 0; } - /* some implementations of new (ie MSVC, see http://support.microsoft.com/?kbid=167733) don't throw std::bad_alloc, so we also explicitly test for a null return. */ - if (asioHostApi->asioDrivers == 0) { + if( asioHostApi->asioDrivers == 0 ) + { result = paInsufficientMemory; goto error; } @@ -1274,23 +1122,24 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex (*hostApi)->info.name = "ASIO"; (*hostApi)->info.deviceCount = 0; -#ifdef WINDOWS - /* use desktop window as system specific ptr */ - asioHostApi->systemSpecific = GetDesktopWindow(); -#endif + #ifdef WINDOWS + /* use desktop window as system specific ptr */ + asioHostApi->systemSpecific = GetDesktopWindow(); + #endif /* driverCount is the number of installed drivers - not necessarily the number of installed physical devices. */ -#if MAC - driverCount = asioHostApi->asioDrivers->getNumFragments(); -#elif WINDOWS - driverCount = asioHostApi->asioDrivers->asioGetNumDev(); -#endif + #if MAC + driverCount = asioHostApi->asioDrivers->getNumFragments(); + #elif WINDOWS + driverCount = asioHostApi->asioDrivers->asioGetNumDev(); + #endif - if (driverCount > 0) { - names = GetAsioDriverNames (asioHostApi, asioHostApi->allocations, driverCount); - - if (!names) { + if( driverCount > 0 ) + { + names = GetAsioDriverNames( asioHostApi, asioHostApi->allocations, driverCount ); + if( !names ) + { result = paInsufficientMemory; goto error; } @@ -1298,59 +1147,63 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex /* allocate enough space for all drivers, even if some aren't installed */ - (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory ( - asioHostApi->allocations, sizeof (PaDeviceInfo*) * driverCount); - - if (! (*hostApi)->deviceInfos) { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaDeviceInfo*) * driverCount ); + if( !(*hostApi)->deviceInfos ) + { result = paInsufficientMemory; goto error; } /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaAsioDeviceInfo*) PaUtil_GroupAllocateMemory ( - asioHostApi->allocations, sizeof (PaAsioDeviceInfo) * driverCount); - - if (!deviceInfoArray) { + deviceInfoArray = (PaAsioDeviceInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, sizeof(PaAsioDeviceInfo) * driverCount ); + if( !deviceInfoArray ) + { result = paInsufficientMemory; goto error; } - IsDebuggerPresent_ = GetProcAddress (LoadLibrary ("Kernel32.dll"), "IsDebuggerPresent"); + IsDebuggerPresent_ = GetProcAddress( LoadLibrary( "Kernel32.dll" ), "IsDebuggerPresent" ); - for (i=0; i < driverCount; ++i) { + for( i=0; i < driverCount; ++i ) + { - PA_DEBUG ( ("ASIO names[%d]:%s\n",i,names[i])); + PA_DEBUG(("ASIO names[%d]:%s\n",i,names[i])); // Since portaudio opens ALL ASIO drivers, and no one else does that, // we face fact that some drivers were not meant for it, drivers which act // like shells on top of REAL drivers, for instance. // so we get duplicate handles, locks and other problems. - // so lets NOT try to load any such wrappers. + // so lets NOT try to load any such wrappers. // The ones i [davidv] know of so far are: - if (strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 - || strcmp (names[i],"ASIO Multimedia Driver") == 0 - || strncmp (names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" - || strncmp (names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" - || strncmp (names[i],"ReaRoute ASIO",13) == 0 //Reaper www.reaper.fm <- fix your stuff man. - ) { - PA_DEBUG ( ("BLACKLISTED!!!\n")); + if ( strcmp (names[i],"ASIO DirectX Full Duplex Driver") == 0 + || strcmp (names[i],"ASIO Multimedia Driver") == 0 + || strncmp(names[i],"Premiere",8) == 0 //"Premiere Elements Windows Sound 1.0" + || strncmp(names[i],"Adobe",5) == 0 //"Adobe Default Windows Sound 1.5" + ) + { + PA_DEBUG(("BLACKLISTED!!!\n")); continue; } - if (IsDebuggerPresent_ && IsDebuggerPresent_()) { + if( IsDebuggerPresent_ && IsDebuggerPresent_() ) + { /* ASIO Digidesign Driver uses PACE copy protection which quits out if a debugger is running. So we don't load it if a debugger is running. */ - if (strcmp (names[i], "ASIO Digidesign Driver") == 0) { - PA_DEBUG ( ("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n")); - continue; - } - } + if( strcmp(names[i], "ASIO Digidesign Driver") == 0 ) + { + PA_DEBUG(("BLACKLISTED!!! ASIO Digidesign Driver would quit the debugger\n")); + continue; + } + } /* Attempt to load the asio driver... */ - if (LoadAsioDriver (asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific) == paNoError) { + if( LoadAsioDriver( asioHostApi, names[i], &paAsioDriverInfo, asioHostApi->systemSpecific ) == paNoError ) + { PaAsioDeviceInfo *asioDeviceInfo = &deviceInfoArray[ (*hostApi)->info.deviceCount ]; PaDeviceInfo *deviceInfo = &asioDeviceInfo->commonDeviceInfo; @@ -1358,33 +1211,33 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->hostApi = hostApiIndex; deviceInfo->name = names[i]; - PA_DEBUG ( ("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); + PA_DEBUG(("PaAsio_Initialize: drv:%d name = %s\n", i,deviceInfo->name)); + PA_DEBUG(("PaAsio_Initialize: drv:%d inputChannels = %d\n", i, paAsioDriverInfo.inputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d outputChannels = %d\n", i, paAsioDriverInfo.outputChannelCount)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMinSize = %d\n", i, paAsioDriverInfo.bufferMinSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferMaxSize = %d\n", i, paAsioDriverInfo.bufferMaxSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferPreferredSize = %d\n", i, paAsioDriverInfo.bufferPreferredSize)); + PA_DEBUG(("PaAsio_Initialize: drv:%d bufferGranularity = %d\n", i, paAsioDriverInfo.bufferGranularity)); deviceInfo->maxInputChannels = paAsioDriverInfo.inputChannelCount; deviceInfo->maxOutputChannels = paAsioDriverInfo.outputChannelCount; deviceInfo->defaultSampleRate = 0.; bool foundDefaultSampleRate = false; - - for (int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j) { - ASIOError asioError = ASIOCanSampleRate (defaultSampleRateSearchOrder_[j]); - - if (asioError != ASE_NoClock && asioError != ASE_NotPresent) { + for( int j=0; j < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++j ) + { + ASIOError asioError = ASIOCanSampleRate( defaultSampleRateSearchOrder_[j] ); + if( asioError != ASE_NoClock && asioError != ASE_NotPresent ) + { deviceInfo->defaultSampleRate = defaultSampleRateSearchOrder_[j]; foundDefaultSampleRate = true; break; } } - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultSampleRate = %f\n", i, deviceInfo->defaultSampleRate)); - if (foundDefaultSampleRate) { + if( foundDefaultSampleRate ){ /* calculate default latency values from bufferPreferredSize for default low latency, and bufferPreferredSize * 3 @@ -1395,28 +1248,27 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex */ double defaultLowLatency = - paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; + paAsioDriverInfo.bufferPreferredSize / deviceInfo->defaultSampleRate; deviceInfo->defaultLowInputLatency = defaultLowLatency; deviceInfo->defaultLowOutputLatency = defaultLowLatency; long defaultHighLatencyBufferSize = - paAsioDriverInfo.bufferPreferredSize * 3; + paAsioDriverInfo.bufferPreferredSize * 3; - if (defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize) + if( defaultHighLatencyBufferSize > paAsioDriverInfo.bufferMaxSize ) defaultHighLatencyBufferSize = paAsioDriverInfo.bufferMaxSize; double defaultHighLatency = - defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; - - if (defaultHighLatency < defaultLowLatency) - defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + defaultHighLatencyBufferSize / deviceInfo->defaultSampleRate; + if( defaultHighLatency < defaultLowLatency ) + defaultHighLatency = defaultLowLatency; /* just incase the driver returns something strange */ + deviceInfo->defaultHighInputLatency = defaultHighLatency; - deviceInfo->defaultHighOutputLatency = defaultHighLatency; - - } else { + + }else{ deviceInfo->defaultLowInputLatency = 0.; deviceInfo->defaultLowOutputLatency = 0.; @@ -1424,11 +1276,10 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex deviceInfo->defaultHighOutputLatency = 0.; } - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); - - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); - PA_DEBUG ( ("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowInputLatency = %f\n", i, deviceInfo->defaultLowInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultLowOutputLatency = %f\n", i, deviceInfo->defaultLowOutputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighInputLatency = %f\n", i, deviceInfo->defaultHighInputLatency)); + PA_DEBUG(("PaAsio_Initialize: drv:%d defaultHighOutputLatency = %f\n", i, deviceInfo->defaultHighOutputLatency)); asioDeviceInfo->minBufferSize = paAsioDriverInfo.bufferMinSize; asioDeviceInfo->maxBufferSize = paAsioDriverInfo.bufferMaxSize; @@ -1436,39 +1287,39 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex asioDeviceInfo->bufferGranularity = paAsioDriverInfo.bufferGranularity; - asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*) PaUtil_GroupAllocateMemory ( - asioHostApi->allocations, - sizeof (ASIOChannelInfo) * (deviceInfo->maxInputChannels - + deviceInfo->maxOutputChannels)); - - if (!asioDeviceInfo->asioChannelInfos) { + asioDeviceInfo->asioChannelInfos = (ASIOChannelInfo*)PaUtil_GroupAllocateMemory( + asioHostApi->allocations, + sizeof(ASIOChannelInfo) * (deviceInfo->maxInputChannels + + deviceInfo->maxOutputChannels) ); + if( !asioDeviceInfo->asioChannelInfos ) + { result = paInsufficientMemory; goto error_unload; } int a; - for (a=0; a < deviceInfo->maxInputChannels; ++a) { + for( a=0; a < deviceInfo->maxInputChannels; ++a ){ asioDeviceInfo->asioChannelInfos[a].channel = a; asioDeviceInfo->asioChannelInfos[a].isInput = ASIOTrue; - ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[a]); - - if (asioError != ASE_OK) { + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[a] ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error_unload; } } - for (a=0; a < deviceInfo->maxOutputChannels; ++a) { + for( a=0; a < deviceInfo->maxOutputChannels; ++a ){ int b = deviceInfo->maxInputChannels + a; asioDeviceInfo->asioChannelInfos[b].channel = a; asioDeviceInfo->asioChannelInfos[b].isInput = ASIOFalse; - ASIOError asioError = ASIOGetChannelInfo (&asioDeviceInfo->asioChannelInfos[b]); - - if (asioError != ASE_OK) { + ASIOError asioError = ASIOGetChannelInfo( &asioDeviceInfo->asioChannelInfos[b] ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error_unload; } } @@ -1478,16 +1329,18 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex UnloadAsioDriver(); (*hostApi)->deviceInfos[ (*hostApi)->info.deviceCount ] = deviceInfo; - - ++ (*hostApi)->info.deviceCount; + ++(*hostApi)->info.deviceCount; } } } - if ( (*hostApi)->info.deviceCount > 0) { + if( (*hostApi)->info.deviceCount > 0 ) + { (*hostApi)->info.defaultInputDevice = 0; (*hostApi)->info.defaultOutputDevice = 0; - } else { + } + else + { (*hostApi)->info.defaultInputDevice = paNoDevice; (*hostApi)->info.defaultOutputDevice = paNoDevice; } @@ -1497,97 +1350,97 @@ PaError PaAsio_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; - PaUtil_InitializeStreamInterface (&asioHostApi->callbackStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &asioHostApi->callbackStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, GetStreamCpuLoad, PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable); + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); - PaUtil_InitializeStreamInterface (&asioHostApi->blockingStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &asioHostApi->blockingStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable); + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); return result; error_unload: - UnloadAsioDriver(); + UnloadAsioDriver(); error: - - if (asioHostApi) { - if (asioHostApi->allocations) { - PaUtil_FreeAllAllocations (asioHostApi->allocations); - PaUtil_DestroyAllocationGroup (asioHostApi->allocations); + if( asioHostApi ) + { + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); } delete asioHostApi->asioDrivers; - asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */ - PaUtil_FreeMemory (asioHostApi); + PaUtil_FreeMemory( asioHostApi ); } - return result; } -static void Terminate (struct PaUtilHostApiRepresentation *hostApi) +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) { - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; /* IMPLEMENT ME: - clean up any resources not handled by the allocation group (need to review if there are any) */ - if (asioHostApi->allocations) { - PaUtil_FreeAllAllocations (asioHostApi->allocations); - PaUtil_DestroyAllocationGroup (asioHostApi->allocations); + if( asioHostApi->allocations ) + { + PaUtil_FreeAllAllocations( asioHostApi->allocations ); + PaUtil_DestroyAllocationGroup( asioHostApi->allocations ); } delete asioHostApi->asioDrivers; /* calls CoUninitialize() */ - asioDrivers = 0; /* keep SDK global in sync until we stop depending on it */ - PaUtil_FreeMemory (asioHostApi); + PaUtil_FreeMemory( asioHostApi ); } -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate) + double sampleRate ) { PaError result = paNoError; - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; PaAsioDriverInfo *driverInfo = &asioHostApi->openAsioDriverInfo; int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; - PaDeviceIndex asioDeviceIndex; + PaDeviceIndex asioDeviceIndex; ASIOError asioError; - - if (inputParameters && outputParameters) { + + if( inputParameters && outputParameters ) + { /* full duplex ASIO stream must use the same device for input and output */ - if (inputParameters->device != outputParameters->device) + if( inputParameters->device != outputParameters->device ) return paBadIODeviceCombination; } - - if (inputParameters) { + + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (inputSampleFormat & paCustomFormat) + if( inputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; - + /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = inputParameters->device; @@ -1596,24 +1449,26 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /** @todo do more validation here */ // if( inputParameters->hostApiSpecificStreamInfo ) // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } else { + } + else + { inputChannelCount = 0; } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (outputSampleFormat & paCustomFormat) + if( outputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; - + /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = outputParameters->device; @@ -1622,7 +1477,9 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /** @todo do more validation here */ // if( outputParameters->hostApiSpecificStreamInfo ) // return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - } else { + } + else + { outputChannelCount = 0; } @@ -1630,8 +1487,9 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /* if an ASIO device is open we can only get format information for the currently open device */ - if (asioHostApi->openAsioDeviceIndex != paNoDevice - && asioHostApi->openAsioDeviceIndex != asioDeviceIndex) { + if( asioHostApi->openAsioDeviceIndex != paNoDevice + && asioHostApi->openAsioDeviceIndex != asioDeviceIndex ) + { return paDeviceUnavailable; } @@ -1640,47 +1498,50 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, rather than the ones in our device info structure which may be stale */ /* open the device if it's not already open */ - if (asioHostApi->openAsioDeviceIndex == paNoDevice) { - result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, - driverInfo, asioHostApi->systemSpecific); - - if (result != paNoError) + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { + result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result != paNoError ) return result; } /* check that input device can support inputChannelCount */ - if (inputChannelCount > 0) { - if (inputChannelCount > driverInfo->inputChannelCount) { + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { result = paInvalidChannelCount; goto done; } } /* check that output device can support outputChannelCount */ - if (outputChannelCount) { - if (outputChannelCount > driverInfo->outputChannelCount) { + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { result = paInvalidChannelCount; goto done; } } - + /* query for sample rate support */ - asioError = ASIOCanSampleRate (sampleRate); - - if (asioError == ASE_NoClock || asioError == ASE_NotPresent) { + asioError = ASIOCanSampleRate( sampleRate ); + if( asioError == ASE_NoClock || asioError == ASE_NotPresent ) + { result = paInvalidSampleRate; goto done; } done: - /* close the device if it wasn't already open */ - - if (asioHostApi->openAsioDeviceIndex == paNoDevice) { + if( asioHostApi->openAsioDeviceIndex == paNoDevice ) + { UnloadAsioDriver(); /* not sure if we should check for errors here */ } - if (result == paNoError) + if( result == paNoError ) return paFormatIsSupported; else return result; @@ -1689,8 +1550,8 @@ done: /** A data structure specifically for storing blocking i/o related data. */ - -typedef struct PaAsioStreamBlockingState { +typedef struct PaAsioStreamBlockingState +{ int stopFlag; /**< Flag indicating that block processing is to be stopped. */ unsigned long writeBuffersRequested; /**< The number of available output buffers, requested by the #WriteStream() function. */ @@ -1718,14 +1579,14 @@ typedef struct PaAsioStreamBlockingState { int outputUnderflowFlag; /**< Flag to signal an output underflow from within the callback function. */ int inputOverflowFlag; /**< Flag to signal an input overflow from within the callback function. */ } - PaAsioStreamBlockingState; /* PaAsioStream - a stream data structure specifically for this implementation */ -typedef struct PaAsioStream { +typedef struct PaAsioStream +{ PaUtilStreamRepresentation streamRepresentation; PaUtilCpuLoadMeasurer cpuLoadMeasurer; PaUtilBufferProcessor bufferProcessor; @@ -1758,6 +1619,7 @@ typedef struct PaAsioStream { HANDLE completedBuffersPlayedEvent; bool streamFinishedCallbackCalled; + int isStopped; volatile int isActive; volatile bool zeroOutput; /* all future calls to the callback will output silence */ @@ -1768,71 +1630,86 @@ typedef struct PaAsioStream { PaAsioStreamBlockingState *blockingState; /**< Blocking i/o data struct, or NULL when using callback interface. */ } - PaAsioStream; static PaAsioStream *theAsioStream = 0; /* due to ASIO sdk limitations there can be only one stream */ -static void ZeroOutputBuffers (PaAsioStream *stream, long index) +static void ZeroOutputBuffers( PaAsioStream *stream, long index ) { int i; - for (i=0; i < stream->outputChannelCount; ++i) { + for( i=0; i < stream->outputChannelCount; ++i ) + { void *buffer = stream->asioBufferInfos[ i + stream->inputChannelCount ].buffers[index]; - int bytesPerSample = BytesPerAsioSample (stream->asioChannelInfos[ i + stream->inputChannelCount ].type); + int bytesPerSample = BytesPerAsioSample( stream->asioChannelInfos[ i + stream->inputChannelCount ].type ); - memset (buffer, 0, stream->framesPerHostCallback * bytesPerSample); + memset( buffer, 0, stream->framesPerHostCallback * bytesPerSample ); } } -static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames, - PaAsioDriverInfo *driverInfo) +static unsigned long SelectHostBufferSize( unsigned long suggestedLatencyFrames, + PaAsioDriverInfo *driverInfo ) { unsigned long result; - if (suggestedLatencyFrames == 0) { + if( suggestedLatencyFrames == 0 ) + { result = driverInfo->bufferPreferredSize; - } else { - if (suggestedLatencyFrames <= (unsigned long) driverInfo->bufferMinSize) { + } + else{ + if( suggestedLatencyFrames <= (unsigned long)driverInfo->bufferMinSize ) + { result = driverInfo->bufferMinSize; - } else if (suggestedLatencyFrames >= (unsigned long) driverInfo->bufferMaxSize) { + } + else if( suggestedLatencyFrames >= (unsigned long)driverInfo->bufferMaxSize ) + { result = driverInfo->bufferMaxSize; - } else { - if (driverInfo->bufferGranularity == -1) { + } + else + { + if( driverInfo->bufferGranularity == -1 ) + { /* power-of-two */ result = 2; - while (result < suggestedLatencyFrames) + while( result < suggestedLatencyFrames ) result *= 2; - if (result < (unsigned long) driverInfo->bufferMinSize) + if( result < (unsigned long)driverInfo->bufferMinSize ) result = driverInfo->bufferMinSize; - if (result > (unsigned long) driverInfo->bufferMaxSize) + if( result > (unsigned long)driverInfo->bufferMaxSize ) result = driverInfo->bufferMaxSize; - } else if (driverInfo->bufferGranularity == 0) { + } + else if( driverInfo->bufferGranularity == 0 ) + { /* the documentation states that bufferGranularity should be zero when bufferMinSize, bufferMaxSize and bufferPreferredSize are the same. We assume that is the case. */ result = driverInfo->bufferPreferredSize; - } else { + } + else + { /* modulo granularity */ unsigned long remainder = - suggestedLatencyFrames % driverInfo->bufferGranularity; + suggestedLatencyFrames % driverInfo->bufferGranularity; - if (remainder == 0) { + if( remainder == 0 ) + { result = suggestedLatencyFrames; - } else { + } + else + { result = suggestedLatencyFrames - + (driverInfo->bufferGranularity - remainder); + + (driverInfo->bufferGranularity - remainder); - if (result > (unsigned long) driverInfo->bufferMaxSize) + if( result > (unsigned long)driverInfo->bufferMaxSize ) result = driverInfo->bufferMaxSize; } } @@ -1845,29 +1722,31 @@ static unsigned long SelectHostBufferSize (unsigned long suggestedLatencyFrames, /* returns channelSelectors if present */ -static PaError ValidateAsioSpecificStreamInfo ( - const PaStreamParameters *streamParameters, - const PaAsioStreamInfo *streamInfo, - int deviceChannelCount, - int **channelSelectors) +static PaError ValidateAsioSpecificStreamInfo( + const PaStreamParameters *streamParameters, + const PaAsioStreamInfo *streamInfo, + int deviceChannelCount, + int **channelSelectors ) { - if (streamInfo) { - if (streamInfo->size != sizeof (PaAsioStreamInfo) - || streamInfo->version != 1) { + if( streamInfo ) + { + if( streamInfo->size != sizeof( PaAsioStreamInfo ) + || streamInfo->version != 1 ) + { return paIncompatibleHostApiSpecificStreamInfo; } - if (streamInfo->flags & paAsioUseChannelSelectors) + if( streamInfo->flags & paAsioUseChannelSelectors ) *channelSelectors = streamInfo->channelSelectors; - if (! (*channelSelectors)) + if( !(*channelSelectors) ) return paIncompatibleHostApiSpecificStreamInfo; - for (int i=0; i < streamParameters->channelCount; ++i) { - if ( (*channelSelectors) [i] < 0 - || (*channelSelectors) [i] >= deviceChannelCount) { + for( int i=0; i < streamParameters->channelCount; ++i ){ + if( (*channelSelectors)[i] < 0 + || (*channelSelectors)[i] >= deviceChannelCount ){ return paInvalidChannelCount; - } + } } } @@ -1875,9 +1754,101 @@ static PaError ValidateAsioSpecificStreamInfo ( } +static bool IsUsingExternalClockSource() +{ + bool result = false; + ASIOError asioError; + ASIOClockSource clocks[32]; + long numSources=32; + + /* davidv: listing ASIO Clock sources. there is an ongoing investigation by + me about whether or not to call ASIOSetSampleRate if an external Clock is + used. A few drivers expected different things here */ + + asioError = ASIOGetClockSources(clocks, &numSources); + if( asioError != ASE_OK ){ + PA_DEBUG(("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText(asioError) )); + }else{ + PA_DEBUG(("INFO ASIOGetClockSources listing %d clocks\n", numSources )); + for (int i=0;i<numSources;++i){ + PA_DEBUG(("ASIOClockSource%d %s current:%d\n", i, clocks[i].name, clocks[i].isCurrentSource )); + + if (clocks[i].isCurrentSource) + result = true; + } + } + + return result; +} + + +static PaError ValidateAndSetSampleRate( double sampleRate ) +{ + PaError result = paNoError; + ASIOError asioError; + + // check that the device supports the requested sample rate + + asioError = ASIOCanSampleRate( sampleRate ); + PA_DEBUG(("ASIOCanSampleRate(%f):%d\n", sampleRate, asioError )); + + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + + // retrieve the current sample rate, we only change to the requested + // sample rate if the device is not already in that rate. + + ASIOSampleRate oldRate; + asioError = ASIOGetSampleRate(&oldRate); + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("ASIOGetSampleRate:%f\n",oldRate)); + + if (oldRate != sampleRate){ + /* Set sample rate */ + + PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate)); + + /* + If you have problems with some drivers when externally clocked, + try switching on the following line and commenting out the one after it. + See IsUsingExternalClockSource() for more info. + */ + //if( IsUsingExternalClockSource() ){ + if( false ){ + asioError = ASIOSetSampleRate( 0 ); + }else{ + asioError = ASIOSetSampleRate( sampleRate ); + } + if( asioError != ASE_OK ) + { + result = paInvalidSampleRate; + PA_DEBUG(("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText(asioError) )); + goto error; + } + PA_DEBUG(("after ASIOSetSampleRate(%f)\n",sampleRate)); + } + else + { + PA_DEBUG(("No Need to change SR\n")); + } + +error: + return result; +} + + /* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -1885,10 +1856,10 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData) + void *userData ) { PaError result = paNoError; - PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*) hostApi; + PaAsioHostApiRepresentation *asioHostApi = (PaAsioHostApiRepresentation*)hostApi; PaAsioStream *stream = 0; PaAsioStreamInfo *inputStreamInfo, *outputStreamInfo; unsigned long framesPerHostBuffer; @@ -1906,10 +1877,9 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, PaAsioDriverInfo *driverInfo; int *inputChannelSelectors = 0; int *outputChannelSelectors = 0; - bool isExternal = false; /* Are we using blocking i/o interface? */ - int usingBlockingIo = (!streamCallback) ? TRUE : FALSE; + int usingBlockingIo = ( !streamCallback ) ? TRUE : FALSE; /* Blocking i/o stuff */ long lBlockingBufferSize = 0; /* Desired ring buffer size in samples. */ long lBlockingBufferSizePow2 = 0; /* Power-of-2 rounded ring buffer size. */ @@ -1922,76 +1892,80 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* unless we move to using lower level ASIO calls, we can only have one device open at a time */ - - if (asioHostApi->openAsioDeviceIndex != paNoDevice) { - PA_DEBUG ( ("OpenStream paDeviceUnavailable\n")); + if( asioHostApi->openAsioDeviceIndex != paNoDevice ) + { + PA_DEBUG(("OpenStream paDeviceUnavailable\n")); return paDeviceUnavailable; } - if (inputParameters && outputParameters) { + assert( theAsioStream == 0 ); + + if( inputParameters && outputParameters ) + { /* full duplex ASIO stream must use the same device for input and output */ - if (inputParameters->device != outputParameters->device) { - PA_DEBUG ( ("OpenStream paBadIODeviceCombination\n")); + if( inputParameters->device != outputParameters->device ) + { + PA_DEBUG(("OpenStream paBadIODeviceCombination\n")); return paBadIODeviceCombination; } } - if (inputParameters) { + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; - suggestedInputLatencyFrames = (unsigned long) ( (inputParameters->suggestedLatency * sampleRate) +0.5f); + suggestedInputLatencyFrames = (unsigned long)((inputParameters->suggestedLatency * sampleRate)+0.5f); /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = inputParameters->device; - PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex]; + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; /* validate hostApiSpecificStreamInfo */ - inputStreamInfo = (PaAsioStreamInfo*) inputParameters->hostApiSpecificStreamInfo; - - result = ValidateAsioSpecificStreamInfo (inputParameters, inputStreamInfo, - asioDeviceInfo->commonDeviceInfo.maxInputChannels, - &inputChannelSelectors - ); - - if (result != paNoError) return result; - } else { + inputStreamInfo = (PaAsioStreamInfo*)inputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( inputParameters, inputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxInputChannels, + &inputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { inputChannelCount = 0; inputSampleFormat = 0; suggestedInputLatencyFrames = 0; } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; - suggestedOutputLatencyFrames = (unsigned long) ( (outputParameters->suggestedLatency * sampleRate) +0.5f); + suggestedOutputLatencyFrames = (unsigned long)((outputParameters->suggestedLatency * sampleRate)+0.5f); /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; asioDeviceIndex = outputParameters->device; - PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[asioDeviceIndex]; + PaAsioDeviceInfo *asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[asioDeviceIndex]; /* validate hostApiSpecificStreamInfo */ - outputStreamInfo = (PaAsioStreamInfo*) outputParameters->hostApiSpecificStreamInfo; - - result = ValidateAsioSpecificStreamInfo (outputParameters, outputStreamInfo, - asioDeviceInfo->commonDeviceInfo.maxOutputChannels, - &outputChannelSelectors - ); - - if (result != paNoError) return result; - } else { + outputStreamInfo = (PaAsioStreamInfo*)outputParameters->hostApiSpecificStreamInfo; + result = ValidateAsioSpecificStreamInfo( outputParameters, outputStreamInfo, + asioDeviceInfo->commonDeviceInfo.maxOutputChannels, + &outputChannelSelectors + ); + if( result != paNoError ) return result; + } + else + { outputChannelCount = 0; outputSampleFormat = 0; suggestedOutputLatencyFrames = 0; @@ -2002,107 +1976,40 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* NOTE: we load the driver and use its current settings rather than the ones in our device info structure which may be stale */ - result = LoadAsioDriver (asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, - driverInfo, asioHostApi->systemSpecific); - - if (result == paNoError) + result = LoadAsioDriver( asioHostApi, asioHostApi->inheritedHostApiRep.deviceInfos[ asioDeviceIndex ]->name, + driverInfo, asioHostApi->systemSpecific ); + if( result == paNoError ) asioIsInitialized = 1; - else { - PA_DEBUG ( ("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result)); + else{ + PA_DEBUG(("OpenStream ERROR1 - LoadAsioDriver returned %d\n", result)); goto error; } /* check that input device can support inputChannelCount */ - if (inputChannelCount > 0) { - if (inputChannelCount > driverInfo->inputChannelCount) { + if( inputChannelCount > 0 ) + { + if( inputChannelCount > driverInfo->inputChannelCount ) + { result = paInvalidChannelCount; - PA_DEBUG ( ("OpenStream ERROR2\n")); + PA_DEBUG(("OpenStream ERROR2\n")); goto error; } } /* check that output device can support outputChannelCount */ - if (outputChannelCount) { - if (outputChannelCount > driverInfo->outputChannelCount) { + if( outputChannelCount ) + { + if( outputChannelCount > driverInfo->outputChannelCount ) + { result = paInvalidChannelCount; - PA_DEBUG ( ("OpenStream ERROR3\n")); + PA_DEBUG(("OpenStream ERROR3\n")); goto error; } } - - /* davidv: listing ASIO Clock sources, there is an ongoing investigation by - me about whether or not call ASIOSetSampleRate if an external Clock is - used. A few drivers expected different things here */ - { - ASIOClockSource clocks[32]; - long numSources=32; - asioError = ASIOGetClockSources (clocks, &numSources); - - if (asioError != ASE_OK) { - PA_DEBUG ( ("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText (asioError))); - } else { - PA_DEBUG ( ("INFO ASIOGetClockSources listing %d clocks\n", numSources)); - - for (int i=0;i<numSources;++i) { - PA_DEBUG ( ("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource)); - - /* - If you have problems with some drivers when externally clocked, - uncomment the next two lines - */ - //if (clocks[i].isCurrentSource) - // isExternal = true; - } - } - } - - // check that the device supports the requested sample rate - - asioError = ASIOCanSampleRate (sampleRate); - - PA_DEBUG ( ("ASIOCanSampleRate(%f):%d\n",sampleRate, asioError)); - - if (asioError != ASE_OK) { - result = paInvalidSampleRate; - PA_DEBUG ( ("ERROR: ASIOCanSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); - goto error; - } - - - // retrieve the current sample rate, we only change to the requested - // sample rate if the device is not already in that rate. - - ASIOSampleRate oldRate; - - asioError = ASIOGetSampleRate (&oldRate); - - if (asioError != ASE_OK) { - result = paInvalidSampleRate; - PA_DEBUG ( ("ERROR: ASIOGetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); + result = ValidateAndSetSampleRate( sampleRate ); + if( result != paNoError ) goto error; - } - - PA_DEBUG ( ("ASIOGetSampleRate:%f\n",oldRate)); - - if (oldRate != sampleRate) { - - PA_DEBUG ( ("before ASIOSetSampleRate(%f)\n",sampleRate)); - - asioError = ASIOSetSampleRate (isExternal?0:sampleRate); - /* Set sample rate */ - - if (asioError != ASE_OK) { - result = paInvalidSampleRate; - PA_DEBUG ( ("ERROR: ASIOSetSampleRate: %s\n", PaAsio_GetAsioErrorText (asioError))); - goto error; - } - - PA_DEBUG ( ("after ASIOSetSampleRate(%f)\n",sampleRate)); - } else { - PA_DEBUG ( ("No Need to change SR\n")); - } - /* IMPLEMENT ME: @@ -2111,32 +2018,30 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, */ /* validate platform specific flags */ - if ( (streamFlags & paPlatformSpecificFlags) != 0) { - PA_DEBUG ( ("OpenStream invalid flags!!\n")); + if( (streamFlags & paPlatformSpecificFlags) != 0 ){ + PA_DEBUG(("OpenStream invalid flags!!\n")); return paInvalidFlag; /* unexpected platform specific flag */ } - stream = (PaAsioStream*) PaUtil_AllocateMemory (sizeof (PaAsioStream)); - - if (!stream) { + stream = (PaAsioStream*)PaUtil_AllocateMemory( sizeof(PaAsioStream) ); + if( !stream ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR5\n")); + PA_DEBUG(("OpenStream ERROR5\n")); goto error; } - stream->blockingState = NULL; /* Blocking i/o not initialized, yet. */ - stream->completedBuffersPlayedEvent = CreateEvent (NULL, TRUE, FALSE, NULL); - - if (stream->completedBuffersPlayedEvent == NULL) { + stream->completedBuffersPlayedEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + if( stream->completedBuffersPlayedEvent == NULL ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - PA_DEBUG ( ("OpenStream ERROR6\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("OpenStream ERROR6\n")); goto error; } - completedBuffersPlayedEventInited = 1; @@ -2145,88 +2050,95 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, stream->bufferPtrs = 0; /* for deallocation in error */ /* Using blocking i/o interface... */ - - if (usingBlockingIo) { + if( usingBlockingIo ) + { /* Blocking i/o is implemented by running callback mode, using a special blocking i/o callback. */ streamCallback = BlockingIoPaCallback; /* Setup PA to use the ASIO blocking i/o callback. */ userData = &theAsioStream; /* The callback user data will be the PA ASIO stream. */ - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &asioHostApi->blockingStreamInterface, streamCallback, userData); - } else { /* Using callback interface... */ - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &asioHostApi->callbackStreamInterface, streamCallback, userData); + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->blockingStreamInterface, streamCallback, userData ); + } + else /* Using callback interface... */ + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &asioHostApi->callbackStreamInterface, streamCallback, userData ); } - PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate); - + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); - stream->asioBufferInfos = (ASIOBufferInfo*) PaUtil_AllocateMemory ( - sizeof (ASIOBufferInfo) * (inputChannelCount + outputChannelCount)); - if (!stream->asioBufferInfos) { + stream->asioBufferInfos = (ASIOBufferInfo*)PaUtil_AllocateMemory( + sizeof(ASIOBufferInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioBufferInfos ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR7\n")); + PA_DEBUG(("OpenStream ERROR7\n")); goto error; } - for (i=0; i < inputChannelCount; ++i) { + for( i=0; i < inputChannelCount; ++i ) + { ASIOBufferInfo *info = &stream->asioBufferInfos[i]; info->isInput = ASIOTrue; - if (inputChannelSelectors) { + if( inputChannelSelectors ){ // inputChannelSelectors values have already been validated in // ValidateAsioSpecificStreamInfo() above info->channelNum = inputChannelSelectors[i]; - } else { + }else{ info->channelNum = i; } info->buffers[0] = info->buffers[1] = 0; } - for (i=0; i < outputChannelCount; ++i) { + for( i=0; i < outputChannelCount; ++i ){ ASIOBufferInfo *info = &stream->asioBufferInfos[inputChannelCount+i]; info->isInput = ASIOFalse; - if (outputChannelSelectors) { + if( outputChannelSelectors ){ // outputChannelSelectors values have already been validated in // ValidateAsioSpecificStreamInfo() above info->channelNum = outputChannelSelectors[i]; - } else { + }else{ info->channelNum = i; } - + info->buffers[0] = info->buffers[1] = 0; } /* Using blocking i/o interface... */ - if (usingBlockingIo) { - /** @todo REVIEW selection of host buffer size for blocking i/o */ + if( usingBlockingIo ) + { +/** @todo REVIEW selection of host buffer size for blocking i/o */ /* Use default host latency for blocking i/o. */ - framesPerHostBuffer = SelectHostBufferSize (0, driverInfo); + framesPerHostBuffer = SelectHostBufferSize( 0, driverInfo ); - } else { /* Using callback interface... */ - framesPerHostBuffer = SelectHostBufferSize ( - ( (suggestedInputLatencyFrames > suggestedOutputLatencyFrames) - ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), - driverInfo); + } + else /* Using callback interface... */ + { + framesPerHostBuffer = SelectHostBufferSize( + (( suggestedInputLatencyFrames > suggestedOutputLatencyFrames ) + ? suggestedInputLatencyFrames : suggestedOutputLatencyFrames), + driverInfo ); } - PA_DEBUG ( ("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); + PA_DEBUG(("PaAsioOpenStream: framesPerHostBuffer :%d\n", framesPerHostBuffer)); - asioError = ASIOCreateBuffers (stream->asioBufferInfos, - inputChannelCount+outputChannelCount, - framesPerHostBuffer, &asioCallbacks_); + asioError = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); - if (asioError != ASE_OK - && framesPerHostBuffer != (unsigned long) driverInfo->bufferPreferredSize) { - PA_DEBUG ( ("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText (asioError))); + if( asioError != ASE_OK + && framesPerHostBuffer != (unsigned long)driverInfo->bufferPreferredSize ) + { + PA_DEBUG(("ERROR: ASIOCreateBuffers: %s\n", PaAsio_GetAsioErrorText(asioError) )); /* Some buggy drivers (like the Hoontech DSP24) give incorrect [min, preferred, max] values They should work with the preferred size @@ -2236,217 +2148,221 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, framesPerHostBuffer = driverInfo->bufferPreferredSize; - PA_DEBUG ( ("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); - - ASIOError asioError2 = ASIOCreateBuffers (stream->asioBufferInfos, - inputChannelCount+outputChannelCount, - framesPerHostBuffer, &asioCallbacks_); + PA_DEBUG(("PaAsioOpenStream: CORRECTED framesPerHostBuffer :%d\n", framesPerHostBuffer)); - if (asioError2 == ASE_OK) + ASIOError asioError2 = ASIOCreateBuffers( stream->asioBufferInfos, + inputChannelCount+outputChannelCount, + framesPerHostBuffer, &asioCallbacks_ ); + if( asioError2 == ASE_OK ) asioError = ASE_OK; } - if (asioError != ASE_OK) { + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); - PA_DEBUG ( ("OpenStream ERROR9\n")); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR9\n")); goto error; } asioBuffersCreated = 1; - stream->asioChannelInfos = (ASIOChannelInfo*) PaUtil_AllocateMemory ( - sizeof (ASIOChannelInfo) * (inputChannelCount + outputChannelCount)); - - if (!stream->asioChannelInfos) { + stream->asioChannelInfos = (ASIOChannelInfo*)PaUtil_AllocateMemory( + sizeof(ASIOChannelInfo) * (inputChannelCount + outputChannelCount) ); + if( !stream->asioChannelInfos ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR10\n")); + PA_DEBUG(("OpenStream ERROR10\n")); goto error; } - for (i=0; i < inputChannelCount + outputChannelCount; ++i) { + for( i=0; i < inputChannelCount + outputChannelCount; ++i ) + { stream->asioChannelInfos[i].channel = stream->asioBufferInfos[i].channelNum; stream->asioChannelInfos[i].isInput = stream->asioBufferInfos[i].isInput; - asioError = ASIOGetChannelInfo (&stream->asioChannelInfos[i]); - - if (asioError != ASE_OK) { + asioError = ASIOGetChannelInfo( &stream->asioChannelInfos[i] ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); - PA_DEBUG ( ("OpenStream ERROR11\n")); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); + PA_DEBUG(("OpenStream ERROR11\n")); goto error; } } - stream->bufferPtrs = (void**) PaUtil_AllocateMemory ( - - 2 * sizeof (void*) * (inputChannelCount + outputChannelCount)); - - if (!stream->bufferPtrs) { + stream->bufferPtrs = (void**)PaUtil_AllocateMemory( + 2 * sizeof(void*) * (inputChannelCount + outputChannelCount) ); + if( !stream->bufferPtrs ) + { result = paInsufficientMemory; - PA_DEBUG ( ("OpenStream ERROR12\n")); + PA_DEBUG(("OpenStream ERROR12\n")); goto error; } - if (inputChannelCount > 0) { + if( inputChannelCount > 0 ) + { stream->inputBufferPtrs[0] = stream-> bufferPtrs; stream->inputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount]; - for (i=0; i<inputChannelCount; ++i) { + for( i=0; i<inputChannelCount; ++i ) + { stream->inputBufferPtrs[0][i] = stream->asioBufferInfos[i].buffers[0]; stream->inputBufferPtrs[1][i] = stream->asioBufferInfos[i].buffers[1]; } - } else { + } + else + { stream->inputBufferPtrs[0] = 0; stream->inputBufferPtrs[1] = 0; } - if (outputChannelCount > 0) { + if( outputChannelCount > 0 ) + { stream->outputBufferPtrs[0] = &stream->bufferPtrs[inputChannelCount*2]; stream->outputBufferPtrs[1] = &stream->bufferPtrs[inputChannelCount*2 + outputChannelCount]; - for (i=0; i<outputChannelCount; ++i) { + for( i=0; i<outputChannelCount; ++i ) + { stream->outputBufferPtrs[0][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[0]; stream->outputBufferPtrs[1][i] = stream->asioBufferInfos[inputChannelCount+i].buffers[1]; } - } else { + } + else + { stream->outputBufferPtrs[0] = 0; stream->outputBufferPtrs[1] = 0; } - if (inputChannelCount > 0) { + if( inputChannelCount > 0 ) + { /* FIXME: assume all channels use the same type for now */ ASIOSampleType inputType = stream->asioChannelInfos[0].type; - PA_DEBUG ( ("ASIO Input type:%d",inputType)); - AsioSampleTypeLOG (inputType); - hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (inputType); + PA_DEBUG(("ASIO Input type:%d",inputType)); + AsioSampleTypeLOG(inputType); + hostInputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( inputType ); - SelectAsioToPaConverter (inputType, &stream->inputBufferConverter, &stream->inputShift); - } else { + SelectAsioToPaConverter( inputType, &stream->inputBufferConverter, &stream->inputShift ); + } + else + { hostInputSampleFormat = 0; stream->inputBufferConverter = 0; } - if (outputChannelCount > 0) { + if( outputChannelCount > 0 ) + { /* FIXME: assume all channels use the same type for now */ ASIOSampleType outputType = stream->asioChannelInfos[inputChannelCount].type; - PA_DEBUG ( ("ASIO Output type:%d",outputType)); - AsioSampleTypeLOG (outputType); - hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat (outputType); + PA_DEBUG(("ASIO Output type:%d",outputType)); + AsioSampleTypeLOG(outputType); + hostOutputSampleFormat = AsioSampleTypeToPaNativeSampleFormat( outputType ); - SelectPaToAsioConverter (outputType, &stream->outputBufferConverter, &stream->outputShift); - } else { + SelectPaToAsioConverter( outputType, &stream->outputBufferConverter, &stream->outputShift ); + } + else + { hostOutputSampleFormat = 0; stream->outputBufferConverter = 0; } - ASIOGetLatencies (&stream->inputLatency, &stream->outputLatency); + ASIOGetLatencies( &stream->inputLatency, &stream->outputLatency ); /* Using blocking i/o interface... */ - - if (usingBlockingIo) { + if( usingBlockingIo ) + { /* Allocate the blocking i/o input ring buffer memory. */ - stream->blockingState = (PaAsioStreamBlockingState*) PaUtil_AllocateMemory (sizeof (PaAsioStreamBlockingState)); - - if (!stream->blockingState) { + stream->blockingState = (PaAsioStreamBlockingState*)PaUtil_AllocateMemory( sizeof(PaAsioStreamBlockingState) ); + if( !stream->blockingState ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o interface struct allocation failed in OpenStream()\n")); goto error; } /* Initialize blocking i/o interface struct. */ stream->blockingState->readFramesReadyEvent = NULL; /* Uninitialized, yet. */ - stream->blockingState->writeBuffersReadyEvent = NULL; /* Uninitialized, yet. */ - stream->blockingState->readRingBufferData = NULL; /* Uninitialized, yet. */ - stream->blockingState->writeRingBufferData = NULL; /* Uninitialized, yet. */ - stream->blockingState->readStreamBuffer = NULL; /* Uninitialized, yet. */ - stream->blockingState->writeStreamBuffer = NULL; /* Uninitialized, yet. */ - stream->blockingState->stopFlag = TRUE; /* Not started, yet. */ /* If the user buffer is unspecified */ - if (framesPerBuffer == paFramesPerBufferUnspecified) { + if( framesPerBuffer == paFramesPerBufferUnspecified ) + { /* Make the user buffer the same size as the host buffer. */ framesPerBuffer = framesPerHostBuffer; } /* Initialize callback buffer processor. */ - result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor , - inputChannelCount , - inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ - hostInputSampleFormat , /* Host format. */ - outputChannelCount , - outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ - hostOutputSampleFormat , /* Host format. */ - sampleRate , - streamFlags , - framesPerBuffer , /* Frames per ring buffer block. */ - framesPerHostBuffer , /* Frames per asio buffer. */ - paUtilFixedHostBufferSize , - streamCallback , - userData); - - if (result != paNoError) { - PA_DEBUG ( ("OpenStream ERROR13\n")); + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor , + inputChannelCount , + inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ + hostInputSampleFormat , /* Host format. */ + outputChannelCount , + outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ + hostOutputSampleFormat , /* Host format. */ + sampleRate , + streamFlags , + framesPerBuffer , /* Frames per ring buffer block. */ + framesPerHostBuffer , /* Frames per asio buffer. */ + paUtilFixedHostBufferSize , + streamCallback , + userData ); + if( result != paNoError ){ + PA_DEBUG(("OpenStream ERROR13\n")); goto error; } - callbackBufferProcessorInited = TRUE; /* Initialize the blocking i/o buffer processor. */ - result = PaUtil_InitializeBufferProcessor (&stream->blockingState->bufferProcessor, - inputChannelCount , - inputSampleFormat , /* User format. */ - inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ - outputChannelCount , - outputSampleFormat , /* User format. */ - outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ - sampleRate , - paClipOff | paDitherOff , /* Don't use dither nor clipping. */ - framesPerBuffer , /* Frames per user buffer. */ - framesPerBuffer , /* Frames per ring buffer block. */ - paUtilBoundedHostBufferSize , - NULL, NULL); /* No callback! */ - - if (result != paNoError) { - PA_DEBUG ( ("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n")); + result = PaUtil_InitializeBufferProcessor(&stream->blockingState->bufferProcessor, + inputChannelCount , + inputSampleFormat , /* User format. */ + inputSampleFormat & ~paNonInterleaved , /* Ring buffer. */ + outputChannelCount , + outputSampleFormat , /* User format. */ + outputSampleFormat & ~paNonInterleaved, /* Ring buffer. */ + sampleRate , + paClipOff | paDitherOff , /* Don't use dither nor clipping. */ + framesPerBuffer , /* Frames per user buffer. */ + framesPerBuffer , /* Frames per ring buffer block. */ + paUtilBoundedHostBufferSize , + NULL, NULL );/* No callback! */ + if( result != paNoError ){ + PA_DEBUG(("ERROR! Blocking i/o buffer processor initialization failed in OpenStream()\n")); goto error; } - blockingBufferProcessorInited = TRUE; /* If input is requested. */ - - if (inputChannelCount) { + if( inputChannelCount ) + { /* Create the callback sync-event. */ - stream->blockingState->readFramesReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL); - - if (stream->blockingState->readFramesReadyEvent == NULL) { + stream->blockingState->readFramesReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( stream->blockingState->readFramesReadyEvent == NULL ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - PA_DEBUG ( ("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("ERROR! Blocking i/o \"read frames ready\" event creation failed in OpenStream()\n")); goto error; } - blockingReadFramesReadyEventInitialized = 1; /* Create pointer buffer to access non-interleaved data in ReadStream() */ - stream->blockingState->readStreamBuffer = (void**) PaUtil_AllocateMemory (sizeof (void*) * inputChannelCount); - - if (!stream->blockingState->readStreamBuffer) { + stream->blockingState->readStreamBuffer = (void**)PaUtil_AllocateMemory( sizeof(void*) * inputChannelCount ); + if( !stream->blockingState->readStreamBuffer ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o read stream buffer allocation failed in OpenStream()\n")); goto error; } @@ -2465,79 +2381,74 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, 5) Get the next larger (or equal) power-of-two buffer size. */ lBlockingBufferSize = suggestedInputLatencyFrames - stream->inputLatency; - lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1; - lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer; - lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer; /* Get the next larger or equal power-of-two buffersize. */ lBlockingBufferSizePow2 = 1; - - while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1)); - + while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) ); lBlockingBufferSize = lBlockingBufferSizePow2; /* Compute total intput latency in seconds */ stream->streamRepresentation.streamInfo.inputLatency = - (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) - + PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) - + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer - + stream->inputLatency) + (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor ) + + PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer + + stream->inputLatency ) / sampleRate; /* The code below prints the ASIO latency which doesn't include the buffer processor latency nor the blocking i/o latency. It reports the added latency separately. */ - PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", - stream->inputLatency, - (long) (stream->inputLatency * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor), - (long) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, - (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate)) - )); + PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", + stream->inputLatency, + (long)( stream->inputLatency * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), + (long)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, + (long)( (PaUtil_GetBufferProcessorInputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) ) + )); /* Determine the size of ring buffer in bytes. */ - lBytesPerFrame = inputChannelCount * Pa_GetSampleSize (inputSampleFormat); + lBytesPerFrame = inputChannelCount * Pa_GetSampleSize(inputSampleFormat ); /* Allocate the blocking i/o input ring buffer memory. */ - stream->blockingState->readRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame); - - if (!stream->blockingState->readRingBufferData) { + stream->blockingState->readRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame ); + if( !stream->blockingState->readRingBufferData ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o input ring buffer allocation failed in OpenStream()\n")); goto error; } /* Initialize the input ring buffer struct. */ - PaUtil_InitializeRingBuffer (&stream->blockingState->readRingBuffer , - lBytesPerFrame , - lBlockingBufferSize , - stream->blockingState->readRingBufferData); + PaUtil_InitializeRingBuffer( &stream->blockingState->readRingBuffer , + lBytesPerFrame , + lBlockingBufferSize , + stream->blockingState->readRingBufferData ); } /* If output is requested. */ - if (outputChannelCount) { - stream->blockingState->writeBuffersReadyEvent = CreateEvent (NULL, FALSE, FALSE, NULL); - - if (stream->blockingState->writeBuffersReadyEvent == NULL) { + if( outputChannelCount ) + { + stream->blockingState->writeBuffersReadyEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( stream->blockingState->writeBuffersReadyEvent == NULL ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - PA_DEBUG ( ("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + PA_DEBUG(("ERROR! Blocking i/o \"write buffers ready\" event creation failed in OpenStream()\n")); goto error; } - blockingWriteBuffersReadyEventInitialized = 1; /* Create pointer buffer to access non-interleaved data in WriteStream() */ - stream->blockingState->writeStreamBuffer = (const void**) PaUtil_AllocateMemory (sizeof (const void*) * outputChannelCount); - - if (!stream->blockingState->writeStreamBuffer) { + stream->blockingState->writeStreamBuffer = (const void**)PaUtil_AllocateMemory( sizeof(const void*) * outputChannelCount ); + if( !stream->blockingState->writeStreamBuffer ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o write stream buffer allocation failed in OpenStream()\n")); goto error; } @@ -2556,11 +2467,8 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, 5) Get the next larger (or equal) power-of-two buffer size. */ lBlockingBufferSize = suggestedOutputLatencyFrames - stream->outputLatency; - lBlockingBufferSize = (lBlockingBufferSize > 0) ? lBlockingBufferSize : 1; - lBlockingBufferSize = (lBlockingBufferSize + framesPerBuffer - 1) / framesPerBuffer; - lBlockingBufferSize = (lBlockingBufferSize + 1) * framesPerBuffer; /* The buffer size (without the additional block) corresponds @@ -2570,163 +2478,159 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* Get the next larger or equal power-of-two buffersize. */ lBlockingBufferSizePow2 = 1; - - while (lBlockingBufferSize > (lBlockingBufferSizePow2<<=1)); - + while( lBlockingBufferSize > (lBlockingBufferSizePow2<<=1) ); lBlockingBufferSize = lBlockingBufferSizePow2; /* Compute total output latency in seconds */ stream->streamRepresentation.streamInfo.outputLatency = - (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) - + PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) - + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer - + stream->outputLatency) + (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor ) + + PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer + + stream->outputLatency ) / sampleRate; /* The code below prints the ASIO latency which doesn't include the buffer processor latency nor the blocking i/o latency. It reports the added latency separately. */ - PA_DEBUG ( ("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", - stream->outputLatency, - (long) (stream->inputLatency * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor), - (long) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) * (1000.0 / sampleRate)), - PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, - (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate)) - )); + PA_DEBUG(("PaAsio : ASIO OutputLatency = %ld (%ld ms),\n added buffProc:%ld (%ld ms),\n added blocking:%ld (%ld ms)\n", + stream->outputLatency, + (long)( stream->inputLatency * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), + (long)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) * (1000.0 / sampleRate) ), + PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer, + (long)( (PaUtil_GetBufferProcessorOutputLatency(&stream->blockingState->bufferProcessor) + (lBlockingBufferSize / framesPerBuffer - 1) * framesPerBuffer) * (1000.0 / sampleRate) ) + )); /* Determine the size of ring buffer in bytes. */ - lBytesPerFrame = outputChannelCount * Pa_GetSampleSize (outputSampleFormat); + lBytesPerFrame = outputChannelCount * Pa_GetSampleSize(outputSampleFormat); /* Allocate the blocking i/o output ring buffer memory. */ - stream->blockingState->writeRingBufferData = (void*) PaUtil_AllocateMemory (lBlockingBufferSize * lBytesPerFrame); - - if (!stream->blockingState->writeRingBufferData) { + stream->blockingState->writeRingBufferData = (void*)PaUtil_AllocateMemory( lBlockingBufferSize * lBytesPerFrame ); + if( !stream->blockingState->writeRingBufferData ) + { result = paInsufficientMemory; - PA_DEBUG ( ("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n")); + PA_DEBUG(("ERROR! Blocking i/o output ring buffer allocation failed in OpenStream()\n")); goto error; } /* Initialize the output ring buffer struct. */ - PaUtil_InitializeRingBuffer (&stream->blockingState->writeRingBuffer , - lBytesPerFrame , - lBlockingBufferSize , - stream->blockingState->writeRingBufferData); + PaUtil_InitializeRingBuffer( &stream->blockingState->writeRingBuffer , + lBytesPerFrame , + lBlockingBufferSize , + stream->blockingState->writeRingBufferData ); } stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - } else { /* Using callback interface... */ - result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor, - inputChannelCount, inputSampleFormat, hostInputSampleFormat, - outputChannelCount, outputSampleFormat, hostOutputSampleFormat, - sampleRate, streamFlags, framesPerBuffer, - framesPerHostBuffer, paUtilFixedHostBufferSize, - streamCallback, userData); - - if (result != paNoError) { - PA_DEBUG ( ("OpenStream ERROR13\n")); + } + else /* Using callback interface... */ + { + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, + inputChannelCount, inputSampleFormat, hostInputSampleFormat, + outputChannelCount, outputSampleFormat, hostOutputSampleFormat, + sampleRate, streamFlags, framesPerBuffer, + framesPerHostBuffer, paUtilFixedHostBufferSize, + streamCallback, userData ); + if( result != paNoError ){ + PA_DEBUG(("OpenStream ERROR13\n")); goto error; } - callbackBufferProcessorInited = TRUE; stream->streamRepresentation.streamInfo.inputLatency = - (double) (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) - + stream->inputLatency) / sampleRate; // seconds + (double)( PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + stream->inputLatency) / sampleRate; // seconds stream->streamRepresentation.streamInfo.outputLatency = - (double) (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) - + stream->outputLatency) / sampleRate; // seconds + (double)( PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + stream->outputLatency) / sampleRate; // seconds stream->streamRepresentation.streamInfo.sampleRate = sampleRate; // the code below prints the ASIO latency which doesn't include the // buffer processor latency. it reports the added latency separately - PA_DEBUG ( ("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", - stream->inputLatency, - (long) ( (stream->inputLatency*1000) / sampleRate), - PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor), - (long) ( (PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) *1000) / sampleRate) - )); - - PA_DEBUG ( ("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", - stream->outputLatency, - (long) ( (stream->outputLatency*1000) / sampleRate), - PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor), - (long) ( (PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) *1000) / sampleRate) - )); + PA_DEBUG(("PaAsio : ASIO InputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->inputLatency, + (long)((stream->inputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); + + PA_DEBUG(("PaAsio : ASIO OuputLatency = %ld (%ld ms), added buffProc:%ld (%ld ms)\n", + stream->outputLatency, + (long)((stream->outputLatency*1000)/ sampleRate), + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor), + (long)((PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor)*1000)/ sampleRate) + )); } stream->asioHostApi = asioHostApi; - stream->framesPerHostCallback = framesPerHostBuffer; stream->inputChannelCount = inputChannelCount; stream->outputChannelCount = outputChannelCount; stream->postOutput = driverInfo->postOutput; + stream->isStopped = 1; stream->isActive = 0; - + asioHostApi->openAsioDeviceIndex = asioDeviceIndex; - *s = (PaStream*) stream; + theAsioStream = stream; + *s = (PaStream*)stream; return result; error: - PA_DEBUG ( ("goto errored\n")); - - if (stream) { - if (stream->blockingState) { - if (blockingBufferProcessorInited) - PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor); - - if (stream->blockingState->writeRingBufferData) - PaUtil_FreeMemory (stream->blockingState->writeRingBufferData); - - if (stream->blockingState->writeStreamBuffer) - PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer); - - if (blockingWriteBuffersReadyEventInitialized) - CloseHandle (stream->blockingState->writeBuffersReadyEvent); - - if (stream->blockingState->readRingBufferData) - PaUtil_FreeMemory (stream->blockingState->readRingBufferData); - - if (stream->blockingState->readStreamBuffer) - PaUtil_FreeMemory (stream->blockingState->readStreamBuffer); - - if (blockingReadFramesReadyEventInitialized) - CloseHandle (stream->blockingState->readFramesReadyEvent); - - PaUtil_FreeMemory (stream->blockingState); + PA_DEBUG(("goto errored\n")); + if( stream ) + { + if( stream->blockingState ) + { + if( blockingBufferProcessorInited ) + PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor ); + + if( stream->blockingState->writeRingBufferData ) + PaUtil_FreeMemory( stream->blockingState->writeRingBufferData ); + if( stream->blockingState->writeStreamBuffer ) + PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer ); + if( blockingWriteBuffersReadyEventInitialized ) + CloseHandle( stream->blockingState->writeBuffersReadyEvent ); + + if( stream->blockingState->readRingBufferData ) + PaUtil_FreeMemory( stream->blockingState->readRingBufferData ); + if( stream->blockingState->readStreamBuffer ) + PaUtil_FreeMemory( stream->blockingState->readStreamBuffer ); + if( blockingReadFramesReadyEventInitialized ) + CloseHandle( stream->blockingState->readFramesReadyEvent ); + + PaUtil_FreeMemory( stream->blockingState ); } - if (callbackBufferProcessorInited) - PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); + if( callbackBufferProcessorInited ) + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); - if (completedBuffersPlayedEventInited) - CloseHandle (stream->completedBuffersPlayedEvent); + if( completedBuffersPlayedEventInited ) + CloseHandle( stream->completedBuffersPlayedEvent ); - if (stream->asioBufferInfos) - PaUtil_FreeMemory (stream->asioBufferInfos); + if( stream->asioBufferInfos ) + PaUtil_FreeMemory( stream->asioBufferInfos ); - if (stream->asioChannelInfos) - PaUtil_FreeMemory (stream->asioChannelInfos); + if( stream->asioChannelInfos ) + PaUtil_FreeMemory( stream->asioChannelInfos ); - if (stream->bufferPtrs) - PaUtil_FreeMemory (stream->bufferPtrs); + if( stream->bufferPtrs ) + PaUtil_FreeMemory( stream->bufferPtrs ); - PaUtil_FreeMemory (stream); + PaUtil_FreeMemory( stream ); } - if (asioBuffersCreated) + if( asioBuffersCreated ) ASIODisposeBuffers(); - if (asioIsInitialized) { - UnloadAsioDriver(); - } - + if( asioIsInitialized ) + { + UnloadAsioDriver(); + } return result; } @@ -2735,57 +2639,57 @@ error: When CloseStream() is called, the multi-api layer ensures that the stream has already been stopped or aborted. */ -static PaError CloseStream (PaStream* s) +static PaError CloseStream( PaStream* s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; /* IMPLEMENT ME: - additional stream closing + cleanup */ - PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); - PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation); + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); stream->asioHostApi->openAsioDeviceIndex = paNoDevice; - CloseHandle (stream->completedBuffersPlayedEvent); + CloseHandle( stream->completedBuffersPlayedEvent ); /* Using blocking i/o interface... */ + if( stream->blockingState ) + { + PaUtil_TerminateBufferProcessor( &stream->blockingState->bufferProcessor ); - if (stream->blockingState) { - PaUtil_TerminateBufferProcessor (&stream->blockingState->bufferProcessor); - - if (stream->inputChannelCount) { - PaUtil_FreeMemory (stream->blockingState->readRingBufferData); - PaUtil_FreeMemory (stream->blockingState->readStreamBuffer); - CloseHandle (stream->blockingState->readFramesReadyEvent); + if( stream->inputChannelCount ) { + PaUtil_FreeMemory( stream->blockingState->readRingBufferData ); + PaUtil_FreeMemory( stream->blockingState->readStreamBuffer ); + CloseHandle( stream->blockingState->readFramesReadyEvent ); } - - if (stream->outputChannelCount) { - PaUtil_FreeMemory (stream->blockingState->writeRingBufferData); - PaUtil_FreeMemory (stream->blockingState->writeStreamBuffer); - CloseHandle (stream->blockingState->writeBuffersReadyEvent); + if( stream->outputChannelCount ) { + PaUtil_FreeMemory( stream->blockingState->writeRingBufferData ); + PaUtil_FreeMemory( stream->blockingState->writeStreamBuffer ); + CloseHandle( stream->blockingState->writeBuffersReadyEvent ); } - PaUtil_FreeMemory (stream->blockingState); + PaUtil_FreeMemory( stream->blockingState ); } - PaUtil_FreeMemory (stream->asioBufferInfos); - - PaUtil_FreeMemory (stream->asioChannelInfos); - PaUtil_FreeMemory (stream->bufferPtrs); - PaUtil_FreeMemory (stream); + PaUtil_FreeMemory( stream->asioBufferInfos ); + PaUtil_FreeMemory( stream->asioChannelInfos ); + PaUtil_FreeMemory( stream->bufferPtrs ); + PaUtil_FreeMemory( stream ); ASIODisposeBuffers(); UnloadAsioDriver(); + theAsioStream = 0; + return result; } -static void bufferSwitch (long index, ASIOBool directProcess) +static void bufferSwitch(long index, ASIOBool directProcess) { //TAKEN FROM THE ASIO SDK @@ -2799,28 +2703,27 @@ static void bufferSwitch (long index, ASIOBool directProcess) // timeInfo.systemTime fields and the according flags ASIOTime timeInfo; - memset (&timeInfo, 0, sizeof (timeInfo)); + memset( &timeInfo, 0, sizeof (timeInfo) ); // get the time stamp of the buffer, not necessary if no // synchronization to other media is required - - if (ASIOGetSamplePosition (&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) - timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; + if( ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) + timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; // Call the real callback - bufferSwitchTimeInfo (&timeInfo, index, directProcess); + bufferSwitchTimeInfo( &timeInfo, index, directProcess ); } // conversion from 64 bit ASIOSample/ASIOTimeStamp to double float #if NATIVE_INT64 -#define ASIO64toDouble(a) (a) + #define ASIO64toDouble(a) (a) #else -const double twoRaisedTo32 = 4294967296.; -#define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) + const double twoRaisedTo32 = 4294967296.; + #define ASIO64toDouble(a) ((a).lo + (a).hi * twoRaisedTo32) #endif -static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool directProcess) +static ASIOTime *bufferSwitchTimeInfo( ASIOTime *timeInfo, long index, ASIOBool directProcess ) { // the actual processing callback. // Beware that this is normally in a seperate thread, hence be sure that @@ -2849,23 +2752,22 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // synchronization to other media is required if (timeInfo->timeInfo.flags & kSystemTimeValid) - asioDriverInfo.nanoSeconds = ASIO64toDouble (timeInfo->timeInfo.systemTime); + asioDriverInfo.nanoSeconds = ASIO64toDouble(timeInfo->timeInfo.systemTime); else - asioDriverInfo.nanoSeconds = 0; + asioDriverInfo.nanoSeconds = 0; if (timeInfo->timeInfo.flags & kSamplePositionValid) - asioDriverInfo.samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition); + asioDriverInfo.samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); else - asioDriverInfo.samples = 0; + asioDriverInfo.samples = 0; if (timeInfo->timeCode.flags & kTcValid) - asioDriverInfo.tcSamples = ASIO64toDouble (timeInfo->timeCode.timeCodeSamples); + asioDriverInfo.tcSamples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); else - asioDriverInfo.tcSamples = 0; + asioDriverInfo.tcSamples = 0; // get the system reference time asioDriverInfo.sysRefTime = get_sys_reference_time(); - #endif #if 0 @@ -2873,19 +2775,14 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // tells you the time when driver got its interrupt and the delay until the app receives // the event notification. static double last_samples = 0; - char tmp[128]; - - sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long) (asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long) (asioDriverInfo.nanoSeconds / 1000000.0), (long) (asioDriverInfo.samples - last_samples)); - + sprintf (tmp, "diff: %d / %d ms / %d ms / %d samples \n", asioDriverInfo.sysRefTime - (long)(asioDriverInfo.nanoSeconds / 1000000.0), asioDriverInfo.sysRefTime, (long)(asioDriverInfo.nanoSeconds / 1000000.0), (long)(asioDriverInfo.samples - last_samples)); OutputDebugString (tmp); - last_samples = asioDriverInfo.samples; - #endif - if (!theAsioStream) + if( !theAsioStream ) return 0L; // Keep sample position @@ -2893,51 +2790,57 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // protect against reentrancy - if (PaAsio_AtomicIncrement (&theAsioStream->reenterCount)) { + if( PaAsio_AtomicIncrement(&theAsioStream->reenterCount) ) + { theAsioStream->reenterError++; //DBUG(("bufferSwitchTimeInfo : reentrancy detection = %d\n", asioDriverInfo.reenterError)); return 0L; } int buffersDone = 0; - - do { - if (buffersDone > 0) { + + do + { + if( buffersDone > 0 ) + { // this is a reentered buffer, we missed processing it on time // set the input overflow and output underflow flags as appropriate - - if (theAsioStream->inputChannelCount > 0) + + if( theAsioStream->inputChannelCount > 0 ) theAsioStream->callbackFlags |= paInputOverflow; - - if (theAsioStream->outputChannelCount > 0) + + if( theAsioStream->outputChannelCount > 0 ) theAsioStream->callbackFlags |= paOutputUnderflow; - } else { - if (theAsioStream->zeroOutput) { - ZeroOutputBuffers (theAsioStream, index); + } + else + { + if( theAsioStream->zeroOutput ) + { + ZeroOutputBuffers( theAsioStream, index ); // Finally if the driver supports the ASIOOutputReady() optimization, // do it here, all data are in place - - if (theAsioStream->postOutput) + if( theAsioStream->postOutput ) ASIOOutputReady(); - if (theAsioStream->stopProcessing) { - if (theAsioStream->stopPlayoutCount < 2) { + if( theAsioStream->stopProcessing ) + { + if( theAsioStream->stopPlayoutCount < 2 ) + { ++theAsioStream->stopPlayoutCount; - - if (theAsioStream->stopPlayoutCount == 2) { + if( theAsioStream->stopPlayoutCount == 2 ) + { theAsioStream->isActive = 0; - - if (theAsioStream->streamRepresentation.streamFinishedCallback != 0) - theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData); - + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); theAsioStream->streamFinishedCallbackCalled = true; - - SetEvent (theAsioStream->completedBuffersPlayedEvent); + SetEvent( theAsioStream->completedBuffersPlayedEvent ); } } } - } else { + } + else + { #if 0 // test code to try to detect slip conditions... these may work on some systems @@ -2945,168 +2848,165 @@ static ASIOTime *bufferSwitchTimeInfo (ASIOTime *timeInfo, long index, ASIOBool // check that sample delta matches buffer size (otherwise we must have skipped // a buffer. - static double last_samples = -512; - double samples; +static double last_samples = -512; +double samples; //if( timeInfo->timeCode.flags & kTcValid ) // samples = ASIO64toDouble(timeInfo->timeCode.timeCodeSamples); //else - samples = ASIO64toDouble (timeInfo->timeInfo.samplePosition); - int delta = samples - last_samples; + samples = ASIO64toDouble(timeInfo->timeInfo.samplePosition); +int delta = samples - last_samples; //printf( "%d\n", delta); - last_samples = samples; +last_samples = samples; - if (delta > theAsioStream->framesPerHostCallback) { - if (theAsioStream->inputChannelCount > 0) - theAsioStream->callbackFlags |= paInputOverflow; +if( delta > theAsioStream->framesPerHostCallback ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; - if (theAsioStream->outputChannelCount > 0) - theAsioStream->callbackFlags |= paOutputUnderflow; - } + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} // check that the buffer index is not the previous index (which would indicate // that a buffer was skipped. - static int previousIndex = 1; - - if (index == previousIndex) { - if (theAsioStream->inputChannelCount > 0) - theAsioStream->callbackFlags |= paInputOverflow; - - if (theAsioStream->outputChannelCount > 0) - theAsioStream->callbackFlags |= paOutputUnderflow; - } - - previousIndex = index; +static int previousIndex = 1; +if( index == previousIndex ) +{ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; +} +previousIndex = index; #endif int i; - PaUtil_BeginCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer); + PaUtil_BeginCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer ); PaStreamCallbackTimeInfo paTimeInfo; // asio systemTime is supposed to be measured according to the same // clock as timeGetTime - paTimeInfo.currentTime = (ASIO64toDouble (timeInfo->timeInfo.systemTime) * .000000001); + paTimeInfo.currentTime = (ASIO64toDouble( timeInfo->timeInfo.systemTime ) * .000000001); /* patch from Paul Boege */ paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - - ( (double) theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + ((double)theAsioStream->inputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + - ( (double) theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); + ((double)theAsioStream->outputLatency/theAsioStream->streamRepresentation.streamInfo.sampleRate); /* old version is buggy because the buffer processor also adds in its latency to the time parameters paTimeInfo.inputBufferAdcTime = paTimeInfo.currentTime - theAsioStream->streamRepresentation.streamInfo.inputLatency; paTimeInfo.outputBufferDacTime = paTimeInfo.currentTime + theAsioStream->streamRepresentation.streamInfo.outputLatency; */ - /* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */ +/* Disabled! Stopping and re-starting the stream causes an input overflow / output undeflow. S.Fischer */ #if 0 // detect underflows by checking inter-callback time > 2 buffer period - static double previousTime = -1; - - if (previousTime > 0) { - - double delta = paTimeInfo.currentTime - previousTime; +static double previousTime = -1; +if( previousTime > 0 ){ - if (delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate)) { - if (theAsioStream->inputChannelCount > 0) - theAsioStream->callbackFlags |= paInputOverflow; - - if (theAsioStream->outputChannelCount > 0) - theAsioStream->callbackFlags |= paOutputUnderflow; - } - } + double delta = paTimeInfo.currentTime - previousTime; - previousTime = paTimeInfo.currentTime; + if( delta >= 2. * (theAsioStream->framesPerHostCallback / theAsioStream->streamRepresentation.streamInfo.sampleRate) ){ + if( theAsioStream->inputChannelCount > 0 ) + theAsioStream->callbackFlags |= paInputOverflow; + if( theAsioStream->outputChannelCount > 0 ) + theAsioStream->callbackFlags |= paOutputUnderflow; + } +} +previousTime = paTimeInfo.currentTime; #endif // note that the above input and output times do not need to be // adjusted for the latency of the buffer processor -- the buffer // processor handles that. - if (theAsioStream->inputBufferConverter) { - for (i=0; i<theAsioStream->inputChannelCount; i++) { - theAsioStream->inputBufferConverter (theAsioStream->inputBufferPtrs[index][i], - theAsioStream->inputShift, theAsioStream->framesPerHostCallback); + if( theAsioStream->inputBufferConverter ) + { + for( i=0; i<theAsioStream->inputChannelCount; i++ ) + { + theAsioStream->inputBufferConverter( theAsioStream->inputBufferPtrs[index][i], + theAsioStream->inputShift, theAsioStream->framesPerHostCallback ); } } - PaUtil_BeginBufferProcessing (&theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags); + PaUtil_BeginBufferProcessing( &theAsioStream->bufferProcessor, &paTimeInfo, theAsioStream->callbackFlags ); /* reset status flags once they've been passed to the callback */ theAsioStream->callbackFlags = 0; - PaUtil_SetInputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */); - - for (i=0; i<theAsioStream->inputChannelCount; ++i) - PaUtil_SetNonInterleavedInputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i]); + PaUtil_SetInputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; i<theAsioStream->inputChannelCount; ++i ) + PaUtil_SetNonInterleavedInputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->inputBufferPtrs[index][i] ); - PaUtil_SetOutputFrameCount (&theAsioStream->bufferProcessor, 0 /* default to host buffer size */); - - for (i=0; i<theAsioStream->outputChannelCount; ++i) - PaUtil_SetNonInterleavedOutputChannel (&theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i]); + PaUtil_SetOutputFrameCount( &theAsioStream->bufferProcessor, 0 /* default to host buffer size */ ); + for( i=0; i<theAsioStream->outputChannelCount; ++i ) + PaUtil_SetNonInterleavedOutputChannel( &theAsioStream->bufferProcessor, i, theAsioStream->outputBufferPtrs[index][i] ); int callbackResult; - - if (theAsioStream->stopProcessing) + if( theAsioStream->stopProcessing ) callbackResult = paComplete; else callbackResult = paContinue; - - unsigned long framesProcessed = PaUtil_EndBufferProcessing (&theAsioStream->bufferProcessor, &callbackResult); - - if (theAsioStream->outputBufferConverter) { - for (i=0; i<theAsioStream->outputChannelCount; i++) { - theAsioStream->outputBufferConverter (theAsioStream->outputBufferPtrs[index][i], - theAsioStream->outputShift, theAsioStream->framesPerHostCallback); + unsigned long framesProcessed = PaUtil_EndBufferProcessing( &theAsioStream->bufferProcessor, &callbackResult ); + + if( theAsioStream->outputBufferConverter ) + { + for( i=0; i<theAsioStream->outputChannelCount; i++ ) + { + theAsioStream->outputBufferConverter( theAsioStream->outputBufferPtrs[index][i], + theAsioStream->outputShift, theAsioStream->framesPerHostCallback ); } } - PaUtil_EndCpuLoadMeasurement (&theAsioStream->cpuLoadMeasurer, framesProcessed); + PaUtil_EndCpuLoadMeasurement( &theAsioStream->cpuLoadMeasurer, framesProcessed ); // Finally if the driver supports the ASIOOutputReady() optimization, // do it here, all data are in place - - if (theAsioStream->postOutput) + if( theAsioStream->postOutput ) ASIOOutputReady(); - if (callbackResult == paContinue) { + if( callbackResult == paContinue ) + { /* nothing special to do */ - } else if (callbackResult == paAbort) { + } + else if( callbackResult == paAbort ) + { /* finish playback immediately */ theAsioStream->isActive = 0; - - if (theAsioStream->streamRepresentation.streamFinishedCallback != 0) - theAsioStream->streamRepresentation.streamFinishedCallback (theAsioStream->streamRepresentation.userData); - + if( theAsioStream->streamRepresentation.streamFinishedCallback != 0 ) + theAsioStream->streamRepresentation.streamFinishedCallback( theAsioStream->streamRepresentation.userData ); theAsioStream->streamFinishedCallbackCalled = true; - - SetEvent (theAsioStream->completedBuffersPlayedEvent); - + SetEvent( theAsioStream->completedBuffersPlayedEvent ); theAsioStream->zeroOutput = true; - } else { /* paComplete or other non-zero value indicating complete */ + } + else /* paComplete or other non-zero value indicating complete */ + { /* Finish playback once currently queued audio has completed. */ theAsioStream->stopProcessing = true; - if (PaUtil_IsBufferProcessorOutputEmpty (&theAsioStream->bufferProcessor)) { + if( PaUtil_IsBufferProcessorOutputEmpty( &theAsioStream->bufferProcessor ) ) + { theAsioStream->zeroOutput = true; theAsioStream->stopPlayoutCount = 0; } } } } - + ++buffersDone; - } while (PaAsio_AtomicDecrement (&theAsioStream->reenterCount) >= 0); + }while( PaAsio_AtomicDecrement(&theAsioStream->reenterCount) >= 0 ); return 0L; } -static void sampleRateChanged (ASIOSampleRate sRate) +static void sampleRateChanged(ASIOSampleRate sRate) { // TAKEN FROM THE ASIO SDK // do whatever you need to do if the sample rate changed @@ -3117,10 +3017,10 @@ static void sampleRateChanged (ASIOSampleRate sRate) // You might have to update time/sample related conversion routines, etc. (void) sRate; /* unused parameter */ - PA_DEBUG ( ("sampleRateChanged : %d \n", sRate)); + PA_DEBUG( ("sampleRateChanged : %d \n", sRate)); } -static long asioMessages (long selector, long value, void* message, double* opt) +static long asioMessages(long selector, long value, void* message, double* opt) { // TAKEN FROM THE ASIO SDK // currently the parameters "value", "message" and "opt" are not used. @@ -3129,22 +3029,20 @@ static long asioMessages (long selector, long value, void* message, double* opt) (void) message; /* unused parameters */ (void) opt; - PA_DEBUG ( ("asioMessages : %d , %d \n", selector, value)); - - switch (selector) { + PA_DEBUG( ("asioMessages : %d , %d \n", selector, value)); + switch(selector) + { case kAsioSelectorSupported: - - if (value == kAsioResetRequest - || value == kAsioEngineVersion - || value == kAsioResyncRequest - || value == kAsioLatenciesChanged - // the following three were added for ASIO 2.0, you don't necessarily have to support them - || value == kAsioSupportsTimeInfo - || value == kAsioSupportsTimeCode - || value == kAsioSupportsInputMonitor) - ret = 1L; - + if(value == kAsioResetRequest + || value == kAsioEngineVersion + || value == kAsioResyncRequest + || value == kAsioLatenciesChanged + // the following three were added for ASIO 2.0, you don't necessarily have to support them + || value == kAsioSupportsTimeInfo + || value == kAsioSupportsTimeCode + || value == kAsioSupportsInputMonitor) + ret = 1L; break; case kAsioBufferSizeChange: @@ -3160,7 +3058,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) /*FIXME: commented the next line out */ //asioDriverInfo.stopped; // In this sample the processing will just stop ret = 1L; - break; case kAsioResyncRequest: @@ -3171,7 +3068,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // by another thread. // However a driver can issue it in other situations, too. ret = 1L; - break; case kAsioLatenciesChanged: @@ -3179,7 +3075,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // Beware, it this does not mean that the buffer sizes have changed! // You might need to update internal delay data. ret = 1L; - //printf("kAsioLatenciesChanged \n"); break; @@ -3188,7 +3083,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // If a host applications does not implement this selector, ASIO 1.0 is assumed // by the driver ret = 2L; - break; case kAsioSupportsTimeInfo: @@ -3197,7 +3091,6 @@ static long asioMessages (long selector, long value, void* message, double* opt) // For compatibility with ASIO 1.0 drivers the host application should always support // the "old" bufferSwitch method, too. ret = 1; - break; case kAsioSupportsTimeCode: @@ -3205,28 +3098,26 @@ static long asioMessages (long selector, long value, void* message, double* opt) // If an application does not need to know about time code, the driver has less work // to do. ret = 0; - break; } - return ret; } -static PaError StartStream (PaStream *s) +static PaError StartStream( PaStream *s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; PaAsioStreamBlockingState *blockingState = stream->blockingState; ASIOError asioError; - if (stream->outputChannelCount > 0) { - ZeroOutputBuffers (stream, 0); - ZeroOutputBuffers (stream, 1); + if( stream->outputChannelCount > 0 ) + { + ZeroOutputBuffers( stream, 0 ); + ZeroOutputBuffers( stream, 1 ); } - PaUtil_ResetBufferProcessor (&stream->bufferProcessor); - + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); stream->stopProcessing = false; stream->zeroOutput = false; @@ -3236,94 +3127,111 @@ static PaError StartStream (PaStream *s) stream->callbackFlags = 0; - if (ResetEvent (stream->completedBuffersPlayedEvent) == 0) { + if( ResetEvent( stream->completedBuffersPlayedEvent ) == 0 ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); } /* Using blocking i/o interface... */ - if (blockingState) { + if( blockingState ) + { /* Reset blocking i/o buffer processor. */ - PaUtil_ResetBufferProcessor (&blockingState->bufferProcessor); + PaUtil_ResetBufferProcessor( &blockingState->bufferProcessor ); /* If we're about to process some input data. */ - - if (stream->inputChannelCount) { + if( stream->inputChannelCount ) + { /* Reset callback-ReadStream sync event. */ - if (ResetEvent (blockingState->readFramesReadyEvent) == 0) { + if( ResetEvent( blockingState->readFramesReadyEvent ) == 0 ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); } /* Flush blocking i/o ring buffer. */ - PaUtil_FlushRingBuffer (&blockingState->readRingBuffer); - - (*blockingState->bufferProcessor.inputZeroer) (blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize); + PaUtil_FlushRingBuffer( &blockingState->readRingBuffer ); + (*blockingState->bufferProcessor.inputZeroer)( blockingState->readRingBuffer.buffer, 1, blockingState->bufferProcessor.inputChannelCount * blockingState->readRingBuffer.bufferSize ); } /* If we're about to process some output data. */ - if (stream->outputChannelCount) { + if( stream->outputChannelCount ) + { /* Reset callback-WriteStream sync event. */ - if (ResetEvent (blockingState->writeBuffersReadyEvent) == 0) { + if( ResetEvent( blockingState->writeBuffersReadyEvent ) == 0 ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); } /* Flush blocking i/o ring buffer. */ - PaUtil_FlushRingBuffer (&blockingState->writeRingBuffer); - - (*blockingState->bufferProcessor.outputZeroer) (blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize); + PaUtil_FlushRingBuffer( &blockingState->writeRingBuffer ); + (*blockingState->bufferProcessor.outputZeroer)( blockingState->writeRingBuffer.buffer, 1, blockingState->bufferProcessor.outputChannelCount * blockingState->writeRingBuffer.bufferSize ); /* Initialize the output ring buffer to "silence". */ - PaUtil_AdvanceRingBufferWriteIndex (&blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames); + PaUtil_AdvanceRingBufferWriteIndex( &blockingState->writeRingBuffer, blockingState->writeRingBufferInitialFrames ); } /* Clear requested frames / buffers count. */ blockingState->writeBuffersRequested = 0; - blockingState->readFramesRequested = 0; - blockingState->writeBuffersRequestedFlag = FALSE; - blockingState->readFramesRequestedFlag = FALSE; - blockingState->outputUnderflowFlag = FALSE; - blockingState->inputOverflowFlag = FALSE; - blockingState->stopFlag = FALSE; } - if (result == paNoError) { - theAsioStream = stream; + if( result == paNoError ) + { + assert( theAsioStream == stream ); /* theAsioStream should be set correctly in OpenStream */ + + /* initialize these variables before the callback has a chance to be invoked */ + stream->isStopped = 0; + stream->isActive = 1; + stream->streamFinishedCallbackCalled = false; + asioError = ASIOStart(); + if( asioError != ASE_OK ) + { + stream->isStopped = 1; + stream->isActive = 0; - if (asioError == ASE_OK) { - stream->isActive = 1; - stream->streamFinishedCallbackCalled = false; - } else { - theAsioStream = 0; result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); } } return result; } +static void EnsureCallbackHasCompleted( PaAsioStream *stream ) +{ + // make sure that the callback is not still in-flight after ASIOStop() + // returns. This has been observed to happen on the Hoontech DSP24 for + // example. + int count = 2000; // only wait for 2 seconds, rather than hanging. + while( stream->reenterCount != -1 && count > 0 ) + { + Sleep(1); + --count; + } +} -static PaError StopStream (PaStream *s) +static PaError StopStream( PaStream *s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; PaAsioStreamBlockingState *blockingState = stream->blockingState; ASIOError asioError; - if (stream->isActive) { + if( stream->isActive ) + { /* If blocking i/o output is in use */ - if (blockingState && stream->outputChannelCount) { + if( blockingState && stream->outputChannelCount ) + { /* Request the whole output buffer to be available. */ blockingState->writeBuffersRequested = blockingState->writeRingBuffer.bufferSize; /* Signalize that additional buffers are need. */ @@ -3334,18 +3242,20 @@ static PaError StopStream (PaStream *s) /* Wait until requested number of buffers has been freed. Time out after twice the blocking i/o ouput buffer could have been consumed. */ - DWORD timeout = (DWORD) (2 * blockingState->writeRingBuffer.bufferSize * 1000 - / stream->streamRepresentation.streamInfo.sampleRate); - DWORD waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout); + DWORD timeout = (DWORD)( 2 * blockingState->writeRingBuffer.bufferSize * 1000 + / stream->streamRepresentation.streamInfo.sampleRate ); + DWORD waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout ); /* If something seriously went wrong... */ - - if (waitResult == WAIT_FAILED) { - PA_DEBUG ( ("WaitForSingleObject() failed in StopStream()\n")); + if( waitResult == WAIT_FAILED ) + { + PA_DEBUG(("WaitForSingleObject() failed in StopStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); - } else if (waitResult == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n")); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); + } + else if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n")); result = paTimedOut; } } @@ -3359,106 +3269,97 @@ static PaError StopStream (PaStream *s) length is longer than the asio buffer size then that should be taken into account. */ - - if (WaitForSingleObject (theAsioStream->completedBuffersPlayedEvent, - (DWORD) (stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.)) - == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in StopStream()\n")); + if( WaitForSingleObject( stream->completedBuffersPlayedEvent, + (DWORD)(stream->streamRepresentation.streamInfo.outputLatency * 1000. * 4.) ) + == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in StopStream()\n" )); } } asioError = ASIOStop(); - - if (asioError != ASE_OK) { + if( asioError == ASE_OK ) + { + EnsureCallbackHasCompleted( stream ); + } + else + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); } - theAsioStream = 0; - + stream->isStopped = 1; stream->isActive = 0; - if (!stream->streamFinishedCallbackCalled) { - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); } return result; } - -static PaError AbortStream (PaStream *s) +static PaError AbortStream( PaStream *s ) { PaError result = paNoError; - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; ASIOError asioError; stream->zeroOutput = true; asioError = ASIOStop(); - - if (asioError != ASE_OK) { + if( asioError == ASE_OK ) + { + EnsureCallbackHasCompleted( stream ); + } + else + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); - } else { - // make sure that the callback is not still in-flight when ASIOStop() - // returns. This has been observed to happen on the Hoontech DSP24 for - // example. - int count = 2000; // only wait for 2 seconds, rather than hanging. - - while (theAsioStream->reenterCount != -1 && count > 0) { - Sleep (1); - --count; - } + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); } - /* it is questionable whether we should zero theAsioStream if ASIOStop() - returns an error, because the callback could still be active. We assume - not - this is based on the fact that ASIOStop is unlikely to fail - if the callback is running - it's more likely to fail because the - callback is not running. */ - - theAsioStream = 0; - + stream->isStopped = 1; stream->isActive = 0; - if (!stream->streamFinishedCallbackCalled) { - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + if( !stream->streamFinishedCallbackCalled ) + { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); } return result; } -static PaError IsStreamStopped (PaStream *s) +static PaError IsStreamStopped( PaStream *s ) { - //PaAsioStream *stream = (PaAsioStream*)s; - (void) s; /* unused parameter */ - return theAsioStream == 0; + PaAsioStream *stream = (PaAsioStream*)s; + + return stream->isStopped; } -static PaError IsStreamActive (PaStream *s) +static PaError IsStreamActive( PaStream *s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; return stream->isActive; } -static PaTime GetStreamTime (PaStream *s) +static PaTime GetStreamTime( PaStream *s ) { (void) s; /* unused parameter */ - return (double) timeGetTime() * .001; + return (double)timeGetTime() * .001; } -static double GetStreamCpuLoad (PaStream* s) +static double GetStreamCpuLoad( PaStream* s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; - return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer); + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); } @@ -3468,12 +3369,12 @@ static double GetStreamCpuLoad (PaStream* s) for blocking streams. */ -static PaError ReadStream (PaStream *s , +static PaError ReadStream( PaStream *s , void *buffer, - unsigned long frames) + unsigned long frames ) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */ + PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */ /* Pointer to the blocking i/o data struct. */ PaAsioStreamBlockingState *blockingState = stream->blockingState; @@ -3502,44 +3403,45 @@ static PaError ReadStream (PaStream *s , unsigned int i; /* Just a counter. */ /* About the time, needed to process 8 data blocks. */ - DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate); + DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate ); DWORD waitResult = 0; /* Check if the stream is still available ready to gather new data. */ - - if (blockingState->stopFlag || !stream->isActive) { - PA_DEBUG ( ("Warning! Stream no longer available for reading in ReadStream()\n")); + if( blockingState->stopFlag || !stream->isActive ) + { + PA_DEBUG(("Warning! Stream no longer available for reading in ReadStream()\n")); result = paStreamIsStopped; return result; } /* If the stream is a input stream. */ - if (stream->inputChannelCount) { + if( stream->inputChannelCount ) + { /* Prepare buffer access. */ - if (!pBp->userOutputIsInterleaved) { + if( !pBp->userOutputIsInterleaved ) + { userBuffer = blockingState->readStreamBuffer; - - for (i = 0; i<pBp->inputChannelCount; ++i) { - ( (void**) userBuffer) [i] = ( (void**) buffer) [i]; + for( i = 0; i<pBp->inputChannelCount; ++i ) + { + ((void**)userBuffer)[i] = ((void**)buffer)[i]; } } /* Use the unchanged buffer. */ - else { - userBuffer = buffer; - } + else { userBuffer = buffer; } - do { /* Internal block processing for too large user data buffers. */ + do /* Internal block processing for too large user data buffers. */ + { /* Get the size of the current data block to be processed. */ - lFramesPerBlock = (lFramesPerBlock < lFramesRemaining) - ? lFramesPerBlock : lFramesRemaining; + lFramesPerBlock =(lFramesPerBlock < lFramesRemaining) + ? lFramesPerBlock : lFramesRemaining; /* Use predefined block size for as long there are enough buffers available, thereafter reduce the processing block size to match the number of remaining buffers. So the final data block is processed although it may be incomplete. */ /* If the available amount of data frames is insufficient. */ - - if (PaUtil_GetRingBufferReadAvailable (pRb) < (long) lFramesPerBlock) { + if( PaUtil_GetRingBufferReadAvailable(pRb) < (long) lFramesPerBlock ) + { /* Make sure, the event isn't already set! */ /* ResetEvent( blockingState->readFramesReadyEvent ); */ @@ -3550,33 +3452,27 @@ static PaError ReadStream (PaStream *s , blockingState->readFramesRequestedFlag = TRUE; /* Wait until requested number of buffers has been freed. */ - waitResult = WaitForSingleObject (blockingState->readFramesReadyEvent, timeout); + waitResult = WaitForSingleObject( blockingState->readFramesReadyEvent, timeout ); /* If something seriously went wrong... */ - - if (waitResult == WAIT_FAILED) { - PA_DEBUG ( ("WaitForSingleObject() failed in ReadStream()\n")); + if( waitResult == WAIT_FAILED ) + { + PA_DEBUG(("WaitForSingleObject() failed in ReadStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); return result; - } else if (waitResult == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in ReadStream()\n")); + } + else if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in ReadStream()\n")); /* If block processing has stopped, abort! */ + if( blockingState->stopFlag ) { return result = paStreamIsStopped; } - if (blockingState->stopFlag) { - return result = paStreamIsStopped; - } - - /* if a timeout is encountered, continue, perhaps we should give up eventually */ - continue; - - /* To give up eventually, we may increase the time out - period and return an error if it fails anyway. */ - /* retrun result = paTimedOut; */ + /* If a timeout is encountered, give up eventually. */ + return result = paTimedOut; } } - /* Now, the ring buffer contains the required amount of data frames. (Therefor we don't need to check the return argument of @@ -3589,48 +3485,47 @@ static PaError ReadStream (PaStream *s , segment is returned. Otherwise, i.e. if the first segment is large enough, the second segment's pointer will be NULL. */ - PaUtil_GetRingBufferReadRegions (pRb , - lFramesPerBlock , - &pRingBufferData1st, - &lRingBufferSize1st, - &pRingBufferData2nd, - &lRingBufferSize2nd); + PaUtil_GetRingBufferReadRegions(pRb , + lFramesPerBlock , + &pRingBufferData1st, + &lRingBufferSize1st, + &pRingBufferData2nd, + &lRingBufferSize2nd); /* Set number of frames to be copied from the ring buffer. */ - PaUtil_SetInputFrameCount (pBp, lRingBufferSize1st); - + PaUtil_SetInputFrameCount( pBp, lRingBufferSize1st ); /* Setup ring buffer access. */ - PaUtil_SetInterleavedInputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData1st, /* First ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_SetInterleavedInputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData1st, /* First ring buffer segment. */ + 0 ); /* Use all available channels. */ /* If a second ring buffer segment is required. */ - if (lRingBufferSize2nd) { + if( lRingBufferSize2nd ) { /* Set number of frames to be copied from the ring buffer. */ - PaUtil_Set2ndInputFrameCount (pBp, lRingBufferSize2nd); + PaUtil_Set2ndInputFrameCount( pBp, lRingBufferSize2nd ); /* Setup ring buffer access. */ - PaUtil_Set2ndInterleavedInputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData2nd, /* Second ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_Set2ndInterleavedInputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData2nd, /* Second ring buffer segment. */ + 0 ); /* Use all available channels. */ } /* Let the buffer processor handle "copy and conversion" and update the ring buffer indices manually. */ - lFramesCopied = PaUtil_CopyInput (pBp, &buffer, lFramesPerBlock); - - PaUtil_AdvanceRingBufferReadIndex (pRb, lFramesCopied); + lFramesCopied = PaUtil_CopyInput( pBp, &buffer, lFramesPerBlock ); + PaUtil_AdvanceRingBufferReadIndex( pRb, lFramesCopied ); /* Decrease number of unprocessed frames. */ lFramesRemaining -= lFramesCopied; } /* Continue with the next data chunk. */ - while (lFramesRemaining); + while( lFramesRemaining ); /* If there has been an input overflow within the callback */ - if (blockingState->inputOverflowFlag) { + if( blockingState->inputOverflowFlag ) + { blockingState->inputOverflowFlag = FALSE; /* Return the corresponding error code. */ @@ -3645,12 +3540,12 @@ static PaError ReadStream (PaStream *s , return result; } -static PaError WriteStream (PaStream *s , +static PaError WriteStream( PaStream *s , const void *buffer, - unsigned long frames) + unsigned long frames ) { PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = (PaAsioStream*) s; /* The PA ASIO stream. */ + PaAsioStream *stream = (PaAsioStream*)s; /* The PA ASIO stream. */ /* Pointer to the blocking i/o data struct. */ PaAsioStreamBlockingState *blockingState = stream->blockingState; @@ -3675,7 +3570,7 @@ static PaError WriteStream (PaStream *s , unsigned long lFramesRemaining = frames; /* About the time, needed to process 8 data blocks. */ - DWORD timeout = (DWORD) (8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate); + DWORD timeout = (DWORD)( 8 * lFramesPerBlock * 1000 / stream->streamRepresentation.streamInfo.sampleRate ); DWORD waitResult = 0; /* Copy the input argument to avoid pointer increment! */ @@ -3684,40 +3579,41 @@ static PaError WriteStream (PaStream *s , /* Check if the stream ist still available ready to recieve new data. */ - - if (blockingState->stopFlag || !stream->isActive) { - PA_DEBUG ( ("Warning! Stream no longer available for writing in WriteStream()\n")); + if( blockingState->stopFlag || !stream->isActive ) + { + PA_DEBUG(("Warning! Stream no longer available for writing in WriteStream()\n")); result = paStreamIsStopped; return result; } /* If the stream is a output stream. */ - if (stream->outputChannelCount) { + if( stream->outputChannelCount ) + { /* Prepare buffer access. */ - if (!pBp->userOutputIsInterleaved) { + if( !pBp->userOutputIsInterleaved ) + { userBuffer = blockingState->writeStreamBuffer; - - for (i = 0; i<pBp->outputChannelCount; ++i) { - ( (const void**) userBuffer) [i] = ( (const void**) buffer) [i]; + for( i = 0; i<pBp->outputChannelCount; ++i ) + { + ((const void**)userBuffer)[i] = ((const void**)buffer)[i]; } } /* Use the unchanged buffer. */ - else { - userBuffer = buffer; - } + else { userBuffer = buffer; } - do { /* Internal block processing for too large user data buffers. */ + do /* Internal block processing for too large user data buffers. */ + { /* Get the size of the current data block to be processed. */ - lFramesPerBlock = (lFramesPerBlock < lFramesRemaining) - ? lFramesPerBlock : lFramesRemaining; + lFramesPerBlock =(lFramesPerBlock < lFramesRemaining) + ? lFramesPerBlock : lFramesRemaining; /* Use predefined block size for as long there are enough frames available, thereafter reduce the processing block size to match the number of remaining frames. So the final data block is processed although it may be incomplete. */ /* If the available amount of buffers is insufficient. */ - - if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) lFramesPerBlock) { + if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) lFramesPerBlock ) + { /* Make sure, the event isn't already set! */ /* ResetEvent( blockingState->writeBuffersReadyEvent ); */ @@ -3728,33 +3624,27 @@ static PaError WriteStream (PaStream *s , blockingState->writeBuffersRequestedFlag = TRUE; /* Wait until requested number of buffers has been freed. */ - waitResult = WaitForSingleObject (blockingState->writeBuffersReadyEvent, timeout); + waitResult = WaitForSingleObject( blockingState->writeBuffersReadyEvent, timeout ); /* If something seriously went wrong... */ - - if (waitResult == WAIT_FAILED) { - PA_DEBUG ( ("WaitForSingleObject() failed in WriteStream()\n")); + if( waitResult == WAIT_FAILED ) + { + PA_DEBUG(("WaitForSingleObject() failed in WriteStream()\n")); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_SYSTEM_ERROR (GetLastError()); + PA_ASIO_SET_LAST_SYSTEM_ERROR( GetLastError() ); return result; - } else if (waitResult == WAIT_TIMEOUT) { - PA_DEBUG ( ("WaitForSingleObject() timed out in WriteStream()\n")); + } + else if( waitResult == WAIT_TIMEOUT ) + { + PA_DEBUG(("WaitForSingleObject() timed out in WriteStream()\n")); /* If block processing has stopped, abort! */ - - if (blockingState->stopFlag) { - return result = paStreamIsStopped; - } - - /* if a timeout is encountered, continue, perhaps we should give up eventually */ - continue; - - /* To give up eventually, we may increase the time out - period and return an error if it fails anyway. */ - /* retrun result = paTimedOut; */ + if( blockingState->stopFlag ) { return result = paStreamIsStopped; } + + /* If a timeout is encountered, give up eventually. */ + return result = paTimedOut; } } - /* Now, the ring buffer contains the required amount of free space to store the provided number of data frames. (Therefor we don't need to check the return argument of @@ -3767,48 +3657,47 @@ static PaError WriteStream (PaStream *s , segment is returned. Otherwise, i.e. if the first segment is large enough, the second segment's pointer will be NULL. */ - PaUtil_GetRingBufferWriteRegions (pRb , - lFramesPerBlock , - &pRingBufferData1st, - &lRingBufferSize1st, - &pRingBufferData2nd, - &lRingBufferSize2nd); + PaUtil_GetRingBufferWriteRegions(pRb , + lFramesPerBlock , + &pRingBufferData1st, + &lRingBufferSize1st, + &pRingBufferData2nd, + &lRingBufferSize2nd); /* Set number of frames to be copied to the ring buffer. */ - PaUtil_SetOutputFrameCount (pBp, lRingBufferSize1st); - + PaUtil_SetOutputFrameCount( pBp, lRingBufferSize1st ); /* Setup ring buffer access. */ - PaUtil_SetInterleavedOutputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData1st, /* First ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_SetInterleavedOutputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData1st, /* First ring buffer segment. */ + 0 ); /* Use all available channels. */ /* If a second ring buffer segment is required. */ - if (lRingBufferSize2nd) { + if( lRingBufferSize2nd ) { /* Set number of frames to be copied to the ring buffer. */ - PaUtil_Set2ndOutputFrameCount (pBp, lRingBufferSize2nd); + PaUtil_Set2ndOutputFrameCount( pBp, lRingBufferSize2nd ); /* Setup ring buffer access. */ - PaUtil_Set2ndInterleavedOutputChannels (pBp , /* Buffer processor. */ - 0 , /* The first channel's index. */ - pRingBufferData2nd, /* Second ring buffer segment. */ - 0); /* Use all available channels. */ + PaUtil_Set2ndInterleavedOutputChannels(pBp , /* Buffer processor. */ + 0 , /* The first channel's index. */ + pRingBufferData2nd, /* Second ring buffer segment. */ + 0 ); /* Use all available channels. */ } /* Let the buffer processor handle "copy and conversion" and update the ring buffer indices manually. */ - lFramesCopied = PaUtil_CopyOutput (pBp, &userBuffer, lFramesPerBlock); - - PaUtil_AdvanceRingBufferWriteIndex (pRb, lFramesCopied); + lFramesCopied = PaUtil_CopyOutput( pBp, &userBuffer, lFramesPerBlock ); + PaUtil_AdvanceRingBufferWriteIndex( pRb, lFramesCopied ); /* Decrease number of unprocessed frames. */ lFramesRemaining -= lFramesCopied; } /* Continue with the next data chunk. */ - while (lFramesRemaining); + while( lFramesRemaining ); /* If there has been an output underflow within the callback */ - if (blockingState->outputUnderflowFlag) { + if( blockingState->outputUnderflowFlag ) + { blockingState->outputUnderflowFlag = FALSE; /* Return the corresponding error code. */ @@ -3816,7 +3705,8 @@ static PaError WriteStream (PaStream *s , } } /* If this is not an output stream. */ - else { + else + { result = paCanNotWriteToAnInputOnlyStream; } @@ -3824,25 +3714,137 @@ static PaError WriteStream (PaStream *s , } -static signed long GetStreamReadAvailable (PaStream* s) +static signed long GetStreamReadAvailable( PaStream* s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; /* Call buffer utility routine to get the number of available frames. */ - return PaUtil_GetRingBufferReadAvailable (&stream->blockingState->readRingBuffer); + return PaUtil_GetRingBufferReadAvailable( &stream->blockingState->readRingBuffer ); } -static signed long GetStreamWriteAvailable (PaStream* s) +static signed long GetStreamWriteAvailable( PaStream* s ) { - PaAsioStream *stream = (PaAsioStream*) s; + PaAsioStream *stream = (PaAsioStream*)s; /* Call buffer utility routine to get the number of empty buffers. */ - return PaUtil_GetRingBufferWriteAvailable (&stream->blockingState->writeRingBuffer); + return PaUtil_GetRingBufferWriteAvailable( &stream->blockingState->writeRingBuffer ); } -PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) +/* This routine will be called by the PortAudio engine when audio is needed. +** It may called at interrupt level on some machines so don't do anything +** that could mess up the system like calling malloc() or free(). +*/ +static int BlockingIoPaCallback(const void *inputBuffer , + void *outputBuffer , + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo *timeInfo , + PaStreamCallbackFlags statusFlags , + void *userData ) +{ + PaError result = paNoError; /* Initial return value. */ + PaAsioStream *stream = *(PaAsioStream**)userData; /* The PA ASIO stream. */ + PaAsioStreamBlockingState *blockingState = stream->blockingState; /* Persume blockingState is valid, otherwise the callback wouldn't be running. */ + + /* Get a pointer to the stream's blocking i/o buffer processor. */ + PaUtilBufferProcessor *pBp = &blockingState->bufferProcessor; + PaUtilRingBuffer *pRb = NULL; + + /* If output data has been requested. */ + if( stream->outputChannelCount ) + { + /* If the callback input argument signalizes a output underflow, + make sure the WriteStream() function knows about it, too! */ + if( statusFlags & paOutputUnderflowed ) { + blockingState->outputUnderflowFlag = TRUE; + } + + /* Access the corresponding ring buffer. */ + pRb = &blockingState->writeRingBuffer; + + /* If the blocking i/o buffer contains enough output data, */ + if( PaUtil_GetRingBufferReadAvailable(pRb) >= (long) framesPerBuffer ) + { + /* Extract the requested data from the ring buffer. */ + PaUtil_ReadRingBuffer( pRb, outputBuffer, framesPerBuffer ); + } + else /* If no output data is available :-( */ + { + /* Signalize a write-buffer underflow. */ + blockingState->outputUnderflowFlag = TRUE; + + /* Fill the output buffer with silence. */ + (*pBp->outputZeroer)( outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer ); + + /* If playback is to be stopped */ + if( blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable(pRb) < (long) framesPerBuffer ) + { + /* Extract all the remaining data from the ring buffer, + whether it is a complete data block or not. */ + PaUtil_ReadRingBuffer( pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable(pRb) ); + } + } + + /* Set blocking i/o event? */ + if( blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable(pRb) >= (long) blockingState->writeBuffersRequested ) + { + /* Reset buffer request. */ + blockingState->writeBuffersRequestedFlag = FALSE; + blockingState->writeBuffersRequested = 0; + /* Signalize that requested buffers are ready. */ + SetEvent( blockingState->writeBuffersReadyEvent ); + /* What do we do if SetEvent() returns zero, i.e. the event + could not be set? How to return errors from within the + callback? - S.Fischer */ + } + } + + /* If input data has been supplied. */ + if( stream->inputChannelCount ) + { + /* If the callback input argument signalizes a input overflow, + make sure the ReadStream() function knows about it, too! */ + if( statusFlags & paInputOverflowed ) { + blockingState->inputOverflowFlag = TRUE; + } + + /* Access the corresponding ring buffer. */ + pRb = &blockingState->readRingBuffer; + + /* If the blocking i/o buffer contains not enough input buffers */ + if( PaUtil_GetRingBufferWriteAvailable(pRb) < (long) framesPerBuffer ) + { + /* Signalize a read-buffer overflow. */ + blockingState->inputOverflowFlag = TRUE; + + /* Remove some old data frames from the buffer. */ + PaUtil_AdvanceRingBufferReadIndex( pRb, framesPerBuffer ); + } + + /* Insert the current input data into the ring buffer. */ + PaUtil_WriteRingBuffer( pRb, inputBuffer, framesPerBuffer ); + + /* Set blocking i/o event? */ + if( blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable(pRb) >= (long) blockingState->readFramesRequested ) + { + /* Reset buffer request. */ + blockingState->readFramesRequestedFlag = FALSE; + blockingState->readFramesRequested = 0; + /* Signalize that requested buffers are ready. */ + SetEvent( blockingState->readFramesReadyEvent ); + /* What do we do if SetEvent() returns zero, i.e. the event + could not be set? How to return errors from within the + callback? - S.Fischer */ + /** @todo report an error with PA_DEBUG */ + } + } + + return paContinue; +} + + +PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific ) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3854,14 +3856,12 @@ PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - - if (result != paNoError) + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - - if (result != paNoError) + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) goto error; /* @@ -3872,87 +3872,84 @@ PaError PaAsio_ShowControlPanel (PaDeviceIndex device, void* systemSpecific) done safely while a stream is open. */ - asioHostApi = (PaAsioHostApiRepresentation*) hostApi; - - if (asioHostApi->openAsioDeviceIndex != paNoDevice) { + asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + if( asioHostApi->openAsioDeviceIndex != paNoDevice ) + { result = paDeviceUnavailable; goto error; } - asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; /* See notes about CoInitialize(0) in LoadAsioDriver(). */ - CoInitialize (0); + CoInitialize(0); - if (!asioHostApi->asioDrivers->loadDriver (const_cast<char*> (asioDeviceInfo->commonDeviceInfo.name))) { + if( !asioHostApi->asioDrivers->loadDriver( const_cast<char*>(asioDeviceInfo->commonDeviceInfo.name) ) ) + { result = paUnanticipatedHostError; goto error; } /* CRUCIAL!!! */ - memset (&asioDriverInfo, 0, sizeof (ASIODriverInfo)); - + memset( &asioDriverInfo, 0, sizeof(ASIODriverInfo) ); asioDriverInfo.asioVersion = 2; - asioDriverInfo.sysRef = systemSpecific; - - asioError = ASIOInit (&asioDriverInfo); - - if (asioError != ASE_OK) { + asioError = ASIOInit( &asioDriverInfo ); + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; - } else { + } + else + { asioIsInitialized = 1; } - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText (asioError))); - - PA_DEBUG ( ("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion)); - PA_DEBUG ( ("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion)); - PA_DEBUG ( ("Name: ASIOInit(): %s\n", asioDriverInfo.name)); - PA_DEBUG ( ("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage)); +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOInit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); +PA_DEBUG(("asioVersion: ASIOInit(): %ld\n", asioDriverInfo.asioVersion )); +PA_DEBUG(("driverVersion: ASIOInit(): %ld\n", asioDriverInfo.driverVersion )); +PA_DEBUG(("Name: ASIOInit(): %s\n", asioDriverInfo.name )); +PA_DEBUG(("ErrorMessage: ASIOInit(): %s\n", asioDriverInfo.errorMessage )); asioError = ASIOControlPanel(); - - if (asioError != ASE_OK) { - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError))); + if( asioError != ASE_OK ) + { + PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); goto error; } - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText (asioError))); +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOControlPanel(): %s\n", PaAsio_GetAsioErrorText(asioError) )); asioError = ASIOExit(); - - if (asioError != ASE_OK) { + if( asioError != ASE_OK ) + { result = paUnanticipatedHostError; - PA_ASIO_SET_LAST_ASIO_ERROR (asioError); + PA_ASIO_SET_LAST_ASIO_ERROR( asioError ); asioIsInitialized = 0; goto error; } - CoUninitialize(); - - PA_DEBUG ( ("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText (asioError))); + CoUninitialize(); +PA_DEBUG(("PaAsio_ShowControlPanel: ASIOExit(): %s\n", PaAsio_GetAsioErrorText(asioError) )); return result; error: - - if (asioIsInitialized) { - ASIOExit(); - } - - CoUninitialize(); + if( asioIsInitialized ) + { + ASIOExit(); + } + CoUninitialize(); return result; } -PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, - const char** channelName) +PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3960,19 +3957,17 @@ PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - - if (result != paNoError) + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - - if (result != paNoError) + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) goto error; - asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; - if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels) { + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxInputChannels ){ result = paInvalidChannelCount; goto error; } @@ -3980,14 +3975,14 @@ PaError PaAsio_GetInputChannelName (PaDeviceIndex device, int channelIndex, *channelName = asioDeviceInfo->asioChannelInfos[channelIndex].name; return paNoError; - + error: return result; } -PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex, - const char** channelName) +PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex, + const char** channelName ) { PaError result = paNoError; PaUtilHostApiRepresentation *hostApi; @@ -3995,140 +3990,76 @@ PaError PaAsio_GetOutputChannelName (PaDeviceIndex device, int channelIndex, PaAsioDeviceInfo *asioDeviceInfo; - result = PaUtil_GetHostApiRepresentation (&hostApi, paASIO); - - if (result != paNoError) + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) goto error; - result = PaUtil_DeviceIndexToHostApiDeviceIndex (&hostApiDevice, device, hostApi); - - if (result != paNoError) + result = PaUtil_DeviceIndexToHostApiDeviceIndex( &hostApiDevice, device, hostApi ); + if( result != paNoError ) goto error; - asioDeviceInfo = (PaAsioDeviceInfo*) hostApi->deviceInfos[hostApiDevice]; + asioDeviceInfo = (PaAsioDeviceInfo*)hostApi->deviceInfos[hostApiDevice]; - if (channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels) { + if( channelIndex < 0 || channelIndex >= asioDeviceInfo->commonDeviceInfo.maxOutputChannels ){ result = paInvalidChannelCount; goto error; } *channelName = asioDeviceInfo->asioChannelInfos[ - - asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; + asioDeviceInfo->commonDeviceInfo.maxInputChannels + channelIndex].name; return paNoError; - + error: return result; } - - - - - - -/* This routine will be called by the PortAudio engine when audio is needed. -** It may called at interrupt level on some machines so don't do anything -** that could mess up the system like calling malloc() or free(). +/* NOTE: the following functions are ASIO-stream specific, and are called directly + by client code. We need to check for many more error conditions here because + we don't have the benefit of pa_front.c's parameter checking. */ -static int BlockingIoPaCallback (const void *inputBuffer , - void *outputBuffer , - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo *timeInfo , - PaStreamCallbackFlags statusFlags , - void *userData) -{ - PaError result = paNoError; /* Initial return value. */ - PaAsioStream *stream = * (PaAsioStream**) userData; /* The PA ASIO stream. */ /* This is a pointer to "theAsioStream", see OpenStream(). */ - PaAsioStreamBlockingState *blockingState = stream->blockingState; /* Persume blockingState is valid, otherwise the callback wouldn't be running. */ - - /* Get a pointer to the stream's blocking i/o buffer processor. */ - PaUtilBufferProcessor *pBp = &blockingState->bufferProcessor; - PaUtilRingBuffer *pRb = NULL; - - /* If output data has been requested. */ - if (stream->outputChannelCount) { - /* If the callback input argument signalizes a output underflow, - make sure the WriteStream() function knows about it, too! */ - if (statusFlags & paOutputUnderflowed) { - blockingState->outputUnderflowFlag = TRUE; - } - - /* Access the corresponding ring buffer. */ - pRb = &blockingState->writeRingBuffer; - - /* If the blocking i/o buffer contains enough output data, */ - if (PaUtil_GetRingBufferReadAvailable (pRb) >= (long) framesPerBuffer) { - /* Extract the requested data from the ring buffer. */ - PaUtil_ReadRingBuffer (pRb, outputBuffer, framesPerBuffer); - } else { /* If no output data is available :-( */ - /* Signalize a write-buffer underflow. */ - blockingState->outputUnderflowFlag = TRUE; - - /* Fill the output buffer with silence. */ - (*pBp->outputZeroer) (outputBuffer, 1, pBp->outputChannelCount * framesPerBuffer); - - /* If playback is to be stopped */ +static PaError GetAsioStreamPointer( PaAsioStream **stream, PaStream *s ) +{ + PaError result; + PaUtilHostApiRepresentation *hostApi; + PaAsioHostApiRepresentation *asioHostApi; + + result = PaUtil_ValidateStreamPointer( s ); + if( result != paNoError ) + return result; - if (blockingState->stopFlag && PaUtil_GetRingBufferReadAvailable (pRb) < (long) framesPerBuffer) { - /* Extract all the remaining data from the ring buffer, - whether it is a complete data block or not. */ - PaUtil_ReadRingBuffer (pRb, outputBuffer, PaUtil_GetRingBufferReadAvailable (pRb)); - } - } + result = PaUtil_GetHostApiRepresentation( &hostApi, paASIO ); + if( result != paNoError ) + return result; - /* Set blocking i/o event? */ - if (blockingState->writeBuffersRequestedFlag && PaUtil_GetRingBufferWriteAvailable (pRb) >= (long) blockingState->writeBuffersRequested) { - /* Reset buffer request. */ - blockingState->writeBuffersRequestedFlag = FALSE; - blockingState->writeBuffersRequested = 0; - /* Signalize that requested buffers are ready. */ - SetEvent (blockingState->writeBuffersReadyEvent); - /* What do we do if SetEvent() returns zero, i.e. the event - could not be set? How to return errors from within the - callback? - S.Fischer */ - } + asioHostApi = (PaAsioHostApiRepresentation*)hostApi; + + if( PA_STREAM_REP( s )->streamInterface == &asioHostApi->callbackStreamInterface + || PA_STREAM_REP( s )->streamInterface == &asioHostApi->blockingStreamInterface ) + { + /* s is an ASIO stream */ + *stream = (PaAsioStream *)s; + return paNoError; } + else + { + return paIncompatibleStreamHostApi; + } +} - /* If input data has been supplied. */ - if (stream->inputChannelCount) { - /* If the callback input argument signalizes a input overflow, - make sure the ReadStream() function knows about it, too! */ - if (statusFlags & paInputOverflowed) { - blockingState->inputOverflowFlag = TRUE; - } - - /* Access the corresponding ring buffer. */ - pRb = &blockingState->readRingBuffer; - - /* If the blocking i/o buffer contains not enough input buffers */ - if (PaUtil_GetRingBufferWriteAvailable (pRb) < (long) framesPerBuffer) { - /* Signalize a read-buffer overflow. */ - blockingState->inputOverflowFlag = TRUE; - - /* Remove some old data frames from the buffer. */ - PaUtil_AdvanceRingBufferReadIndex (pRb, framesPerBuffer); - } - /* Insert the current input data into the ring buffer. */ - PaUtil_WriteRingBuffer (pRb, inputBuffer, framesPerBuffer); +PaError PaAsio_SetStreamSampleRate( PaStream* s, double sampleRate ) +{ + PaAsioStream *stream; + PaError result = GetAsioStreamPointer( &stream, s ); + if( result != paNoError ) + return result; - /* Set blocking i/o event? */ - if (blockingState->readFramesRequestedFlag && PaUtil_GetRingBufferReadAvailable (pRb) >= (long) blockingState->readFramesRequested) { - /* Reset buffer request. */ - blockingState->readFramesRequestedFlag = FALSE; - blockingState->readFramesRequested = 0; - /* Signalize that requested buffers are ready. */ - SetEvent (blockingState->readFramesReadyEvent); - /* What do we do if SetEvent() returns zero, i.e. the event - could not be set? How to return errors from within the - callback? - S.Fischer */ - /** @todo report an error with PA_DEBUG */ - } - } + if( stream != theAsioStream ) + return paBadStreamPtr; - return paContinue; + return ValidateAndSetSampleRate( sampleRate ); } + diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c index 98cfbb518c2d4aadbb1591c7219de0c3bb471c50..0da5dc5b7d41828e38238b77ab3fe5771d89b2ee 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c @@ -1714,19 +1714,19 @@ static OSStatus ringBufferIOProc( AudioConverterRef inAudioConverter, void*inUserData ) { void *dummyData; - long dummySize; + ring_buffer_size_t dummySize; PaUtilRingBuffer *rb = (PaUtilRingBuffer *) inUserData; VVDBUG(("ringBufferIOProc()\n")); - assert( sizeof( UInt32 ) == sizeof( long ) ); if( PaUtil_GetRingBufferReadAvailable( rb ) == 0 ) { *outData = NULL; *ioDataSize = 0; return RING_BUFFER_EMPTY; } + assert(sizeof(UInt32) == sizeof(ring_buffer_size_t)); PaUtil_GetRingBufferReadRegions( rb, *ioDataSize, - outData, (long *)ioDataSize, + outData, (ring_buffer_size_t *)ioDataSize, &dummyData, &dummySize ); assert( *ioDataSize ); @@ -1938,7 +1938,7 @@ static OSStatus AudioIOProc( void *inRefCon, because we have to do a little buffer processing that the AudioConverter would otherwise handle for us. */ void *data1, *data2; - long size1, size2; + ring_buffer_size_t size1, size2; PaUtil_GetRingBufferReadRegions( &stream->inputRingBuffer, inChan*frames*flsz, &data1, &size1, diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c index d858c6219b81170892afc72c547cdb3134deca23..6d31a713dba7bab4968421c1d71f0b97ccb15565 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c @@ -577,7 +577,7 @@ signed long GetStreamReadAvailable( PaStream* stream ) VVDBUG(("GetStreamReadAvailable()\n")); return PaUtil_GetRingBufferReadAvailable( &blio->inputRingBuffer ) - / ( blio->outputSampleSizeActual * blio->outChan ); + / ( blio->inputSampleSizeActual * blio->inChan ); } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h index 291304c7e3c6f704edfb2b568a2d603b605e7c94..1797cbafd4375ca316fae2e2a3ba34019f8123fe 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h @@ -61,10 +61,11 @@ #ifndef PA_MAC_CORE_INTERNAL_H__ #define PA_MAC_CORE_INTERNAL_H__ +#include <CoreAudio/CoreAudio.h> +#include <CoreServices/CoreServices.h> #include <AudioUnit/AudioUnit.h> #include <AudioToolbox/AudioToolbox.h> - #include "portaudio.h" #include "pa_util.h" #include "pa_hostapi.h" diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c index 5bc592e86e163c10daa7837daaaba9308bf5868d..b58b82202281f2541a8ce9176eb3964ee2a6af73 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c @@ -61,6 +61,7 @@ #include <libkern/OSAtomic.h> #include <strings.h> #include <pthread.h> +#include <sys/time.h> PaError PaMacCore_SetUnixError( int err, int line ) { @@ -305,8 +306,13 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters, /* * Durring testing of core audio, I found that serious crashes could occur * if properties such as sample rate were changed multiple times in rapid - * succession. The function below has some fancy logic to make sure that changes - * are acknowledged before another is requested. That seems to help a lot. + * succession. The function below could be used to with a condition variable. + * to prevent propertychanges from happening until the last property + * change is acknowledged. Instead, I implemented a busy-wait, which is simpler + * to implement b/c in second round of testing (nov '09) property changes occured + * quickly and so there was no real way to test the condition variable implementation. + * therefore, this function is not used, but it is aluded to in commented code below, + * since it represents a theoretically better implementation. */ OSStatus propertyProc( @@ -316,9 +322,7 @@ OSStatus propertyProc( AudioDevicePropertyID inPropertyID, void* inClientData ) { - MutexAndBool *mab = (MutexAndBool *) inClientData; - mab->once = TRUE; - pthread_mutex_unlock( &(mab->mutex) ); + // this is where we would set the condition variable return noErr; } @@ -326,7 +330,11 @@ OSStatus propertyProc( be acknowledged, and returns the final value, which is not guaranteed by this function to be the same as the desired value. Obviously, this function can only be used for data whose input and output are the - same size and format, and their size and format are known in advance.*/ + same size and format, and their size and format are known in advance. + whether or not the call succeeds, if the data is successfully read, + it is returned in outPropertyData. If it is not read successfully, + outPropertyData is zeroed, which may or may not be useful in + determining if the property was read. */ PaError AudioDeviceSetPropertyNowAndWaitForChange( AudioDeviceID inDevice, UInt32 inChannel, @@ -337,83 +345,72 @@ PaError AudioDeviceSetPropertyNowAndWaitForChange( void *outPropertyData ) { OSStatus macErr; - int unixErr; - MutexAndBool mab; UInt32 outPropertyDataSize = inPropertyDataSize; /* First, see if it already has that value. If so, return. */ macErr = AudioDeviceGetProperty( inDevice, inChannel, isInput, inPropertyID, &outPropertyDataSize, outPropertyData ); - if( macErr ) - goto failMac2; + if( macErr ) { + memset( outPropertyData, 0, inPropertyDataSize ); + goto failMac; + } if( inPropertyDataSize!=outPropertyDataSize ) return paInternalError; if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) return paNoError; - /* setup and lock mutex */ - mab.once = FALSE; - unixErr = pthread_mutex_init( &mab.mutex, NULL ); - if( unixErr ) - goto failUnix2; - unixErr = pthread_mutex_lock( &mab.mutex ); - if( unixErr ) - goto failUnix; + /* Ideally, we'd use a condition variable to determine changes. + we could set that up here. */ - /* add property listener */ + /* If we were using a cond variable, we'd do something useful here, + but for now, this is just to make 10.6 happy. */ macErr = AudioDeviceAddPropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc, - &mab ); + NULL ); if( macErr ) + /* we couldn't add a listener. */ goto failMac; + /* set property */ macErr = AudioDeviceSetProperty( inDevice, NULL, inChannel, isInput, inPropertyID, inPropertyDataSize, inPropertyData ); - if( macErr ) { - /* we couldn't set the property, so we'll just unlock the mutex - and move on. */ - pthread_mutex_unlock( &mab.mutex ); - } - - /* wait for property to change */ - unixErr = pthread_mutex_lock( &mab.mutex ); - if( unixErr ) - goto failUnix; - - /* now read the property back out */ - macErr = AudioDeviceGetProperty( inDevice, inChannel, - isInput, inPropertyID, - &outPropertyDataSize, outPropertyData ); if( macErr ) goto failMac; - /* cleanup */ - AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, - inPropertyID, propertyProc ); - unixErr = pthread_mutex_unlock( &mab.mutex ); - if( unixErr ) - goto failUnix2; - unixErr = pthread_mutex_destroy( &mab.mutex ); - if( unixErr ) - goto failUnix2; + /* busy-wait up to 30 seconds for the property to change */ + /* busy-wait is justified here only because the correct alternative (condition variable) + was hard to test, since most of the waiting ended up being for setting rather than + getting in OS X 10.5. This was not the case in earlier OS versions. */ + struct timeval tv1, tv2; + gettimeofday( &tv1, NULL ); + memcpy( &tv2, &tv1, sizeof( struct timeval ) ); + while( tv2.tv_sec - tv1.tv_sec < 30 ) { + /* now read the property back out */ + macErr = AudioDeviceGetProperty( inDevice, inChannel, + isInput, inPropertyID, + &outPropertyDataSize, outPropertyData ); + if( macErr ) { + memset( outPropertyData, 0, inPropertyDataSize ); + goto failMac; + } + /* and compare... */ + if( 0==memcmp( outPropertyData, inPropertyData, outPropertyDataSize ) ) { + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc ); + return paNoError; + } + /* No match yet, so let's sleep and try again. */ + Pa_Sleep( 100 ); + gettimeofday( &tv2, NULL ); + } + DBUG( ("Timeout waiting for device setting.\n" ) ); + + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc ); return paNoError; - failUnix: - pthread_mutex_destroy( &mab.mutex ); - AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, - inPropertyID, propertyProc ); - - failUnix2: - DBUG( ("Error #%d while setting a device property: %s\n", unixErr, strerror( unixErr ) ) ); - return paUnanticipatedHostError; - failMac: - pthread_mutex_destroy( &mab.mutex ); - AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, - inPropertyID, propertyProc ); - failMac2: + AudioDeviceRemovePropertyListener( inDevice, inChannel, isInput, inPropertyID, propertyProc ); return ERR( macErr ); } @@ -431,10 +428,6 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device, const bool requireExact, const Float64 desiredSrate ) { - /*FIXME: changing the sample rate is disruptive to other programs using the - device, so it might be good to offer a custom flag to not change the - sample rate and just do conversion. (in my casual tests, there is - no disruption unless the sample rate really does need to change) */ const bool isInput = isOutput ? 0 : 1; Float64 srate; UInt32 propsize = sizeof( Float64 ); @@ -446,13 +439,15 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device, VDBUG(("Setting sample rate for device %ld to %g.\n",device,(float)desiredSrate)); /* -- try setting the sample rate -- */ + srate = 0; err = AudioDeviceSetPropertyNowAndWaitForChange( device, 0, isInput, kAudioDevicePropertyNominalSampleRate, propsize, &desiredSrate, &srate ); - if( err ) - return err; + /* -- if the rate agrees, and was changed, we are done -- */ + if( srate != 0 && srate == desiredSrate ) + return paNoError; /* -- if the rate agrees, and we got no errors, we are done -- */ if( !err && srate == desiredSrate ) return paNoError; @@ -505,19 +500,19 @@ PaError setBestSampleRateForDevice( const AudioDeviceID device, /* -- set the sample rate -- */ propsize = sizeof( best ); + srate = 0; err = AudioDeviceSetPropertyNowAndWaitForChange( device, 0, isInput, kAudioDevicePropertyNominalSampleRate, propsize, &best, &srate ); - if( err ) - return err; - if( err ) - return ERR( err ); /* -- if the set rate matches, we are done -- */ - if( srate == best ) + if( srate != 0 && srate == best ) return paNoError; + if( err ) + return ERR( err ); + /* -- otherwise, something wierd happened: we didn't set the rate, and we got no errors. Just bail. */ return paInternalError; } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h index 899826d596419c0d5355dea7c48b5d52fadbca8b..7c4afe52cacdb6808de37e827807c8144d0b4ebd 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h @@ -143,18 +143,6 @@ long computeRingBufferSize( const PaStreamParameters *inputParameters, long outputFramesPerBuffer, double sampleRate ); -/* - * Durring testing of core audio, I found that serious crashes could occur - * if properties such as sample rate were changed multiple times in rapid - * succession. The function below has some fancy logic to make sure that changes - * are acknowledged before another is requested. That seems to help a lot. - */ - -typedef struct { - bool once; /* I didn't end up using this. bdr */ - pthread_mutex_t mutex; -} MutexAndBool ; - OSStatus propertyProc( AudioDeviceID inDevice, UInt32 inChannel, diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c index dc71439f72e7bb8cbceacff25ceeef20485b2074..46c5caee41e4609619b7959593a9eff521e887d6 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/dsound/pa_win_ds.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_ds.c 1339 2008-02-15 07:50:33Z rossb $ + * $Id: pa_win_ds.c 1433 2009-12-09 01:42:59Z rossb $ * Portable Audio I/O Library DirectSound implementation * * Authors: Phil Burk, Robert Marsanyi & Ross Bencina @@ -107,7 +107,11 @@ provided in newer platform sdks and x64 */ #ifndef DWORD_PTR -#define DWORD_PTR DWORD + #if defined(_WIN64) + #define DWORD_PTR unsigned __int64 + #else + #define DWORD_PTR unsigned long + #endif #endif #define PRINT(x) PA_DEBUG(x); @@ -1401,12 +1405,14 @@ static HRESULT InitInputBuffer( PaWinDsStream *stream, PaSampleFormat sampleForm // first try WAVEFORMATEXTENSIBLE. if this fails, fall back to WAVEFORMATEX PaWin_InitializeWaveFormatExtensible( &waveFormat, nChannels, - sampleFormat, nFrameRate, channelMask ); + sampleFormat, PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), + nFrameRate, channelMask ); if( IDirectSoundCapture_CreateCaptureBuffer( stream->pDirectSoundCapture, &captureDesc, &stream->pDirectSoundInputBuffer, NULL) != DS_OK ) { - PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, nFrameRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, + PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), nFrameRate ); if ((result = IDirectSoundCapture_CreateCaptureBuffer( stream->pDirectSoundCapture, &captureDesc, &stream->pDirectSoundInputBuffer, NULL)) != DS_OK) return result; @@ -1477,11 +1483,13 @@ static HRESULT InitOutputBuffer( PaWinDsStream *stream, PaSampleFormat sampleFor // first try WAVEFORMATEXTENSIBLE. if this fails, fall back to WAVEFORMATEX PaWin_InitializeWaveFormatExtensible( &waveFormat, nChannels, - sampleFormat, nFrameRate, channelMask ); + sampleFormat, PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), + nFrameRate, channelMask ); if( IDirectSoundBuffer_SetFormat( pPrimaryBuffer, (WAVEFORMATEX*)&waveFormat) != DS_OK ) { - PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, nFrameRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, nChannels, sampleFormat, + PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ), nFrameRate ); if((result = IDirectSoundBuffer_SetFormat( pPrimaryBuffer, (WAVEFORMATEX*)&waveFormat)) != DS_OK) return result; } diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp index 0653b138b06b8af86dcc82464d605d4e3eac2922..498fc6c442d629146256fb025d6e2b42bada30cc 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp @@ -26,13 +26,13 @@ */ /* - * The text above constitutes the entire PortAudio license; however, + * The text above constitutes the entire PortAudio license; however, * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the * license above. */ @@ -56,6 +56,8 @@ #include <functiondiscoverykeys.h> // PKEY_Device_FriendlyName #endif +#include <process.h> + #include "pa_util.h" #include "pa_allocation.h" #include "pa_hostapi.h" @@ -73,7 +75,12 @@ #define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_SHARED //#define PORTAUDIO_SHAREMODE AUDCLNT_SHAREMODE_EXCLUSIVE - +/* use CreateThread for CYGWIN, _beginthreadex for all others */ +#ifndef __CYGWIN__ +#define CREATE_THREAD (HANDLE) _beginthreadex(NULL, 0, (unsigned (_stdcall *)(void *))ProcThread, (LPVOID) stream, 0, (unsigned *)&stream->dwThreadId) +#else +#define CREATE_THREAD CreateThread(NULL, 0, ProcThread, (LPVOID) stream, 0, &stream->dwThreadId) +#endif /* prototypes for functions declared in this file */ @@ -82,22 +89,21 @@ extern "C" { #endif /* __cplusplus */ - PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index); +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); #ifdef __cplusplus } - #endif /* __cplusplus */ -static void Terminate (struct PaUtilHostApiRepresentation *hostApi); -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ); +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate); -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, + double sampleRate ); +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -105,19 +111,19 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData); -static PaError CloseStream (PaStream* stream); -static PaError StartStream (PaStream *stream); -static PaError StopStream (PaStream *stream); -static PaError AbortStream (PaStream *stream); -static PaError IsStreamStopped (PaStream *s); -static PaError IsStreamActive (PaStream *stream); -static PaTime GetStreamTime (PaStream *stream); -static double GetStreamCpuLoad (PaStream* stream); -static PaError ReadStream (PaStream* stream, void *buffer, unsigned long frames); -static PaError WriteStream (PaStream* stream, const void *buffer, unsigned long frames); -static signed long GetStreamReadAvailable (PaStream* stream); -static signed long GetStreamWriteAvailable (PaStream* stream); + void *userData ); +static PaError CloseStream( PaStream* stream ); +static PaError StartStream( PaStream *stream ); +static PaError StopStream( PaStream *stream ); +static PaError AbortStream( PaStream *stream ); +static PaError IsStreamStopped( PaStream *s ); +static PaError IsStreamActive( PaStream *stream ); +static PaTime GetStreamTime( PaStream *stream ); +static double GetStreamCpuLoad( PaStream* stream ); +static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames ); +static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames ); +static signed long GetStreamReadAvailable( PaStream* stream ); +static signed long GetStreamWriteAvailable( PaStream* stream ); /* IMPLEMENT ME: a macro like the following one should be used for reporting @@ -133,8 +139,7 @@ static signed long GetStreamWriteAvailable (PaStream* stream); //currently built using RC1 SDK (5600) #if _MSC_VER < 1400 -PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) -{ +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){ return paNoError; } @@ -151,8 +156,8 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi i assume that neither of these will cause the Driver to "load", but again, who knows how they implement their stuff */ - -typedef struct PaWinWasapiDeviceInfo { +typedef struct PaWinWasapiDeviceInfo +{ //hmm is it wise to keep a reference until Terminate? //TODO Check if that interface requires the driver to be loaded! IMMDevice * device; @@ -176,7 +181,8 @@ typedef struct PaWinWasapiDeviceInfo { } PaWinWasapiDeviceInfo; -typedef struct { +typedef struct +{ PaUtilHostApiRepresentation inheritedHostApiRep; PaUtilStreamInterface callbackStreamInterface; PaUtilStreamInterface blockingStreamInterface; @@ -200,7 +206,7 @@ typedef struct { /* PaWinWasapiStream - a stream data structure specifically for this implementation */ -typedef struct PaWinWasapiSubStream { +typedef struct PaWinWasapiSubStream{ IAudioClient *client; WAVEFORMATEXTENSIBLE wavex; UINT32 bufferSize; @@ -209,7 +215,8 @@ typedef struct PaWinWasapiSubStream { unsigned long framesPerHostCallback; /* just an example */ }PaWinWasapiSubStream; -typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ +typedef struct PaWinWasapiStream +{ /* IMPLEMENT ME: rename this */ PaUtilStreamRepresentation streamRepresentation; PaUtilCpuLoadMeasurer cpuLoadMeasurer; PaUtilBufferProcessor bufferProcessor; @@ -220,20 +227,20 @@ typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ //input - PaWinWasapiSubStream in; + PaWinWasapiSubStream in; IAudioCaptureClient *cclient; IAudioEndpointVolume *inVol; - //output - PaWinWasapiSubStream out; + //output + PaWinWasapiSubStream out; IAudioRenderClient *rclient; - IAudioEndpointVolume *outVol; + IAudioEndpointVolume *outVol; bool running; bool closeRequest; DWORD dwThreadId; HANDLE hThread; - HANDLE hNotificationEvent; + HANDLE hNotificationEvent; GUID session; @@ -242,145 +249,62 @@ typedef struct PaWinWasapiStream { /* IMPLEMENT ME: rename this */ #define PRINT(x) PA_DEBUG(x); void -logAUDCLNT_E (HRESULT res) -{ +logAUDCLNT_E(HRESULT res){ char *text = 0; - - switch (res) { - - case S_OK: - return; - break; - - case E_POINTER : - text ="E_POINTER"; - break; - - case E_INVALIDARG : - text ="E_INVALIDARG"; - break; - - case AUDCLNT_E_NOT_INITIALIZED : - text ="AUDCLNT_E_NOT_INITIALIZED"; - break; - - case AUDCLNT_E_ALREADY_INITIALIZED : - text ="AUDCLNT_E_ALREADY_INITIALIZED"; - break; - - case AUDCLNT_E_WRONG_ENDPOINT_TYPE : - text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; - break; - - case AUDCLNT_E_DEVICE_INVALIDATED : - text ="AUDCLNT_E_DEVICE_INVALIDATED"; - break; - - case AUDCLNT_E_NOT_STOPPED : - text ="AUDCLNT_E_NOT_STOPPED"; - break; - - case AUDCLNT_E_BUFFER_TOO_LARGE : - text ="AUDCLNT_E_BUFFER_TOO_LARGE"; - break; - - case AUDCLNT_E_OUT_OF_ORDER : - text ="AUDCLNT_E_OUT_OF_ORDER"; - break; - - case AUDCLNT_E_UNSUPPORTED_FORMAT : - text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; - break; - - case AUDCLNT_E_INVALID_SIZE : - text ="AUDCLNT_E_INVALID_SIZE"; - break; - - case AUDCLNT_E_DEVICE_IN_USE : - text ="AUDCLNT_E_DEVICE_IN_USE"; - break; - - case AUDCLNT_E_BUFFER_OPERATION_PENDING : - text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; - break; - - case AUDCLNT_E_THREAD_NOT_REGISTERED : - text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; - break; - - case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED : - text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; - break; - - case AUDCLNT_E_ENDPOINT_CREATE_FAILED : - text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; - break; - - case AUDCLNT_E_SERVICE_NOT_RUNNING : - text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; - break; - // case AUDCLNT_E_CPUUSAGE_EXCEEDED :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break; - //Header error? - - case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED : - text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; - break; - - case AUDCLNT_E_EXCLUSIVE_MODE_ONLY : - text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; - break; - - case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL : - text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; - break; - - case AUDCLNT_E_EVENTHANDLE_NOT_SET : - text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; - break; - - case AUDCLNT_E_INCORRECT_BUFFER_SIZE : - text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; - break; - - case AUDCLNT_E_BUFFER_SIZE_ERROR : - text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; - break; - - case AUDCLNT_S_BUFFER_EMPTY : - text ="AUDCLNT_S_BUFFER_EMPTY"; - break; - - case AUDCLNT_S_THREAD_ALREADY_REGISTERED : - text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; - break; - + switch(res){ + case S_OK: return; break; + case E_POINTER :text ="E_POINTER"; break; + case E_INVALIDARG :text ="E_INVALIDARG"; break; + + case AUDCLNT_E_NOT_INITIALIZED :text ="AUDCLNT_E_NOT_INITIALIZED"; break; + case AUDCLNT_E_ALREADY_INITIALIZED :text ="AUDCLNT_E_ALREADY_INITIALIZED"; break; + case AUDCLNT_E_WRONG_ENDPOINT_TYPE :text ="AUDCLNT_E_WRONG_ENDPOINT_TYPE"; break; + case AUDCLNT_E_DEVICE_INVALIDATED :text ="AUDCLNT_E_DEVICE_INVALIDATED"; break; + case AUDCLNT_E_NOT_STOPPED :text ="AUDCLNT_E_NOT_STOPPED"; break; + case AUDCLNT_E_BUFFER_TOO_LARGE :text ="AUDCLNT_E_BUFFER_TOO_LARGE"; break; + case AUDCLNT_E_OUT_OF_ORDER :text ="AUDCLNT_E_OUT_OF_ORDER"; break; + case AUDCLNT_E_UNSUPPORTED_FORMAT :text ="AUDCLNT_E_UNSUPPORTED_FORMAT"; break; + case AUDCLNT_E_INVALID_SIZE :text ="AUDCLNT_E_INVALID_SIZE"; break; + case AUDCLNT_E_DEVICE_IN_USE :text ="AUDCLNT_E_DEVICE_IN_USE"; break; + case AUDCLNT_E_BUFFER_OPERATION_PENDING :text ="AUDCLNT_E_BUFFER_OPERATION_PENDING"; break; + case AUDCLNT_E_THREAD_NOT_REGISTERED :text ="AUDCLNT_E_THREAD_NOT_REGISTERED"; break; + case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED :text ="AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED"; break; + case AUDCLNT_E_ENDPOINT_CREATE_FAILED :text ="AUDCLNT_E_ENDPOINT_CREATE_FAILED"; break; + case AUDCLNT_E_SERVICE_NOT_RUNNING :text ="AUDCLNT_E_SERVICE_NOT_RUNNING"; break; + // case AUDCLNT_E_CPUUSAGE_EXCEEDED :text ="AUDCLNT_E_CPUUSAGE_EXCEEDED"; break; + //Header error? + case AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED :text ="AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED"; break; + case AUDCLNT_E_EXCLUSIVE_MODE_ONLY :text ="AUDCLNT_E_EXCLUSIVE_MODE_ONLY"; break; + case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL :text ="AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL"; break; + case AUDCLNT_E_EVENTHANDLE_NOT_SET :text ="AUDCLNT_E_EVENTHANDLE_NOT_SET"; break; + case AUDCLNT_E_INCORRECT_BUFFER_SIZE :text ="AUDCLNT_E_INCORRECT_BUFFER_SIZE"; break; + case AUDCLNT_E_BUFFER_SIZE_ERROR :text ="AUDCLNT_E_BUFFER_SIZE_ERROR"; break; + case AUDCLNT_S_BUFFER_EMPTY :text ="AUDCLNT_S_BUFFER_EMPTY"; break; + case AUDCLNT_S_THREAD_ALREADY_REGISTERED :text ="AUDCLNT_S_THREAD_ALREADY_REGISTERED"; break; default: text =" dunno!"; return ; - break; + break; } - - PRINT ( ("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); + PRINT(("WASAPI ERROR HRESULT: 0x%X : %s\n",res,text)); } inline double -nano100ToMillis (const REFERENCE_TIME &ref) -{ +nano100ToMillis(const REFERENCE_TIME &ref){ // 1 nano = 0.000000001 seconds //100 nano = 0.0000001 seconds //100 nano = 0.0001 milliseconds - return ( (double) ref) *0.0001; + return ((double)ref)*0.0001; } inline double -nano100ToSeconds (const REFERENCE_TIME &ref) -{ +nano100ToSeconds(const REFERENCE_TIME &ref){ // 1 nano = 0.000000001 seconds //100 nano = 0.0000001 seconds //100 nano = 0.0001 milliseconds - return ( (double) ref) *0.0000001; + return ((double)ref)*0.0000001; } #ifndef IF_FAILED_JUMP @@ -391,11 +315,11 @@ nano100ToSeconds (const REFERENCE_TIME &ref) //AVRT is the new "multimedia schedulling stuff" -typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); -typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); -typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); -typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); -typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); +typedef BOOL (WINAPI *FAvRtCreateThreadOrderingGroup) (PHANDLE,PLARGE_INTEGER,GUID*,PLARGE_INTEGER); +typedef BOOL (WINAPI *FAvRtDeleteThreadOrderingGroup) (HANDLE); +typedef BOOL (WINAPI *FAvRtWaitOnThreadOrderingGroup) (HANDLE); +typedef HANDLE (WINAPI *FAvSetMmThreadCharacteristics) (LPCTSTR,LPDWORD); +typedef BOOL (WINAPI *FAvSetMmThreadPriority) (HANDLE,AVRT_PRIORITY); HMODULE hDInputDLL = 0; FAvRtCreateThreadOrderingGroup pAvRtCreateThreadOrderingGroup=0; @@ -413,60 +337,51 @@ FAvSetMmThreadPriority pAvSetMmThreadPriority=0; return false; \ } \ } \ - -bool -setupAVRT() -{ - hDInputDLL = LoadLibraryA ("avrt.dll"); +bool +setupAVRT(){ - if (hDInputDLL == NULL) + hDInputDLL = LoadLibraryA("avrt.dll"); + if(hDInputDLL == NULL) return false; - setupPTR (pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); - - setupPTR (pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); - - setupPTR (pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); - - setupPTR (pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); - - setupPTR (pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); + setupPTR(pAvRtCreateThreadOrderingGroup, FAvRtCreateThreadOrderingGroup, "AvRtCreateThreadOrderingGroup"); + setupPTR(pAvRtDeleteThreadOrderingGroup, FAvRtDeleteThreadOrderingGroup, "AvRtDeleteThreadOrderingGroup"); + setupPTR(pAvRtWaitOnThreadOrderingGroup, FAvRtWaitOnThreadOrderingGroup, "AvRtWaitOnThreadOrderingGroup"); + setupPTR(pAvSetMmThreadCharacteristics, FAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristicsA"); + setupPTR(pAvSetMmThreadPriority, FAvSetMmThreadPriority, "AvSetMmThreadPriority"); return true; } -PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex) +PaError PaWinWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ) { - if (!setupAVRT()) { - PRINT ( ("Windows WASAPI : No AVRT! (not VISTA?)")); + if (!setupAVRT()){ + PRINT(("Windows WASAPI : No AVRT! (not VISTA?)")); return paNoError; } - CoInitialize (NULL); + CoInitialize(NULL); PaError result = paNoError; PaWinWasapiHostApiRepresentation *paWasapi; PaDeviceInfo *deviceInfoArray; - paWasapi = (PaWinWasapiHostApiRepresentation*) PaUtil_AllocateMemory (sizeof (PaWinWasapiHostApiRepresentation)); - - if (!paWasapi) { + paWasapi = (PaWinWasapiHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaWinWasapiHostApiRepresentation) ); + if( !paWasapi ){ result = paInsufficientMemory; goto error; } paWasapi->allocations = PaUtil_CreateAllocationGroup(); - - if (!paWasapi->allocations) { + if( !paWasapi->allocations ){ result = paInsufficientMemory; goto error; } *hostApi = &paWasapi->inheritedHostApiRep; - (*hostApi)->info.structVersion = 1; (*hostApi)->info.type = paWASAPI; (*hostApi)->info.name = "Windows WASAPI"; @@ -479,181 +394,170 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi IMMDeviceCollection* spEndpoints=0; paWasapi->enumerator = 0; - hResult = CoCreateInstance ( - __uuidof (MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, - __uuidof (IMMDeviceEnumerator), - (void**) &paWasapi->enumerator); + hResult = CoCreateInstance( + __uuidof(MMDeviceEnumerator), NULL,CLSCTX_INPROC_SERVER, + __uuidof(IMMDeviceEnumerator), + (void**)&paWasapi->enumerator); - IF_FAILED_JUMP (hResult, error); + IF_FAILED_JUMP(hResult, error); //getting default device ids in the eMultimedia "role" { { IMMDevice* defaultRenderer=0; - hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eRender, eMultimedia, &defaultRenderer); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultRenderer); + IF_FAILED_JUMP(hResult, error); WCHAR* pszDeviceId = NULL; - hResult = defaultRenderer->GetId (&pszDeviceId); - IF_FAILED_JUMP (hResult, error); - StringCchCopyW (paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree (pszDeviceId); + hResult = defaultRenderer->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->defaultRenderer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); defaultRenderer->Release(); } { IMMDevice* defaultCapturer=0; - hResult = paWasapi->enumerator->GetDefaultAudioEndpoint (eCapture, eMultimedia, &defaultCapturer); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->enumerator->GetDefaultAudioEndpoint(eCapture, eMultimedia, &defaultCapturer); + IF_FAILED_JUMP(hResult, error); WCHAR* pszDeviceId = NULL; - hResult = defaultCapturer->GetId (&pszDeviceId); - IF_FAILED_JUMP (hResult, error); - StringCchCopyW (paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree (pszDeviceId); + hResult = defaultCapturer->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->defaultCapturer, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); defaultCapturer->Release(); } } - hResult = paWasapi->enumerator->EnumAudioEndpoints (eAll, DEVICE_STATE_ACTIVE, &spEndpoints); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->enumerator->EnumAudioEndpoints(eAll, DEVICE_STATE_ACTIVE, &spEndpoints); + IF_FAILED_JUMP(hResult, error); - hResult = spEndpoints->GetCount (&paWasapi->deviceCount); - IF_FAILED_JUMP (hResult, error); + hResult = spEndpoints->GetCount(&paWasapi->deviceCount); + IF_FAILED_JUMP(hResult, error); paWasapi->devInfo = new PaWinWasapiDeviceInfo[paWasapi->deviceCount]; { for (size_t step=0;step<paWasapi->deviceCount;++step) - memset (&paWasapi->devInfo[step],0,sizeof (PaWinWasapiDeviceInfo)); + memset(&paWasapi->devInfo[step],0,sizeof(PaWinWasapiDeviceInfo)); } - if (paWasapi->deviceCount > 0) { - (*hostApi)->deviceInfos = (PaDeviceInfo**) PaUtil_GroupAllocateMemory ( - paWasapi->allocations, sizeof (PaDeviceInfo*) * paWasapi->deviceCount); - - if (! (*hostApi)->deviceInfos) { + if( paWasapi->deviceCount > 0 ) + { + (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory( + paWasapi->allocations, sizeof(PaDeviceInfo*) * paWasapi->deviceCount ); + if( !(*hostApi)->deviceInfos ){ result = paInsufficientMemory; goto error; } /* allocate all device info structs in a contiguous block */ - deviceInfoArray = (PaDeviceInfo*) PaUtil_GroupAllocateMemory ( - paWasapi->allocations, sizeof (PaDeviceInfo) * paWasapi->deviceCount); - - if (!deviceInfoArray) { + deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory( + paWasapi->allocations, sizeof(PaDeviceInfo) * paWasapi->deviceCount ); + if( !deviceInfoArray ){ result = paInsufficientMemory; goto error; } - for (UINT i=0; i < paWasapi->deviceCount; ++i) { + for( UINT i=0; i < paWasapi->deviceCount; ++i ){ - PA_DEBUG ( ("i:%d\n",i)); + PA_DEBUG(("i:%d\n",i)); PaDeviceInfo *deviceInfo = &deviceInfoArray[i]; deviceInfo->structVersion = 2; deviceInfo->hostApi = hostApiIndex; - hResult = spEndpoints->Item (i, &paWasapi->devInfo[i].device); - IF_FAILED_JUMP (hResult, error); + hResult = spEndpoints->Item(i, &paWasapi->devInfo[i].device); + IF_FAILED_JUMP(hResult, error); //getting ID { WCHAR* pszDeviceId = NULL; - hResult = paWasapi->devInfo[i].device->GetId (&pszDeviceId); - IF_FAILED_JUMP (hResult, error); - StringCchCopyW (paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); - CoTaskMemFree (pszDeviceId); + hResult = paWasapi->devInfo[i].device->GetId(&pszDeviceId); + IF_FAILED_JUMP(hResult, error); + StringCchCopyW(paWasapi->devInfo[i].szDeviceID, MAX_STR_LEN-1, pszDeviceId); + CoTaskMemFree(pszDeviceId); - if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer) ==0) { + if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultCapturer)==0){ //we found the default input! (*hostApi)->info.defaultInputDevice = (*hostApi)->info.deviceCount; } - - if (lstrcmpW (paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer) ==0) { + if (lstrcmpW(paWasapi->devInfo[i].szDeviceID, paWasapi->defaultRenderer)==0){ //we found the default output! (*hostApi)->info.defaultOutputDevice = (*hostApi)->info.deviceCount; } } DWORD state=0; - hResult = paWasapi->devInfo[i].device->GetState (&paWasapi->devInfo[i].state); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->devInfo[i].device->GetState(&paWasapi->devInfo[i].state); + IF_FAILED_JUMP(hResult, error); - if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE) { - PRINT ( ("WASAPI device:%d is not currently available (state:%d)\n",i,state)); + if (paWasapi->devInfo[i].state != DEVICE_STATE_ACTIVE){ + PRINT(("WASAPI device:%d is not currently available (state:%d)\n",i,state)); //spDevice->Release(); //continue; } { IPropertyStore* spProperties; - hResult = paWasapi->devInfo[i].device->OpenPropertyStore (STGM_READ, &spProperties); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->devInfo[i].device->OpenPropertyStore(STGM_READ, &spProperties); + IF_FAILED_JUMP(hResult, error); //getting "Friendly" Name { PROPVARIANT value; - PropVariantInit (&value); - hResult = spProperties->GetValue (PKEY_Device_FriendlyName, &value); - IF_FAILED_JUMP (hResult, error); + PropVariantInit(&value); + hResult = spProperties->GetValue(PKEY_Device_FriendlyName, &value); + IF_FAILED_JUMP(hResult, error); deviceInfo->name = 0; - char* deviceName = (char*) PaUtil_GroupAllocateMemory (paWasapi->allocations, MAX_STR_LEN + 1); - - if (!deviceName) { + char* deviceName = (char*)PaUtil_GroupAllocateMemory( paWasapi->allocations, MAX_STR_LEN + 1 ); + if( !deviceName ){ result = paInsufficientMemory; goto error; } - - if (value.pwszVal) - wcstombs (deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size - else { - sprintf (deviceName,"baddev%d",i); - } + if (value.pwszVal) + wcstombs(deviceName, value.pwszVal,MAX_STR_LEN-1); //todo proper size + else{ + _snprintf_s(deviceName,MAX_STR_LEN-1,MAX_STR_LEN-1,"baddev%d",i); + } deviceInfo->name = deviceName; - - PropVariantClear (&value); + PropVariantClear(&value); } #if 0 DWORD numProps = 0; - hResult = spProperties->GetCount (&numProps); - IF_FAILED_JUMP (hResult, error); + hResult = spProperties->GetCount(&numProps); + IF_FAILED_JUMP(hResult, error); { - for (DWORD i=0;i<numProps;++i) { + for (DWORD i=0;i<numProps;++i){ PROPERTYKEY pkey; - hResult = spProperties->GetAt (i,&pkey); + hResult = spProperties->GetAt(i,&pkey); PROPVARIANT value; - PropVariantInit (&value); - hResult = spProperties->GetValue (pkey, &value); - - switch (value.vt) { + PropVariantInit(&value); + hResult = spProperties->GetValue(pkey, &value); + switch(value.vt){ case 11: - PRINT ( ("property*%u*\n",value.ulVal)); - break; - + PRINT(("property*%u*\n",value.ulVal)); + break; case 19: - PRINT ( ("property*%d*\n",value.boolVal)); - break; - - case 31: { + PRINT(("property*%d*\n",value.boolVal)); + break; + case 31: + { char temp[512]; - wcstombs (temp, value.pwszVal,MAX_STR_LEN-1); - PRINT ( ("property*%s*\n",temp)); + wcstombs(temp, value.pwszVal,MAX_STR_LEN-1); + PRINT(("property*%s*\n",temp)); } - break; - - default: - break; + default:break; } - PropVariantClear (&value); + PropVariantClear(&value); } } - #endif /* These look interresting... but they are undocumented @@ -670,10 +574,9 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi //getting the Endpoint data { IMMEndpoint *endpoint=0; - hResult = paWasapi->devInfo[i].device->QueryInterface (__uuidof (IMMEndpoint), (void **) &endpoint); - - if (SUCCEEDED (hResult)) { - hResult = endpoint->GetDataFlow (&paWasapi->devInfo[i].flow); + hResult = paWasapi->devInfo[i].device->QueryInterface(__uuidof(IMMEndpoint),(void **)&endpoint); + if (SUCCEEDED(hResult)){ + hResult = endpoint->GetDataFlow(&paWasapi->devInfo[i].flow); endpoint->Release(); } } @@ -683,60 +586,56 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi { IAudioClient *myClient=0; - hResult = paWasapi->devInfo[i].device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); - IF_FAILED_JUMP (hResult, error); + hResult = paWasapi->devInfo[i].device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + IF_FAILED_JUMP(hResult, error); - hResult = myClient->GetDevicePeriod ( - &paWasapi->devInfo[i].DefaultDevicePeriod, - &paWasapi->devInfo[i].MinimumDevicePeriod); - IF_FAILED_JUMP (hResult, error); + hResult = myClient->GetDevicePeriod( + &paWasapi->devInfo[i].DefaultDevicePeriod, + &paWasapi->devInfo[i].MinimumDevicePeriod); + IF_FAILED_JUMP(hResult, error); - hResult = myClient->GetMixFormat (&paWasapi->devInfo[i].MixFormat); + hResult = myClient->GetMixFormat(&paWasapi->devInfo[i].MixFormat); - if (hResult != S_OK) { - /*davidv: this happened with my hardware, previously for that same device in DirectSound: - Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} - so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/ - logAUDCLNT_E (hResult); - goto error; - } + if (hResult != S_OK){ + /*davidv: this happened with my hardware, previously for that same device in DirectSound: + Digital Output (Realtek AC'97 Audio)'s GUID: {0x38f2cf50,0x7b4c,0x4740,0x86,0xeb,0xd4,0x38,0x66,0xd8,0xc8, 0x9f} + so something must be _really_ wrong with this device, TODO handle this better. We kind of need GetMixFormat*/ + logAUDCLNT_E(hResult); + goto error; + } myClient->Release(); } //we can now fill in portaudio device data deviceInfo->maxInputChannels = 0; //for now - deviceInfo->maxOutputChannels = 0; //for now - switch (paWasapi->devInfo[i].flow) { - + switch(paWasapi->devInfo[i].flow){ case eRender: //hum not exaclty maximum, more like "default" deviceInfo->maxOutputChannels = paWasapi->devInfo[i].MixFormat->nChannels; - deviceInfo->defaultHighOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod); - deviceInfo->defaultLowOutputLatency = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod); - break; - + deviceInfo->defaultHighOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowOutputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); + break; case eCapture: //hum not exaclty maximum, more like "default" deviceInfo->maxInputChannels = paWasapi->devInfo[i].MixFormat->nChannels; - deviceInfo->defaultHighInputLatency = nano100ToSeconds (paWasapi->devInfo[i].DefaultDevicePeriod); - deviceInfo->defaultLowInputLatency = nano100ToSeconds (paWasapi->devInfo[i].MinimumDevicePeriod); - break; - + deviceInfo->defaultHighInputLatency = nano100ToSeconds(paWasapi->devInfo[i].DefaultDevicePeriod); + deviceInfo->defaultLowInputLatency = nano100ToSeconds(paWasapi->devInfo[i].MinimumDevicePeriod); + break; default: - PRINT ( ("WASAPI device:%d bad Data FLow! \n",i)); + PRINT(("WASAPI device:%d bad Data FLow! \n",i)); goto error; - break; + break; } - deviceInfo->defaultSampleRate = (double) paWasapi->devInfo[i].MixFormat->nSamplesPerSec; + deviceInfo->defaultSampleRate = (double)paWasapi->devInfo[i].MixFormat->nSamplesPerSec; (*hostApi)->deviceInfos[i] = deviceInfo; - ++ (*hostApi)->info.deviceCount; + ++(*hostApi)->info.deviceCount; } } @@ -746,16 +645,16 @@ PaError PaWinWasapi_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApi (*hostApi)->OpenStream = OpenStream; (*hostApi)->IsFormatSupported = IsFormatSupported; - PaUtil_InitializeStreamInterface (&paWasapi->callbackStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &paWasapi->callbackStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, GetStreamCpuLoad, PaUtil_DummyRead, PaUtil_DummyWrite, - PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable); + PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable ); - PaUtil_InitializeStreamInterface (&paWasapi->blockingStreamInterface, CloseStream, StartStream, + PaUtil_InitializeStreamInterface( &paWasapi->blockingStreamInterface, CloseStream, StartStream, StopStream, AbortStream, IsStreamStopped, IsStreamActive, GetStreamTime, PaUtil_DummyGetCpuLoad, - ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable); + ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable ); return result; @@ -767,105 +666,92 @@ error: if (paWasapi->enumerator) paWasapi->enumerator->Release(); - if (paWasapi) { - if (paWasapi->allocations) { - PaUtil_FreeAllAllocations (paWasapi->allocations); - PaUtil_DestroyAllocationGroup (paWasapi->allocations); + if( paWasapi ) + { + if( paWasapi->allocations ) + { + PaUtil_FreeAllAllocations( paWasapi->allocations ); + PaUtil_DestroyAllocationGroup( paWasapi->allocations ); } - PaUtil_FreeMemory (paWasapi); + PaUtil_FreeMemory( paWasapi ); } - return result; } -static void Terminate (struct PaUtilHostApiRepresentation *hostApi) +static void Terminate( struct PaUtilHostApiRepresentation *hostApi ) { - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; paWasapi->enumerator->Release(); - for (UINT i=0;i<paWasapi->deviceCount;++i) { + for (UINT i=0;i<paWasapi->deviceCount;++i){ PaWinWasapiDeviceInfo *info = &paWasapi->devInfo[i]; if (info->device) info->device->Release(); if (info->MixFormat) - CoTaskMemFree (info->MixFormat); + CoTaskMemFree(info->MixFormat); } - delete [] paWasapi->devInfo; CoUninitialize(); - if (paWasapi->allocations) { - PaUtil_FreeAllAllocations (paWasapi->allocations); - PaUtil_DestroyAllocationGroup (paWasapi->allocations); + if( paWasapi->allocations ){ + PaUtil_FreeAllAllocations( paWasapi->allocations ); + PaUtil_DestroyAllocationGroup( paWasapi->allocations ); } - PaUtil_FreeMemory (paWasapi); + PaUtil_FreeMemory( paWasapi ); } static void -LogWAVEFORMATEXTENSIBLE (const WAVEFORMATEXTENSIBLE *in) -{ - - const WAVEFORMATEX *old = (WAVEFORMATEX *) in; - - switch (old->wFormatTag) { - - case WAVE_FORMAT_EXTENSIBLE: { - - PRINT ( ("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); - - if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) { - PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); - } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) { - PRINT ( ("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); - } else { - PRINT ( ("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", - in->SubFormat.Data1, - in->SubFormat.Data2, - in->SubFormat.Data3, - (int) in->SubFormat.Data4[0], - (int) in->SubFormat.Data4[1], - (int) in->SubFormat.Data4[2], - (int) in->SubFormat.Data4[3], - (int) in->SubFormat.Data4[4], - (int) in->SubFormat.Data4[5], - (int) in->SubFormat.Data4[6], - (int) in->SubFormat.Data4[7])); - } - - PRINT ( ("Samples.wValidBitsPerSample=%d\n", in->Samples.wValidBitsPerSample)); - - PRINT ( ("dwChannelMask=0x%X\n",in->dwChannelMask)); - } - - break; - - case WAVE_FORMAT_PCM: - PRINT ( ("wFormatTag=WAVE_FORMAT_PCM\n")); - break; - - case WAVE_FORMAT_IEEE_FLOAT: - PRINT ( ("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); - break; - - default : - PRINT ( ("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); - break; - } - - PRINT ( ("nChannels =%d\n",old->nChannels)); - - PRINT ( ("nSamplesPerSec =%d\n",old->nSamplesPerSec)); - PRINT ( ("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); - PRINT ( ("nBlockAlign =%d\n",old->nBlockAlign)); - PRINT ( ("wBitsPerSample =%d\n",old->wBitsPerSample)); - PRINT ( ("cbSize =%d\n",old->cbSize)); +LogWAVEFORMATEXTENSIBLE(const WAVEFORMATEXTENSIBLE *in){ + + const WAVEFORMATEX *old = (WAVEFORMATEX *)in; + + switch (old->wFormatTag){ + case WAVE_FORMAT_EXTENSIBLE:{ + + PRINT(("wFormatTag=WAVE_FORMAT_EXTENSIBLE\n")); + + if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ + PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\n")); + } + else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ + PRINT(("SubFormat=KSDATAFORMAT_SUBTYPE_PCM\n")); + } + else{ + PRINT(("SubFormat=CUSTOM GUID{%d:%d:%d:%d%d%d%d%d%d%d%d}\n", + in->SubFormat.Data1, + in->SubFormat.Data2, + in->SubFormat.Data3, + (int)in->SubFormat.Data4[0], + (int)in->SubFormat.Data4[1], + (int)in->SubFormat.Data4[2], + (int)in->SubFormat.Data4[3], + (int)in->SubFormat.Data4[4], + (int)in->SubFormat.Data4[5], + (int)in->SubFormat.Data4[6], + (int)in->SubFormat.Data4[7])); + } + PRINT(("Samples.wValidBitsPerSample=%d\n", in->Samples.wValidBitsPerSample)); + PRINT(("dwChannelMask=0x%X\n",in->dwChannelMask)); + }break; + + case WAVE_FORMAT_PCM: PRINT(("wFormatTag=WAVE_FORMAT_PCM\n")); break; + case WAVE_FORMAT_IEEE_FLOAT: PRINT(("wFormatTag=WAVE_FORMAT_IEEE_FLOAT\n")); break; + default : PRINT(("wFormatTag=UNKNOWN(%d)\n",old->wFormatTag)); break; + } + + PRINT(("nChannels =%d\n",old->nChannels)); + PRINT(("nSamplesPerSec =%d\n",old->nSamplesPerSec)); + PRINT(("nAvgBytesPerSec=%d\n",old->nAvgBytesPerSec)); + PRINT(("nBlockAlign =%d\n",old->nBlockAlign)); + PRINT(("wBitsPerSample =%d\n",old->wBitsPerSample)); + PRINT(("cbSize =%d\n",old->cbSize)); } @@ -874,82 +760,53 @@ LogWAVEFORMATEXTENSIBLE (const WAVEFORMATEXTENSIBLE *in) WAVEFORMATXXX is always interleaved */ static PaSampleFormat -waveformatToPaFormat (const WAVEFORMATEXTENSIBLE *in) -{ +waveformatToPaFormat(const WAVEFORMATEXTENSIBLE *in){ - const WAVEFORMATEX *old = (WAVEFORMATEX*) in; + const WAVEFORMATEX *old = (WAVEFORMATEX*)in; - switch (old->wFormatTag) { + switch (old->wFormatTag){ - case WAVE_FORMAT_EXTENSIBLE: { - if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) { + case WAVE_FORMAT_EXTENSIBLE: + { + if (in->SubFormat == KSDATAFORMAT_SUBTYPE_IEEE_FLOAT){ if (in->Samples.wValidBitsPerSample == 32) return paFloat32; else return paCustomFormat; - } else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM) { - switch (old->wBitsPerSample) { - - case 32: - return paInt32; - break; - - case 24: - return paInt24; - break; - - case 8: - return paUInt8; - break; - - case 16: - return paInt16; - break; - - default: - return paCustomFormat; - break; + } + else if (in->SubFormat == KSDATAFORMAT_SUBTYPE_PCM){ + switch (old->wBitsPerSample){ + case 32: return paInt32; break; + case 24: return paInt24;break; + case 8: return paUInt8;break; + case 16: return paInt16;break; + default: return paCustomFormat;break; } - } else + } + else return paCustomFormat; } - break; case WAVE_FORMAT_IEEE_FLOAT: return paFloat32; - break; - - case WAVE_FORMAT_PCM: { - switch (old->wBitsPerSample) { - - case 32: - return paInt32; - break; - - case 24: - return paInt24; - break; - - case 8: - return paUInt8; - break; - - case 16: - return paInt16; - break; + break; - default: - return paCustomFormat; - break; + case WAVE_FORMAT_PCM: + { + switch (old->wBitsPerSample){ + case 32: return paInt32; break; + case 24: return paInt24;break; + case 8: return paUInt8;break; + case 16: return paInt16;break; + default: return paCustomFormat;break; } } - break; default: return paCustomFormat; - break; + break; } return paCustomFormat; @@ -958,96 +815,56 @@ waveformatToPaFormat (const WAVEFORMATEXTENSIBLE *in) static PaError -waveformatFromParams (WAVEFORMATEXTENSIBLE*wavex, - const PaStreamParameters * params, - double sampleRate) -{ +waveformatFromParams(WAVEFORMATEXTENSIBLE*wavex, + const PaStreamParameters * params, + double sampleRate){ size_t bytesPerSample = 0; - - switch (params->sampleFormat & ~paNonInterleaved) { - + switch( params->sampleFormat & ~paNonInterleaved ){ case paFloat32: - - case paInt32: - bytesPerSample=4; - break; - - case paInt16: - bytesPerSample=2; - break; - - case paInt24: - bytesPerSample=3; - break; - + case paInt32: bytesPerSample=4;break; + case paInt16: bytesPerSample=2;break; + case paInt24: bytesPerSample=3;break; case paInt8: - - case paUInt8: - bytesPerSample=1; - break; - + case paUInt8: bytesPerSample=1;break; case paCustomFormat: - - default: - return paSampleFormatNotSupported; - break; + default: return paSampleFormatNotSupported;break; } - memset (wavex,0,sizeof (WAVEFORMATEXTENSIBLE)); + memset(wavex,0,sizeof(WAVEFORMATEXTENSIBLE)); - WAVEFORMATEX *old = (WAVEFORMATEX *) wavex; - old->nChannels = (WORD) params->channelCount; - old->nSamplesPerSec = (DWORD) sampleRate; - old->wBitsPerSample = (WORD) (bytesPerSample*8); - old->nAvgBytesPerSec = (DWORD) (old->nSamplesPerSec * old->nChannels * bytesPerSample); - old->nBlockAlign = (WORD) (old->nChannels * bytesPerSample); + WAVEFORMATEX *old = (WAVEFORMATEX *)wavex; + old->nChannels = (WORD)params->channelCount; + old->nSamplesPerSec = (DWORD)sampleRate; + old->wBitsPerSample = (WORD)(bytesPerSample*8); + old->nAvgBytesPerSec = (DWORD)(old->nSamplesPerSec * old->nChannels * bytesPerSample); + old->nBlockAlign = (WORD)(old->nChannels * bytesPerSample); //WAVEFORMATEX - - if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)) { + if (params->channelCount <=2 && (bytesPerSample == 2 || bytesPerSample == 1)){ old->cbSize = 0; old->wFormatTag = WAVE_FORMAT_PCM; } - //WAVEFORMATEXTENSIBLE - else { + else{ old->wFormatTag = WAVE_FORMAT_EXTENSIBLE; old->cbSize = sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX); - if ( (params->sampleFormat & ~paNonInterleaved) == paFloat32) + if ((params->sampleFormat & ~paNonInterleaved) == paFloat32) wavex->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; else wavex->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; wavex->Samples.wValidBitsPerSample = old->wBitsPerSample; //no extra padding! - switch (params->channelCount) { - - case 1: - wavex->dwChannelMask = SPEAKER_FRONT_CENTER; - break; - - case 2: - wavex->dwChannelMask = 0x1 | 0x2; - break; - - case 4: - wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; - break; - - case 6: - wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; - break; - - case 8: - wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; - break; - - default: - wavex->dwChannelMask = 0; - break; + switch(params->channelCount){ + case 1: wavex->dwChannelMask = SPEAKER_FRONT_CENTER; break; + case 2: wavex->dwChannelMask = 0x1 | 0x2; break; + case 4: wavex->dwChannelMask = 0x1 | 0x2 | 0x10 | 0x20; break; + case 6: wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20; break; + case 8: wavex->dwChannelMask = 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80; break; + default: wavex->dwChannelMask = 0; break; } } @@ -1066,47 +883,51 @@ waveformatFromParams (WAVEFORMATEXTENSIBLE*wavex, #define paInt16 ((PaSampleFormat) 0x00000008) */ //lifted from pa_wdmks -static void wasapiFillWFEXT (WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) +static void wasapiFillWFEXT( WAVEFORMATEXTENSIBLE* pwfext, PaSampleFormat sampleFormat, double sampleRate, int channelCount) { - PA_DEBUG ( ("sampleFormat = %lx\n" , sampleFormat)); - PA_DEBUG ( ("sampleRate = %f\n" , sampleRate)); - PA_DEBUG ( ("chanelCount = %d\n", channelCount)); + PA_DEBUG(( "sampleFormat = %lx\n" , sampleFormat )); + PA_DEBUG(( "sampleRate = %f\n" , sampleRate )); + PA_DEBUG(( "chanelCount = %d\n", channelCount )); pwfext->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; pwfext->Format.nChannels = channelCount; - pwfext->Format.nSamplesPerSec = (int) sampleRate; - - if (channelCount == 1) + pwfext->Format.nSamplesPerSec = (int)sampleRate; + if(channelCount == 1) pwfext->dwChannelMask = KSAUDIO_SPEAKER_DIRECTOUT; else pwfext->dwChannelMask = KSAUDIO_SPEAKER_STEREO; - - if (sampleFormat == paFloat32) { + if(sampleFormat == paFloat32) + { pwfext->Format.nBlockAlign = channelCount * 4; pwfext->Format.wBitsPerSample = 32; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 32; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; - } else if (sampleFormat == paInt32) { + } + else if(sampleFormat == paInt32) + { pwfext->Format.nBlockAlign = channelCount * 4; pwfext->Format.wBitsPerSample = 32; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 32; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } else if (sampleFormat == paInt24) { + } + else if(sampleFormat == paInt24) + { pwfext->Format.nBlockAlign = channelCount * 3; pwfext->Format.wBitsPerSample = 24; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 24; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - } else if (sampleFormat == paInt16) { + } + else if(sampleFormat == paInt16) + { pwfext->Format.nBlockAlign = channelCount * 2; pwfext->Format.wBitsPerSample = 16; - pwfext->Format.cbSize = sizeof (WAVEFORMATEXTENSIBLE)-sizeof (WAVEFORMATEX); + pwfext->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX); pwfext->Samples.wValidBitsPerSample = 16; pwfext->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; } - pwfext->Format.nAvgBytesPerSec = pwfext->Format.nSamplesPerSec * pwfext->Format.nBlockAlign; } @@ -1122,201 +943,198 @@ const int BestToWorst[FORMATTESTS]={paFloat32,paInt24,paInt16}; static PaError -GetClosestFormat (IAudioClient * myClient, double sampleRate,const PaStreamParameters * params, - AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex) +GetClosestFormat(IAudioClient * myClient, double sampleRate,const PaStreamParameters * params, + AUDCLNT_SHAREMODE *shareMode, WAVEFORMATEXTENSIBLE *outWavex) { - //TODO we should try exclusive first and shared after - *shareMode = PORTAUDIO_SHAREMODE; - - PaError answer = paInvalidSampleRate; - - waveformatFromParams (outWavex,params,sampleRate); - WAVEFORMATEX *sharedClosestMatch=0; - HRESULT hResult=!S_OK; - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) outWavex,NULL); - else - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &outWavex,&sharedClosestMatch); - - if (hResult == S_OK) - answer = paFormatIsSupported; - else if (sharedClosestMatch) { - WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*) sharedClosestMatch; - - int closestMatchSR = (int) sharedClosestMatch->nSamplesPerSec; - - if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) - memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEXTENSIBLE)); - else - memcpy (outWavex,sharedClosestMatch,sizeof (WAVEFORMATEX)); - - CoTaskMemFree (sharedClosestMatch); - - if ( (int) sampleRate == closestMatchSR) - answer = paFormatIsSupported; - else - answer = paInvalidSampleRate; - - } else { - - //it doesnt suggest anything?? ok lets show it the MENU! - - //ok fun time as with pa_win_mme, we know only a refusal of the user-requested - //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything - //so lets only use the number - for (int i=0;i<FORMATTESTS;++i) { - WAVEFORMATEXTENSIBLE ext; - wasapiFillWFEXT (&ext,BestToWorst[i],sampleRate,params->channelCount); - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &ext,NULL); - else - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &ext,&sharedClosestMatch); - - if (hResult == S_OK) { - memcpy (outWavex,&ext,sizeof (WAVEFORMATEXTENSIBLE)); - answer = paFormatIsSupported; - break; - } - } - - if (answer!=paFormatIsSupported) { - //try MIX format? - //why did it HAVE to come to this .... - WAVEFORMATEX pcm16WaveFormat; - memset (&pcm16WaveFormat,0,sizeof (WAVEFORMATEX)); - pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; - pcm16WaveFormat.nChannels = 2; - pcm16WaveFormat.nSamplesPerSec = (DWORD) sampleRate; - pcm16WaveFormat.nBlockAlign = 4; - pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; - pcm16WaveFormat.wBitsPerSample = 16; - pcm16WaveFormat.cbSize = 0; - - if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_EXCLUSIVE, (WAVEFORMATEX*) &pcm16WaveFormat,NULL); - else - hResult = myClient->IsFormatSupported (AUDCLNT_SHAREMODE_SHARED, (WAVEFORMATEX*) &pcm16WaveFormat,&sharedClosestMatch); - - if (hResult == S_OK) { - memcpy (outWavex,&pcm16WaveFormat,sizeof (WAVEFORMATEX)); - answer = paFormatIsSupported; - } - } - - logAUDCLNT_E (hResult); - } - - return answer; + //TODO we should try exclusive first and shared after + *shareMode = PORTAUDIO_SHAREMODE; + + PaError answer = paInvalidSampleRate; + + waveformatFromParams(outWavex,params,sampleRate); + WAVEFORMATEX *sharedClosestMatch=0; + HRESULT hResult=!S_OK; + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,&outWavex->Format,NULL); + else + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &outWavex->Format,&sharedClosestMatch); + + if (hResult == S_OK) + answer = paFormatIsSupported; + else if (sharedClosestMatch){ + WAVEFORMATEXTENSIBLE* ext = (WAVEFORMATEXTENSIBLE*)sharedClosestMatch; + + int closestMatchSR = (int)sharedClosestMatch->nSamplesPerSec; + + if (sharedClosestMatch->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEXTENSIBLE)); + else + memcpy(outWavex,sharedClosestMatch,sizeof(WAVEFORMATEX)); + + CoTaskMemFree(sharedClosestMatch); + + if ((int)sampleRate == closestMatchSR) + answer = paFormatIsSupported; + else + answer = paInvalidSampleRate; + + }else { + + //it doesnt suggest anything?? ok lets show it the MENU! + + //ok fun time as with pa_win_mme, we know only a refusal of the user-requested + //sampleRate+num Channel is disastrous, as the portaudio buffer processor converts between anything + //so lets only use the number + for (int i=0;i<FORMATTESTS;++i){ + WAVEFORMATEXTENSIBLE ext; + wasapiFillWFEXT(&ext,BestToWorst[i],sampleRate,params->channelCount); + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,&ext.Format,NULL); + else + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &ext.Format,&sharedClosestMatch); + + if (hResult == S_OK){ + memcpy(outWavex,&ext,sizeof(WAVEFORMATEXTENSIBLE)); + answer = paFormatIsSupported; + break; + } + } + + if (answer!=paFormatIsSupported) { + //try MIX format? + //why did it HAVE to come to this .... + WAVEFORMATEX pcm16WaveFormat; + memset(&pcm16WaveFormat,0,sizeof(WAVEFORMATEX)); + pcm16WaveFormat.wFormatTag = WAVE_FORMAT_PCM; + pcm16WaveFormat.nChannels = 2; + pcm16WaveFormat.nSamplesPerSec = (DWORD)sampleRate; + pcm16WaveFormat.nBlockAlign = 4; + pcm16WaveFormat.nAvgBytesPerSec = pcm16WaveFormat.nSamplesPerSec*pcm16WaveFormat.nBlockAlign; + pcm16WaveFormat.wBitsPerSample = 16; + pcm16WaveFormat.cbSize = 0; + + if (*shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_EXCLUSIVE,&pcm16WaveFormat,NULL); + else + hResult = myClient->IsFormatSupported(AUDCLNT_SHAREMODE_SHARED, &pcm16WaveFormat,&sharedClosestMatch); + + if (hResult == S_OK){ + memcpy(outWavex,&pcm16WaveFormat,sizeof(WAVEFORMATEX)); + answer = paFormatIsSupported; + } + } + + logAUDCLNT_E(hResult); + } + + return answer; } -static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, +static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, - double sampleRate) + double sampleRate ) { int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; - if (inputParameters) { + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (inputSampleFormat & paCustomFormat) + if( inputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that input device can support inputChannelCount */ - if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels) + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) return paInvalidChannelCount; /* validate inputStreamInfo */ - if (inputParameters->hostApiSpecificStreamInfo) + if( inputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; - - - IAudioClient *myClient=0; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); - if (hResult != S_OK) { - logAUDCLNT_E (hResult); - return paInvalidDevice; - } + IAudioClient *myClient=0; + HRESULT hResult = paWasapi->devInfo[inputParameters->device].device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } WAVEFORMATEXTENSIBLE wavex; + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(myClient,sampleRate,inputParameters,&shareMode,&wavex); + myClient->Release(); - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat (myClient,sampleRate,inputParameters,&shareMode,&wavex); - myClient->Release(); - - if (answer !=paFormatIsSupported) - return answer; - } else { + if (answer !=paFormatIsSupported) + return answer; + } + else + { inputChannelCount = 0; } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* all standard sample formats are supported by the buffer adapter, this implementation doesn't support any custom sample formats */ - - if (outputSampleFormat & paCustomFormat) + if( outputSampleFormat & paCustomFormat ) return paSampleFormatNotSupported; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that output device can support outputChannelCount */ - if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels) + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) return paInvalidChannelCount; /* validate outputStreamInfo */ - if (outputParameters->hostApiSpecificStreamInfo) + if( outputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; - - IAudioClient *myClient=0; - - HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**) &myClient); + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; - if (hResult != S_OK) { - logAUDCLNT_E (hResult); - return paInvalidDevice; - } + IAudioClient *myClient=0; + HRESULT hResult = paWasapi->devInfo[outputParameters->device].device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, (void**)&myClient); + if (hResult != S_OK){ + logAUDCLNT_E(hResult); + return paInvalidDevice; + } WAVEFORMATEXTENSIBLE wavex; + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(myClient,sampleRate,outputParameters,&shareMode,&wavex); + myClient->Release(); - AUDCLNT_SHAREMODE shareMode; - PaError answer = GetClosestFormat (myClient,sampleRate,outputParameters,&shareMode,&wavex); - myClient->Release(); - - if (answer !=paFormatIsSupported) - return answer; - } else { + if (answer !=paFormatIsSupported) + return answer; + } + else + { outputChannelCount = 0; } @@ -1328,7 +1146,7 @@ static PaError IsFormatSupported (struct PaUtilHostApiRepresentation *hostApi, /* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */ -static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, +static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, PaStream** s, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, @@ -1336,204 +1154,200 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, - void *userData) + void *userData ) { PaError result = paNoError; - PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*) hostApi; + PaWinWasapiHostApiRepresentation *paWasapi = (PaWinWasapiHostApiRepresentation*)hostApi; PaWinWasapiStream *stream = 0; int inputChannelCount, outputChannelCount; PaSampleFormat inputSampleFormat, outputSampleFormat; PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat; - stream = (PaWinWasapiStream*) PaUtil_AllocateMemory (sizeof (PaWinWasapiStream)); - - if (!stream) { + stream = (PaWinWasapiStream*)PaUtil_AllocateMemory( sizeof(PaWinWasapiStream) ); + if( !stream ){ result = paInsufficientMemory; goto error; } - if (inputParameters) { + if( inputParameters ) + { inputChannelCount = inputParameters->channelCount; inputSampleFormat = inputParameters->sampleFormat; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (inputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( inputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that input device can support inputChannelCount */ - if (inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels) + if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels ) return paInvalidChannelCount; /* validate inputStreamInfo */ - if (inputParameters->hostApiSpecificStreamInfo) + if( inputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ PaWinWasapiDeviceInfo &info = paWasapi->devInfo[inputParameters->device]; - HRESULT hResult = info.device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->in.client); + HRESULT hResult = info.device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->in.client); if (hResult != S_OK) return paInvalidDevice; - hResult = info.device->Activate ( - __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->inVol); + hResult = info.device->Activate( + __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->inVol); if (hResult != S_OK) return paInvalidDevice; - - AUDCLNT_SHAREMODE shareMode; - - PaError answer = GetClosestFormat (stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex); - - if (answer !=paFormatIsSupported) - return answer; + + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(stream->in.client,sampleRate,inputParameters,&shareMode,&stream->in.wavex); + + if (answer !=paFormatIsSupported) + return answer; //stream->out.period = info.DefaultDevicePeriod; stream->in.period = info.MinimumDevicePeriod; - hResult = stream->in.client->Initialize ( - shareMode, - 0, //no flags - stream->in.period, - 0,//stream->out.period, - (WAVEFORMATEX*) &stream->in.wavex, - &stream->session - ); - - if (hResult != S_OK) { - logAUDCLNT_E (hResult); + hResult = stream->in.client->Initialize( + shareMode, + 0, //no flags + stream->in.period, + 0,//stream->out.period, + (WAVEFORMATEX*)&stream->in.wavex, + &stream->session + ); + + if (hResult != S_OK){ + logAUDCLNT_E(hResult); return paInvalidDevice; } - hResult = stream->in.client->GetBufferSize (&stream->in.bufferSize); - + hResult = stream->in.client->GetBufferSize(&stream->in.bufferSize); if (hResult != S_OK) return paInvalidDevice; - hResult = stream->in.client->GetStreamLatency (&stream->in.latency); - + hResult = stream->in.client->GetStreamLatency(&stream->in.latency); if (hResult != S_OK) return paInvalidDevice; - double periodsPerSecond = 1.0/nano100ToSeconds (stream->in.period); - - double samplesPerPeriod = (double) (stream->in.wavex.Format.nSamplesPerSec) /periodsPerSecond; + double periodsPerSecond = 1.0/nano100ToSeconds(stream->in.period); + double samplesPerPeriod = (double)(stream->in.wavex.Format.nSamplesPerSec)/periodsPerSecond; //this is the number of samples that are required at each period - stream->in.framesPerHostCallback = (unsigned long) samplesPerPeriod;//unrelated to channels + stream->in.framesPerHostCallback = (unsigned long)samplesPerPeriod;//unrelated to channels /* IMPLEMENT ME - establish which host formats are available */ hostInputSampleFormat = - PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->in.wavex), inputSampleFormat); - } else { + PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->in.wavex), inputSampleFormat ); + } + else + { inputChannelCount = 0; inputSampleFormat = hostInputSampleFormat = paInt16; /* Surpress 'uninitialised var' warnings. */ } - if (outputParameters) { + if( outputParameters ) + { outputChannelCount = outputParameters->channelCount; outputSampleFormat = outputParameters->sampleFormat; /* unless alternate device specification is supported, reject the use of paUseHostApiSpecificDeviceSpecification */ - if (outputParameters->device == paUseHostApiSpecificDeviceSpecification) + if( outputParameters->device == paUseHostApiSpecificDeviceSpecification ) return paInvalidDevice; /* check that output device can support inputChannelCount */ - if (outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels) + if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels ) return paInvalidChannelCount; /* validate outputStreamInfo */ - if (outputParameters->hostApiSpecificStreamInfo) + if( outputParameters->hostApiSpecificStreamInfo ) return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */ PaWinWasapiDeviceInfo &info = paWasapi->devInfo[outputParameters->device]; - HRESULT hResult = info.device->Activate ( - __uuidof (IAudioClient), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->out.client); + HRESULT hResult = info.device->Activate( + __uuidof(IAudioClient), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->out.client); if (hResult != S_OK) return paInvalidDevice; - AUDCLNT_SHAREMODE shareMode; - - PaError answer = GetClosestFormat (stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex); - - if (answer !=paFormatIsSupported) - return answer; - - LogWAVEFORMATEXTENSIBLE (&stream->out.wavex); + AUDCLNT_SHAREMODE shareMode; + PaError answer = GetClosestFormat(stream->out.client,sampleRate,outputParameters,&shareMode,&stream->out.wavex); + + if (answer !=paFormatIsSupported) + return answer; + LogWAVEFORMATEXTENSIBLE(&stream->out.wavex); - // stream->out.period = info.DefaultDevicePeriod; + // stream->out.period = info.DefaultDevicePeriod; stream->out.period = info.MinimumDevicePeriod; - /*For an exclusive-mode stream that uses event-driven buffering, - the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, - and the values of these two parameters must be equal */ - if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE) { - hResult = stream->out.client->Initialize ( - shareMode, - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, - stream->out.period, - stream->out.period, - (WAVEFORMATEX*) &stream->out.wavex, - &stream->session - ); - } else { - hResult = stream->out.client->Initialize ( - shareMode, - AUDCLNT_STREAMFLAGS_EVENTCALLBACK, - 0, - 0, - (WAVEFORMATEX*) &stream->out.wavex, - &stream->session - ); - } - - - if (hResult != S_OK) { - logAUDCLNT_E (hResult); + /*For an exclusive-mode stream that uses event-driven buffering, + the caller must specify nonzero values for hnsPeriodicity and hnsBufferDuration, + and the values of these two parameters must be equal */ + if (shareMode == AUDCLNT_SHAREMODE_EXCLUSIVE){ + hResult = stream->out.client->Initialize( + shareMode, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, + stream->out.period, + stream->out.period, + (WAVEFORMATEX*)&stream->out.wavex, + &stream->session + ); + } + else{ + hResult = stream->out.client->Initialize( + shareMode, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, + 0, + 0, + (WAVEFORMATEX*)&stream->out.wavex, + &stream->session + ); + } + + + if (hResult != S_OK){ + logAUDCLNT_E(hResult); return paInvalidDevice; } - hResult = info.device->Activate ( - - __uuidof (IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, - (void**) &stream->outVol); + hResult = info.device->Activate( + __uuidof(IAudioEndpointVolume), CLSCTX_INPROC_SERVER, NULL, + (void**)&stream->outVol); if (hResult != S_OK) return paInvalidDevice; - hResult = stream->out.client->GetBufferSize (&stream->out.bufferSize); - + hResult = stream->out.client->GetBufferSize(&stream->out.bufferSize); if (hResult != S_OK) return paInvalidDevice; - hResult = stream->out.client->GetStreamLatency (&stream->out.latency); - + hResult = stream->out.client->GetStreamLatency(&stream->out.latency); if (hResult != S_OK) return paInvalidDevice; - - double periodsPerSecond = 1.0/nano100ToSeconds (stream->out.period); - - double samplesPerPeriod = (double) (stream->out.wavex.Format.nSamplesPerSec) /periodsPerSecond; + + double periodsPerSecond = 1.0/nano100ToSeconds(stream->out.period); + double samplesPerPeriod = (double)(stream->out.wavex.Format.nSamplesPerSec)/periodsPerSecond; //this is the number of samples that are required at each period stream->out.framesPerHostCallback = stream->out.bufferSize; //(unsigned long)samplesPerPeriod;//unrelated to channels /* IMPLEMENT ME - establish which host formats are available */ - hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat (waveformatToPaFormat (&stream->out.wavex), outputSampleFormat); - } else { + hostOutputSampleFormat = PaUtil_SelectClosestAvailableFormat( waveformatToPaFormat(&stream->out.wavex), outputSampleFormat ); + } + else + { outputChannelCount = 0; outputSampleFormat = hostOutputSampleFormat = paInt16; /* Surpress 'uninitialized var' warnings. */ } @@ -1567,55 +1381,56 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, /* validate platform specific flags */ - if ( (streamFlags & paPlatformSpecificFlags) != 0) + if( (streamFlags & paPlatformSpecificFlags) != 0 ) return paInvalidFlag; /* unexpected platform specific flag */ - if (streamCallback) { - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &paWasapi->callbackStreamInterface, streamCallback, userData); - } else { - PaUtil_InitializeStreamRepresentation (&stream->streamRepresentation, - &paWasapi->blockingStreamInterface, streamCallback, userData); + if( streamCallback ) + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &paWasapi->callbackStreamInterface, streamCallback, userData ); + } + else + { + PaUtil_InitializeStreamRepresentation( &stream->streamRepresentation, + &paWasapi->blockingStreamInterface, streamCallback, userData ); } - PaUtil_InitializeCpuLoadMeasurer (&stream->cpuLoadMeasurer, sampleRate); + PaUtil_InitializeCpuLoadMeasurer( &stream->cpuLoadMeasurer, sampleRate ); - if (outputParameters && inputParameters) { + if (outputParameters && inputParameters){ - //serious problem #1 - if (stream->in.period != stream->out.period) { - PRINT ( ("OpenStream: period discrepancy\n")); - goto error; - } + //serious problem #1 + if (stream->in.period != stream->out.period){ + PRINT(("OpenStream: period discrepancy\n")); + goto error; + } - //serious problem #2 - if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback) { - PRINT ( ("OpenStream: framesPerHostCallback discrepancy\n")); - goto error; - } - } + //serious problem #2 + if (stream->out.framesPerHostCallback != stream->in.framesPerHostCallback){ + PRINT(("OpenStream: framesPerHostCallback discrepancy\n")); + goto error; + } + } - unsigned long framesPerHostCallback = (outputParameters) ? - - stream->out.framesPerHostCallback: - stream->in.framesPerHostCallback; + unsigned long framesPerHostCallback = (outputParameters)? + stream->out.framesPerHostCallback: + stream->in.framesPerHostCallback; /* we assume a fixed host buffer size in this example, but the buffer processor can also support bounded and unknown host buffer sizes by passing paUtilBoundedHostBufferSize or paUtilUnknownHostBufferSize instead of paUtilFixedHostBufferSize below. */ - result = PaUtil_InitializeBufferProcessor (&stream->bufferProcessor, + result = PaUtil_InitializeBufferProcessor( &stream->bufferProcessor, inputChannelCount, inputSampleFormat, hostInputSampleFormat, outputChannelCount, outputSampleFormat, hostOutputSampleFormat, sampleRate, streamFlags, framesPerBuffer, framesPerHostCallback, paUtilFixedHostBufferSize, - streamCallback, userData); - - if (result != paNoError) + streamCallback, userData ); + if( result != paNoError ) goto error; @@ -1624,24 +1439,24 @@ static PaError OpenStream (struct PaUtilHostApiRepresentation *hostApi, values. */ stream->streamRepresentation.streamInfo.inputLatency = - PaUtil_GetBufferProcessorInputLatency (&stream->bufferProcessor) - + ( (inputParameters) ?nano100ToSeconds (stream->in.latency) :0); + PaUtil_GetBufferProcessorInputLatency(&stream->bufferProcessor) + + ((inputParameters)?nano100ToSeconds(stream->in.latency) :0); stream->streamRepresentation.streamInfo.outputLatency = - PaUtil_GetBufferProcessorOutputLatency (&stream->bufferProcessor) - + ( (outputParameters) ?nano100ToSeconds (stream->out.latency) :0); + PaUtil_GetBufferProcessorOutputLatency(&stream->bufferProcessor) + + ((outputParameters)?nano100ToSeconds(stream->out.latency) :0); stream->streamRepresentation.streamInfo.sampleRate = sampleRate; - *s = (PaStream*) stream; + *s = (PaStream*)stream; return result; error: - if (stream) - PaUtil_FreeMemory (stream); + if( stream ) + PaUtil_FreeMemory( stream ); return result; } @@ -1657,68 +1472,60 @@ error: if ((punk) != NULL) \ { (punk)->Release(); (punk) = NULL; } -static PaError CloseStream (PaStream* s) +static PaError CloseStream( PaStream* s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* IMPLEMENT ME: - additional stream closing + cleanup */ - SAFE_RELEASE (stream->out.client); - SAFE_RELEASE (stream->in.client); - SAFE_RELEASE (stream->cclient); - SAFE_RELEASE (stream->rclient); - SAFE_RELEASE (stream->inVol); - SAFE_RELEASE (stream->outVol); - CloseHandle (stream->hThread); - CloseHandle (stream->hNotificationEvent); + SAFE_RELEASE(stream->out.client); + SAFE_RELEASE(stream->in.client); + SAFE_RELEASE(stream->cclient); + SAFE_RELEASE(stream->rclient); + SAFE_RELEASE(stream->inVol); + SAFE_RELEASE(stream->outVol); + CloseHandle(stream->hThread); + CloseHandle(stream->hNotificationEvent); - PaUtil_TerminateBufferProcessor (&stream->bufferProcessor); - PaUtil_TerminateStreamRepresentation (&stream->streamRepresentation); - PaUtil_FreeMemory (stream); + PaUtil_TerminateBufferProcessor( &stream->bufferProcessor ); + PaUtil_TerminateStreamRepresentation( &stream->streamRepresentation ); + PaUtil_FreeMemory( stream ); return result; } -DWORD WINAPI ProcThread (void *client); +DWORD WINAPI ProcThread(void *client); -static PaError StartStream (PaStream *s) +static PaError StartStream( PaStream *s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; - - PaUtil_ResetBufferProcessor (&stream->bufferProcessor); - - HRESULT hResult=S_OK; - - if (stream->out.client) { - hResult = stream->out.client->GetService (__uuidof (IAudioRenderClient), (void**) &stream->rclient); - logAUDCLNT_E (hResult); - - if (hResult!=S_OK) - return paUnanticipatedHostError; - } - - if (stream->in.client) { - hResult = stream->in.client->GetService (__uuidof (IAudioCaptureClient), (void**) &stream->cclient); - logAUDCLNT_E (hResult); - - if (hResult!=S_OK) - return paUnanticipatedHostError; - } + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; + + PaUtil_ResetBufferProcessor( &stream->bufferProcessor ); + + HRESULT hResult=S_OK; + + if (stream->out.client){ + hResult = stream->out.client->GetService(__uuidof(IAudioRenderClient),(void**)&stream->rclient); + logAUDCLNT_E(hResult); + if (hResult!=S_OK) + return paUnanticipatedHostError; + } + + if (stream->in.client){ + hResult = stream->in.client->GetService(__uuidof(IAudioCaptureClient),(void**)&stream->cclient); + logAUDCLNT_E(hResult); + if (hResult!=S_OK) + return paUnanticipatedHostError; + } // Create a thread for this client. - stream->hThread = CreateThread ( - NULL, // no security attribute - 0, // default stack size - ProcThread, - (LPVOID) stream, // thread parameter - 0, // not suspended - &stream->dwThreadId); // returns thread ID - + stream->hThread = CREATE_THREAD; + if (stream->hThread == NULL) return paUnanticipatedHostError; @@ -1726,17 +1533,16 @@ static PaError StartStream (PaStream *s) } -static PaError StopStream (PaStream *s) +static PaError StopStream( PaStream *s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ stream->closeRequest = true; //todo something MUCH better than this - - while (stream->closeRequest) - Sleep (100); + while(stream->closeRequest) + Sleep(100); /* IMPLEMENT ME, see portaudio.h for required behavior */ @@ -1746,17 +1552,16 @@ static PaError StopStream (PaStream *s) } -static PaError AbortStream (PaStream *s) +static PaError AbortStream( PaStream *s ) { PaError result = paNoError; - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ stream->closeRequest = true; //todo something MUCH better than this - - while (stream->closeRequest) - Sleep (100); + while(stream->closeRequest) + Sleep(100); /* IMPLEMENT ME, see portaudio.h for required behavior */ @@ -1764,42 +1569,42 @@ static PaError AbortStream (PaStream *s) } -static PaError IsStreamStopped (PaStream *s) +static PaError IsStreamStopped( PaStream *s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; return !stream->running; } -static PaError IsStreamActive (PaStream *s) +static PaError IsStreamActive( PaStream *s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; return stream->running; } -static PaTime GetStreamTime (PaStream *s) +static PaTime GetStreamTime( PaStream *s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) stream; /* IMPLEMENT ME, see portaudio.h for required behavior*/ - //this is lame ds and mme does the same thing, quite useless method imho - //why dont we fetch the time in the pa callbacks? - //at least its doing to be clocked to something + //this is lame ds and mme does the same thing, quite useless method imho + //why dont we fetch the time in the pa callbacks? + //at least its doing to be clocked to something return PaUtil_GetTime(); } -static double GetStreamCpuLoad (PaStream* s) +static double GetStreamCpuLoad( PaStream* s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; - return PaUtil_GetCpuLoad (&stream->cpuLoadMeasurer); + return PaUtil_GetCpuLoad( &stream->cpuLoadMeasurer ); } @@ -1809,11 +1614,11 @@ static double GetStreamCpuLoad (PaStream* s) for blocking streams. */ -static PaError ReadStream (PaStream* s, +static PaError ReadStream( PaStream* s, void *buffer, - unsigned long frames) + unsigned long frames ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) buffer; @@ -1826,11 +1631,11 @@ static PaError ReadStream (PaStream* s, } -static PaError WriteStream (PaStream* s, +static PaError WriteStream( PaStream* s, const void *buffer, - unsigned long frames) + unsigned long frames ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) buffer; @@ -1843,9 +1648,9 @@ static PaError WriteStream (PaStream* s, } -static signed long GetStreamReadAvailable (PaStream* s) +static signed long GetStreamReadAvailable( PaStream* s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) stream; @@ -1856,9 +1661,9 @@ static signed long GetStreamReadAvailable (PaStream* s) } -static signed long GetStreamWriteAvailable (PaStream* s) +static signed long GetStreamWriteAvailable( PaStream* s ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) s; + PaWinWasapiStream *stream = (PaWinWasapiStream*)s; /* suppress unused variable warnings */ (void) stream; @@ -1875,16 +1680,16 @@ static signed long GetStreamWriteAvailable (PaStream* s) occur in a host implementation. */ -static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, +static void WaspiHostProcessingLoop( void *inputBuffer, long inputFrames, void *outputBuffer, long outputFrames, - void *userData) + void *userData ) { - PaWinWasapiStream *stream = (PaWinWasapiStream*) userData; + PaWinWasapiStream *stream = (PaWinWasapiStream*)userData; PaStreamCallbackTimeInfo timeInfo = {0,0,0}; /* IMPLEMENT ME */ int callbackResult; unsigned long framesProcessed; - PaUtil_BeginCpuLoadMeasurement (&stream->cpuLoadMeasurer); + PaUtil_BeginCpuLoadMeasurement( &stream->cpuLoadMeasurer ); /* @@ -1900,7 +1705,7 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, - PaUtil_BeginBufferProcessing (&stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */); + PaUtil_BeginBufferProcessing( &stream->bufferProcessor, &timeInfo, 0 /* IMPLEMENT ME: pass underflow/overflow flags when necessary */ ); /* depending on whether the host buffers are interleaved, non-interleaved @@ -1908,20 +1713,22 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, PaUtil_SetNonInterleaved*Channel() or PaUtil_Set*Channel() here. */ - if (stream->bufferProcessor.inputChannelCount > 0) { - PaUtil_SetInputFrameCount (&stream->bufferProcessor, inputFrames); - PaUtil_SetInterleavedInputChannels (&stream->bufferProcessor, - 0, /* first channel of inputBuffer is channel 0 */ - inputBuffer, - 0); /* 0 - use inputChannelCount passed to init buffer processor */ + if( stream->bufferProcessor.inputChannelCount > 0 ) + { + PaUtil_SetInputFrameCount( &stream->bufferProcessor, inputFrames ); + PaUtil_SetInterleavedInputChannels( &stream->bufferProcessor, + 0, /* first channel of inputBuffer is channel 0 */ + inputBuffer, + 0 ); /* 0 - use inputChannelCount passed to init buffer processor */ } - if (stream->bufferProcessor.outputChannelCount > 0) { - PaUtil_SetOutputFrameCount (&stream->bufferProcessor, outputFrames); - PaUtil_SetInterleavedOutputChannels (&stream->bufferProcessor, - 0, /* first channel of outputBuffer is channel 0 */ - outputBuffer, - 0); /* 0 - use outputChannelCount passed to init buffer processor */ + if( stream->bufferProcessor.outputChannelCount > 0 ) + { + PaUtil_SetOutputFrameCount( &stream->bufferProcessor, outputFrames); + PaUtil_SetInterleavedOutputChannels( &stream->bufferProcessor, + 0, /* first channel of outputBuffer is channel 0 */ + outputBuffer, + 0 ); /* 0 - use outputChannelCount passed to init buffer processor */ } /* you must pass a valid value of callback result to PaUtil_EndBufferProcessing() @@ -1931,8 +1738,7 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, using PaUtil_IsBufferProcessorOuputEmpty( bufferProcessor ) */ callbackResult = paContinue; - - framesProcessed = PaUtil_EndBufferProcessing (&stream->bufferProcessor, &callbackResult); + framesProcessed = PaUtil_EndBufferProcessing( &stream->bufferProcessor, &callbackResult ); /* @@ -1940,147 +1746,134 @@ static void WaspiHostProcessingLoop (void *inputBuffer, long inputFrames, host format, do it here. */ - PaUtil_EndCpuLoadMeasurement (&stream->cpuLoadMeasurer, framesProcessed); + PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed ); - if (callbackResult == paContinue) { + if( callbackResult == paContinue ) + { /* nothing special to do */ - } else if (callbackResult == paAbort) { + } + else if( callbackResult == paAbort ) + { /* IMPLEMENT ME - finish playback immediately */ /* once finished, call the finished callback */ - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); - } else { + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); + } + else + { /* User callback has asked us to stop with paComplete or other non-zero value */ /* IMPLEMENT ME - finish playback once currently queued audio has completed */ /* once finished, call the finished callback */ - if (stream->streamRepresentation.streamFinishedCallback != 0) - stream->streamRepresentation.streamFinishedCallback (stream->streamRepresentation.userData); + if( stream->streamRepresentation.streamFinishedCallback != 0 ) + stream->streamRepresentation.streamFinishedCallback( stream->streamRepresentation.userData ); } } -void -MMCSS_activate() -{ +void +MMCSS_activate(){ DWORD stuff=0; - HANDLE thCarac = pAvSetMmThreadCharacteristics ("Pro Audio",&stuff); - - if (!thCarac) { - PRINT ( ("AvSetMmThreadCharacteristics failed!\n")); + HANDLE thCarac = pAvSetMmThreadCharacteristics("Pro Audio",&stuff); + if (!thCarac){ + PRINT(("AvSetMmThreadCharacteristics failed!\n")); } - BOOL prio = pAvSetMmThreadPriority (thCarac,AVRT_PRIORITY_NORMAL); - - if (!prio) { - PRINT ( ("AvSetMmThreadPriority failed!\n")); + BOOL prio = pAvSetMmThreadPriority(thCarac,AVRT_PRIORITY_NORMAL); + if (!prio){ + PRINT(("AvSetMmThreadPriority failed!\n")); } - //debug + //debug { HANDLE hh = GetCurrentThread(); - int currprio = GetThreadPriority (hh); - DWORD currclass = GetPriorityClass (GetCurrentProcess()); - PRINT ( ("currprio 0x%X currclass 0x%X\n",currprio,currclass)); + int currprio = GetThreadPriority(hh); + DWORD currclass = GetPriorityClass(GetCurrentProcess()); + PRINT(("currprio 0x%X currclass 0x%X\n",currprio,currclass)); } } DWORD WINAPI -ProcThread (void* param) -{ - HRESULT hResult; - MMCSS_activate(); - - PaWinWasapiStream *stream = (PaWinWasapiStream*) param; - - stream->hNotificationEvent = CreateEvent (NULL, - FALSE, //bManualReset are we sure?? - FALSE, - "PAWASA"); - hResult = stream->out.client->SetEventHandle (stream->hNotificationEvent); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - if (stream->out.client) { - hResult = stream->out.client->Start(); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - } - - stream->running = true; - - bool bOne = false; - - while (!stream->closeRequest) { - //lets wait but have a 1 second timeout - DWORD dwResult = WaitForSingleObject (stream->hNotificationEvent, 1000); - - switch (dwResult) { - - case WAIT_OBJECT_0: { - - unsigned long usingBS = stream->out.framesPerHostCallback; - - BYTE* indata = 0; - BYTE* outdata = 0; - - hResult = stream->rclient->GetBuffer (usingBS, &outdata); - - if (hResult != S_OK || !outdata) { - //logAUDCLNT_E(hResult); - //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE - UINT32 padding = 0; - hResult = stream->out.client->GetCurrentPadding (&padding); - - if (padding == 0) - break; - - usingBS = usingBS-padding; - - if (usingBS == 0) - break;//huh? - - hResult = stream->rclient->GetBuffer (usingBS, &outdata); - - if (hResult != S_OK) //what can we do NOW?? - break; - - //logAUDCLNT_E(hResult); - } - - WaspiHostProcessingLoop (indata, usingBS ,outdata, usingBS, stream); - - hResult = stream->rclient->ReleaseBuffer (usingBS, 0); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - /* This was suggested, but in my tests it doesnt seem to improve the - locking behaviour some drivers have running in exclusive mode. - if(!ResetEvent(stream->hNotificationEvent)){ - logAUDCLNT_E(hResult); - } - */ - - } - - break; +ProcThread(void* param){ + HRESULT hResult; + MMCSS_activate(); + + PaWinWasapiStream *stream = (PaWinWasapiStream*)param; + + stream->hNotificationEvent = CreateEvent(NULL, + FALSE, //bManualReset are we sure?? + FALSE, + "PAWASA"); + hResult = stream->out.client->SetEventHandle(stream->hNotificationEvent); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + if (stream->out.client){ + hResult = stream->out.client->Start(); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + } + + stream->running = true; + bool bOne = false; + + while( !stream->closeRequest ) + { + //lets wait but have a 1 second timeout + DWORD dwResult = WaitForSingleObject(stream->hNotificationEvent, 1000); + switch( dwResult ) { + case WAIT_OBJECT_0: { + + unsigned long usingBS = stream->out.framesPerHostCallback; + + BYTE* indata = 0; + BYTE* outdata = 0; + + hResult = stream->rclient->GetBuffer(usingBS, &outdata); + + if (hResult != S_OK || !outdata) { + //logAUDCLNT_E(hResult); + //most probably shared mode and hResult=AUDCLNT_E_BUFFER_TOO_LARGE + UINT32 padding = 0; + hResult = stream->out.client->GetCurrentPadding(&padding); + if (padding == 0) + break; + usingBS = usingBS-padding; + if (usingBS == 0) + break;//huh? + hResult = stream->rclient->GetBuffer(usingBS, &outdata); + if (hResult != S_OK)//what can we do NOW?? + break; + //logAUDCLNT_E(hResult); + } + + WaspiHostProcessingLoop(indata, usingBS ,outdata, usingBS, stream); + + hResult = stream->rclient->ReleaseBuffer(usingBS, 0); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + /* This was suggested, but in my tests it doesnt seem to improve the + locking behaviour some drivers have running in exclusive mode. + if(!ResetEvent(stream->hNotificationEvent)){ + logAUDCLNT_E(hResult); + } + */ + + } + break; } } - - stream->out.client->Stop(); - + stream->out.client->Stop(); stream->closeRequest = false; - - return 0; + + return 0; } @@ -2092,42 +1885,28 @@ ProcThread (void* param) #if 0 - -if (bFirst) -{ - float masteur; - hResult = stream->outVol->GetMasterVolumeLevelScalar (&masteur); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - float chan1, chan2; - - hResult = stream->outVol->GetChannelVolumeLevelScalar (0, &chan1); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - hResult = stream->outVol->GetChannelVolumeLevelScalar (1, &chan2); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - BOOL bMute; - - hResult = stream->outVol->GetMute (&bMute); - - if (hResult != S_OK) - logAUDCLNT_E (hResult); - - stream->outVol->SetMasterVolumeLevelScalar (0.5, NULL); - - stream->outVol->SetChannelVolumeLevelScalar (0, 0.5, NULL); - - stream->outVol->SetChannelVolumeLevelScalar (1, 0.5, NULL); - - stream->outVol->SetMute (FALSE, NULL); - - bFirst = false; -} + if(bFirst) { + float masteur; + hResult = stream->outVol->GetMasterVolumeLevelScalar(&masteur); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + float chan1, chan2; + hResult = stream->outVol->GetChannelVolumeLevelScalar(0, &chan1); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + hResult = stream->outVol->GetChannelVolumeLevelScalar(1, &chan2); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + BOOL bMute; + hResult = stream->outVol->GetMute(&bMute); + if (hResult != S_OK) + logAUDCLNT_E(hResult); + + stream->outVol->SetMasterVolumeLevelScalar(0.5, NULL); + stream->outVol->SetChannelVolumeLevelScalar(0, 0.5, NULL); + stream->outVol->SetChannelVolumeLevelScalar(1, 0.5, NULL); + stream->outVol->SetMute(FALSE, NULL); + bFirst = false; + } #endif \ No newline at end of file diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c index 5dff2865cb10de7bec57808e75d2dc51297dde72..caddfd52d6a2fb673b8794007f5ba9bf2bebcbcb 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_wdmks.c 1339 2008-02-15 07:50:33Z rossb $ + * $Id: pa_win_wdmks.c 1411 2009-05-14 14:37:37Z rossb $ * PortAudio Windows WDM-KS interface * * Author: Andrew Baldwin @@ -77,7 +77,7 @@ #include <windows.h> #include <winioctl.h> - +#include <process.h> #ifdef __GNUC__ #undef PA_LOGE_ @@ -106,25 +106,31 @@ #define DYNAMIC_GUID(data) DYNAMIC_GUID_THUNK(data) #endif +/* use CreateThread for CYGWIN, _beginthreadex for all others */ +#ifndef __CYGWIN__ +#define CREATE_THREAD (HANDLE)_beginthreadex( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#else +#define CREATE_THREAD CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#endif + +/* use ExitThread for CYGWIN, _endthreadex for all others */ +#ifndef __CYGWIN__ +#define EXIT_THREAD _endthreadex(0) +#else +#define EXIT_THREAD ExitThread(0) +#endif + #ifdef _MSC_VER + #define NOMMIDS #define DYNAMIC_GUID(data) {data} - #define _INC_MMREG #define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */ #undef DEFINE_GUID #define DEFINE_GUID(n,data) EXTERN_C const GUID n = {data} #define DEFINE_GUID_THUNK(n,data) DEFINE_GUID(n,data) #define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n) - #if !defined( DEFINE_WAVEFORMATEX_GUID ) - #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 - #endif - #define WAVE_FORMAT_ADPCM 0x0002 - #define WAVE_FORMAT_IEEE_FLOAT 0x0003 - #define WAVE_FORMAT_ALAW 0x0006 - #define WAVE_FORMAT_MULAW 0x0007 - #define WAVE_FORMAT_MPEG 0x0050 - #define WAVE_FORMAT_DRM 0x0009 #endif +#include <mmreg.h> #include <ks.h> #include <ksmedia.h> #include <tchar.h> @@ -2910,11 +2916,26 @@ static DWORD WINAPI ProcessingThread(LPVOID pParam) PaUtil_SetInputChannel(&stream->bufferProcessor,i,((unsigned char*)(stream->packets[inbuf].Header.Data))+(i*stream->inputSampleSize),stream->deviceInputChannels); } } - /* Only call the EndBufferProcessing function is the total input frames == total output frames */ - if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == - (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + + if (stream->recordingPin && stream->playbackPin) /* full duplex */ + { + /* Only call the EndBufferProcessing function when the total input frames == total output frames */ + + if((stream->bufferProcessor.hostInputFrameCount[0] + stream->bufferProcessor.hostInputFrameCount[1]) == + (stream->bufferProcessor.hostOutputFrameCount[0] + stream->bufferProcessor.hostOutputFrameCount[1]) ) + { + framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor,&cbResult); + } + else + { + framesProcessed = 0; + } + } + else + { framesProcessed = PaUtil_EndBufferProcessing(&stream->bufferProcessor,&cbResult); - else framesProcessed = 0; + } + if( doChannelCopy ) { /* Copy the first output channel to the other channels */ @@ -3010,7 +3031,7 @@ static DWORD WINAPI ProcessingThread(LPVOID pParam) } PA_LOGL_; - ExitThread(0); + EXIT_THREAD; return 0; } @@ -3045,7 +3066,7 @@ static PaError StartStream( PaStream *s ) PA_DEBUG(("Class ret = %d;",ret));*/ stream->streamStarted = 1; - stream->streamThread = CreateThread(NULL, 0, ProcessingThread, stream, 0, &dwID); + stream->streamThread = (HANDLE)_beginthreadex(NULL, 0, ProcessingThread, stream, 0, &dwID); if(stream->streamThread == NULL) { stream->streamStarted = 0; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c index bbb8f8b87d733c9849f86c8dd2838f90bf3a1a9d..2436d8de1fa909ea349f66d51e2ba424b352cb34 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_wmme.c 1340 2008-02-15 08:31:42Z rossb $ + * $Id: pa_win_wmme.c 1432 2009-12-09 01:31:44Z rossb $ * pa_win_wmme.c * Implementation of PortAudio for Windows MultiMedia Extensions (WMME) * @@ -151,7 +151,17 @@ Non-critical stuff for the future: #endif #endif /* PAWIN_USE_WDMKS_DEVICE_INFO */ -#if (defined(UNDER_CE)) +/* use CreateThread for CYGWIN, _beginthreadex for all others */ +#if !defined(__CYGWIN__) && !defined(_WIN32_WCE) +#define CREATE_THREAD (HANDLE)_beginthreadex( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#define PA_THREAD_FUNC static unsigned WINAPI +#define PA_THREAD_ID unsigned +#else +#define CREATE_THREAD CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ) +#define PA_THREAD_FUNC static DWORD WINAPI +#define PA_THREAD_ID DWORD +#endif +#if (defined(_WIN32_WCE)) #pragma comment(lib, "Coredll.lib") #elif (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ #pragma comment(lib, "winmm.lib") @@ -161,7 +171,11 @@ Non-critical stuff for the future: provided in newer platform sdks */ #ifndef DWORD_PTR -#define DWORD_PTR DWORD + #if defined(_WIN64) + #define DWORD_PTR unsigned __int64 + #else + #define DWORD_PTR unsigned long + #endif #endif /************************************************* Constants ********/ @@ -198,6 +212,34 @@ Non-critical stuff for the future: static const char constInputMapperSuffix_[] = " - Input"; static const char constOutputMapperSuffix_[] = " - Output"; +/* +copies TCHAR string to explicit char string +*/ +char *StrTCpyToC(char *to, const TCHAR *from) +{ +#if !defined(_UNICODE) && !defined(UNICODE) + return strcpy(to, from); +#else + int count = wcslen(from); + if (count != 0) + if (WideCharToMultiByte(CP_ACP, 0, from, count, to, count, NULL, NULL) == 0) + return NULL; + return to; +#endif +} + +/* +returns length of TCHAR string +*/ +size_t StrTLen(const TCHAR *str) +{ +#if !defined(_UNICODE) && !defined(UNICODE) + return strlen(str); +#else + return wcslen(str); +#endif +} + /********************************************************************/ typedef struct PaWinMmeStream PaWinMmeStream; /* forward declaration */ @@ -464,6 +506,21 @@ static UINT LocalDeviceIndexToWinMmeDeviceId( PaWinMmeHostApiRepresentation *hos } +static int SampleFormatAndWinWmmeSpecificFlagsToLinearWaveFormatTag( PaSampleFormat sampleFormat, unsigned long winMmeSpecificFlags ) +{ + int waveFormatTag = 0; + + if( winMmeSpecificFlags & paWinMmeWaveFormatDolbyAc3Spdif ) + waveFormatTag = PAWIN_WAVE_FORMAT_DOLBY_AC3_SPDIF; + else if( winMmeSpecificFlags & paWinMmeWaveFormatWmaSpdif ) + waveFormatTag = PAWIN_WAVE_FORMAT_WMA_SPDIF; + else + waveFormatTag = PaWin_SampleFormatToLinearWaveFormatTag( sampleFormat ); + + return waveFormatTag; +} + + static PaError QueryInputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx ) { MMRESULT mmresult; @@ -518,43 +575,55 @@ static PaError QueryOutputWaveFormatEx( int deviceId, WAVEFORMATEX *waveFormatEx static PaError QueryFormatSupported( PaDeviceInfo *deviceInfo, PaError (*waveFormatExQueryFunction)(int, WAVEFORMATEX*), - int winMmeDeviceId, int channels, double sampleRate ) + int winMmeDeviceId, int channels, double sampleRate, unsigned long winMmeSpecificFlags ) { PaWinMmeDeviceInfo *winMmeDeviceInfo = (PaWinMmeDeviceInfo*)deviceInfo; PaWinWaveFormat waveFormat; + PaSampleFormat sampleFormat; + int waveFormatTag; + + /* @todo at the moment we only query with 16 bit sample format and directout speaker config*/ + + sampleFormat = paInt16; + waveFormatTag = SampleFormatAndWinWmmeSpecificFlagsToLinearWaveFormatTag( sampleFormat, winMmeSpecificFlags ); + + if( waveFormatTag == PaWin_SampleFormatToLinearWaveFormatTag( paInt16 ) ){ - if( sampleRate == 11025.0 - && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1M16)) - || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1S16)) ) ){ + /* attempt bypass querying the device for linear formats */ - return paNoError; - } + if( sampleRate == 11025.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_1S16)) ) ){ - if( sampleRate == 22050.0 - && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2M16)) - || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2S16)) ) ){ + return paNoError; + } - return paNoError; - } + if( sampleRate == 22050.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_2S16)) ) ){ - if( sampleRate == 44100.0 - && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4M16)) - || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4S16)) ) ){ + return paNoError; + } - return paNoError; + if( sampleRate == 44100.0 + && ( (channels == 1 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4M16)) + || (channels == 2 && (winMmeDeviceInfo->dwFormats & WAVE_FORMAT_4S16)) ) ){ + + return paNoError; + } } + /* first, attempt to query the device using WAVEFORMATEXTENSIBLE, if this fails we fall back to WAVEFORMATEX */ - /* @todo at the moment we only query with 16 bit sample format and directout speaker config*/ - PaWin_InitializeWaveFormatExtensible( &waveFormat, channels, - paInt16, sampleRate, PAWIN_SPEAKER_DIRECTOUT ); + PaWin_InitializeWaveFormatExtensible( &waveFormat, channels, sampleFormat, waveFormatTag, + sampleRate, PAWIN_SPEAKER_DIRECTOUT ); if( waveFormatExQueryFunction( winMmeDeviceId, (WAVEFORMATEX*)&waveFormat ) == paNoError ) return paNoError; - PaWin_InitializeWaveFormatEx( &waveFormat, channels, paInt16, sampleRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, channels, sampleFormat, waveFormatTag, sampleRate ); return waveFormatExQueryFunction( winMmeDeviceId, (WAVEFORMATEX*)&waveFormat ); } @@ -576,7 +645,7 @@ static void DetectDefaultSampleRate( PaWinMmeDeviceInfo *winMmeDeviceInfo, int w for( i=0; i < PA_DEFAULTSAMPLERATESEARCHORDER_COUNT_; ++i ) { double sampleRate = defaultSampleRateSearchOrder_[ i ]; - PaError paerror = QueryFormatSupported( deviceInfo, waveFormatExQueryFunction, winMmeDeviceId, maxChannels, sampleRate ); + PaError paerror = QueryFormatSupported( deviceInfo, waveFormatExQueryFunction, winMmeDeviceId, maxChannels, sampleRate, 0 ); if( paerror == paNoError ) { deviceInfo->defaultSampleRate = sampleRate; @@ -651,25 +720,25 @@ static PaError InitializeInputDeviceInfo( PaWinMmeHostApiRepresentation *winMmeH { /* Append I/O suffix to WAVE_MAPPER device. */ deviceName = (char *)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); + winMmeHostApi->allocations, StrTLen( wic.szPname ) + 1 + sizeof(constInputMapperSuffix_) ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, wic.szPname ); + StrTCpyToC( deviceName, wic.szPname ); strcat( deviceName, constInputMapperSuffix_ ); } else { deviceName = (char*)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( wic.szPname ) + 1 ); + winMmeHostApi->allocations, StrTLen( wic.szPname ) + 1 ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, wic.szPname ); + StrTCpyToC( deviceName, wic.szPname ); } deviceInfo->name = deviceName; @@ -751,6 +820,7 @@ static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMme MMRESULT mmresult; WAVEOUTCAPS woc; PaDeviceInfo *deviceInfo = &winMmeDeviceInfo->inheritedDeviceInfo; + int wdmksDeviceOutputChannelCountIsKnown; *success = 0; @@ -774,25 +844,25 @@ static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMme { /* Append I/O suffix to WAVE_MAPPER device. */ deviceName = (char *)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); + winMmeHostApi->allocations, StrTLen( woc.szPname ) + 1 + sizeof(constOutputMapperSuffix_) ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, woc.szPname ); + StrTCpyToC( deviceName, woc.szPname ); strcat( deviceName, constOutputMapperSuffix_ ); } else { deviceName = (char*)PaUtil_GroupAllocateMemory( - winMmeHostApi->allocations, strlen( woc.szPname ) + 1 ); + winMmeHostApi->allocations, StrTLen( woc.szPname ) + 1 ); if( !deviceName ) { result = paInsufficientMemory; goto error; } - strcpy( deviceName, woc.szPname ); + StrTCpyToC( deviceName, woc.szPname ); } deviceInfo->name = deviceName; @@ -816,8 +886,10 @@ static PaError InitializeOutputDeviceInfo( PaWinMmeHostApiRepresentation *winMme } #ifdef PAWIN_USE_WDMKS_DEVICE_INFO - winMmeDeviceInfo->deviceOutputChannelCountIsKnown = - QueryWaveOutKSFilterMaxChannels( winMmeOutputDeviceId, &deviceInfo->maxOutputChannels ); + wdmksDeviceOutputChannelCountIsKnown = QueryWaveOutKSFilterMaxChannels( + winMmeOutputDeviceId, &deviceInfo->maxOutputChannels ); + if( wdmksDeviceOutputChannelCountIsKnown && !winMmeDeviceInfo->deviceOutputChannelCountIsKnown ) + winMmeDeviceInfo->deviceOutputChannelCountIsKnown = 1; #endif /* PAWIN_USE_WDMKS_DEVICE_INFO */ winMmeDeviceInfo->dwFormats = woc.dwFormats; @@ -906,11 +978,11 @@ PaError PaWinMme_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd /* the following calls assume that if wave*Message fails the preferred device parameter won't be modified */ preferredDeviceStatusFlags = 0; waveInPreferredDevice = -1; - waveInMessage( (HWAVEIN)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD)&waveInPreferredDevice, (DWORD)&preferredDeviceStatusFlags ); + waveInMessage( (HWAVEIN)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR)&waveInPreferredDevice, (DWORD_PTR)&preferredDeviceStatusFlags ); preferredDeviceStatusFlags = 0; waveOutPreferredDevice = -1; - waveOutMessage( (HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD)&waveOutPreferredDevice, (DWORD)&preferredDeviceStatusFlags ); + waveOutMessage( (HWAVEOUT)WAVE_MAPPER, DRVM_MAPPER_PREFERRED_GET, (DWORD_PTR)&waveOutPreferredDevice, (DWORD_PTR)&preferredDeviceStatusFlags ); maximumPossibleDeviceCount = 0; @@ -1170,7 +1242,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputStreamInfo->devices[i].device ); - paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputStreamInfo->devices[i].channelCount, sampleRate ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, + winMmeInputDeviceId, inputStreamInfo->devices[i].channelCount, sampleRate, + ((inputStreamInfo) ? inputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1192,7 +1266,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeInputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, inputParameters->device ); - paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, winMmeInputDeviceId, inputChannelCount, sampleRate ); + paerror = QueryFormatSupported( inputDeviceInfo, QueryInputWaveFormatEx, + winMmeInputDeviceId, inputChannelCount, sampleRate, + ((inputStreamInfo) ? inputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1230,7 +1306,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputStreamInfo->devices[i].device ); - paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputStreamInfo->devices[i].channelCount, sampleRate ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, + winMmeOutputDeviceId, outputStreamInfo->devices[i].channelCount, sampleRate, + ((outputStreamInfo) ? outputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1252,7 +1330,9 @@ static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi, /* test for valid sample rate, see comment above */ winMmeOutputDeviceId = LocalDeviceIndexToWinMmeDeviceId( winMmeHostApi, outputParameters->device ); - paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, winMmeOutputDeviceId, outputChannelCount, sampleRate ); + paerror = QueryFormatSupported( outputDeviceInfo, QueryOutputWaveFormatEx, + winMmeOutputDeviceId, outputChannelCount, sampleRate, + ((outputStreamInfo) ? outputStreamInfo->flags : 0) ); if( paerror != paNoError ) return paInvalidSampleRate; } @@ -1676,6 +1756,7 @@ typedef struct static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers ); static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long winMmeSpecificFlags, unsigned long bytesPerHostSample, double sampleRate, PaWinMmeDeviceAndChannelCount *devices, unsigned int deviceCount, PaWinWaveFormatChannelMask channelMask, int isInput ); @@ -1700,6 +1781,7 @@ static void InitializeSingleDirectionHandlesAndBuffers( PaWinMmeSingleDirectionH static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostApi, PaWinMmeSingleDirectionHandlesAndBuffers *handlesAndBuffers, + unsigned long winMmeSpecificFlags, unsigned long bytesPerHostSample, double sampleRate, PaWinMmeDeviceAndChannelCount *devices, unsigned int deviceCount, PaWinWaveFormatChannelMask channelMask, int isInput ) @@ -1707,6 +1789,8 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA PaError result; MMRESULT mmresult; signed int i, j; + PaSampleFormat sampleFormat; + int waveFormatTag; /* for error cleanup we expect that InitializeSingleDirectionHandlesAndBuffers() has already been called to zero some fields */ @@ -1734,6 +1818,10 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA ((HWAVEOUT*)handlesAndBuffers->waveHandles)[i] = 0; } + /* @todo at the moment we only use 16 bit sample format */ + sampleFormat = paInt16; + waveFormatTag = SampleFormatAndWinWmmeSpecificFlagsToLinearWaveFormatTag( sampleFormat, winMmeSpecificFlags ); + for( i = 0; i < (signed int)deviceCount; ++i ) { PaWinWaveFormat waveFormat; @@ -1749,16 +1837,16 @@ static PaError InitializeWaveHandles( PaWinMmeHostApiRepresentation *winMmeHostA /* first, attempt to open the device using WAVEFORMATEXTENSIBLE, if this fails we fall back to WAVEFORMATEX */ - /* @todo at the moment we only use 16 bit sample format */ PaWin_InitializeWaveFormatExtensible( &waveFormat, devices[i].channelCount, - paInt16, sampleRate, channelMask ); + sampleFormat, waveFormatTag, sampleRate, channelMask ); } else { /* retry with WAVEFORMATEX */ - PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount, paInt16, sampleRate ); + PaWin_InitializeWaveFormatEx( &waveFormat, devices[i].channelCount, + sampleFormat, waveFormatTag, sampleRate ); } /* REVIEW: consider not firing an event for input when a full duplex @@ -2042,7 +2130,7 @@ struct PaWinMmeStream /* Processing thread management -------------- */ HANDLE abortEvent; HANDLE processingThread; - DWORD processingThreadId; + PA_THREAD_ID processingThreadId; char throttleProcessingThreadOnOverload; /* 0 -> don't throtte, non-0 -> throttle */ int processingThreadPriority; @@ -2063,6 +2151,7 @@ struct PaWinMmeStream static PaError ValidateWinMmeSpecificStreamInfo( const PaStreamParameters *streamParameters, const PaWinMmeStreamInfo *streamInfo, + unsigned long *winMmeSpecificFlags, char *throttleProcessingThreadOnOverload, unsigned long *deviceCount ) { @@ -2074,6 +2163,8 @@ static PaError ValidateWinMmeSpecificStreamInfo( return paIncompatibleHostApiSpecificStreamInfo; } + *winMmeSpecificFlags = streamInfo->flags; + if( streamInfo->flags & paWinMmeDontThrottleOverloadedProcessingThread ) *throttleProcessingThreadOnOverload = 0; @@ -2217,8 +2308,10 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, unsigned long hostOutputBufferCount; unsigned long framesPerBufferProcessorCall; PaWinMmeDeviceAndChannelCount *inputDevices = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ + unsigned long winMmeSpecificInputFlags = 0; unsigned long inputDeviceCount = 0; PaWinMmeDeviceAndChannelCount *outputDevices = 0; + unsigned long winMmeSpecificOutputFlags = 0; unsigned long outputDeviceCount = 0; /* contains all devices and channel counts as local host api ids, even when PaWinMmeUseMultipleDevices is not used */ char throttleProcessingThreadOnOverload = 1; @@ -2234,6 +2327,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* validate input hostApiSpecificStreamInfo */ inputStreamInfo = (PaWinMmeStreamInfo*)inputParameters->hostApiSpecificStreamInfo; result = ValidateWinMmeSpecificStreamInfo( inputParameters, inputStreamInfo, + &winMmeSpecificInputFlags, &throttleProcessingThreadOnOverload, &inputDeviceCount ); if( result != paNoError ) return result; @@ -2283,6 +2377,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, /* validate output hostApiSpecificStreamInfo */ outputStreamInfo = (PaWinMmeStreamInfo*)outputParameters->hostApiSpecificStreamInfo; result = ValidateWinMmeSpecificStreamInfo( outputParameters, outputStreamInfo, + &winMmeSpecificOutputFlags, &throttleProcessingThreadOnOverload, &outputDeviceCount ); if( result != paNoError ) return result; @@ -2332,6 +2427,14 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, return paInvalidFlag; /* unexpected platform specific flag */ + /* always disable clipping and dithering if we are outputting a raw spdif stream */ + if( (winMmeSpecificOutputFlags & paWinMmeWaveFormatDolbyAc3Spdif) + || (winMmeSpecificOutputFlags & paWinMmeWaveFormatWmaSpdif) ){ + + streamFlags = streamFlags | paClipOff | paDitherOff; + } + + result = CalculateBufferSettings( &framesPerHostInputBuffer, &hostInputBufferCount, &framesPerHostOutputBuffer, &hostOutputBufferCount, inputChannelCount, hostInputSampleFormat, suggestedInputLatency, inputStreamInfo, @@ -2430,6 +2533,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, if( inputParameters ) { result = InitializeWaveHandles( winMmeHostApi, &stream->input, + winMmeSpecificInputFlags, stream->bufferProcessor.bytesPerHostInputSample, sampleRate, inputDevices, inputDeviceCount, inputChannelMask, 1 /* isInput */ ); if( result != paNoError ) goto error; @@ -2438,6 +2542,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi, if( outputParameters ) { result = InitializeWaveHandles( winMmeHostApi, &stream->output, + winMmeSpecificOutputFlags, stream->bufferProcessor.bytesPerHostOutputSample, sampleRate, outputDevices, outputDeviceCount, outputChannelMask, 0 /* isInput */ ); if( result != paNoError ) goto error; @@ -2691,7 +2796,7 @@ static PaError CatchUpOutputBuffers( PaWinMmeStream *stream ) } -static DWORD WINAPI ProcessingThreadProc( void *pArg ) +PA_THREAD_FUNC ProcessingThreadProc( void *pArg ) { PaWinMmeStream *stream = (PaWinMmeStream *)pArg; HANDLE events[3]; @@ -3244,7 +3349,7 @@ static PaError StartStream( PaStream *s ) if( result != paNoError ) goto error; /* Create thread that waits for audio buffers to be ready for processing. */ - stream->processingThread = CreateThread( 0, 0, ProcessingThreadProc, stream, 0, &stream->processingThreadId ); + stream->processingThread = CREATE_THREAD; if( !stream->processingThread ) { result = paUnanticipatedHostError; diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c index 8407c3ecd9c6c5b36d6ba263337a8b4e49494fae..339e1b148d242456b32a267a5c63e406f6571ae9 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_hostapis.c @@ -1,5 +1,5 @@ /* - * $Id: pa_unix_hostapis.c 1381 2008-03-30 21:02:09Z aknudsen $ + * $Id: pa_unix_hostapis.c 1413 2009-05-24 17:00:36Z aknudsen $ * Portable Audio I/O Library UNIX initialization table * * Based on the Open Source API proposed by Ross Bencina @@ -52,8 +52,7 @@ PaError PaAsiHpi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiInd PaError PaMacCore_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index ); -/** Note that ALSA is placed before OSS so that the latter is preferred over the - * latter on Linux. +/** Note that on Linux, ALSA is placed before OSS so that the former is preferred over the latter. */ PaUtilHostApiInitializer *paHostApiInitializers[] = @@ -68,7 +67,7 @@ PaUtilHostApiInitializer *paHostApiInitializers[] = PaOSS_Initialize, #endif -#else +#else /* __linux__ */ #ifdef PA_USE_OSS PaOSS_Initialize, diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c index 1cb838752c13d47748eeed869d42244a4e6c1efa..de54e51ddbd9f5c29bd07d2af0926c767ac7beac 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/unix/pa_unix_util.c @@ -1,5 +1,5 @@ /* - * $Id: pa_unix_util.c 1232 2007-06-16 14:49:43Z rossb $ + * $Id: pa_unix_util.c 1419 2009-10-22 17:28:35Z bjornroche $ * Portable Audio I/O Library * UNIX platform-specific support functions * @@ -51,6 +51,13 @@ #include <math.h> #include <errno.h> +#if defined(__APPLE__) && !defined(HAVE_MACH_ABSOLUTE_TIME) +#define HAVE_MACH_ABSOLUTE_TIME +#endif +#ifdef HAVE_MACH_ABSOLUTE_TIME +#include <mach/mach_time.h> +#endif + #include "pa_util.h" #include "pa_unix_util.h" #include "pa_debugprint.h" @@ -118,27 +125,47 @@ void Pa_Sleep( long msec ) #endif } -/* *** NOT USED YET: *** -static int usePerformanceCounter_; -static double microsecondsPerTick_; +#ifdef HAVE_MACH_ABSOLUTE_TIME +/* + Discussion on the CoreAudio mailing list suggests that calling + gettimeofday (or anything else in the BSD layer) is not real-time + safe, so we use mach_absolute_time on OSX. This implementation is + based on these two links: + + Technical Q&A QA1398 - Mach Absolute Time Units + http://developer.apple.com/mac/library/qa/qa2004/qa1398.html + + Tutorial: Performance and Time. + http://www.macresearch.org/tutorial_performance_and_time */ +/* Scaler to convert the result of mach_absolute_time to seconds */ +static double machSecondsConversionScaler_ = 0.0; +#endif + void PaUtil_InitializeClock( void ) { - /* TODO */ +#ifdef HAVE_MACH_ABSOLUTE_TIME + mach_timebase_info_data_t info; + kern_return_t err = mach_timebase_info( &info ); + if( err == 0 ) + machSecondsConversionScaler_ = 1e-9 * (double) info.numer / (double) info.denom; +#endif } PaTime PaUtil_GetTime( void ) { -#ifdef HAVE_CLOCK_GETTIME +#ifdef HAVE_MACH_ABSOLUTE_TIME + return mach_absolute_time() * machSecondsConversionScaler_; +#elif defined(HAVE_CLOCK_GETTIME) struct timespec tp; clock_gettime(CLOCK_REALTIME, &tp); - return (PaTime)(tp.tv_sec + tp.tv_nsec / 1.e9); + return (PaTime)(tp.tv_sec + tp.tv_nsec * 1e-9); #else struct timeval tv; gettimeofday( &tv, NULL ); - return (PaTime) tv.tv_usec / 1000000. + tv.tv_sec; + return (PaTime) tv.tv_usec * 1e-6 + tv.tv_sec; #endif } @@ -190,7 +217,7 @@ PaError PaUtil_CancelThreading( PaUtilThreading *threading, int wait, PaError *e /* paUnixMainThread * We have to be a bit careful with defining this global variable, * as explained below. */ -#ifdef __apple__ +#ifdef __APPLE__ /* apple/gcc has a "problem" with global vars and dynamic libs. Initializing it seems to fix the problem. Described a bit in this thread: diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c index e882886c9f88e58fa6effa1fd540316bd6e489a5..1354b9ab23d8672e8cbd16fd2c7369913b45ee43 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_util.c @@ -1,5 +1,5 @@ /* - * $Id: pa_win_util.c 1339 2008-02-15 07:50:33Z rossb $ + * $Id: pa_win_util.c 1410 2009-04-07 10:08:48Z rossb $ * Portable Audio I/O Library * Win32 platform-specific support functions * @@ -51,6 +51,10 @@ #include "pa_util.h" +#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */ +#pragma comment( lib, "winmm.lib" ) +#endif + /* Track memory allocations to avoid leaks. diff --git a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c index 6b91ebd98401c021fbc29b1b9e33db87a12f2018..bbf616c3448315d1ffcd516406f80ba277bb4713 100644 --- a/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c +++ b/sflphone-common/libs/pjproject/third_party/portaudio/src/os/win/pa_win_waveformat.c @@ -47,30 +47,27 @@ #define WAVE_FORMAT_EXTENSIBLE 0xFFFE #endif -#if !defined(WAVE_FORMAT_IEEE_FLOAT) -#define WAVE_FORMAT_IEEE_FLOAT 0x0003 -#endif - -static GUID pawin_ksDataFormatSubtypePcm = +static GUID pawin_ksDataFormatSubtypeGuidBase = { (USHORT)(WAVE_FORMAT_PCM), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }; -static GUID pawin_ksDataFormatSubtypeIeeeFloat = - { (USHORT)(WAVE_FORMAT_IEEE_FLOAT), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }; +int PaWin_SampleFormatToLinearWaveFormatTag( PaSampleFormat sampleFormat ) +{ + if( sampleFormat == paFloat32 ) + return PAWIN_WAVE_FORMAT_IEEE_FLOAT; + + return PAWIN_WAVE_FORMAT_PCM; +} void PaWin_InitializeWaveFormatEx( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate ) + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate ) { WAVEFORMATEX *waveFormatEx = (WAVEFORMATEX*)waveFormat; int bytesPerSample = Pa_GetSampleSize(sampleFormat); unsigned long bytesPerFrame = numChannels * bytesPerSample; - - if( sampleFormat == paFloat32 ) - waveFormatEx->wFormatTag = WAVE_FORMAT_IEEE_FLOAT; - else - waveFormatEx->wFormatTag = WAVE_FORMAT_PCM; + waveFormatEx->wFormatTag = waveFormatTag; waveFormatEx->nChannels = (WORD)numChannels; waveFormatEx->nSamplesPerSec = (DWORD)sampleRate; waveFormatEx->nAvgBytesPerSec = waveFormatEx->nSamplesPerSec * bytesPerFrame; @@ -81,12 +78,13 @@ void PaWin_InitializeWaveFormatEx( PaWinWaveFormat *waveFormat, void PaWin_InitializeWaveFormatExtensible( PaWinWaveFormat *waveFormat, - int numChannels, PaSampleFormat sampleFormat, double sampleRate, + int numChannels, PaSampleFormat sampleFormat, int waveFormatTag, double sampleRate, PaWinWaveFormatChannelMask channelMask ) { WAVEFORMATEX *waveFormatEx = (WAVEFORMATEX*)waveFormat; int bytesPerSample = Pa_GetSampleSize(sampleFormat); unsigned long bytesPerFrame = numChannels * bytesPerSample; + GUID guid; waveFormatEx->wFormatTag = WAVE_FORMAT_EXTENSIBLE; waveFormatEx->nChannels = (WORD)numChannels; @@ -100,13 +98,10 @@ void PaWin_InitializeWaveFormatExtensible( PaWinWaveFormat *waveFormat, waveFormatEx->wBitsPerSample; *((DWORD*)&waveFormat->fields[PAWIN_INDEXOF_DWCHANNELMASK]) = channelMask; - - if( sampleFormat == paFloat32 ) - *((GUID*)&waveFormat->fields[PAWIN_INDEXOF_SUBFORMAT]) = - pawin_ksDataFormatSubtypeIeeeFloat; - else - *((GUID*)&waveFormat->fields[PAWIN_INDEXOF_SUBFORMAT]) = - pawin_ksDataFormatSubtypePcm; + + guid = pawin_ksDataFormatSubtypeGuidBase; + guid.Data1 = (USHORT)waveFormatTag; + *((GUID*)&waveFormat->fields[PAWIN_INDEXOF_SUBFORMAT]) = guid; } diff --git a/sflphone-common/man/sflphoned.pod b/sflphone-common/man/sflphoned.pod index bd1e40a2dbfdac8a0650b04b41b9bc2a4201f262..99edc5140ff7e6c9752b913a51b5936456983d47 100644 --- a/sflphone-common/man/sflphoned.pod +++ b/sflphone-common/man/sflphoned.pod @@ -4,7 +4,7 @@ sflphoned - SIP and IAX2 compatible voice over IP softphone core. =head1 SYNOPSIS -sflphoned --help +B<sflphoned> [OPTION]... =head1 DESCRIPTION @@ -14,7 +14,7 @@ B<sflphoned> is the core of SFLphone; it communicates with the client side throu =head1 BUGS -Please report bugs at http://dev.savoirfairelinux.net/sflphone/newticket. +Please report bugs at https://projects.savoirfairelinux.com/projects/sflphone/issues/new. =head1 AUTHORS diff --git a/sflphone-common/src/account.cpp b/sflphone-common/src/account.cpp index e916ac6875c8c3ce94d1b949fcbd91b4c277e900..68c3e732b17865fceaaf3cd999bec09188d76f03 100644 --- a/sflphone-common/src/account.cpp +++ b/sflphone-common/src/account.cpp @@ -23,43 +23,91 @@ #include "manager.h" Account::Account (const AccountID& accountID, std::string type) : - _accountID (accountID) - , _link (NULL) - , _enabled (false) - , _type (type) + _accountID (accountID) + , _link (NULL) + , _enabled (false) + , _type (type) + , _codecOrder () { - setRegistrationState (Unregistered); + setRegistrationState (Unregistered); } Account::~Account() { } -void Account::loadConfig() -{ - std::string p; +void Account::loadConfig() { + + std::string p; - p = Manager::instance().getConfigString (_accountID , CONFIG_ACCOUNT_TYPE); + p = Manager::instance().getConfigString (_accountID , CONFIG_ACCOUNT_TYPE); #ifdef USE_IAX - _enabled = (Manager::instance().getConfigString (_accountID, CONFIG_ACCOUNT_ENABLE) == "true") ? true : false; + _enabled = (Manager::instance().getConfigString (_accountID, CONFIG_ACCOUNT_ENABLE) == "true") ? true : false; #else - if (p.c_str() == "IAX") - _enabled = false; - else - _enabled = (Manager::instance().getConfigString (_accountID, CONFIG_ACCOUNT_ENABLE) == "true") ? true : false; + if (p == "IAX") + _enabled = false; + else + _enabled = (Manager::instance().getConfigString (_accountID, CONFIG_ACCOUNT_ENABLE) == "true") ? true : false; #endif + + loadAudioCodecs (); } -void Account::setRegistrationState (RegistrationState state) -{ +void Account::setRegistrationState (RegistrationState state) { + + if (state != _registrationState) { + _debug ("Account: set registration state"); + _registrationState = state; + + // Notify the client + Manager::instance().connectionStatusNotification(); + } +} + +void Account::loadAudioCodecs (void) { + + // if the user never set the codec list, use the default configuration for this account + if (Manager::instance ().getConfigString (_accountID, "ActiveCodecs") == "") { + _info ("Account: use the default order"); + Manager::instance ().getCodecDescriptorMap ().setDefaultOrder(); + } + + // else retrieve the one set in the user config file + else { + std::vector<std::string> active_list = Manager::instance ().retrieveActiveCodecs(); + // This property is now set per account basis + std::string s = Manager::instance ().getConfigString (_accountID, "ActiveCodecs"); + setActiveCodecs (Manager::instance ().unserialize (s)); + } +} + +void Account::setActiveCodecs (const std::vector <std::string> &list) { + + _codecOrder.clear(); + // list contains the ordered payload of active codecs picked by the user for this account + // we used the CodecOrder vector to save the order. + int i=0; + int payload; + size_t size = list.size(); + + _info ("Account: Set the custom order %i", list.size ()); + + while ( (unsigned int) i < size) { + payload = std::atoi (list[i].data()); + _info ("Account: Adding codec with RTP payload=%i", payload); + //if (Manager::instance ().getCodecDescriptorMap ().isCodecLoaded (payload)) { + _codecOrder.push_back ( (AudioCodecType) payload); + //} + i++; + } + + // setConfig + std::string s = Manager::instance ().serialize (list); + _info ("Account: Setting codec with payload number %s to the active list", s.c_str()); + // Set the config per account + Manager::instance().setConfig (_accountID, "ActiveCodecs", s); - if (state != _registrationState) { - _debug ("Account::setRegistrationState"); - _registrationState = state; - // Notify the client - Manager::instance().connectionStatusNotification(); - } } diff --git a/sflphone-common/src/account.h b/sflphone-common/src/account.h index 2edddfe9bfeda5fc6599b624d5ecca8bcd2bbddc..3272010a2e9f8d924ae09a817cc7f40a03f51cfe 100644 --- a/sflphone-common/src/account.h +++ b/sflphone-common/src/account.h @@ -54,6 +54,9 @@ typedef enum RegistrationState { #define AccountNULL "" +// Account identifier +#define ACCOUNT_ID "Account.id" + // Common account parameters #define CONFIG_ACCOUNT_TYPE "Account.type" #define CONFIG_ACCOUNT_ALIAS "Account.alias" @@ -62,6 +65,7 @@ typedef enum RegistrationState { #define CONFIG_ACCOUNT_RESOLVE_ONCE "Account.resolveOnce" #define CONFIG_ACCOUNT_REGISTRATION_EXPIRE "Account.expire" #define CONFIG_CREDENTIAL_NUMBER "Credential.count" +#define ACCOUNT_DTMF_TYPE "Account.dtmfType" #define HOSTNAME "hostname" #define USERNAME "username" @@ -69,6 +73,7 @@ typedef enum RegistrationState { #define PASSWORD "password" #define REALM "realm" #define DEFAULT_REALM "*" +#define USERAGENT "useragent" #define LOCAL_INTERFACE "Account.localInterface" #define PUBLISHED_SAMEAS_LOCAL "Account.publishedSameAsLocal" @@ -88,11 +93,13 @@ typedef enum RegistrationState { #define SRTP_ENABLE "SRTP.enable" #define SRTP_KEY_EXCHANGE "SRTP.keyExchange" #define SRTP_ENCRYPTION_ALGO "SRTP.encryptionAlgorithm" // Provided by ccRTP,0=NULL,1=AESCM,2=AESF8 +#define SRTP_RTP_FALLBACK "SRTP.rtpFallback" #define ZRTP_HELLO_HASH "ZRTP.helloHashEnable" #define ZRTP_DISPLAY_SAS "ZRTP.displaySAS" #define ZRTP_NOT_SUPP_WARNING "ZRTP.notSuppWarning" #define ZRTP_DISPLAY_SAS_ONCE "ZRTP.displaySasOnce" +#define TLS_LISTENER_PORT "TLS.listenerPort" #define TLS_ENABLE "TLS.enable" #define TLS_CA_LIST_FILE "TLS.certificateListFile" #define TLS_CERTIFICATE_FILE "TLS.certificateFile" @@ -111,6 +118,7 @@ typedef enum RegistrationState { #define REGISTRATION_STATE_CODE "Registration.code" #define REGISTRATION_STATE_DESCRIPTION "Registration.description" + class Account{ public: @@ -207,6 +215,14 @@ class Account{ inline std::string getType( void ) { return _type; } inline void setType( std::string type ) { _type = type; } + + /** + * Accessor to data structures + * @return CodecOrder& The list that reflects the user's choice + */ + inline CodecOrder& getActiveCodecs() { return _codecOrder; } + + void setActiveCodecs (const std::vector <std::string>& list); private: // copy constructor @@ -215,6 +231,8 @@ class Account{ // assignment operator Account& operator=(const Account& rh); + void loadAudioCodecs (void); + protected: /** * Account ID are assign in constructor and shall not changed @@ -271,6 +289,11 @@ class Account{ */ std::pair<int, std::string> _registrationStateDetailed; + /** + * Vector containing the order of the codecs + */ + CodecOrder _codecOrder; + }; #endif diff --git a/sflphone-common/src/audio/Makefile.am b/sflphone-common/src/audio/Makefile.am index 19e5f45793c140ae16fc8936023ad03821990b64..4e86ba6f5350dea43a11f00c62afb3845674b8e8 100644 --- a/sflphone-common/src/audio/Makefile.am +++ b/sflphone-common/src/audio/Makefile.am @@ -2,13 +2,6 @@ include $(top_srcdir)/globals.mak noinst_LTLIBRARIES = libaudio.la - -if BUILD_ILBC -ILBC_FLAG = -DBUILD_ILBC -else -ILBC_FLAG = -endif - SUBDIRS = codecs audiortp sound alsa pulseaudio libaudio_la_SOURCES = \ diff --git a/sflphone-common/src/audio/alsa/alsalayer.cpp b/sflphone-common/src/audio/alsa/alsalayer.cpp index 920ab666b3be0e2e0824f8130dc4943e722b0542..caa4d7f46cf1ae5710ac6e58f18b68fd29f07e33 100644 --- a/sflphone-common/src/audio/alsa/alsalayer.cpp +++ b/sflphone-common/src/audio/alsa/alsalayer.cpp @@ -135,7 +135,8 @@ AlsaLayer::openDevice (int indexIn, int indexOut, int sampleRate, int frameSize, std::string pcmc = buildDeviceTopo (plugin, indexIn, 0); - _converter = new SamplerateConverter (_audioSampleRate, _frameSize); + // use 1 sec buffer for resampling + _converter = new SamplerateConverter (_audioSampleRate, 1000); // open_device (pcmp, pcmc, stream); return true; // open_device (pcmp, pcmc, stream); @@ -383,12 +384,12 @@ bool AlsaLayer::alsa_set_params (snd_pcm_t *pcm_handle, int type, int rate) int err; int format; int periods = 4; - int periodsize = 1024; + int periodsize = 2048; /* Allocate the snd_pcm_hw_params_t struct */ snd_pcm_hw_params_malloc (&hwparams); - _periodSize = 940; + _periodSize = 2048; /* Full configuration space */ if ( (err = snd_pcm_hw_params_any (pcm_handle, hwparams)) < 0) { diff --git a/sflphone-common/src/audio/audiolayer.cpp b/sflphone-common/src/audio/audiolayer.cpp index e0a84d48481a1514b163a5824840f442517ffdbc..c6b40d81ef122f51b23a125b0f2569fc1e5295b6 100644 --- a/sflphone-common/src/audio/audiolayer.cpp +++ b/sflphone-common/src/audio/audiolayer.cpp @@ -40,7 +40,6 @@ void AudioLayer::flushUrgent (void) int AudioLayer::putUrgent (void* buffer, int toCopy) { - _debug ("------------------- AudioLayer::putUrgent --------------------"); int a; ost::MutexLock guard (_mutex); diff --git a/sflphone-common/src/audio/audiolayer.h b/sflphone-common/src/audio/audiolayer.h index 580c064e510b337790ddf0c453e06b4b23c9d4ff..46dc81533f7a826669f7c2f9136976661cf9d783 100644 --- a/sflphone-common/src/audio/audiolayer.h +++ b/sflphone-common/src/audio/audiolayer.h @@ -58,7 +58,7 @@ class AudioLayer { */ AudioLayer( ManagerImpl* manager , int type ) : _defaultVolume(100) - , _layerType( type ) + , _layerType( type ) , _manager(manager) , _urgentRingBuffer( SIZEBUF, default_id ) , _indexIn ( 0 ) diff --git a/sflphone-common/src/audio/audiortp.cpp b/sflphone-common/src/audio/audiortp.cpp deleted file mode 100644 index 26615888a789d5b863c2a3e9f284fca381e2b458..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/audiortp.cpp +++ /dev/null @@ -1,685 +0,0 @@ -/* - * Copyright (C) 2004-2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> - * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <cstdio> -#include <cstdlib> -#include <ccrtp/rtp.h> -#include <assert.h> -#include <cstring> -#include <math.h> -#include <dlfcn.h> -#include <iostream> -#include <sstream> - -#include "../global.h" -#include "../manager.h" -#include "codecDescriptor.h" -#include "audiortp.h" -#include "audiolayer.h" -#include "ringbuffer.h" -#include "../user_cfg.h" -#include "../sipcall.h" - - -int AudioRtpRTX::count_rtp = 0; - -//////////////////////////////////////////////////////////////////////////////// -// AudioRtp -//////////////////////////////////////////////////////////////////////////////// -AudioRtp::AudioRtp() :_RTXThread (0), _symmetric(), _rtpMutex() -{ - -} - -AudioRtp::~AudioRtp (void) -{ - ost::MutexLock m (_rtpMutex); - - if (_RTXThread != _RTXThread) { - delete _RTXThread; - _RTXThread = 0; - } - -} - -void -AudioRtp::createNewSession (SIPCall *ca) -{ - - ost::MutexLock m (_rtpMutex); - - _debug ("AudioRtp::Create new rtp session"); - - // something should stop the thread before... - - if (_RTXThread != 0) { - _debug ("**********************************************************"); - _debug ("! ARTP Failure: Thread already exists..., stopping it"); - _debug ("**********************************************************"); - delete _RTXThread; - _RTXThread = 0; - } - - // Start RTP Send/Receive threads - _symmetric = Manager::instance().getConfigInt (SIGNALISATION,SYMMETRIC) ? true : false; - - _RTXThread = new AudioRtpRTX (ca, _symmetric); - -} - -int -AudioRtp::start (void) -{ - ost::MutexLock m (_rtpMutex); - - if (_RTXThread == 0) { - _debug ("! ARTP Failure: Cannot start audiortp thread since not yet created"); - throw AudioRtpException(); - } - - - try { - if (_RTXThread->start() != 0) { - _debug ("! ARTP Failure: unable to start RTX Thread"); - return -1; - } - } catch (...) { - _debugException ("! ARTP Failure: when trying to start a thread"); - throw; - } - - return 0; -} - - -bool -AudioRtp::closeRtpSession () -{ - - ost::MutexLock m (_rtpMutex); - // This will make RTP threads finish. - _debug ("AudioRtp::Stopping rtp session"); - - try { - if (_RTXThread != 0) { - delete _RTXThread; - _RTXThread = 0; - } - } catch (...) { - _debugException ("! ARTP Exception: when stopping audiortp"); - throw; - } - - _debug ("AudioRtp::Audio rtp stopped"); - - return true; -} - -/* -void -AudioRtp::setRecording() -{ - - _debug ("AudioRtp::setRecording"); - _RTXThread->_ca->setRecording(); - -} -*/ - -//////////////////////////////////////////////////////////////////////////////// -// AudioRtpRTX Class // -//////////////////////////////////////////////////////////////////////////////// -AudioRtpRTX::AudioRtpRTX (SIPCall *sipcall, bool sym) : time (new ost::Time()), _ca (sipcall), _sessionSend (NULL), _sessionRecv (NULL), _session (NULL), - _sym (sym), micData (NULL), micDataConverted (NULL), micDataEncoded (NULL), spkrDataDecoded (NULL), spkrDataConverted (NULL), - converter (NULL), _layerSampleRate(),_codecSampleRate(), _layerFrameSize(), _audiocodec (NULL) -{ - - setCancel (cancelDefault); - // AudioRtpRTX should be close if we change sample rate - // TODO: Change bind address according to user settings. - // TODO: this should be the local ip not the external (router) IP - std::string localipConfig = _ca->getLocalIp(); // _ca->getLocalIp(); - ost::InetHostAddress local_ip (localipConfig.c_str()); - - _debug ("%i", _ca->getLocalAudioPort()); - _session = new ost::SymmetricRTPSession (local_ip, _ca->getLocalAudioPort()); - // _session = new ost::RTPSessionBase(local_ip, _ca->getLocalAudioPort()); - _sessionRecv = NULL; - _sessionSend = NULL; - - //mic, we receive from soundcard in stereo, and we send encoded - //encoding before sending - _audiolayer = Manager::instance().getAudioDriver(); - _layerFrameSize = _audiolayer->getFrameSize(); // in ms - _layerSampleRate = _audiolayer->getSampleRate(); - - // initBuffers(); - - // initAudioRtpSession(); - - _payloadIsSet = false; - _remoteIpIsSet = false; - - - count_rtp++; - // open files - std::string s_input; - std::string s_output; - - // convert count into string - std::stringstream out; - out << count_rtp; - - s_input = "/home/alexandresavard/Desktop/buffer_record/rtp_input_"; - s_input.append (out.str()); - - s_output = "/home/alexandresavard/Desktop/buffer_record/rtp_output_"; - s_output.append (out.str()); - - rtp_input_rec = new std::fstream(); - rtp_output_rec = new std::fstream(); - - rtp_input_rec->open (s_input.c_str(), std::fstream::out); - rtp_output_rec->open (s_output.c_str(), std::fstream::out); - -} - -AudioRtpRTX::~AudioRtpRTX () -{ - - ost::MutexLock m (_rtpRtxMutex); - - _debug ("Delete AudioRtpRTX instance in callid %s", _ca->getCallId().c_str()); - - try { - this->terminate(); - } catch (...) { - _debugException ("! ARTP: Thread destructor didn't terminate correctly"); - throw; - } - - _debug ("Remove audio stream for call id %s", _ca->getCallId().c_str()); - - _audiolayer->getMainBuffer()->unBindAll (_ca->getCallId()); - // Manager::instance().removeStream(_ca->getCallId()); - - _debug ("DELETE print micData address %p", micData); - delete [] micData; - micData = NULL; - delete [] micDataConverted; - micDataConverted = NULL; - delete [] micDataEncoded; - micDataEncoded = NULL; - - delete [] spkrDataDecoded; - spkrDataDecoded = NULL; - delete [] spkrDataConverted; - spkrDataConverted = NULL; - - delete time; - time = NULL; - - delete converter; - converter = NULL; - - _ca = 0; - // _session->terminate(); - - delete _session; - _session = NULL; - - _debug ("AudioRtpRTX instance deleted"); - - rtp_input_rec->close(); - rtp_output_rec->close(); - -} - - -void -AudioRtpRTX::initBuffers() -{ - ost::MutexLock m (_rtpRtxMutex); - - _debug ("AudioRtpRTX::initBuffers Init RTP buffers for %s", _ca->getCallId().c_str()); - - converter = new SamplerateConverter (_layerSampleRate , _layerFrameSize); - - nbSamplesMax = (int) (_layerSampleRate * _layerFrameSize /1000); - - - _debug ("AudioRtpRTX::initBuffers NBSAMPLEMAX %i", nbSamplesMax); - - micData = new SFLDataFormat[nbSamplesMax]; - _debug ("CREATE print micData address %p", micData); - micDataConverted = new SFLDataFormat[nbSamplesMax]; - micDataEncoded = new unsigned char[nbSamplesMax]; - - spkrDataConverted = new SFLDataFormat[nbSamplesMax]; - spkrDataDecoded = new SFLDataFormat[nbSamplesMax]; - - Manager::instance().addStream (_ca->getCallId()); - // _audiolayer->getMainBuffer()->bindCallID(_ca->getCallId()); -} - - -void -AudioRtpRTX::initAudioRtpSession (void) -{ - - try { - - _session->setSchedulingTimeout (100000); - _session->setExpireTimeout (1000000); - - - } catch (...) { - _debugException ("! ARTP Failure: initialisation failed"); - throw; - } - -} - -void -AudioRtpRTX::setRtpSessionMedia (void) -{ - - if (_ca == 0) { - _debug (" !ARTP: No call, can't init RTP media"); - return; - } - - AudioCodecType pl = (AudioCodecType) _ca->getLocalSDP()->get_session_media()->getPayload(); - - _audiocodec = Manager::instance().getCodecDescriptorMap().instantiateCodec (pl); - - if (_audiocodec == NULL) { - _debug (" !ARTP: No audiocodec, can't init RTP media"); - return; - } - - _debug ("Init audio RTP session: codec payload %i", _audiocodec->getPayload()); - - // _audioCodecInstance = *_audiocodec; - - _codecSampleRate = _audiocodec->getClockRate(); - - _codecFrameSize = _audiocodec->getFrameSize(); - - if (_audiocodec->getPayload() == 9) { - _payloadIsSet = _session->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); - } else if (_audiocodec->hasDynamicPayload()) { - _payloadIsSet = _session->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); - } else if (!_audiocodec->hasDynamicPayload() && _audiocodec->getPayload() != 9) { - _payloadIsSet = _session->setPayloadFormat (ost::StaticPayloadFormat ( (ost::StaticPayloadType) _audiocodec->getPayload())); - } - - - -} - -void -AudioRtpRTX::setRtpSessionRemoteIp (void) -{ - - if (!_remoteIpIsSet) { - - _debug ("++++++++++++++++++++++++++ SET IP ADDRESS ++++++++++++++++++++++++++++"); - - if (_ca == 0) { - _debug (" !ARTP: No call, can't init RTP media "); - return; - } - - ost::InetHostAddress remote_ip (_ca->getLocalSDP()->get_remote_ip().c_str()); - - _debug ("Init audio RTP session: remote ip %s", _ca->getLocalSDP()->get_remote_ip().data()); - - if (!remote_ip) { - _debug (" !ARTP Thread Error: Target IP address [%s] is not correct!", _ca->getLocalSDP()->get_remote_ip().data()); - return; - } - - _debug ("++++Address: %s, audioport: %d", _ca->getLocalSDP()->get_remote_ip().c_str(), _ca->getLocalSDP()->get_remote_audio_port()); - - _debug ("++++Audioport: %d", (int) _ca->getLocalSDP()->get_remote_audio_port()); - - if (!_session->addDestination (remote_ip, (unsigned short) _ca->getLocalSDP()->get_remote_audio_port())) { - _debug (" !ARTP Thread Error: can't add destination to session!"); - return; - } - - _remoteIpIsSet = true; - } else { - _debug ("+++++++++++++++++++++++ IP ADDRESS ALREADY SET ++++++++++++++++++++++++"); - } - -} - - - -float -AudioRtpRTX::computeCodecFrameSize (int codecSamplePerFrame, int codecClockRate) -{ - return ( (float) codecSamplePerFrame * 1000.0) / (float) codecClockRate; -} - -int -AudioRtpRTX::computeNbByteAudioLayer (float codecFrameSize) -{ - return (int) ( (float) _layerSampleRate * codecFrameSize * (float) sizeof (SFLDataFormat) / 1000.0); -} - - -int -AudioRtpRTX::processDataEncode() -{ - - // compute codec framesize in ms - float fixed_codec_framesize = computeCodecFrameSize (_audiocodec->getFrameSize(), _audiocodec->getClockRate()); - - // compute nb of byte to get coresponding to 20 ms at audio layer frame size (44.1 khz) - int maxBytesToGet = computeNbByteAudioLayer (fixed_codec_framesize); - - // available bytes inside ringbuffer - int availBytesFromMic = _audiolayer->getMainBuffer()->availForGet (_ca->getCallId()); - - // _debug("AudioRtpRTX::processDataEncode() callid: %s availBytesFromMic %i", _ca->getCallId().c_str(), availBytesFromMic); - - // _debug("AudioRtpRTX::processDataEncode: availBytesFromMic: %i", availBytesFromMic); - // set available byte to maxByteToGet - int bytesAvail = (availBytesFromMic < maxBytesToGet) ? availBytesFromMic : maxBytesToGet; - // _debug("bytesAvail %i", bytesAvail); - - if (bytesAvail == 0) - return 0; - - // _debug("AudioRtpRTX::processDataEncode: bytesAvail: %i", bytesAvail); - // Get bytes from micRingBuffer to data_from_mic - int nbSample = _audiolayer->getMainBuffer()->getData (micData , bytesAvail, 100, _ca->getCallId()) / sizeof (SFLDataFormat); - - rtp_output_rec->write ( (char*) micData, bytesAvail); - - // _debug("AudioRtpRTX::processDataEncode: nbSample: %i", nbSample); - - // nb bytes to be sent over RTP - int compSize = 0; - - // test if resampling is required - if (_audiocodec->getClockRate() != _layerSampleRate) { - - int nb_sample_up = nbSample; - //_debug("_nbSample audiolayer->getMic(): %i ", nbSample); - - // Store the length of the mic buffer in samples for recording - _nSamplesMic = nbSample; - - nbSample = reSampleData (micData , micDataConverted, _audiocodec->getClockRate(), nb_sample_up, DOWN_SAMPLING); - - compSize = _audiocodec->codecEncode (micDataEncoded, micDataConverted, nbSample*sizeof (int16)); - - } else { - // no resampling required - compSize = _audiocodec->codecEncode (micDataEncoded, micData, nbSample*sizeof (int16)); - } - - return compSize; -} - - -void -AudioRtpRTX::processDataDecode (unsigned char* spkrData, unsigned int size, int& countTime) -{ - if (_audiocodec != NULL) { - - // Return the size of data in bytes - int expandedSize = _audiocodec->codecDecode (spkrDataDecoded , spkrData , size); - - // buffer _receiveDataDecoded ----> short int or int16, coded on 2 bytes - int nbSample = expandedSize / sizeof (SFLDataFormat); - - // test if resampling is required - - if (_audiocodec->getClockRate() != _layerSampleRate) { - - // Do sample rate conversion - int nb_sample_down = nbSample; - nbSample = reSampleData (spkrDataDecoded, spkrDataConverted, _codecSampleRate, nb_sample_down, UP_SAMPLING); - - rtp_input_rec->write ( (char*) spkrDataConverted, nbSample * sizeof (SFLDataFormat)); - - // Store the number of samples for recording - _nSamplesSpkr = nbSample; - - - - // put data in audio layer, size in byte - _audiolayer->getMainBuffer()->putData (spkrDataConverted, nbSample * sizeof (SFLDataFormat), 100, _ca->getCallId()); - - } else { - - // Stor the number of samples for recording - _nSamplesSpkr = nbSample; - - // put data in audio layer, size in byte - _audiolayer->getMainBuffer()->putData (spkrDataDecoded, nbSample * sizeof (SFLDataFormat), 100, _ca->getCallId()); - } - - // Notify (with a beep) an incoming call when there is already a call - countTime += time->getSecond(); - - if (Manager::instance().incomingCallWaiting() > 0) { - countTime = countTime % 500; // more often... - - if (countTime == 0) { - Manager::instance().notificationIncomingCall(); - } - } - - } else { - countTime += time->getSecond(); - } -} - -void -AudioRtpRTX::sendSessionFromMic (int timestamp) -{ - // STEP: - // 1. get data from mic - // 2. convert it to int16 - good sample, good rate - // 3. encode it - // 4. send it - - timestamp += time->getSecond(); - // no call, so we do nothing - - if (_ca==0) { - _debug (" !ARTP: No call associated (mic)"); - return; - } - - // AudioLayer* audiolayer = Manager::instance().getAudioDriver(); - if (!_audiolayer) { - _debug (" !ARTP: No audiolayer available for MIC"); - return; - } - - if (!_audiocodec) { - _debug (" !ARTP: No audiocodec available for MIC"); - return; - } - - - - int compSize = processDataEncode(); - - // putData put the data on RTP queue, sendImmediate bypass this queue - // _debug("AudioRtpRTX::sendSessionFromMic: timestamp: %i, compsize: %i", timestamp, compSize); - - if ( (compSize != 0) && (micDataEncoded != NULL)) - _session->putData (timestamp, micDataEncoded, compSize); - - // _session->sendImmediate(timestamp, micDataEncoded, compSize); - - -} - - -void -AudioRtpRTX::receiveSessionForSpkr (int& countTime) -{ - - if (_ca == 0) { - return; - } - - if (!_audiolayer) { - _debug (" !ARTP: No audiolayer available for SPEAKER"); - return; - } - - if (!_audiocodec) { - _debug (" !ARTP: No audiocodec available for SPEAKER"); - return; - } - - const ost::AppDataUnit* adu = NULL; - - // int is_waiting = _session->isWaiting(); - - // if (is_waiting != 0) - adu = _session->getData (_session->getFirstTimestamp()); - - // else - // return; - - - - if (adu == NULL) - return; - - unsigned char* spkrData = (unsigned char*) adu->getData(); // data in char - - unsigned int size = adu->getSize(); // size in char - - processDataDecode (spkrData, size, countTime); - - if (adu != NULL) { - delete adu; - adu = NULL; - } - -} - - -int -AudioRtpRTX::reSampleData (SFLDataFormat *input, SFLDataFormat *output, int sampleRate_codec, int nbSamples, int status) -{ - if (status==UP_SAMPLING) { - return converter->upsampleData (input, output, sampleRate_codec , _layerSampleRate , nbSamples); - } else if (status==DOWN_SAMPLING) { - return converter->downsampleData (micData , micDataConverted , sampleRate_codec , _layerSampleRate , nbSamples); - } else - - return 0; -} - - - -void -AudioRtpRTX::run () -{ - - int sessionWaiting; - - initBuffers(); - initAudioRtpSession(); - setRtpSessionRemoteIp(); - setRtpSessionMedia(); - - int timestep = _codecFrameSize; - - int countTime = 0; // for receive - - int threadSleep = 0; - - if (_codecSampleRate != 0) - threadSleep = (_codecFrameSize * 1000) / _codecSampleRate; - else - threadSleep = _layerFrameSize; - - TimerPort::setTimer (threadSleep); - - _audiolayer->startStream(); - - _audiolayer->getMainBuffer()->flush (_ca->getCallId()); - - _session->startRunning(); - - int timestamp = _session->getCurrentTimestamp(); // for mic - - _debug ("- ARTP Action: Start call %s",_ca->getCallId().c_str()); - - while (!testCancel()) { - - - // _debug("Main while loop for call: %s", _ca->getCallId().c_str()); - // Send session - sessionWaiting = _session->isWaiting(); - - sendSessionFromMic (timestamp); - timestamp += timestep; - // timestamp = _session->getCurrentTimestamp(); - - // Recv session - receiveSessionForSpkr (countTime); - - // Let's wait for the next transmit cycle - - - if (sessionWaiting == 1) { - // Record mic and speaker during conversation - _ca->recAudio.recData (spkrDataConverted,micData,_nSamplesSpkr,_nSamplesMic); - } else { - // Record mic only while leaving a message - _ca->recAudio.recData (micData,_nSamplesMic); - } - - - // Let's wait for the next transmit cycle - Thread::sleep (TimerPort::getTimer()); - - - // TimerPort::incTimer(20); // 'frameSize' ms - TimerPort::incTimer (threadSleep); - - } - - // _audiolayer->stopStream(); - _debug ("- ARTP Action: Stop call %s",_ca->getCallId().c_str()); - - -} - - -// EOF diff --git a/sflphone-common/src/audio/audiortp.h b/sflphone-common/src/audio/audiortp.h deleted file mode 100644 index f9dc1671a9297b15cd79bab4a537b456340a370d..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/audiortp.h +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (C) 2004-2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> - * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __AUDIO_RTP_H__ -#define __AUDIO_RTP_H__ - -#include <cstdio> -#include <cstdlib> -#include <iostream> -#include <ccrtp/rtp.h> -#include <cc++/numbers.h> - -#include "../global.h" -// #include "plug-in/audiorecorder/audiorecord.h" -#include "../samplerateconverter.h" -#include "codecDescriptor.h" - -#include <fstream> - -#define UP_SAMPLING 0 -#define DOWN_SAMPLING 1 - - - -class AudioRtpException: public std::exception -{ - virtual const char* what() const throw() - { - return "AudioRtpException occured"; - } -}; - - -/** - * @file audiortp.h - * @brief Manage the real-time data transport in a SIP call - */ - - -class SIPCall; - -/////////////////////////////////////////////////////////////////////////////// -// Two pair of sockets -/////////////////////////////////////////////////////////////////////////////// -class AudioRtpRTX : public ost::Thread, public ost::TimerPort { - public: - /** - * Constructor - * @param sipcall The pointer on the SIP call - * @param sym Tells whether or not the voip links are symmetric - */ - AudioRtpRTX (SIPCall* sipcall, bool sym); - - /** - * Destructor - */ - ~AudioRtpRTX(); - - /** For incoming call notification */ - ost::Time *time; - - /** Thread associated method */ - virtual void run (); - - /** A SIP call */ - SIPCall* _ca; - - /** - * Update RTP session media info as received from SDP negociation - */ - void setRtpSessionMedia(void); - - /** - * Update RTP session remote ip destination as received from sip transaction - */ - void setRtpSessionRemoteIp(void); - - - friend class RtpTest; - - private: - - // copy constructor - AudioRtpRTX(const AudioRtpRTX& rh); - - // assignment operator - AudioRtpRTX& operator=(const AudioRtpRTX& rh); - - /** RTP session to send data */ - ost::RTPSession *_sessionSend; - - /** RTP session to receive data */ - ost::RTPSession *_sessionRecv; - - /** RTP symmetric session ( receive and send data in the same session ) */ - ost::SymmetricRTPSession *_session; - - /** Semaphore */ - // ost::Semaphore _start; - - /** Is the session symmetric or not */ - bool _sym; - - /** Mic-data related buffers */ - SFLDataFormat* micData; - SFLDataFormat* micDataConverted; - unsigned char* micDataEncoded; - - /** Speaker-data related buffers */ - SFLDataFormat* spkrDataDecoded; - SFLDataFormat* spkrDataConverted; - - /** Sample rate converter object */ - SamplerateConverter* converter; - - /** audio layer */ - AudioLayer *_audiolayer; - - /** Variables to process audio stream: sample rate for playing sound (typically 44100HZ) */ - int _layerSampleRate; - - /** Sample rate of the codec we use to encode and decode (most of time 8000HZ) */ - int _codecSampleRate; - - /** Length of the sound frame we capture in ms (typically 20ms) */ - int _layerFrameSize; - - /** Codecs frame size in samples (20 ms => 882 at 44.1kHz) - The exact value is stored in the codec */ - int _codecFrameSize; - - /** Speaker buffer length in samples once the data are resampled - * (used for mixing and recording) - */ - int _nSamplesSpkr; - - /** Mic buffer length in samples once the data are resampled - * (used for mixing and recording) - */ - int _nSamplesMic; - - /** - * Maximum number of sample for audio buffers (mic and spkr) - */ - int nbSamplesMax; - - - - bool _payloadIsSet; - bool _remoteIpIsSet; - - /** - * Init the RTP session. Create either symmetric or double sessions to manage data transport - * Set the payloads according to the manager preferences - */ - void initAudioRtpSession(void); - - /** - * Return the lenth the codec frame in ms - */ - float computeCodecFrameSize(int codecSamplePerFrame, int codecClockRate); - - /** - * Compute nb of byte to get coresponding to X ms at audio layer frame size (44.1 khz) - */ - int computeNbByteAudioLayer(float codecFrameSize); - - - int processDataEncode(); - - - void processDataDecode(unsigned char* spkrData, unsigned int size, int& countTime); - - - /** - * Get the data from the mic, encode it and send it through the RTP session - * @param timestamp To manage time and synchronizing - */ - void sendSessionFromMic(int timestamp); - - /** - * Get the data from the RTP packets, decode it and send it to the sound card - * @param countTime To manage time and synchronizing - */ - void receiveSessionForSpkr(int& countTime); - - /** - * Init the buffers used for processing sound data - */ - void initBuffers(void); - - /** - * Call the appropriate function, up or downsampling - * @param sampleRate_codec The sample rate of the codec selected to encode/decode the data - * @param nbSamples Number of samples to process - * @param status Type of resampling - * UPSAMPLING - * DOWNSAMPLING - * @return int The number of samples after process - */ - int reSampleData(SFLDataFormat *input, SFLDataFormat *output,int sampleRate_codec, int nbSamples, int status); - - /** The audio codec used during the session */ - AudioCodec *_audiocodec; - // AudioCodec _audioCodecInstance; - - /** Mutex */ - ost::Mutex _rtpRtxMutex; - - public: - - std::fstream *rtp_input_rec; - std::fstream *rtp_output_rec; - - static int count_rtp; - - -}; - -/////////////////////////////////////////////////////////////////////////////// -// Main class rtp -/////////////////////////////////////////////////////////////////////////////// -class AudioRtp { - public: - /** - * Constructor - */ - AudioRtp(); - - /** - * Destructor - */ - ~AudioRtp(); - - /** - * Create a brand new RTP session by calling the AudioRtpRTX constructor - * @param ca A pointer on a SIP call - */ - void createNewSession (SIPCall *ca); - - /** - * Start the AudioRtpRTX thread created with createNewSession - */ - int start(void); - - /** - * Close a RTP session and kills the remaining threads - */ - bool closeRtpSession( void ); - - /** - * Start recording - */ - // void setRecording (); - - friend class RtpTest; - - /** - * - */ - inline AudioRtpRTX * getAudioRtpRtxThread(void) { return _RTXThread; } - private: - // copy constructor - AudioRtp(const AudioRtp& rh); - - // assignment operator - AudioRtp& operator=(const AudioRtp& rh); - - /** The RTP thread */ - AudioRtpRTX* _RTXThread; - - /** Symmetric session or not */ - bool _symmetric; - - /** Mutex */ - ost::Mutex _rtpMutex; - -}; - -#endif // __AUDIO_RTP_H__ diff --git a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp index 3cf0fd3583a6b0eb62094842eb00d74e2f322589..09756c4adff42163459b71e15d7f3cec7fc80c21 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp +++ b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp @@ -22,7 +22,6 @@ #include "AudioZrtpSession.h" #include "AudioSrtpSession.h" #include "AudioSymmetricRtpSession.h" - #include "manager.h" #include "account.h" #include "sip/sipcall.h" @@ -122,35 +121,34 @@ void AudioRtpFactory::initAudioRtpSession (SIPCall * ca) } } -void AudioRtpFactory::start (void) +void AudioRtpFactory::start (AudioCodec* audiocodec) { if (_rtpSession == NULL) { - throw AudioRtpFactoryException ("_rtpSession was null when trying to start audio thread"); + throw AudioRtpFactoryException ("RTP: Error: _rtpSession was null when trying to start audio thread"); } switch (_rtpSessionType) { case Sdes: - if (static_cast<AudioSrtpSession *> (_rtpSession)->startRtpThread() != 0) { - throw AudioRtpFactoryException ("Failed to start AudioSRtpSession thread"); + if (static_cast<AudioSrtpSession *> (_rtpSession)->startRtpThread(audiocodec) != 0) { + throw AudioRtpFactoryException ("RTP: Error: Failed to start AudioSRtpSession thread"); } break; case Symmetric: _debug ("Starting symmetric rtp thread"); - if (static_cast<AudioSymmetricRtpSession *> (_rtpSession)->startRtpThread() != 0) { - throw AudioRtpFactoryException ("Failed to start AudioSymmetricRtpSession thread"); + if (static_cast<AudioSymmetricRtpSession *> (_rtpSession)->startRtpThread(audiocodec) != 0) { + throw AudioRtpFactoryException ("RTP: Error: Failed to start AudioSymmetricRtpSession thread"); } break; case Zrtp: - if (static_cast<AudioZrtpSession *> (_rtpSession)->startRtpThread() != 0) { - throw AudioRtpFactoryException ("Failed to start AudioZrtpSession thread"); + if (static_cast<AudioZrtpSession *> (_rtpSession)->startRtpThread(audiocodec) != 0) { + throw AudioRtpFactoryException ("RTP: Error: Failed to start AudioZrtpSession thread"); } - break; } } @@ -158,10 +156,10 @@ void AudioRtpFactory::start (void) void AudioRtpFactory::stop (void) { ost::MutexLock mutex (_audioRtpThreadMutex); - _debug ("Stopping audio rtp session"); + _info("RTP: Stopping audio rtp session"); if (_rtpSession == NULL) { - _debugException ("_rtpSession is null when trying to stop. Returning."); + _debugException ("RTP: Error: _rtpSession is null when trying to stop. Returning."); return; } @@ -183,16 +181,16 @@ void AudioRtpFactory::stop (void) _rtpSession = NULL; } catch (...) { - _debugException ("Exception caught when stopping the audio rtp session"); - throw AudioRtpFactoryException("caught exception in AudioRtpFactory::stop"); + _debugException ("RTP: Error: Exception caught when stopping the audio rtp session"); + throw AudioRtpFactoryException("RTP: Error: caught exception in AudioRtpFactory::stop"); } } void AudioRtpFactory::updateDestinationIpAddress (void) { - _debug ("Updating IP address"); + _info ("RTP: Updating IP address"); if (_rtpSession == NULL) { - throw AudioRtpFactoryException ("_rtpSession was null when trying to update IP address"); + throw AudioRtpFactoryException ("RTP: Error: _rtpSession was null when trying to update IP address"); } switch (_rtpSessionType) { @@ -211,24 +209,50 @@ void AudioRtpFactory::updateDestinationIpAddress (void) } } +sfl::AudioSymmetricRtpSession * AudioRtpFactory::getAudioSymetricRtpSession() +{ + if ( (_rtpSessionType == Symmetric) && (_rtpSessionType != NULL)) { + return static_cast<AudioSymmetricRtpSession *> (_rtpSession); + } else { + throw AudioRtpFactoryException("RTP: Error: _rtpSession is NULL in getAudioSymetricRtpSession"); + } +} + sfl::AudioZrtpSession * AudioRtpFactory::getAudioZrtpSession() { if ( (_rtpSessionType == Zrtp) && (_rtpSessionType != NULL)) { return static_cast<AudioZrtpSession *> (_rtpSession); } else { - throw AudioRtpFactoryException("_rtpSession is NULL in getAudioZrtpSession"); + throw AudioRtpFactoryException("RTP: Error: _rtpSession is NULL in getAudioZrtpSession"); } } - void AudioRtpFactory::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) +void AudioRtpFactory::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) { - if ( (_rtpSessionType != NULL) && (_rtpSessionType == Sdes)) { + if ( _rtpSession && _rtpSessionType && (_rtpSessionType == Sdes)) { static_cast<AudioSrtpSession *> (_rtpSession)->setRemoteCryptoInfo(nego); } else { - throw AudioRtpFactoryException("_rtpSession is NULL in setRemoteCryptoInfo"); + throw AudioRtpFactoryException("RTP: Error: _rtpSession is NULL in setRemoteCryptoInfo"); } } + +void AudioRtpFactory::sendDtmfDigit(int digit) { + switch(_rtpSessionType) { + + case Sdes: + static_cast<AudioSrtpSession *> (_rtpSession)->putDtmfEvent(digit); + break; + + case Symmetric: + static_cast<AudioSymmetricRtpSession *> (_rtpSession)->putDtmfEvent(digit); + break; + + case Zrtp: + static_cast<AudioZrtpSession *> (_rtpSession)->putDtmfEvent(digit); + break; + } +} } diff --git a/sflphone-common/src/audio/audiortp/AudioRtpFactory.h b/sflphone-common/src/audio/audiortp/AudioRtpFactory.h index cfa14165f1cf0f85960eb775b4b09fd476df7062..de16a31fe610b5ae2e27420f451d47bb87d0b7a9 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpFactory.h +++ b/sflphone-common/src/audio/audiortp/AudioRtpFactory.h @@ -23,6 +23,7 @@ #include <cc++/thread.h> #include "sip/SdesNegotiator.h" +#include "audio/codecs/audiocodec.h" class SdesNegotiator; class SIPCall; @@ -30,6 +31,7 @@ class SIPCall; namespace sfl { class AudioZrtpSession; class AudioSrtpSession; + class AudioSymmetricRtpSession; } namespace sfl { @@ -63,54 +65,56 @@ namespace sfl { void initAudioRtpConfig(SIPCall *ca); - /** - * Lazy instantiation method. Create a new RTP session of a given - * type according to the content of the configuration file. - * @param ca A pointer on a SIP call - * @return A new AudioRtpSession object - */ - void initAudioRtpSession(SIPCall *ca); - - /** - * Start the audio rtp thread of the type specified in the configuration - * file. initAudioRtpSession must have been called prior to that. - * @param None - */ - void start(); - - /** - * Stop the audio rtp thread of the type specified in the configuration - * file. initAudioRtpSession must have been called prior to that. - * @param None - */ - void stop(); + /** + * Lazy instantiation method. Create a new RTP session of a given + * type according to the content of the configuration file. + * @param ca A pointer on a SIP call + * @return A new AudioRtpSession object + */ + void initAudioRtpSession(SIPCall *ca); + + /** + * Start the audio rtp thread of the type specified in the configuration + * file. initAudioRtpSession must have been called prior to that. + * @param None + */ + void start(AudioCodec*); /** - * Update current RTP destination address with one stored in call - * @param None - */ + * Stop the audio rtp thread of the type specified in the configuration + * file. initAudioRtpSession must have been called prior to that. + * @param None + */ + void stop(); + + /** + * Update current RTP destination address with one stored in call + * @param None + */ void updateDestinationIpAddress (void); - /** - * @param None - * @return The internal audio rtp thread of the type specified in the configuration - * file. initAudioRtpSession must have been called prior to that. - */ - inline void * getAudioRtpSession(void) { return _rtpSession; } + /** + * @param None + * @return The internal audio rtp thread of the type specified in the configuration + * file. initAudioRtpSession must have been called prior to that. + */ + inline void * getAudioRtpSession(void) { return _rtpSession; } + + AudioSymmetricRtpSession * getAudioSymetricRtpSession(); /** - * @param None - * @return The internal audio rtp session type - * Symmetric = 0 - * Zrtp = 1 - * Sdes = 2 - */ - inline RtpMethod getAudioRtpType(void) { return _rtpSessionType; } + * @param None + * @return The internal audio rtp session type + * Symmetric = 0 + * Zrtp = 1 + * Sdes = 2 + */ + inline RtpMethod getAudioRtpType(void) { return _rtpSessionType; } - /** - * @param Set internal audio rtp session type (Symmetric, Zrtp, Sdes) - */ - inline void setAudioRtpType(RtpMethod type) { _rtpSessionType = type; } + /** + * @param Set internal audio rtp session type (Symmetric, Zrtp, Sdes) + */ + inline void setAudioRtpType(RtpMethod type) { _rtpSessionType = type; } /** * Manually set the srtpEnable option (usefull for RTP fallback) @@ -127,35 +131,43 @@ namespace sfl { */ void setHelloHashEnabled(bool enable){ _helloHashEnabled = enable; } - /** - * Get the current AudioZrtpSession. Throws an AudioRtpFactoryException - * if the current rtp thread is null, or if it's not of the correct type. - * @return The current AudioZrtpSession thread. - */ - sfl::AudioZrtpSession * getAudioZrtpSession(); + /** + * Get the current AudioZrtpSession. Throws an AudioRtpFactoryException + * if the current rtp thread is null, or if it's not of the correct type. + * @return The current AudioZrtpSession thread. + */ + sfl::AudioZrtpSession * getAudioZrtpSession(); /** - * Set remote cryptographic info. Should be called after negotiation in SDP + * Set remote cryptographic info. Should be called after negotiation in SDP * offer/answer session. - */ - void setRemoteCryptoInfo(sfl::SdesNegotiator& nego); + */ + void setRemoteCryptoInfo(sfl::SdesNegotiator& nego); + + /** + * Send DTMF over RTP (RFC2833). The timestamp and sequence number must be + * incremented as if it was microphone audio. This function change the payload type of the rtp session, + * send the appropriate DTMF digit using this payload, discard coresponding data from mainbuffer and get + * back the codec payload for further audio processing. + */ + void sendDtmfDigit(int digit); - private: - void * _rtpSession; - RtpMethod _rtpSessionType; - ost::Mutex _audioRtpThreadMutex; - - // Field used when initializinga udio rtp session - // May be set manually or from config using initAudioRtpConfig - bool _srtpEnabled; - - // Field used when initializinga udio rtp session - // May be set manually or from config using initAudioRtpConfig - int _keyExchangeProtocol; - - // Field used when initializinga udio rtp session - // May be set manually or from config using initAudioRtpConfig - bool _helloHashEnabled; - }; +private: + void * _rtpSession; + RtpMethod _rtpSessionType; + ost::Mutex _audioRtpThreadMutex; + + // Field used when initializinga udio rtp session + // May be set manually or from config using initAudioRtpConfig + bool _srtpEnabled; + + // Field used when initializinga udio rtp session + // May be set manually or from config using initAudioRtpConfig + int _keyExchangeProtocol; + + // Field used when initializinga udio rtp session + // May be set manually or from config using initAudioRtpConfig + bool _helloHashEnabled; +}; } #endif // __AUDIO_RTP_FACTORY_H__ diff --git a/sflphone-common/src/audio/audiortp/AudioRtpSession.h b/sflphone-common/src/audio/audiortp/AudioRtpSession.h index d168cb8d750fef943960ef2e3b1c7999002a4bc3..ad271a61989e6dee80d4669935f0d4cd8295fe6e 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpSession.h +++ b/sflphone-common/src/audio/audiortp/AudioRtpSession.h @@ -25,6 +25,7 @@ #include <iostream> #include <exception> +#include <list> #include "global.h" @@ -43,6 +44,7 @@ namespace sfl { static const int schedulingTimeout = 100000; static const int expireTimeout = 1000000; + class AudioRtpSessionException: public std::exception { virtual const char* what() const throw() @@ -51,6 +53,14 @@ namespace sfl { } }; + typedef struct DtmfEvent { + ost::RTPPacket::RFC2833Payload payload; + int length; + bool newevent; + } DtmfEvent; + + typedef list<DtmfEvent *> EventQueue; + template <typename D> class AudioRtpSession : public ost::Thread, public ost::TimerPort { public: @@ -65,33 +75,44 @@ namespace sfl { // Thread associated method virtual void run (); - int startRtpThread(); + int startRtpThread(AudioCodec*); + + /** + * Used mostly when receiving a reinvite + */ + void updateDestinationIpAddress(void); + + void putDtmfEvent(int digit); - /** - * Used mostly when receiving a reinvite - */ - void updateDestinationIpAddress(void); + /** + * Send DTMF over RTP (RFC2833). The timestamp and sequence number must be + * incremented as if it was microphone audio. This function change the payload type of the rtp session, + * send the appropriate DTMF digit using this payload, discard coresponding data from mainbuffer and get + * back the codec payload for further audio processing. + */ + void sendDtmfEvent(sfl::DtmfEvent *dtmf); + + inline float computeCodecFrameSize (int codecSamplePerFrame, int codecClockRate) { + return ( (float) codecSamplePerFrame * 1000.0) / (float) codecClockRate; + } + + int computeNbByteAudioLayer (float codecFrameSize) { + return (int) ( ((float) _converterSamplingRate * codecFrameSize * sizeof(SFLDataFormat))/ 1000.0); + } private: void initBuffers(void); void setSessionTimeouts(void); - void setSessionMedia(void); + void setSessionMedia(AudioCodec*); void setDestinationIpAddress(void); int processDataEncode(void); - void processDataDecode(unsigned char * spkrData, unsigned int size, int& countTime); - - inline float computeCodecFrameSize (int codecSamplePerFrame, int codecClockRate) { - return ( (float) codecSamplePerFrame * 1000.0) / (float) codecClockRate; - } - int computeNbByteAudioLayer (float codecFrameSize) { - return (int) ( ((float) converterSamplingRate * codecFrameSize * sizeof(SFLDataFormat))/ 1000.0); - } + void processDataDecode(unsigned char * spkrData, unsigned int size); - void sendMicData(int timestamp); - void receiveSpeakerData (int& countTime); + void sendMicData(); + void receiveSpeakerData (); ost::Time * _time; @@ -104,15 +125,16 @@ namespace sfl { // start() with no semaphore at all. ost::Semaphore * _mainloopSemaphore; - // Main destination address for this rtp session. - // Stored in case or reINVITE, which may require to forget - // this destination and update a new one. - ost::InetHostAddress _remote_ip; + // Main destination address for this rtp session. + // Stored in case or reINVITE, which may require to forget + // this destination and update a new one. + ost::InetHostAddress _remote_ip; + - // Main destination port for this rtp session. - // Stored in case reINVITE, which may require to forget - // this destination and update a new one - unsigned short _remote_port; + // Main destination port for this rtp session. + // Stored in case reINVITE, which may require to forget + // this destination and update a new one + unsigned short _remote_port; AudioCodec * _audiocodec; @@ -163,11 +185,28 @@ namespace sfl { */ ManagerImpl * _manager; - int converterSamplingRate; + /** + * Sampling rate of audio converter + */ + int _converterSamplingRate; + + /** + * Timestamp for this session + */ + int _timestamp; + + /** + * Time counter used to trigger incoming call notification + */ + int _countNotificationTime; + + /** + * EventQueue used to store list of DTMF- + */ + EventQueue _eventQueue; protected: - SIPCall * _ca; - + SIPCall * _ca; }; template <typename D> @@ -186,13 +225,16 @@ namespace sfl { _codecSampleRate(0), _layerFrameSize(0), _manager(manager), + _converterSamplingRate(0), + _timestamp(0), + _countNotificationTime(0), _ca (sipcall) { setCancel (cancelDefault); assert(_ca); - _debug ("Local audio port %i will be used\n", _ca->getLocalAudioPort()); + _info ("Rtp: Local audio port %i will be used", _ca->getLocalAudioPort()); //mic, we receive from soundcard in stereo, and we send encoded _audiolayer = _manager->getAudioDriver(); @@ -207,7 +249,7 @@ namespace sfl { template <typename D> AudioRtpSession<D>::~AudioRtpSession() { - _debug ("Delete AudioRtpSession instance\n"); + _debug ("RTP: Delete AudioRtpSession instance"); try { terminate(); @@ -216,9 +258,7 @@ namespace sfl { throw; } - _debug("Unbind audio RTP stream for call id %s\n", _ca->getCallId().c_str()); - // _audiolayer->getMainBuffer()->unBindAll(_ca->getCallId()); - _manager->getAudioDriver()->getMainBuffer()->unBindAll(_ca->getCallId()); + _manager->getAudioDriver()->getMainBuffer()->unBindAll(_ca->getCallId()); delete [] _micData; delete [] _micDataConverted; @@ -227,22 +267,19 @@ namespace sfl { delete [] _spkrDataConverted; delete _time; delete _converter; - _debug ("AudioRtpSession instance deleted\n"); } template <typename D> void AudioRtpSession<D>::initBuffers() { - // Set sampling rate, main buffer choose the highest one - // _audiolayer->getMainBuffer()->setInternalSamplingRate(_codecSampleRate); + // Set sampling rate, main buffer choose the highest one _manager->getAudioDriver()->getMainBuffer()->setInternalSamplingRate(_codecSampleRate); - // may be different than one already setted - // converterSamplingRate = _audiolayer->getMainBuffer()->getInternalSamplingRate(); - converterSamplingRate = _manager->getAudioDriver()->getMainBuffer()->getInternalSamplingRate(); + // may be different than one already setted + _converterSamplingRate = _manager->getAudioDriver()->getMainBuffer()->getInternalSamplingRate(); - // initialize SampleRate converter using AudioLayer's sampling rate - // (internal buffers initialized with maximal sampling rate and frame size) + // initialize SampleRate converter using AudioLayer's sampling rate + // (internal buffers initialized with maximal sampling rate and frame size) _converter = new SamplerateConverter(_layerSampleRate, _layerFrameSize); int nbSamplesMax = (int)(_codecSampleRate * _layerFrameSize /1000)*2; @@ -252,7 +289,7 @@ namespace sfl { _spkrDataConverted = new SFLDataFormat[nbSamplesMax]; _spkrDataDecoded = new SFLDataFormat[nbSamplesMax]; - _manager->addStream(_ca->getCallId()); + _manager->addStream(_ca->getCallId()); } template <typename D> @@ -268,32 +305,27 @@ namespace sfl { } template <typename D> - void AudioRtpSession<D>::setSessionMedia(void) + void AudioRtpSession<D>::setSessionMedia(AudioCodec* audiocodec) { - assert(_ca); + _audiocodec = audiocodec; - AudioCodecType pl = (AudioCodecType)_ca->getLocalSDP()->get_session_media()->getPayload(); - _audiocodec = _manager->getCodecDescriptorMap().instantiateCodec(pl); - - if (_audiocodec == NULL) { - _debug ("No audiocodec, can't init RTP media\n"); - throw AudioRtpSessionException(); - } - - _debug ("Init audio RTP session: codec payload %i\n", _audiocodec->getPayload()); + _debug ("RTP: Init codec payload %i", _audiocodec->getPayload()); _codecSampleRate = _audiocodec->getClockRate(); _codecFrameSize = _audiocodec->getFrameSize(); + _debug("RTP: Codec sampling rate: %d", _codecSampleRate); + _debug("RTP: Codec frame size: %d", _codecFrameSize); + //TODO: figure out why this is necessary. if (_audiocodec->getPayload() == 9) { - _debug ("Setting payload format to G722\n"); + _debug ("RTP: Setting payload format to G722"); static_cast<D*>(this)->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); } else if (_audiocodec->hasDynamicPayload()) { - _debug ("Setting a dynamic payload format\n"); + _debug ("RTP: Setting a dynamic payload format"); static_cast<D*>(this)->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) _audiocodec->getPayload(), _audiocodec->getClockRate())); } else if (!_audiocodec->hasDynamicPayload() && _audiocodec->getPayload() != 9) { - _debug ("Setting a static payload format\n"); + _debug ("RTP: Setting a static payload format"); static_cast<D*>(this)->setPayloadFormat (ost::StaticPayloadFormat ( (ost::StaticPayloadType) _audiocodec->getPayload())); } } @@ -302,27 +334,30 @@ namespace sfl { void AudioRtpSession<D>::setDestinationIpAddress(void) { if (_ca == NULL) { - _debug ("Sipcall is gone.\n"); - throw AudioRtpSessionException(); + _error ("RTP: Sipcall is gone."); + throw AudioRtpSessionException(); } - _debug ("Setting IP address for the RTP session\n"); + _info ("RTP: Setting IP address for the RTP session"); - // Store remote ip in case we would need to forget current destination + // Store remote ip in case we would need to forget current destination _remote_ip = ost::InetHostAddress(_ca->getLocalSDP()->get_remote_ip().c_str()); - _debug ("Init audio RTP session: remote ip %s\n", _ca->getLocalSDP()->get_remote_ip().data()); if (!_remote_ip) { - _debug ("Target IP address [%s] is not correct!\n", _ca->getLocalSDP()->get_remote_ip().data()); + _warn("RTP: Target IP address (%s) is not correct!", + _ca->getLocalSDP()->get_remote_ip().data()); return; } - // Store remote port in case we would need to forget current destination - _remote_port = (unsigned short) _ca->getLocalSDP()->get_remote_audio_port(); + // Store remote port in case we would need to forget current destination + _remote_port = (unsigned short) _ca->getLocalSDP()->get_remote_audio_port(); + + _info("RTP: New remote address for session: %s:%d", + _ca->getLocalSDP()->get_remote_ip().data(), _remote_port); if (! static_cast<D*>(this)->addDestination (_remote_ip, _remote_port)) { - _debug ("Can't add destination to session!\n"); - return; + _warn("RTP: Can't add new destination to session!"); + return; } } @@ -330,14 +365,78 @@ namespace sfl { void AudioRtpSession<D>::updateDestinationIpAddress(void) { // Destination address are stored in a list in ccrtp - // This method clear off this entry - static_cast<D*>(this)->forgetDestination(_remote_ip, _remote_port); + // This method remove the current destination entry - // new destination is stored in call - // we just need to recall this method + if(!static_cast<D*>(this)->forgetDestination(_remote_ip, _remote_port, _remote_port+1)) + _warn("RTP: Could not remove previous destination"); + + // new destination is stored in call + // we just need to recall this method setDestinationIpAddress(); } + template<typename D> + void AudioRtpSession<D>::putDtmfEvent(int digit) + { + + sfl::DtmfEvent *dtmf = new sfl::DtmfEvent(); + + dtmf->payload.event = digit; + dtmf->payload.ebit = false; // end of event bit + dtmf->payload.rbit = false; // reserved bit + dtmf->payload.duration = 1; // duration for this event + dtmf->newevent = true; + dtmf->length = 1000; + + _eventQueue.push_back(dtmf); + + _debug("RTP: Put Dtmf Event %d", _eventQueue.size()); + + } + + template<typename D> + void AudioRtpSession<D>::sendDtmfEvent(sfl::DtmfEvent *dtmf) + { + _debug("RTP: Send Dtmf %d", _eventQueue.size()); + + _timestamp += 160; + + // discard equivalent size of audio + processDataEncode(); + + // change Payload type for DTMF payload + static_cast<D*>(this)->setPayloadFormat (ost::DynamicPayloadFormat ( (ost::PayloadType) 101, 8000)); + + // Set marker in case this is a new Event + if(dtmf->newevent) + static_cast<D*>(this)->setMark (true); + + static_cast<D*>(this)->putData (_timestamp, (const unsigned char*)(&(dtmf->payload)), sizeof(ost::RTPPacket::RFC2833Payload)); + + // This is no more a new event + if(dtmf->newevent) { + dtmf->newevent = false; + static_cast<D*>(this)->setMark (false); + } + + // get back the payload to audio + static_cast<D*>(this)->setPayloadFormat (ost::StaticPayloadFormat ( (ost::StaticPayloadType) _audiocodec->getPayload())); + + // decrease length remaining to process for this event + dtmf->length -= 160; + + dtmf->payload.duration += 1; + + // next packet is going to be the last one + if((dtmf->length - 160) < 160) + dtmf->payload.ebit = true; + + if(dtmf->length < 160) { + delete dtmf; + _eventQueue.pop_front(); + } + } + template <typename D> int AudioRtpSession<D>::processDataEncode(void) { @@ -345,7 +444,7 @@ namespace sfl { assert(_audiolayer); - int _mainBufferSampleRate = _manager->getAudioDriver()->getMainBuffer()->getInternalSamplingRate(); + int _mainBufferSampleRate = _manager->getAudioDriver()->getMainBuffer()->getInternalSamplingRate(); // compute codec framesize in ms float fixed_codec_framesize = computeCodecFrameSize (_audiocodec->getFrameSize(), _audiocodec->getClockRate()); @@ -380,7 +479,7 @@ namespace sfl { } else { - _nSamplesMic = nbSample; + _nSamplesMic = nbSample; // no resampling required compSize = _audiocodec->codecEncode (_micDataEncoded, _micData, nbSample*sizeof (int16)); @@ -390,8 +489,7 @@ namespace sfl { } template <typename D> - void AudioRtpSession<D>::processDataDecode(unsigned char * spkrData, unsigned int size, int& countTime) - { + void AudioRtpSession<D>::processDataDecode(unsigned char * spkrData, unsigned int size) { if (_audiocodec != NULL) { @@ -429,26 +527,23 @@ namespace sfl { } // Notify (with a beep) an incoming call when there is already a call - countTime += _time->getSecond(); - if (_manager->incomingCallWaiting() > 0) { - int countTime_modulo = countTime % 4000; - // _debug("countTime: %i\n", countTime); - // _debug("countTime_modulo: %i\n", countTime_modulo); - if ((countTime_modulo - countTime) < 0) { + _countNotificationTime += _time->getSecond(); + int countTimeModulo = _countNotificationTime % 5000; + // _debug("countNotificationTime: %d\n", countNotificationTime); + // _debug("countTimeModulo: %d\n", countTimeModulo); + if ((countTimeModulo - _countNotificationTime) < 0) { _manager->notificationIncomingCall(); } - countTime = countTime_modulo; + _countNotificationTime = countTimeModulo; } - } else { - countTime += _time->getSecond(); - } + } } template <typename D> - void AudioRtpSession<D>::sendMicData(int timestamp) + void AudioRtpSession<D>::sendMicData() { // STEP: // 1. get data from mic @@ -456,35 +551,36 @@ namespace sfl { // 3. encode it // 4. send it - timestamp += _time->getSecond(); + // Increment timestamp for outgoing packet + _timestamp += _codecFrameSize; if (!_audiolayer) { - _debug ("No audiolayer available for MIC\n"); + _debug ("No audiolayer available for MIC"); return; } if (!_audiocodec) { - _debug ("No audiocodec available for MIC\n"); + _debug ("No audiocodec available for MIC"); return; } int compSize = processDataEncode(); // putData put the data on RTP queue, sendImmediate bypass this queue - static_cast<D*>(this)->putData (timestamp, _micDataEncoded, compSize); + static_cast<D*>(this)->putData (_timestamp, _micDataEncoded, compSize); } template <typename D> - void AudioRtpSession<D>::receiveSpeakerData (int& countTime) + void AudioRtpSession<D>::receiveSpeakerData () { if (!_audiolayer) { - _debug ("No audiolayer available for speaker\n"); + _debug ("No audiolayer available for speaker"); return; } if (!_audiocodec) { - _debug ("No audiocodec available for speaker\n"); + _debug ("No audiocodec available for speaker"); return; } @@ -501,79 +597,82 @@ namespace sfl { unsigned int size = adu->getSize(); // size in char - // _debug("RTP size: %i\n", size); + // DTMF over RTP, size must be over 4 in order to process it as voice data + if(size > 4) { + processDataDecode (spkrData, size); + } + else { + _debug("RTP: Received an RTP event with payload: %d", adu->getType()); + ost::RTPPacket::RFC2833Payload *dtmf = (ost::RTPPacket::RFC2833Payload *)adu->getData(); + _debug("RTP: Data received %d", dtmf->event); - // Size of DTMF over RTP - if(size > 4) { - processDataDecode (spkrData, size, countTime); - } + } } template <typename D> - int AudioRtpSession<D>::startRtpThread () + int AudioRtpSession<D>::startRtpThread (AudioCodec* audiocodec) { - _debug("Starting main thread\n"); + _debug("RTP: Starting main thread"); + setSessionTimeouts(); + setSessionMedia(audiocodec); + initBuffers(); return start(_mainloopSemaphore); } template <typename D> void AudioRtpSession<D>::run () { - - setSessionTimeouts(); - setDestinationIpAddress(); - setSessionMedia(); - - initBuffers(); + // Timestamp must be initialized randomly + _timestamp = static_cast<D*>(this)->getCurrentTimestamp(); int sessionWaiting; - int timestep = _codecFrameSize; - int timestamp = static_cast<D*>(this)->getCurrentTimestamp(); // for mic - int countTime = 0; // for receive int threadSleep = 0; - if (_codecSampleRate != 0) - { threadSleep = (_codecFrameSize * 1000) / _codecSampleRate; } - else - { threadSleep = _layerFrameSize; } + if (_codecSampleRate != 0){ + threadSleep = (_codecFrameSize * 1000) / _codecSampleRate; + } + else { + threadSleep = _layerFrameSize; + } TimerPort::setTimer (threadSleep); if (_audiolayer == NULL) { - _debug("For some unknown reason, audiolayer is null, just as \ - we were about to start the audio stream\n"); + _error("RTP: Error: Audiolayer is null, cannot start the audio stream"); throw AudioRtpSessionException(); } - _ca->setRecordingSmplRate(_audiocodec->getClockRate()); + _ca->setRecordingSmplRate(_audiocodec->getClockRate()); - // Start audio stream (if not started) AND flush all buffers (main and urgent) - _manager->getAudioDriver()->startStream(); + // Start audio stream (if not started) AND flush all buffers (main and urgent) + _manager->getAudioDriver()->startStream(); static_cast<D*>(this)->startRunning(); - // Already called in _audiolayer->startStream() - // _audiolayer->flushUrgent(); - // _audiolayer->flushMain(); - _debug ("Entering RTP mainloop for callid %s\n",_ca->getCallId().c_str()); + _debug ("RTP: Entering mainloop for call %s",_ca->getCallId().c_str()); while (!testCancel()) { - // ost::MutexLock lock(*(_manager->getAudioLayerMutex())); + // ost::MutexLock lock(*(_manager->getAudioLayerMutex())); - _manager->getAudioLayerMutex()->enter(); + _manager->getAudioLayerMutex()->enter(); - // converterSamplingRate = _audiolayer->getMainBuffer()->getInternalSamplingRate(); - _manager->getAudioDriver()->getMainBuffer()->getInternalSamplingRate(); + // converterSamplingRate = _audiolayer->getMainBuffer()->getInternalSamplingRate(); + _converterSamplingRate = _manager->getAudioDriver()->getMainBuffer()->getInternalSamplingRate(); - // Send session - sessionWaiting = static_cast<D*>(this)->isWaiting(); - sendMicData (timestamp); - timestamp += timestep; + sessionWaiting = static_cast<D*>(this)->isWaiting(); + + // Send session + if(_eventQueue.size() > 0) { + sendDtmfEvent(_eventQueue.front()); + } + else { + sendMicData (); + } // Recv session - receiveSpeakerData (countTime); + receiveSpeakerData (); // Let's wait for the next transmit cycle if (sessionWaiting == 1) { @@ -584,17 +683,14 @@ namespace sfl { _ca->recAudio.recData (_micData,_nSamplesMic); } - // ost::MutexLock unlock(*(_manager->getAudioLayerMutex())); - _manager->getAudioLayerMutex()->leave(); + _manager->getAudioLayerMutex()->leave(); // Let's wait for the next transmit cycle Thread::sleep (TimerPort::getTimer()); - - // TimerPort::incTimer(20); // 'frameSize' ms TimerPort::incTimer (threadSleep); } - _debug ("Left RTP main loop for callid %s\n",_ca->getCallId().c_str()); + _debug ("RTP: Left main loop for call%s", _ca->getCallId().c_str()); } } diff --git a/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp index 7099b807bd6150f345a988c4c151945ca35f4fe3..0595cf43660e7fcb9e51fdd6b74d64aecb0578b9 100644 --- a/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp +++ b/sflphone-common/src/audio/audiortp/AudioSrtpSession.cpp @@ -33,12 +33,6 @@ #include <cstring> #include <cerrno> -static uint8 mk[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; - -static uint8 ms[] = { 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d }; - namespace sfl { @@ -75,10 +69,11 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo() { std::string crypto_suite = sfl::CryptoSuites[_localCryptoSuite].name; // srtp keys formated as the following as the following + // inline:keyParameters|keylifetime|MasterKeyIdentifier // inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32 std::string srtp_keys = "inline:"; srtp_keys += getBase64ConcatenatedKeys(); - srtp_keys.append("|2^20|1:32"); + // srtp_keys.append("|2^20|1:32"); // generate crypto attribute std::string crypto_attr = tag.append(" "); @@ -95,7 +90,7 @@ std::vector<std::string> AudioSrtpSession::getLocalCryptoInfo() { void AudioSrtpSession::setRemoteCryptoInfo(sfl::SdesNegotiator& nego) { - _debug("Set remote Cryptographic info for Srtp session"); + _debug("Set remote Cryptographic info for Srtp"); // decode keys unBase64ConcatenatedKeys(nego.getKeyInfo()); @@ -122,12 +117,13 @@ void AudioSrtpSession::initializeLocalMasterKey(void) memcpy(_localMasterKey, random_key, _localMasterKeyLength); + /* printf("Local Master: "); for(int i = 0; i < _localMasterKeyLength; i++){ printf("%d", _localMasterKey[i]); } printf("\n"); - + */ return; } @@ -180,7 +176,6 @@ std::string AudioSrtpSession::getBase64ConcatenatedKeys() void AudioSrtpSession::unBase64ConcatenatedKeys(std::string base64keys) { - _remoteMasterKeyLength = sfl::CryptoSuites[1].masterKeyLength / 8; _remoteMasterSaltLength = sfl::CryptoSuites[1].masterSaltLength / 8; @@ -203,41 +198,41 @@ void AudioSrtpSession::unBase64ConcatenatedKeys(std::string base64keys) void AudioSrtpSession::initializeRemoteCryptoContext(void) { + CryptoSuiteDefinition crypto = sfl::CryptoSuites[_localCryptoSuite]; _remoteCryptoCtx = new ost::CryptoContext(0x0, - 0, // roc, - 0L, // keydr, - SrtpEncryptionAESCM, // encryption algo - SrtpAuthenticationSha1Hmac, // authtication algo - _remoteMasterKey, // Master Key - _remoteMasterKeyLength, // Master Key length - _remoteMasterSalt, // Master Salt - _remoteMasterSaltLength, // Master Salt length - 128 / 8, // encryption keyl - 160 / 8, // authentication key len - 112 / 8, // session salt len - 80 / 8); // authentication tag len - + 0, // roc, + 0L, // keydr, + SrtpEncryptionAESCM, // encryption algo + SrtpAuthenticationSha1Hmac, // authtication algo + _remoteMasterKey, + _remoteMasterKeyLength, + _remoteMasterSalt, + _remoteMasterSaltLength, + crypto.encryptionKeyLength / 8, + crypto.srtpAuthKeyLength / 8, + 112 / 8, // session salt len + crypto.srtpAuthTagLength / 8); } void AudioSrtpSession::initializeLocalCryptoContext(void) { + CryptoSuiteDefinition crypto = sfl::CryptoSuites[_localCryptoSuite]; _localCryptoCtx = new ost::CryptoContext(OutgoingDataQueue::getLocalSSRC(), - 0, // roc, - 0L, // keydr, - SrtpEncryptionAESCM, // encryption algo - SrtpAuthenticationSha1Hmac, // authtication algo - _localMasterKey, // Master Key - _localMasterKeyLength, // Master Key length - _localMasterSalt, // Master Salt - _localMasterSaltLength, // Master Salt length - 128 / 8, // encryption keyl - 160 / 8, // authentication key len - 112 / 8, // session salt len - 80 / 8); // authentication tag len - + 0, // roc, + 0L, // keydr, + SrtpEncryptionAESCM, // encryption algo + SrtpAuthenticationSha1Hmac, // authtication algo + _localMasterKey, + _localMasterKeyLength, + _localMasterSalt, + _localMasterSaltLength, + crypto.encryptionKeyLength / 8, + crypto.srtpAuthKeyLength / 8, + 112 / 8, // session salt len + crypto.srtpAuthTagLength / 8); } diff --git a/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp b/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp index cdd2a118214f2d23c1409b6797a2226fac74101e..cb82fe29e227fe0071d48c6aeda2cab3be5e9008 100644 --- a/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp +++ b/sflphone-common/src/audio/audiortp/AudioZrtpSession.cpp @@ -38,7 +38,6 @@ AudioZrtpSession::AudioZrtpSession (ManagerImpl * manager, SIPCall * sipcall, co { _debug ("AudioZrtpSession initialized"); initializeZid(); - startZrtp(); } void AudioZrtpSession::initializeZid (void) diff --git a/sflphone-common/src/audio/audiortp/AudioZrtpSession.h b/sflphone-common/src/audio/audiortp/AudioZrtpSession.h index 2e41e04b45b42086f903e551207563cdd9fdfba7..138bd2684733881494e2e26f8e1af01c85fe931c 100644 --- a/sflphone-common/src/audio/audiortp/AudioZrtpSession.h +++ b/sflphone-common/src/audio/audiortp/AudioZrtpSession.h @@ -38,8 +38,8 @@ namespace sfl { class AudioZrtpSession : public ost::SymmetricZRTPSession, public AudioRtpSession<AudioZrtpSession> { public: - AudioZrtpSession(ManagerImpl * manager, SIPCall * sipcall, const std::string& zidFilename); - + AudioZrtpSession(ManagerImpl * manager, SIPCall * sipcall, const std::string& zidFilename); + private: void initializeZid(void); std::string _zidFilename; diff --git a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp index ebdcd8f95e277e0d8de0628045cb3bc6a03ee212..145792e0bce09f97977772b4602a12559e2d4566 100644 --- a/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp +++ b/sflphone-common/src/audio/audiortp/ZrtpSessionCallback.cpp @@ -44,7 +44,7 @@ ZrtpSessionCallback::ZrtpSessionCallback (SIPCall *sipcall) : return; } - _debug ("Initialize callbacks"); + _info("Zrtp: Initialize callbacks"); /** * Information Map @@ -114,31 +114,33 @@ ZrtpSessionCallback::ZrtpSessionCallback (SIPCall *sipcall) : void ZrtpSessionCallback::secureOn (std::string cipher) { - _debug ("Secure mode is on with cipher %s", cipher.c_str()); - DBusManager::instance().getCallManager()->secureOn (_sipcall->getCallId(), cipher); + _debug ("Zrtp: Secure mode is on with cipher %s", cipher.c_str()); + DBusManager::instance().getCallManager()->secureZrtpOn (_sipcall->getCallId(), cipher); } void ZrtpSessionCallback::secureOff (void) { - _debug ("Secure mode is off"); - DBusManager::instance().getCallManager()->secureOff (_sipcall->getCallId()); + _debug ("Zrtp: Secure mode is off"); + DBusManager::instance().getCallManager()->secureZrtpOff (_sipcall->getCallId()); } void ZrtpSessionCallback::showSAS (std::string sas, bool verified) { - _debug ("SAS is: %s", sas.c_str()); + _debug ("Zrtp: SAS is: %s", sas.c_str()); DBusManager::instance().getCallManager()->showSAS (_sipcall->getCallId(), sas, verified); } + void ZrtpSessionCallback::zrtpNotSuppOther() { - _debug ("Callee does not support ZRTP"); + _debug ("Zrtp: Callee does not support ZRTP"); DBusManager::instance().getCallManager()->zrtpNotSuppOther (_sipcall->getCallId()); } + void ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t subCode) { @@ -148,7 +150,6 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub msg = _infoMap[subCode]; if (msg != NULL) { - _debug ("ZRTP Debug:"); } } @@ -156,7 +157,6 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub msg = _warningMap[subCode]; if (msg != NULL) { - _debug ("ZRTP Debug:"); } } @@ -164,10 +164,11 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub msg = _severeMap[subCode]; if (msg != NULL) { - _debug ("ZRTP Debug:"); } } + + if (sev == ZrtpError) { if (subCode < 0) { // received an error packet from peer subCode *= -1; @@ -179,7 +180,7 @@ ZrtpSessionCallback::showMessage (GnuZrtpCodes::MessageSeverity sev, int32_t sub msg = _zrtpMap[subCode]; if (msg != NULL) { - _debug ("ZRTP Debug: %s", msg->c_str()); + } } } @@ -192,9 +193,9 @@ ZrtpSessionCallback::zrtpNegotiationFailed (MessageSeverity severity, int subCod if (severity == ZrtpError) { if (subCode < 0) { // received an error packet from peer subCode *= -1; - _debug ("Received error packet: "); + _debug ("Zrtp: Received error packet: "); } else { - _debug ("Sent error packet: "); + _debug ("Zrtp: Sent error packet: "); } msg = _zrtpMap[subCode]; @@ -213,7 +214,7 @@ ZrtpSessionCallback::zrtpNegotiationFailed (MessageSeverity severity, int subCod void ZrtpSessionCallback::confirmGoClear() { - _debug ("Received go clear message. Until confirmation, ZRTP won't send any data"); + _debug ("Zrtp: Received go clear message. Until confirmation, ZRTP won't send any data"); DBusManager::instance().getCallManager()->zrtpNotSuppOther (_sipcall->getCallId()); } diff --git a/sflphone-common/src/audio/codecs/Makefile.am b/sflphone-common/src/audio/codecs/Makefile.am index 230ee7bbc0dce19ecfd5f02f18236afefb84965d..e338dc3fb5f898a86039e174c6705370fc20b91a 100644 --- a/sflphone-common/src/audio/codecs/Makefile.am +++ b/sflphone-common/src/audio/codecs/Makefile.am @@ -49,7 +49,7 @@ CELT_LIB = libcodec_celt.so libcodec_celt_so_SOURCES = celtcodec.cpp libcodec_celt_so_CFLAGS = -fPIC -g -Wall libcodec_celt_so_CXXFLAGS = -fPIC -g -Wall -libcodec_celt_so_LDFLAGS = --shared -lc -lcelt $(CELT_NIMP) +libcodec_celt_so_LDFLAGS = --shared -lc -lcelt0 $(CELT_NIMP) INSTALL_CELT_RULE = install-libcodec_celt_so endif diff --git a/sflphone-common/src/audio/codecs/celtcodec.cpp b/sflphone-common/src/audio/codecs/celtcodec.cpp index 8787bd6b6b3f7c8bfeec6fbf31464de24e31816c..612faa67911d51515c355cd2aff3fee088e5ace5 100644 --- a/sflphone-common/src/audio/codecs/celtcodec.cpp +++ b/sflphone-common/src/audio/codecs/celtcodec.cpp @@ -26,27 +26,59 @@ class Celt : public AudioCodec { public: - Celt (int payload=0) - : AudioCodec (payload, "celt") { - _clockRate = 44100; - _frameSize = 512; // fixed frameSize, TODO: support variable size from 64 to 512 + Celt (int payload=0) : AudioCodec (payload, "celt") { + + _clockRate = 32000; + _frameSize = 320; // fixed frameSize, TODO: support variable size from 64 to 512 _channel = 1; _bitrate = 0; _bandwidth = 0; + initCelt(); + } Celt (const Celt&); Celt& operator= (const Celt&); void initCelt() { - printf ("init celt"); + printf ("Celt: Init Celt codec"); + + int error = 0; + + _mode = celt_mode_create (_clockRate, _frameSize, &error); + + if(error != CELT_OK) { + switch(error) { + case CELT_BAD_ARG: + printf("Celt: Error: An (or more) invalid argument (e.g. out of range)\n"); + break; + case CELT_INVALID_MODE: + printf("Celt: Error: The mode struct passed is invalid\n"); + break; + case CELT_INTERNAL_ERROR: + printf("Celt: Error: An internal error was detected\n"); + break; + case CELT_CORRUPTED_DATA: + printf("Celt: Error: The data passed (e.g. compressed data to decoder) is corrupted\n"); + break; + case CELT_UNIMPLEMENTED: + printf("Celt: Error: Invalid/unsupported request numbe\n"); + break; + case CELT_INVALID_STATE: + printf("Celt: Error: An encoder or decoder structure is invalid or already freed\n"); + break; + case CELT_ALLOC_FAIL: + printf("Celt: Error: Memory allocation has failed\n"); + break; + default: + printf("Celt: Error"); + } - mode = celt_mode_create (_clockRate, _channel, _frameSize, NULL); - // celt_mode_info(mode, CELT_GET_LOOKAHEAD, &skip); + } - if (mode == NULL) { - printf ("failed to create a mode"); + if (_mode == NULL) { + printf ("Celt: Error: Failed to create Celt mode"); } // bytes_per_packet = 1024; @@ -58,11 +90,15 @@ class Celt : public AudioCodec // celt_mode_info(mode, CELT_GET_FRAME_SIZE, &frame_size); // celt_mode_info(mode, CELT_GET_NB_CHANNELS, &_channel); - enc = celt_encoder_create (mode); + _enc = celt_encoder_create (_mode, _channel, &error); + + _dec = celt_decoder_create (_mode, _channel, &error); - dec = celt_decoder_create (mode); + celt_encoder_ctl (_enc, CELT_SET_COMPLEXITY (2)); + celt_decoder_ctl(_dec, CELT_SET_COMPLEXITY (2)); - celt_encoder_ctl (enc,CELT_SET_COMPLEXITY (10)); + celt_encoder_ctl (_enc, CELT_SET_PREDICTION(2)); + celt_decoder_ctl(_dec, CELT_SET_PREDICTION(2)); } @@ -72,32 +108,34 @@ class Celt : public AudioCodec void terminateCelt() { - celt_encoder_destroy (enc); - celt_decoder_destroy (dec); + celt_encoder_destroy (_enc); + celt_decoder_destroy (_dec); + + celt_mode_destroy(_mode); } virtual int codecDecode (short *dst, unsigned char *src, unsigned int size) { int err = 0; - err = celt_decode (dec, src, size, (celt_int16_t*) dst); - return _frameSize * sizeof (celt_int16_t); + err = celt_decode (_dec, src, size, (celt_int16*) dst); + return _frameSize * sizeof (celt_int16); } virtual int codecEncode (unsigned char *dst, short *src, unsigned int size) { int len = 0; - len = celt_encode (enc, (celt_int16_t *) src, (celt_int16_t *) src, dst, 512); + len = celt_encode (_enc, (celt_int16*) src, (celt_int16 *) src, dst, 40); // returns the number of bytes writen return len; } private: - CELTMode *mode; + CELTMode *_mode; - CELTEncoder *enc; - CELTDecoder *dec; + CELTEncoder *_enc; + CELTDecoder *_dec; - celt_int32_t _celt_frame_size; - celt_int32_t skip; + celt_int32 _celt_frame_size; + celt_int32 skip; }; diff --git a/sflphone-common/src/audio/codecs/codecDescriptor.cpp b/sflphone-common/src/audio/codecs/codecDescriptor.cpp index 87a3c8c3d300791c0b89415ea8bf806c71f0e57e..29355764f1f8a5e96a13fc8ee2b6c8a1d6dbba62 100644 --- a/sflphone-common/src/audio/codecs/codecDescriptor.cpp +++ b/sflphone-common/src/audio/codecs/codecDescriptor.cpp @@ -25,7 +25,7 @@ #include "codecDescriptor.h" -CodecDescriptor::CodecDescriptor() : _CodecsMap(), _codecOrder(), _Cache(), _nbCodecs(), _CodecInMemory() +CodecDescriptor::CodecDescriptor() : _CodecsMap(), _defaultCodecOrder(), _Cache(), _nbCodecs(), _CodecInMemory() { } @@ -62,14 +62,13 @@ CodecDescriptor::init() } } -void -CodecDescriptor::setDefaultOrder() -{ - _codecOrder.clear(); +void CodecDescriptor::setDefaultOrder() { + + _defaultCodecOrder.clear(); CodecsMap::iterator iter = _CodecsMap.begin(); while (iter != _CodecsMap.end()) { - _codecOrder.push_back (iter->first); + _defaultCodecOrder.push_back (iter->first); iter->second->setState (true); iter ++ ; } @@ -103,32 +102,8 @@ CodecDescriptor::getCodec (AudioCodecType payload) return NULL; } -bool -CodecDescriptor::isActive (AudioCodecType payload) -{ - int i; - - for (i=0 ; (unsigned int) i < _codecOrder.size() ; i++) { - if (_codecOrder[i] == payload) - return true; - } - - return false; -} - -void -CodecDescriptor::removeCodec (AudioCodecType payload UNUSED) -{ -} - -void -CodecDescriptor::addCodec (AudioCodecType payload UNUSED) -{ -} +double CodecDescriptor::getBitRate (AudioCodecType payload) { -double -CodecDescriptor::getBitRate (AudioCodecType payload) -{ CodecsMap::iterator iter = _CodecsMap.find (payload); if (iter!=_CodecsMap.end()) @@ -137,9 +112,8 @@ CodecDescriptor::getBitRate (AudioCodecType payload) return 0.0; } -double -CodecDescriptor::getBandwidthPerCall (AudioCodecType payload) -{ +double CodecDescriptor::getBandwidthPerCall (AudioCodecType payload) { + CodecsMap::iterator iter = _CodecsMap.find (payload); if (iter!=_CodecsMap.end()) @@ -148,9 +122,8 @@ CodecDescriptor::getBandwidthPerCall (AudioCodecType payload) return 0.0; } -int -CodecDescriptor::getSampleRate (AudioCodecType payload) -{ +int CodecDescriptor::getSampleRate (AudioCodecType payload) { + CodecsMap::iterator iter = _CodecsMap.find (payload); if (iter!=_CodecsMap.end()) @@ -159,21 +132,9 @@ CodecDescriptor::getSampleRate (AudioCodecType payload) return 0; } -int -CodecDescriptor::getChannel (AudioCodecType payload) -{ - CodecsMap::iterator iter = _CodecsMap.find (payload); - - if (iter!=_CodecsMap.end()) - return (iter->second->getChannel()); - else - return 0; -} +void CodecDescriptor::saveActiveCodecs (const std::vector<std::string>& list) { -void -CodecDescriptor::saveActiveCodecs (const std::vector<std::string>& list) -{ - _codecOrder.clear(); + _defaultCodecOrder.clear(); // list contains the ordered payload of active codecs picked by the user // we used the CodecOrder vector to save the order. int i=0; @@ -184,7 +145,7 @@ CodecDescriptor::saveActiveCodecs (const std::vector<std::string>& list) payload = std::atoi (list[i].data()); if (isCodecLoaded (payload)) { - _codecOrder.push_back ( (AudioCodecType) payload); + _defaultCodecOrder.push_back ( (AudioCodecType) payload); _CodecsMap.find ( (AudioCodecType) payload)->second->setState (true); } @@ -192,9 +153,8 @@ CodecDescriptor::saveActiveCodecs (const std::vector<std::string>& list) } } -std::vector<AudioCodec*> -CodecDescriptor::scanCodecDirectory (void) -{ +std::vector<AudioCodec*> CodecDescriptor::scanCodecDirectory (void) { + std::vector<AudioCodec*> codecs; std::string tmp; int i; @@ -218,7 +178,6 @@ CodecDescriptor::scanCodecDirectory (void) tmp = dirStruct -> d_name ; if (tmp == CURRENT_DIR || tmp == PARENT_DIR) {} else { if (seemsValid (tmp) && !alreadyInCache (tmp)) { - //_debug("Codec : %s", tmp.c_str()); _Cache.push_back (tmp); audioCodec = loadCodec (dirStr.append (tmp)); codecs.push_back (audioCodec); @@ -234,10 +193,8 @@ CodecDescriptor::scanCodecDirectory (void) return codecs; } -AudioCodec* -CodecDescriptor::loadCodec (std::string path) -{ - //_debug("Load path %s", path.c_str()); +AudioCodec* CodecDescriptor::loadCodec (std::string path) { + CodecHandlePointer p; using std::cerr; void * codecHandle = dlopen (path.c_str() , RTLD_LAZY); @@ -262,10 +219,8 @@ CodecDescriptor::loadCodec (std::string path) } -void -CodecDescriptor::unloadCodec (CodecHandlePointer p) -{ - // _debug("Unload codec %s", p.first->getCodecName().c_str()); +void CodecDescriptor::unloadCodec (CodecHandlePointer p) { + using std::cerr; destroy_t* destroyCodec = (destroy_t*) dlsym (p.second , "destroy"); @@ -277,9 +232,7 @@ CodecDescriptor::unloadCodec (CodecHandlePointer p) dlclose (p.second); } -AudioCodec* -CodecDescriptor::instantiateCodec (AudioCodecType payload) -{ +AudioCodec* CodecDescriptor::instantiateCodec (AudioCodecType payload) { using std::cerr; @@ -304,9 +257,8 @@ CodecDescriptor::instantiateCodec (AudioCodecType payload) return NULL; } -AudioCodec* -CodecDescriptor::getFirstCodecAvailable (void) -{ +AudioCodec* CodecDescriptor::getFirstCodecAvailable (void) { + CodecsMap::iterator iter = _CodecsMap.begin(); if (iter != _CodecsMap.end()) @@ -315,9 +267,8 @@ CodecDescriptor::getFirstCodecAvailable (void) return NULL; } -bool -CodecDescriptor::seemsValid (std::string lib) -{ +bool CodecDescriptor::seemsValid (std::string lib) { + // The name of the shared library seems valid <==> it looks like libcodec_xxx.so // We check this std::string begin = SFL_CODEC_VALID_PREFIX; @@ -382,9 +333,8 @@ CodecDescriptor::alreadyInCache (std::string lib) return false; } -bool -CodecDescriptor::isCodecLoaded (int payload) -{ +bool CodecDescriptor::isCodecLoaded (int payload) { + CodecsMap::iterator iter = _CodecsMap.begin(); while (iter != _CodecsMap.end()) { @@ -397,6 +347,35 @@ CodecDescriptor::isCodecLoaded (int payload) return false; } +std::vector <std::string> CodecDescriptor::getCodecSpecifications (const int32_t& payload) { + + _warn ("Gathering codec specifications for payload %i", payload); + + std::vector<std::string> v; + std::stringstream ss; + + // Add the name of the codec + v.push_back (getCodecName ( (AudioCodecType) payload)); + + // Add the sample rate + ss << getSampleRate ( (AudioCodecType) payload); + v.push_back ( (ss.str()).data()); + ss.str (""); + + // Add the bit rate + ss << getBitRate ( (AudioCodecType) payload); + v.push_back ( (ss.str()).data()); + ss.str (""); + + // Add the bandwidth information + ss << getBandwidthPerCall ( (AudioCodecType) payload); + v.push_back ( (ss.str()).data()); + ss.str (""); + + return v; + +} + diff --git a/sflphone-common/src/audio/codecs/codecDescriptor.h b/sflphone-common/src/audio/codecs/codecDescriptor.h index 9ca8773a4c8986c4ba015caafafb1963b0d0b98f..437d39d0bc7aa2882b8d1d414f90304a068e0514 100644 --- a/sflphone-common/src/audio/codecs/codecDescriptor.h +++ b/sflphone-common/src/audio/codecs/codecDescriptor.h @@ -30,39 +30,12 @@ #include "user_cfg.h" #include "audio/codecs/audiocodec.h" -/** Enumeration that contains known audio payloads */ -typedef enum { - // http://www.iana.org/assignments/rtp-parameters - // http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0 - // 0 PCMU A 8000 1 [RFC3551] - PAYLOAD_CODEC_ULAW = 0, - // 3 GSM A 8000 1 [RFC3551] - PAYLOAD_CODEC_GSM = 3, - // 8 PCMA A 8000 1 [RFC3551] - PAYLOAD_CODEC_ALAW = 8, - // 9 G722 A 8000 1 [RFC3551] - PAYLOAD_CODEC_G722 = 9, - // http://www.ietf.org/rfc/rfc3952.txt - // 97 iLBC/8000 - PAYLOAD_CODEC_ILBC_20 = 97, - PAYLOAD_CODEC_ILBC_30 = 98, - // http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt - // 97 speex/8000 - // http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e - // 100 speex/16000 - PAYLOAD_CODEC_SPEEX_8000 = 110, - PAYLOAD_CODEC_SPEEX_16000 = 111, - PAYLOAD_CODEC_SPEEX_32000 = 112 -} AudioCodecType; - -/** A codec is identified by its payload. A payload is associated with a name. */ -typedef std::map<AudioCodecType, std::string> CodecMap; -/** The struct to reflect the order the user wants to use the codecs */ -typedef std::vector<AudioCodecType> CodecOrder; /** Enable us to keep the handle pointer on the codec dynamicaly loaded so that we could destroy when we dont need it anymore */ typedef std::pair<AudioCodec* , void*> CodecHandlePointer; /** Maps a pointer on an audiocodec object to a payload */ typedef std::map<AudioCodecType , AudioCodec*> CodecsMap; +/** A codec is identified by its payload. A payload is associated with a name. */ +typedef std::map<AudioCodecType, std::string> CodecMap; /* * @file codecdescriptor.h @@ -91,7 +64,7 @@ class CodecDescriptor { * Accessor to data structures * @return CodecOrder& The list that reflects the user's choice */ - CodecOrder& getActiveCodecs() { return _codecOrder; } + // CodecOrder& getActiveCodecs() { return _codecOrder; } /** * Get codec name by its payload @@ -114,30 +87,11 @@ class CodecDescriptor { void init(); /** - * Set the default codecs order + * Set the default codecs order. + * This order will be apply to each account by default */ void setDefaultOrder(); - /** - * Check in the map codec if the specified codec is supported - * @param payload unique identifier of a codec (RFC) - * @return bool True if the codec specified is supported - * false otherwise - */ - bool isActive(AudioCodecType payload); - - /** - * Remove the codec with payload payload from the list - * @param payload the codec to erase - */ - void removeCodec(AudioCodecType payload); - - /** - * Add a codec in the list. - * @param payload the codec to add - */ - void addCodec(AudioCodecType payload); - /** * Get the bit rate of the specified codec. * @param payload The payload of the codec @@ -154,7 +108,6 @@ class CodecDescriptor { */ double getBandwidthPerCall(AudioCodecType payload); - /** * Get the clock rate of the specified codec * @param payload The payload of the codec @@ -162,14 +115,7 @@ class CodecDescriptor { */ int getSampleRate(AudioCodecType payload); - /** - * Get the number of channels - * @param payload The payload of the codec - * @return int Number of channels - */ - int getChannel(AudioCodecType payload); - - /** + /** * Set the order of codecs by their payload * @param list The ordered list sent by DBus */ @@ -199,6 +145,22 @@ class CodecDescriptor { */ AudioCodec* instantiateCodec(AudioCodecType payload); + /** + * For a given codec, return its specification + * + * @param payload The RTP payload of the codec + * @return std::vector <std::string> A vector containing codec's name, sample rate, bandwidth and bit rate + */ + std::vector <std::string> getCodecSpecifications (const int32_t& payload); + + /** + * Check if the audiocodec object has been successfully created + * @param payload The payload of the codec + * @return bool True if the audiocodec has been created + * false otherwise + */ + bool isCodecLoaded( int payload ); + private: /** @@ -238,23 +200,15 @@ class CodecDescriptor { */ bool alreadyInCache( std::string ); - /** - * Check if the audiocodec object has been successfully created - * @param payload The payload of the codec - * @return bool True if the audiocodec has been created - * false otherwise - */ - bool isCodecLoaded( int payload ); - /** * Map the payload of a codec and the object associated ( AudioCodec * ) */ CodecsMap _CodecsMap; /** - * Vector containing the order of the codecs + * Vector containing a default order for the codecs */ - CodecOrder _codecOrder; + CodecOrder _defaultCodecOrder; /** * Vector containing the complete name of the codec shared library scanned diff --git a/sflphone-common/src/audio/codecs/speexcodec_nb.cpp b/sflphone-common/src/audio/codecs/speexcodec_nb.cpp index a2603fc8271e1430ca664edce67d07e3205b3ad4..9099dca71fbc7a69d71982394794c59f1d95492e 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_nb.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_nb.cpp @@ -39,7 +39,7 @@ class Speex : public AudioCodec _clockRate = 8000; _frameSize = 160; // samples, 20 ms at 8kHz _channel = 1; - _bitrate = 0; + _bitrate = 24; _bandwidth = 0; initSpeex(); } diff --git a/sflphone-common/src/audio/codecs/speexcodec_wb.cpp b/sflphone-common/src/audio/codecs/speexcodec_wb.cpp index 9d3b618674d016fdd939b08e30e833aa70d47bf0..28e099791f511dd838fdedc5c37dd4e4f20d4265 100644 --- a/sflphone-common/src/audio/codecs/speexcodec_wb.cpp +++ b/sflphone-common/src/audio/codecs/speexcodec_wb.cpp @@ -39,7 +39,7 @@ class Speex : public AudioCodec _clockRate = 16000; _frameSize = 320; // 20 ms at 16 kHz _channel = 1; - _bitrate = 0; + _bitrate = 42; _bandwidth = 0; initSpeex(); } diff --git a/sflphone-common/src/audio/mainbuffer.cpp b/sflphone-common/src/audio/mainbuffer.cpp index 54be846cc2ef875a0df94d693bb62961022d2ebe..f0da142792d6a6e428a5f7d3d0659af570765c1f 100644 --- a/sflphone-common/src/audio/mainbuffer.cpp +++ b/sflphone-common/src/audio/mainbuffer.cpp @@ -563,7 +563,7 @@ void MainBuffer::stateInfo() iter_call_id++; } - _debug ("%s\n", dbg_str.c_str()); + _debug ("%s", dbg_str.c_str()); iter_call++; } @@ -597,7 +597,7 @@ void MainBuffer::stateInfo() } } - _debug ("%s\n", dbg_str.c_str()); + _debug ("%s", dbg_str.c_str()); iter_buffer++; } diff --git a/sflphone-common/src/audio/pulseaudio/audiostream.cpp b/sflphone-common/src/audio/pulseaudio/audiostream.cpp index dd11a28d57e2cb74c59284783eb15612b2cf9375..e743c85286d9e3e16292f6d4f4de478f9d714143 100644 --- a/sflphone-common/src/audio/pulseaudio/audiostream.cpp +++ b/sflphone-common/src/audio/pulseaudio/audiostream.cpp @@ -24,20 +24,19 @@ static pa_channel_map channel_map; -AudioStream::AudioStream (PulseLayerType * driver) +AudioStream::AudioStream (PulseLayerType * driver, int smplrate) : _audiostream (NULL), _context (driver->context), _streamType (driver->type), _streamDescription (driver->description), _volume(), - flag (PA_STREAM_AUTO_TIMING_UPDATE), - sample_spec(), + _flag (PA_STREAM_AUTO_TIMING_UPDATE), + _sample_spec(), _mainloop (driver->mainloop) { - sample_spec.format = PA_SAMPLE_S16LE; - // sample_spec.format = PA_SAMPLE_FLOAT32LE; - sample_spec.rate = 44100; - sample_spec.channels = 1; + _sample_spec.format = PA_SAMPLE_S16LE; // PA_SAMPLE_FLOAT32LE; + _sample_spec.rate = smplrate; + _sample_spec.channels = 1; channel_map.channels = 1; pa_cvolume_set (&_volume , 1 , PA_VOLUME_NORM) ; // * vol / 100 ; } @@ -73,7 +72,7 @@ bool AudioStream::drainStream (void) { if (_audiostream) { - _debug ("Draining stream"); + _info("Audio: Draining stream"); pa_operation * operation; pa_threaded_mainloop_lock (_mainloop); @@ -81,7 +80,7 @@ AudioStream::drainStream (void) if ( (operation = pa_stream_drain (_audiostream, success_cb, _mainloop))) { while (pa_operation_get_state (operation) != PA_OPERATION_DONE) { if (!_context || pa_context_get_state (_context) != PA_CONTEXT_READY || !_audiostream || pa_stream_get_state (_audiostream) != PA_STREAM_READY) { - _debug ("Connection died: %s", _context ? pa_strerror (pa_context_errno (_context)) : "NULL"); + _warn("Audio: Connection died: %s", _context ? pa_strerror (pa_context_errno (_context)) : "NULL"); pa_operation_unref (operation); break; } else { @@ -99,7 +98,7 @@ AudioStream::drainStream (void) bool AudioStream::disconnectStream (void) { - _debug ("Destroy audio streams"); + _info("Audio: Destroy audio streams"); pa_threaded_mainloop_lock (_mainloop); @@ -128,7 +127,7 @@ AudioStream::stream_state_callback (pa_stream* s, void* user_data) { pa_threaded_mainloop *m; - _debug ("AudioStream::stream_state_callback :: The state of the stream changed"); + _info("Audio: The state of the stream changed"); assert (s); m = (pa_threaded_mainloop*) user_data; @@ -137,26 +136,25 @@ AudioStream::stream_state_callback (pa_stream* s, void* user_data) switch (pa_stream_get_state (s)) { case PA_STREAM_CREATING: - _debug ("Stream is creating..."); + _info("Audio: Stream is creating..."); break; case PA_STREAM_TERMINATED: - _debug ("Stream is terminating..."); + _info ("Audio: Stream is terminating..."); break; case PA_STREAM_READY: - _debug ("Stream successfully created, connected to %s", pa_stream_get_device_name (s)); - // pa_stream_cork( s, 0, NULL, NULL); + _info ("Audio: Stream successfully created, connected to %s", pa_stream_get_device_name (s)); break; case PA_STREAM_UNCONNECTED: - _debug ("Stream unconnected"); + _info ("Audio: Stream unconnected"); break; case PA_STREAM_FAILED: default: - _debug ("Stream error - Sink/Source doesn't exists: %s" , pa_strerror (pa_context_errno (pa_stream_get_context (s)))); + _warn("Audio: Error - Sink/Source doesn't exists: %s" , pa_strerror (pa_context_errno (pa_stream_get_context (s)))); exit (0); break; } @@ -178,56 +176,49 @@ AudioStream::createStream (pa_context* c) ost::MutexLock guard (_mutex); pa_stream* s; - //pa_cvolume cv; - // pa_sample_spec ss; - // ss.format = PA_SAMPLE_S16LE; - // ss.rate = 44100; - // ss.channels = 1; - - - assert (pa_sample_spec_valid (&sample_spec)); + assert (pa_sample_spec_valid (&_sample_spec)); assert (pa_channel_map_valid (&channel_map)); + _info("Audio: Create pulseaudio stream"); + pa_buffer_attr* attributes = (pa_buffer_attr*) malloc (sizeof (pa_buffer_attr)); - if (! (s = pa_stream_new (c, _streamDescription.c_str() , &sample_spec, &channel_map))) - _debug ("%s: pa_stream_new() failed : %s" , _streamDescription.c_str(), pa_strerror (pa_context_errno (c))); + + if (! (s = pa_stream_new (c, _streamDescription.c_str() , &_sample_spec, &channel_map))) + _warn ("Audio: Error: %s: pa_stream_new() failed : %s" , _streamDescription.c_str(), pa_strerror (pa_context_errno (c))); assert (s); - // parameters are defined as number of bytes - // 2048 bytes (1024 int16) is 20 ms at 44100 Hz if (_streamType == PLAYBACK_STREAM) { - // 20 ms framesize TODO: take framesize value from config attributes->maxlength = (uint32_t) -1; - attributes->tlength = pa_usec_to_bytes (100 * PA_USEC_PER_MSEC, &sample_spec); + attributes->tlength = pa_usec_to_bytes (100 * PA_USEC_PER_MSEC, &_sample_spec); attributes->prebuf = 0; attributes->minreq = (uint32_t) -1; - attributes->fragsize = (uint32_t) -1; - pa_stream_connect_playback (s , NULL , attributes, PA_STREAM_ADJUST_LATENCY, &_volume, NULL); + pa_threaded_mainloop_lock(_mainloop); + pa_stream_connect_playback (s , NULL , attributes, (pa_stream_flags_t)(PA_STREAM_ADJUST_LATENCY|PA_STREAM_AUTO_TIMING_UPDATE), &_volume, NULL); + pa_threaded_mainloop_unlock(_mainloop); + } else if (_streamType == CAPTURE_STREAM) { - // 20 ms framesize TODO: take framesize value from config attributes->maxlength = (uint32_t) -1; - attributes->tlength = (uint32_t) -1; - attributes->prebuf = (uint32_t) -1; - attributes->minreq = (uint32_t) -1; - attributes->fragsize = pa_usec_to_bytes (50 * PA_USEC_PER_MSEC, &sample_spec); - + attributes->fragsize = pa_usec_to_bytes (50 * PA_USEC_PER_MSEC, &_sample_spec); - - pa_stream_connect_record (s, NULL, attributes, (pa_stream_flags_t) (PA_STREAM_PEAK_DETECT|PA_STREAM_ADJUST_LATENCY)); + pa_threaded_mainloop_lock(_mainloop); + pa_stream_connect_record (s, NULL, attributes, (pa_stream_flags_t) (PA_STREAM_ADJUST_LATENCY|PA_STREAM_AUTO_TIMING_UPDATE)); + pa_threaded_mainloop_unlock(_mainloop); + } else if (_streamType == UPLOAD_STREAM) { pa_stream_connect_upload (s , 1024); } else { - _debug ("Stream type unknown "); + _warn ("Audio: Error: Stream type unknown "); } pa_stream_set_state_callback (s , stream_state_callback, _mainloop); + free (attributes); return s; diff --git a/sflphone-common/src/audio/pulseaudio/audiostream.h b/sflphone-common/src/audio/pulseaudio/audiostream.h index 1d860ebc1262c1daa63049689583d5ebe2690dae..75705f18dfdfe5933da279574bf167211a18e606 100644 --- a/sflphone-common/src/audio/pulseaudio/audiostream.h +++ b/sflphone-common/src/audio/pulseaudio/audiostream.h @@ -54,7 +54,7 @@ class AudioStream { * Constructor * @param context The PulseLayerType structure containing various information. */ - AudioStream(PulseLayerType * driver); + AudioStream(PulseLayerType * driver, int smplrate); /** * Destructor @@ -175,8 +175,8 @@ class AudioStream { * Streams parameters */ pa_cvolume _volume; - pa_stream_flags_t flag; - pa_sample_spec sample_spec ; + pa_stream_flags_t _flag; + pa_sample_spec _sample_spec ; pa_threaded_mainloop * _mainloop; diff --git a/sflphone-common/src/audio/pulseaudio/pulselayer.cpp b/sflphone-common/src/audio/pulseaudio/pulselayer.cpp index 773956df5b35328bf5b2683b59507aa1d7af3faf..3f754c8df169c1bbb9fe49e3b79bab666e71c4fc 100644 --- a/sflphone-common/src/audio/pulseaudio/pulselayer.cpp +++ b/sflphone-common/src/audio/pulseaudio/pulselayer.cpp @@ -1,7 +1,7 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,62 +25,47 @@ int framesPerBuffer = 2048; static void playback_callback (pa_stream* s, size_t bytes, void* userdata) { - // _debug("playback_callback"); assert (s && bytes); assert (bytes > 0); static_cast<PulseLayer*> (userdata)->processPlaybackData(); - // static_cast<PulseLayer*> (userdata)->processData(); + } static void capture_callback (pa_stream* s, size_t bytes, void* userdata) { - // _debug("capture_callback"); assert (s && bytes); assert (bytes > 0); static_cast<PulseLayer*> (userdata)->processCaptureData(); - // static_cast<PulseLayer*> (userdata)->processData(); + } /* static void stream_suspended_callback (pa_stream *s UNUSED, void *userdata UNUSED) { - _debug("PulseLayer::Stream Suspended"); + _debug("Audio: Stream Suspended"); } */ /* static void stream_moved_callback(pa_stream *s UNUSED, void *userdata UNUSED) { - _debug("PulseLayer::Stream Moved"); + _debug("Audio: Stream Moved"); } */ static void playback_underflow_callback (pa_stream* s, void* userdata UNUSED) { - _debug ("PulseLayer::Buffer Underflow"); - // const pa_timing_info* info = pa_stream_get_timing_info(s); - // _debug(" pa write_index: %l", (long)(info->write_index)); - // _debug(" pa write_index_corupt (if not 0): %i", info->write_index_corrupt); - // _debug(" pa read_index: %l", (long)(info->read_index)); - // _debug(" pa read_index_corrupt (if not 0): %i", info->read_index_corrupt); - - - // fill in audio buffer twice the prebuffering value to restart playback - pa_stream_writable_size (s); + _debug ("Audio: Buffer Underflow"); pa_stream_trigger (s, NULL, NULL); - - } static void playback_overflow_callback (pa_stream* s UNUSED, void* userdata UNUSED) { - _debug ("PulseLayer::Buffer OverFlow"); - //PulseLayer* pulse = (PulseLayer*) userdata; - // pa_stream_drop (s); - // pa_stream_trigger (s, NULL, NULL); + _debug ("Audio: Buffer OverFlow"); + } @@ -91,11 +76,11 @@ PulseLayer::PulseLayer (ManagerImpl* manager) , playback() , record() { - _debug ("PulseLayer::Pulse audio constructor: Create context"); - _urgentRingBuffer.createReadPointer(); dcblocker = new DcBlocker(); is_started = false; + + openLayer(); } // Destructor @@ -113,28 +98,59 @@ PulseLayer::~PulseLayer (void) dcblocker = NULL; } +void +PulseLayer::openLayer (void) +{ + if (!is_started) { + + _info("Audio: Open layer"); + + if (!m) { + + _info("Audio: Creating PulseAudio mainloop"); + if (!(m = pa_threaded_mainloop_new())) + _warn ("Audio: Error: while creating pulseaudio mainloop"); + + if (pa_threaded_mainloop_start (m) < 0) { + _warn("Audio: Error: Failed to start pulseaudio mainloop"); + } + + assert(m); + } + + if (!context) { + + _info("Audio: Creating new PulseAudio Context"); + pa_threaded_mainloop_lock (m); + + // Instanciate a context + if (! (context = pa_context_new (pa_threaded_mainloop_get_api (m) , "SFLphone"))) + _warn ("Audio: Error: while creating pulseaudio context"); + + pa_threaded_mainloop_unlock (m); + + assert (context); + } + + // Create Streams + connectPulseAudioServer(); + + is_started = true; + } + +} + bool PulseLayer::closeLayer (void) { - _debug ("PulseLayer::closeLayer :: Destroy pulselayer"); - - // Commenting the line below will make the - // PulseLayer to close immediately, not - // waiting for the playback buffer to be - // emptied. It should not hurt. - //playback->drainStream(); + _info("Audio: Destroy pulselayer"); + disconnectAudioStream(); + if (m) { pa_threaded_mainloop_stop (m); } - // playback->disconnectStream(); - // closePlaybackStream(); - - // record->disconnectStream(); - // closeCaptureStream(); - - // disconnectAudioStream(); if (context) { pa_context_disconnect (context); @@ -153,7 +169,7 @@ PulseLayer::closeLayer (void) void PulseLayer::connectPulseAudioServer (void) { - _debug ("PulseLayer::connectPulseAudioServer "); + _info("Audio: connect to pulseaudio server"); setenv ("PULSE_PROP_media.role", "phone", 1); @@ -161,30 +177,27 @@ PulseLayer::connectPulseAudioServer (void) pa_threaded_mainloop_lock (m); - _debug ("Connect the context to the server"); + _info("Audio: Connect the context to the server"); pa_context_connect (context, NULL , flag , NULL); pa_context_set_state_callback (context, context_state_callback, this); - pa_threaded_mainloop_wait (m); - + pa_threaded_mainloop_wait(m); + + // Run the main loop - if (pa_context_get_state (context) != PA_CONTEXT_READY) { - _debug ("Error connecting to pulse audio server"); - // pa_threaded_mainloop_unlock (m); + _warn("Audio: Error: connecting to pulse audio server"); } pa_threaded_mainloop_unlock (m); - //serverinfo(); - //muteAudioApps(99); - _debug ("Context creation done"); + _info("Audio: Context creation done"); } void PulseLayer::context_state_callback (pa_context* c, void* user_data) { - _debug ("PulseLayer::context_state_callback ::The state of the context changed"); + _info("Audio: The state of the context changed"); PulseLayer* pulse = (PulseLayer*) user_data; assert (c && pulse->m); @@ -195,46 +208,45 @@ void PulseLayer::context_state_callback (pa_context* c, void* user_data) case PA_CONTEXT_AUTHORIZING: case PA_CONTEXT_SETTING_NAME: - _debug ("Waiting...."); + _debug ("Audio: Waiting...."); break; case PA_CONTEXT_READY: - pulse->createStreams (c); - _debug ("Connection to PulseAudio server established"); + _debug ("Audio: Connection to PulseAudio server established"); + pa_threaded_mainloop_signal(pulse->m, 0); break; case PA_CONTEXT_TERMINATED: - _debug ("Context terminated"); + _debug ("Audio: Context terminated"); break; case PA_CONTEXT_FAILED: default: - _debug (" Error : %s" , pa_strerror (pa_context_errno (c))); + _warn("Audio: Error : %s" , pa_strerror (pa_context_errno (c))); pulse->disconnectAudioStream(); exit (0); break; } } -bool PulseLayer::disconnectAudioStream (void) +bool PulseLayer::openDevice (int indexIn UNUSED, int indexOut UNUSED, int sampleRate, int frameSize , int stream UNUSED, std::string plugin UNUSED) { - _debug (" PulseLayer::disconnectAudioStream( void ) "); + _audioSampleRate = sampleRate; + _frameSize = frameSize; - closePlaybackStream(); + flushUrgent(); - closeCaptureStream(); + // use 1 sec buffer for resampling + _converter = new SamplerateConverter (_audioSampleRate, 1000); - if (!playback && !record) - return true; - else - return false; + return true; } bool PulseLayer::createStreams (pa_context* c) { - _debug ("PulseLayer::createStreams"); + _info("Audio: Create streams"); PulseLayerType * playbackParam = new PulseLayerType(); playbackParam->context = c; @@ -243,7 +255,7 @@ bool PulseLayer::createStreams (pa_context* c) playbackParam->volume = _manager->getSpkrVolume(); playbackParam->mainloop = m; - playback = new AudioStream (playbackParam); + playback = new AudioStream (playbackParam, _audioSampleRate); playback->connectStream(); pa_stream_set_write_callback (playback->pulseStream(), playback_callback, this); pa_stream_set_overflow_callback (playback->pulseStream(), playback_overflow_callback, this); @@ -259,7 +271,7 @@ bool PulseLayer::createStreams (pa_context* c) recordParam->volume = _manager->getMicVolume(); recordParam->mainloop = m; - record = new AudioStream (recordParam); + record = new AudioStream (recordParam, _audioSampleRate); record->connectStream(); pa_stream_set_read_callback (record->pulseStream() , capture_callback, this); // pa_stream_set_suspended_callback(record->pulseStream(), stream_suspended_callback, this); @@ -270,98 +282,66 @@ bool PulseLayer::createStreams (pa_context* c) flushMain(); flushUrgent(); - // _urgentRingBuffer.flushAll(); - return true; } -bool PulseLayer::openDevice (int indexIn UNUSED, int indexOut UNUSED, int sampleRate, int frameSize , int stream UNUSED, std::string plugin UNUSED) +bool PulseLayer::disconnectAudioStream (void) { - _audioSampleRate = sampleRate; - _frameSize = frameSize; + _info("Audio: Disconnect audio stream"); - // _urgentRingBuffer.flushAll(); - flushUrgent(); - - _converter = new SamplerateConverter (_audioSampleRate, _frameSize*4); + closePlaybackStream(); + closeCaptureStream(); - return true; + if (!playback && !record) + return true; + else + return false; } + void PulseLayer::closeCaptureStream (void) { if (record) { - delete record; record=NULL; } } + void PulseLayer::closePlaybackStream (void) { if (playback) { - delete playback; playback=NULL; } } + int PulseLayer::canGetMic() { if (record) - return 0; // _micRingBuffer.AvailForGet(); + return 0; else return 0; } + int PulseLayer::getMic (void *buffer, int toCopy) { if (record) { - return 0; // _micRingBuffer.Get (buffer, toCopy, 100); + return 0; } else return 0; } + void PulseLayer::startStream (void) { - // connectPulseAudioServer(); - - if (!is_started) { - - _debug ("PulseLayer::Start Stream"); - - if (!m) { - - _debug ("Creating PulseAudio MainLoop"); - m = pa_threaded_mainloop_new(); - assert (m); - - if (pa_threaded_mainloop_start (m) < 0) { - _debug ("Failed starting the mainloop"); - } - } - - if (!context) { - - _debug ("Creating new PulseAudio Context"); - pa_threaded_mainloop_lock (m); - // Instanciate a context - - if (! (context = pa_context_new (pa_threaded_mainloop_get_api (m) , "SFLphone"))) - _debug ("Error while creating the context"); - - pa_threaded_mainloop_unlock (m); - - assert (context); - } - - // Create Streams - connectPulseAudioServer(); - - is_started = true; - } + // Create Streams + if(!playback || !record) + createStreams(context); // Flush outside the if statement: every time start stream is // called is to notify a new event @@ -371,71 +351,33 @@ void PulseLayer::startStream (void) } + void PulseLayer::stopStream (void) { - if (is_started) { + _info("Audio: Stop audio stream"); - _debug ("PulseLayer::Stop Audio Stream"); - pa_stream_flush (playback->pulseStream(), NULL, NULL); - pa_stream_flush (record->pulseStream(), NULL, NULL); - - if (m) { - pa_threaded_mainloop_stop (m); - } + pa_threaded_mainloop_lock (m); - disconnectAudioStream(); + if(playback) + pa_stream_flush (playback->pulseStream(), NULL, NULL); - _debug ("Disconnecting PulseAudio context"); - - if (context) { - - pa_threaded_mainloop_lock (m); - pa_context_disconnect (context); - pa_context_unref (context); - pa_threaded_mainloop_unlock (m); - context = NULL; - } + if(record) + pa_stream_flush (record->pulseStream(), NULL, NULL); - _debug ("Freeing Pulseaudio mainloop"); - - if (m) { - pa_threaded_mainloop_free (m); - m = NULL; - } - - - is_started = false; - - } + pa_threaded_mainloop_unlock (m); + disconnectAudioStream(); } -// void PulseLayer::underflow (pa_stream* s UNUSED, void* userdata UNUSED) -//{ -// _debug ("PulseLayer::Buffer Underflow"); -//} - -/* -void PulseLayer::overflow (pa_stream* s, void* userdata UNUSED) -{ - //PulseLayer* pulse = (PulseLayer*) userdata; - pa_stream_drop (s); - pa_stream_trigger (s, NULL, NULL); -} -*/ - - void PulseLayer::processPlaybackData (void) { // Handle the data for the speakers if (playback && (playback->pulseStream()) && (pa_stream_get_state (playback->pulseStream()) == PA_STREAM_READY)) { - // _debug("PulseLayer::processPlaybackData()"); - // If the playback buffer is full, we don't overflow it; wait for it to have free space if (pa_stream_writable_size (playback->pulseStream()) == 0) return; @@ -463,8 +405,6 @@ void PulseLayer::processData (void) // Handle the data for the speakers if (playback && (playback->pulseStream()) && (pa_stream_get_state (playback->pulseStream()) == PA_STREAM_READY)) { - // _debug("PulseLayer::processPlaybackData()"); - // If the playback buffer is full, we don't overflow it; wait for it to have free space if (pa_stream_writable_size (playback->pulseStream()) == 0) return; @@ -494,24 +434,19 @@ void PulseLayer::writeToSpeaker (void) urgentAvailBytes = _urgentRingBuffer.AvailForGet(); + // available bytes to be written in pulseaudio internal buffer int writeableSize = pa_stream_writable_size (playback->pulseStream()); - // _debug("PulseLayer writablesize : %i", writeableSize); if (writeableSize < 0) - _debug ("PulseLayer playback error : %s", pa_strerror (writeableSize)); + _warn ("Audio: playback error : %s", pa_strerror (writeableSize)); if (urgentAvailBytes > writeableSize) { - // _debug("urgentAvailBytes: %i", urgentAvailBytes); - - // _debug("Play Urgent!"); - out = (SFLDataFormat*) pa_xmalloc (writeableSize); _urgentRingBuffer.Get (out, writeableSize, 100); - // pa_threaded_mainloop_lock (m); + pa_stream_write (playback->pulseStream(), out, writeableSize, NULL, 0, PA_SEEK_RELATIVE); - // pa_threaded_mainloop_unlock (m); pa_xfree (out); @@ -529,17 +464,12 @@ void PulseLayer::writeToSpeaker (void) if (tone != 0) { - // _debug("PlayTone writeableSize: %i", writeableSize); - if (playback->getStreamState() == PA_STREAM_READY) { - // _debug("Play Sine Tone!"); - out = (SFLDataFormat*) pa_xmalloc (writeableSize); int copied = tone->getNext (out, writeableSize / sizeof (SFLDataFormat), 100); - // pa_threaded_mainloop_lock (m); - pa_stream_write (playback->pulseStream(), out, copied * sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE); - // pa_threaded_mainloop_unlock (m); + + int returnValue = pa_stream_write (playback->pulseStream(), out, copied * sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE); pa_xfree (out); @@ -549,15 +479,13 @@ void PulseLayer::writeToSpeaker (void) else if (file_tone != 0) { if (playback->getStreamState() == PA_STREAM_READY) { - // _debug("Play File Tone!"); out = (SFLDataFormat*) pa_xmalloc (writeableSize); int copied = file_tone->getNext (out, writeableSize / sizeof (SFLDataFormat), 100); - // pa_threaded_mainloop_lock (m); + pa_stream_write (playback->pulseStream(), out, copied * sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE); pa_xfree (out); - // pa_threaded_mainloop_unlock (m); } @@ -587,7 +515,6 @@ void PulseLayer::writeToSpeaker (void) normalAvailBytes = getMainBuffer()->availForGet(); byteToGet = (normalAvailBytes < (int) (maxNbBytesToGet)) ? normalAvailBytes : maxNbBytesToGet; - // _debug("byteToGet: %i", byteToGet); if (byteToGet) { @@ -611,12 +538,10 @@ void PulseLayer::writeToSpeaker (void) int nbSample = _converter->upsampleData ( (SFLDataFormat*) out, rsmpl_out, _mainBufferSampleRate, _audioSampleRate, nb_sample_down); if ( (nbSample*sizeof (SFLDataFormat)) > (unsigned int) writeableSize) - _debug ("Error: nbsbyte exceed buffer length"); + _warn("Audio: Error: nbsbyte exceed buffer length"); - // pa_threaded_mainloop_lock (m); pa_stream_write (playback->pulseStream(), rsmpl_out, nbSample*sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE); - // pa_threaded_mainloop_unlock (m); pa_xfree (rsmpl_out); } else { @@ -635,9 +560,7 @@ void PulseLayer::writeToSpeaker (void) bzero (zeros, writeableSize); - // pa_threaded_mainloop_lock (m); pa_stream_write (playback->pulseStream(), zeros, writeableSize, NULL, 0, PA_SEEK_RELATIVE); - // pa_threaded_mainloop_unlock (m); pa_xfree (zeros); @@ -658,14 +581,11 @@ void PulseLayer::readFromMic (void) const char* data = NULL; size_t r; - // if (record->getStreamState() - int readableSize = pa_stream_readable_size (record->pulseStream()); - // _debug("readableSize: %i", readableSize); if (pa_stream_peek (record->pulseStream() , (const void**) &data , &r) < 0 || !data) { - _debug ("pa_stream_peek() failed: %s" , pa_strerror (pa_context_errno (context))); + _warn("Audio: Error capture stream peek failed: %s" , pa_strerror (pa_context_errno (context))); } @@ -674,13 +594,10 @@ void PulseLayer::readFromMic (void) int _mainBufferSampleRate = getMainBuffer()->getInternalSamplingRate(); // test if resampling is required - if (_mainBufferSampleRate && ( (int) _audioSampleRate != _mainBufferSampleRate)) { - - SFLDataFormat* rsmpl_out = (SFLDataFormat*) pa_xmalloc (readableSize); - // _debug("Byte read: %i", r); + int nbSample = r / sizeof (SFLDataFormat); int nb_sample_up = nbSample; @@ -706,10 +623,9 @@ void PulseLayer::readFromMic (void) } if (pa_stream_drop (record->pulseStream()) < 0) { - //_debug("pa_stream_drop() failed: %s" , pa_strerror( pa_context_errno( context) )); + _warn("Audio: Error: capture stream drop failed: %s" , pa_strerror( pa_context_errno( context) )); } - // pa_threaded_mainloop_unlock (m); } static void retrieve_server_info (pa_context *c UNUSED, const pa_server_info *i, void *userdata UNUSED) diff --git a/sflphone-common/src/audio/pulseaudio/pulselayer.h b/sflphone-common/src/audio/pulseaudio/pulselayer.h index eb252408313c1873f47a1a688df800471ebe7942..a8248b56be1ee1e1b543ce6f96efea0b88f51c31 100644 --- a/sflphone-common/src/audio/pulseaudio/pulselayer.h +++ b/sflphone-common/src/audio/pulseaudio/pulselayer.h @@ -1,6 +1,7 @@ /* * Copyright (C) 2008 Savoir-Faire Linux inc. * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,6 +42,8 @@ class PulseLayer : public AudioLayer { PulseLayer(ManagerImpl* manager); ~PulseLayer(void); + void openLayer( void ); + bool closeLayer( void ); /** diff --git a/sflphone-common/src/audio/samplerateconverter.cpp b/sflphone-common/src/audio/samplerateconverter.cpp index 8d115a25560149e1a0b73c54f91d7fea26ace8a3..ba68515756e811546ebd41777766320172289b71 100644 --- a/sflphone-common/src/audio/samplerateconverter.cpp +++ b/sflphone-common/src/audio/samplerateconverter.cpp @@ -20,7 +20,7 @@ #include "manager.h" SamplerateConverter::SamplerateConverter (void) - : _frequence (Manager::instance().getConfigInt (AUDIO , ALSA_SAMPLE_RATE)) //44100 + : _frequence (Manager::instance().getConfigInt (AUDIO , AUDIO_SAMPLE_RATE)) //44100 , _framesize (Manager::instance().getConfigInt (AUDIO , ALSA_FRAME_SIZE)) , _floatBufferDownMic (NULL) , _floatBufferUpMic (NULL) @@ -77,8 +77,7 @@ void SamplerateConverter::init (void) _src_state_spkr = src_new (SRC_LINEAR, 1, &_src_err); int nbSamplesMax = (int) (getFrequence() * getFramesize() / 1000); - // TODO: fix this hack that make sure we have enought place in buffers to upsample - nbSamplesMax = nbSamplesMax*4; + _floatBufferDownMic = new float32[nbSamplesMax]; _floatBufferUpMic = new float32[nbSamplesMax]; _floatBufferDownSpkr = new float32[nbSamplesMax]; @@ -104,9 +103,8 @@ int SamplerateConverter::upsampleData (SFLDataFormat* dataIn , SFLDataFormat* da { double upsampleFactor = (double) samplerate2 / samplerate1 ; - //_debug("factor = %f" , upsampleFactor); + int nbSamplesMax = (int) (samplerate2 * getFramesize() / 1000); - nbSamplesMax = nbSamplesMax*4; if (upsampleFactor != 1 && dataIn != NULL) { SRC_DATA src_data; @@ -136,10 +134,8 @@ int SamplerateConverter::downsampleData (SFLDataFormat* dataIn , SFLDataFormat* { double downsampleFactor = (double) samplerate1 / samplerate2; - //_debug("factor = %f" , downsampleFactor); - int nbSamplesMax = (int) (samplerate1 * getFramesize() / 1000); - nbSamplesMax = nbSamplesMax*4; + int nbSamplesMax = (int) (samplerate1 * getFramesize() / 1000); if (downsampleFactor != 1) { SRC_DATA src_data; diff --git a/sflphone-common/src/audio/sound/Makefile.am b/sflphone-common/src/audio/sound/Makefile.am index 37d7ddc61eb82225f25c86da9c270da8da0dc208..10e9960b7a14c29d2c66d7fb1447f2e18e2bdc1f 100644 --- a/sflphone-common/src/audio/sound/Makefile.am +++ b/sflphone-common/src/audio/sound/Makefile.am @@ -5,14 +5,12 @@ noinst_LTLIBRARIES = libsound.la libsound_la_SOURCES = \ audiofile.cpp \ tone.cpp \ - tonegenerator.cpp \ tonelist.cpp \ dtmf.cpp \ dtmfgenerator.cpp noinst_HEADERS = \ audiofile.h \ - tonegenerator.h \ tone.h \ tonelist.h \ dtmfgenerator.h \ diff --git a/sflphone-common/src/audio/sound/tone.cpp b/sflphone-common/src/audio/sound/tone.cpp index d8849cbf3235ffe1db8b1c0b9daa64f41238b55e..7f60f1ecca749103c8e42fe94f92231f9675677d 100644 --- a/sflphone-common/src/audio/sound/tone.cpp +++ b/sflphone-common/src/audio/sound/tone.cpp @@ -28,8 +28,12 @@ #include <cstdlib> #include <strings.h> -Tone::Tone (const std::string& definition, unsigned int sampleRate) : AudioLoop(), _sampleRate (sampleRate) +#define TABLE_LENGTH 4096 +double TWOPI = 2 * M_PI; + +Tone::Tone (const std::string& definition, unsigned int sampleRate) : AudioLoop(), _sampleRate (sampleRate), _xhigher(0.0), _xlower(0.0) { + fillWavetable(); genBuffer (definition); // allocate memory with definition parameter } @@ -101,6 +105,7 @@ Tone::genBuffer (const std::string& definition) } // Generate SAMPLING_RATE samples of sinus, buffer is the result + _debug("genSin(%d, %d)", freq1, freq2); genSin (bufferPos, freq1, freq2, count); // To concatenate the different buffers for each section. @@ -124,20 +129,70 @@ Tone::genBuffer (const std::string& definition) bufferPos=0; } +void +Tone::fillWavetable() +{ + double tableSize = (double)TABLE_LENGTH; + + for(int i = 0; i < TABLE_LENGTH; i++) { + _wavetable[i] = sin( ((double)i / (tableSize - 1.0)) * TWOPI ); + } +} + +double +Tone::interpolate(double x) +{ + int xi_0, xi_1; + double yi_0, yi_1, A, B; + + xi_0 = (int)x; + xi_1 = xi_0+1; + + yi_0 =_wavetable[xi_0]; + yi_1 = _wavetable[xi_1]; + + A = (x - xi_0); + B = 1.0 - A; + + return A*yi_0 + B*yi_1; +} + void Tone::genSin (SFLDataFormat* buffer, int frequency1, int frequency2, int nb) { + _xhigher = 0.0; + _xlower = 0.0; - double pi2 = 6.28318520; - double var1 = pi2 * (double) frequency1 / (double) _sampleRate; - double var2 = pi2 * (double) frequency2 / (double) _sampleRate; + double sr = (double)_sampleRate; + double tableSize = (double)TABLE_LENGTH; - // softer - double amp = (double) SFLDataAmplitude; + double N_h = sr / (double) (frequency1); + double N_l = sr / (double) (frequency2); - for (int t = 0; t < nb; t++) { - buffer[t] = (SFLDataFormat) (amp * ( (sin (var1 * t) + sin (var2 * t)))); - } + double dx_h = tableSize / N_h; + double dx_l = tableSize / N_l; + + double x_h = _xhigher; + double x_l = _xlower; + + double amp = (double)SFLDataAmplitude; + + for (int t = 0; t < nb; t ++) { + buffer[t] = (int16)(amp*(interpolate(x_h) + interpolate(x_l))); + x_h += dx_h; + x_l += dx_l; + + if(x_h > tableSize) { + x_h -= tableSize; + } + + if(x_l > tableSize) { + x_l -= tableSize; + } + } + + _xhigher = x_h; + _xlower = x_l; } diff --git a/sflphone-common/src/audio/sound/tone.h b/sflphone-common/src/audio/sound/tone.h index a725059dcf20a6d5ca509ffa8d0bc07c4187de28..94be60a0b8ecbe4a9b23465dfeec310231d2eedc 100644 --- a/sflphone-common/src/audio/sound/tone.h +++ b/sflphone-common/src/audio/sound/tone.h @@ -28,6 +28,8 @@ #define TONE_NBTONE 4 #define TONE_NBCOUNTRY 7 +#define TABLE_LENGTH 4096 + /** * @file tone.h * @brief Tone sample (dial, busy, ring, congestion) @@ -65,6 +67,17 @@ public: */ void genSin(SFLDataFormat* buffer, int frequency1, int frequency2, int nb); + /** + * + */ + void fillWavetable(void); + + /** + * + */ + double interpolate(double x); + + private: /** @@ -75,6 +88,11 @@ private: /** Sample rate */ unsigned int _sampleRate; + + double _wavetable[TABLE_LENGTH]; + + double _xhigher; + double _xlower; }; #endif // __TONE_H__ diff --git a/sflphone-common/src/audio/sound/tonegenerator.cpp b/sflphone-common/src/audio/sound/tonegenerator.cpp deleted file mode 100644 index dcdbb6be078724e8792321fb8cebfb829476c016..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/sound/tonegenerator.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (C) 2004-2005 Savoir-Faire Linux inc. - * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <fstream> -#include <math.h> -#include <stdlib.h> - -#include "tonegenerator.h" -#include "global.h" - -int AMPLITUDE = 32767; - -/////////////////////////////////////////////////////////////////////////////// -// ToneGenerator implementation -/////////////////////////////////////////////////////////////////////////////// - -ToneGenerator::ToneGenerator (unsigned int sampleRate) : sample (NULL), freq1(), freq2(), time(), totalbytes(), _sampleRate (sampleRate) -{ -} - -ToneGenerator::~ToneGenerator (void) -{ -} - -/** - * Calculate superposition of 2 sinus - * - */ -void -ToneGenerator::generateSin (int lowerfreq, int higherfreq, int16* ptr, int len) const -{ - double var1, var2; - - var1 = (double) 2 * (double) M_PI * (double) higherfreq / (double) _sampleRate; - var2 = (double) 2 * (double) M_PI * (double) lowerfreq / (double) _sampleRate; - - double amp = (double) (AMPLITUDE >> 2); - - for (int t = 0; t < len; t++) { - ptr[t] = (int16) (amp * ( (sin (var1 * t) + sin (var2 * t)))); - } -} - diff --git a/sflphone-common/src/audio/sound/tonegenerator.h b/sflphone-common/src/audio/sound/tonegenerator.h deleted file mode 100644 index ce1ad56e618ebce339448607027f7b694e686ba1..0000000000000000000000000000000000000000 --- a/sflphone-common/src/audio/sound/tonegenerator.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2004-2006 Savoir-Faire Linux inc. - * Author: Yan Morin <yan.morin@savoirfairelinux.com> - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __TONE_GENERATOR_H__ -#define __TONE_GENERATOR_H__ - -#include <string> -#include <cc++/thread.h> - -#include "global.h" - -/** - * @file tonegenerator.h - * @brief Sine generator to create tone with string definition - */ - -class ToneGenerator { - public: - /** - * Constructor - * @param sampleRate The sample rate of the generated samples - */ - ToneGenerator (unsigned int sampleRate); - - /** - * Destructor - */ - ~ToneGenerator (void); - - /** - * Calculate sinus with superposition of 2 frequencies - * @param lowerfreq Lower frequency - * @param higherfreq Higher frequency - * @param ptr For result buffer - * @param len The length of the data to be generated - */ - void generateSin (int, int, int16 *, int len) const; - - - /////////////////////////// - // Public members variable - ////////////////////////// - int16 *sample; - int freq1, freq2; - int time; - int totalbytes; - - private: - // Copy Constructor - ToneGenerator(const ToneGenerator& rh); - - // Assignment Operator - ToneGenerator& operator=( const ToneGenerator& rh); - - /* - * Initialisation of the supported tones according to the countries. - */ - void initTone (void); - - int16 _buf[SIZEBUF]; - int _sampleRate; -}; - -#endif // __TONE_GENRATOR_H__ diff --git a/sflphone-common/src/dbus/callmanager-introspec.xml b/sflphone-common/src/dbus/callmanager-introspec.xml index 77d48b130c62b371cba633573e4453c1a0100736..534bde252d506dcda4b622b0667c7b86005d8510 100644 --- a/sflphone-common/src/dbus/callmanager-introspec.xml +++ b/sflphone-common/src/dbus/callmanager-introspec.xml @@ -1,259 +1,699 @@ -<?xml version="1.0" ?> -<node name="/org/sflphone/SFLphone"> - <interface name="org.sflphone.SFLphone.CallManager"> - - <method name="placeCall"> - <arg type="s" name="accountID" direction="in"/> - <arg type="s" name="callID" direction="in"/> - <arg type="s" name="to" direction="in"/> - </method> - - <method name="refuse"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="accept"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="hangUp"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="hangUpConference"> - <arg type="s" name="confID" direction="in"/> - </method> - - <method name="hold"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="unhold"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="transfert"> - <arg type="s" name="callID" direction="in"/> - <arg type="s" name="to" direction="in"/> - </method> - - <method name="playDTMF"> - <arg type="s" name="key" direction="in"/> - </method> - - <method name="startTone"> - <arg type="i" name="start" direction="in"/> - <arg type="i" name="type" direction="in"/> - </method> - - <method name="setVolume"> - <arg type="s" name="device" direction="in"/> - <arg type="d" name="value" direction="in"/> - </method> - - <method name="getVolume"> - <arg type="s" name="device" direction="in"/> - <arg type="d" name="value" direction="out"/> - </method> - - <method name="joinParticipant"> - <arg type="s" name="sel_callID" direction="in"/> - <arg type="s" name="drag_callID" direction="in"/> - </method> - - <method name="addParticipant"> - <arg type="s" name="callID" direction="in"/> - <arg type="s" name="confID" direction="in"/> - </method> - - <method name="addMainParticipant"> - <arg type="s" name="confID" direction="in"/> - </method> - - <method name="detachParticipant"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="joinConference"> - <arg type="s" name="sel_confID" direction="in"/> - <arg type="s" name="drag_confID" direction="in"/> - </method> - - <method name="getConferenceDetails"> - <arg type="s" name="callID" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="infos" direction="out"/> - </method> - - <method name="getConferenceList"> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="setRecording"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="getIsRecording"> - <arg type="s" name="callID" direction="in"/> - <arg type="b" name="isRecording" direction="out"/> - </method> - - <method name="getCallDetails"> - <arg type="s" name="callID" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="infos" direction="out"/> - </method> - - <method name="getCallList"> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getCurrentCallID"> - <arg type="s" name="callID" direction="out"/> - </method> - - <method name="getCurrentCodecName"> - <arg type="s" name="callID" direction="in"/> - <arg type="s" name="codecName" direction="out"/> - </method> - - <signal name="currentSelectedCodec"> - <arg type="s" name="callID" direction="out" /> - <arg type="s" name="codecName" direction="out"/> - </signal> - - <signal name="incomingCall"> - <arg type="s" name="accountID" /> - <arg type="s" name="callID" /> - <arg type="s" name="from" /> - </signal> - - <signal name="incomingMessage"> - <arg type="s" name="accountID" direction="out" /> - <arg type="s" name="message" direction="out"/> - </signal> - - <signal name="callStateChanged"> - <arg type="s" name="callID" direction="out"/> - <arg type="s" name="state" direction="out"/> - </signal> - - <signal name="conferenceChanged"> - <arg type="s" name="confID" direction="out"/> - <arg type="s" name="state" direction="out"/> - </signal> - - <method name="getParticipantList"> - <arg type="s" name="confID" direction="in"/> - <arg type="as" name="list" direction="out"/> - </method> - - <signal name="conferenceCreated"> - <arg type="s" name="confID" direction="out"/> - </signal> - - <signal name="conferenceRemoved"> - <arg type="s" name="confID" direction="out"/> - </signal> - - <method name="holdConference"> - <arg type="s" name="confID" direction="in"/> - </method> - - <method name="unholdConference"> - <arg type="s" name="confID" direction="in"/> - </method> - - <signal name="sipCallStateChanged"> - <arg type="s" name="callID" direction="out"/> - <arg type="s" name="state" direction="out"/> - <arg type="i" name="code" direction="out"/> - </signal> - - <signal name="registrationStateChanged"> - <arg type="s" name="accountID" direction="out"/> - <arg type="s" name="state" direction="out"/> - <arg type="i" name="code" direction="out"/> - </signal> - - <signal name="voiceMailNotify"> - <arg type="s" name="accountID" direction="out"/> - <arg type="i" name="count" direction="out"/> - </signal> - - <signal name="volumeChanged"> - <arg type="s" name="device" direction="out"/> - <arg type="d" name="value" direction="out"/> - </signal> - - <signal name="transferSucceded"> - </signal> - - <signal name="transferFailed"> - </signal> - - <!-- ZRTP Methods and Signals --> - <signal name="secureOn"> - <arg type="s" name="callID" direction="out" /> - <arg type="s" name="cipher" direction="out" /> - </signal> - - <signal name="secureOff"> - <arg type="s" name="callID" direction="out" /> - </signal> - - <signal name="confirmGoClear"> - <arg type="s" name="callID" direction="out" /> - </signal> - - <signal name="zrtpNegotiationFailed"> - <arg type="s" name="callID" direction="out" /> - <arg type="s" name="reason" direction="out" /> - <arg type="s" name="severity" direction="out" /> - </signal> - - <signal name="zrtpNotSuppOther"> - <arg type="s" name="callID" direction="out" /> - </signal> - - <signal name="showSAS"> - <arg type="s" name="callID" direction="out" /> - <arg type="s" name="sas" direction="out" /> - <arg type="b" name="verified" direction="out" /> - </signal> - - <method name="setSASVerified"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="resetSASVerified"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="setConfirmGoClear"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="requestGoClear"> - <arg type="s" name="callID" direction="in"/> - </method> - - <method name="acceptEnrollment"> - <arg type="s" name="callID" direction="in"/> - <arg type="b" name="accepted" direction="in"/> - </method> - - <method name="setPBXEnrollment"> - <arg type="s" name="callID" direction="in"/> - <arg type="b" name="yesNo" direction="in"/> - </method> -<!-- - <signal name="error"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="details" direction="out"/> - </signal> ---> - - </interface> +<?xml version="1.0" encoding="UTF-8" ?> + +<node name="/callmanager-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <interface name="org.sflphone.SFLphone.CallManager"> + + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p>The CallManager interface is used to manage any call related actions.</p> + <p>Since SFLphone-daemon support multiple incoming/outgoing calls, any actions involving a specific call must address the method by the means of a unique callID. SFLphone-clients is responsible to generate the callID on outgoing call. On the other hand, SFLphone-daemon will generate a unique callID on incoming calls.</p> + </tp:docstring> + <method name="placeCall" tp:name-for-bindings="placeCall"> + <tp:docstring> + <p>This is the main method in order to place a new call. The call is registered to the daemon using this method.</p> + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + The ID of the account you want to make a call with. If the call is to be placed whithout any account by the means of a SIP URI (i.e. sip:num@server), the "IP2IP_PROFILE" is passed as the accountID. For more details about accounts see the configuration manager interface. + </tp:docstring> + </arg> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID is a unique identifier that must be randomly generated on the client's side. Any subsequent actions refering to this call must use this callID. + </tp:docstring> + </arg> + <arg type="s" name="to" direction="in"> + <tp:docstring> + If bound to a VoIP account, then the argument is the phone number. In case of calls involving "IP2IP_PROFILE", a complete SIP URI must be specified. + </tp:docstring> + </arg> + </method> + + <method name="placeCallFirstAccount" tp:name-for-bindings="placeCallFirstAccount"> + <tp:added version="0.9.8"/> + <tp:docstring> + Place a call with the fist registered account, regarding to the account list order. + <tp:rationale> + Use this function when you don't have any information about the accounts used (Ex: Firefly mozilla extension) + </tp:rationale> + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID is a unique identifier that must be randomly generated on the client's side. Any subsequent actions refering to this call must use this callID. + </tp:docstring> + </arg> + <arg type="s" name="to" direction="in"> + <tp:docstring> + If bound to a VoIP account, then the argument is the phone number. In case of calls involving "IP2IP_PROFILE", a complete SIP URI must be specified. + </tp:docstring> + </arg> + </method> + + <method name="refuse" tp:name-for-bindings="refuse"> + <tp:docstring> + Refuse an incoming call. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID. + </tp:docstring> + </arg> + + </method> + + <method name="accept" tp:name-for-bindings="accept"> + <tp:docstring> + Answer an incoming call. Automatically put the current call on state HOLD. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID. + </tp:docstring> + </arg> + </method> + + <method name="hangUp" tp:name-for-bindings="hangUp"> + <tp:docstring> + Hangup a call in state "CURRENT" or "HOLD". + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID. + </tp:docstring> + </arg> + </method> + + <method name="hangUpConference" tp:name-for-bindings="hangUpConference"> + <tp:added version="0.9.7"/> + <tp:docstring> + Hangup a conference, and every call participating to the conference. + </tp:docstring> + <arg type="s" name="confID" direction="in"> + <tp:docstring> + The unique conference ID. + </tp:docstring> + </arg> + </method> + + <method name="hold" tp:name-for-bindings="hold"> + <tp:docstring> + Place a call on hold. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID. + </tp:docstring> + </arg> + </method> + + <method name="unhold" tp:name-for-bindings="unhold"> + <tp:docstring> + Hold off a call, and place this call on state CURRENT. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID. + </tp:docstring> + </arg> + </method> + + <method name="transfert" tp:name-for-bindings="transfert"> + <tp:docstring> + Transfer a call to given phone number. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The callID. + </tp:docstring> + </arg> + <arg type="s" name="to" direction="in"> + <tp:docstring> + The phone number to transfer the call to. + </tp:docstring> + </arg> + </method> + + <method name="playDTMF" tp:name-for-bindings="playDTMF"> + <tp:docstring> + Dual-Tone multi-frequency. Tell the core to play dial tones. A SIP INFO message is sent to notify the server. + </tp:docstring> + <arg type="s" name="key" direction="in"> + <tp:docstring> + Unicode charter for pressed key + </tp:docstring> + </arg> + </method> + + <method name="startTone" tp:name-for-bindings="startTone"> + <tp:docstring> + Start audio stream and play tone.. + </tp:docstring> + <arg type="i" name="start" direction="in"/> + <arg type="i" name="type" direction="in"/> + </method> + + <method name="setVolume" tp:name-for-bindings="setVolume"> + <tp:docstring> + <p>Sets the volume using a linear scale [0,100].</p> + <tp:rationale>Pulseaudio has its own mechanism to modify application volume. This method is enabled only if the ALSA API is used.</tp:rationale> + </tp:docstring> + <arg type="s" name="device" direction="in"> + <tp:docstring> + The device: mic or speaker + </tp:docstring> + </arg> + <arg type="d" name="value" direction="in"> + <tp:docstring> + The volume value (between 0 and 100) + </tp:docstring> + </arg> + </method> + + <method name="getVolume" tp:name-for-bindings="getVolume"> + <tp:docstring> + <p>Return the volume value of the given device on a linear scale [0,100].</p> + <tp:rationale>Only enabled if the ALSA API is used, Pulseaudio has its own mechanism to modify application volume.</tp:rationale> + </tp:docstring> + <arg type="s" name="device" direction="in"> + <tp:docstring> + The device: mic or speaker + </tp:docstring> + </arg> + <arg type="d" name="value" direction="out"> + <tp:docstring> + The volume value (between 0 and 100) + </tp:docstring> + </arg> + </method> + + <method name="joinParticipant" tp:name-for-bindings="joinParticipant"> + <tp:added version="0.9.7"/> + <tp:docstring> + <p>Join two participants together to create a 3-way conference including the current client.</p> + <tp:rationale>The signal <tp:member-ref>conferenceCreated</tp:member-ref> is emitted on success.</tp:rationale> + </tp:docstring> + <arg type="s" name="sel_callID" direction="in"/> + <arg type="s" name="drag_callID" direction="in"/> + </method> + + <method name="addParticipant" tp:name-for-bindings="addParticipant"> + <tp:added version="0.9.7"/> + <tp:docstring> + <p>Join a new particiant to an existing conference.</p> + <tp:rationale>The signal <tp:member-ref>conferenceChanged</tp:member-ref> is emitted on success.</tp:rationale> + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The ID of the call to add to the conference + </tp:docstring> + </arg> + <arg type="s" name="confID" direction="in"> + <tp:docstring> + An existing conference ID + </tp:docstring> + </arg> + </method> + + <method name="addMainParticipant" tp:name-for-bindings="addMainParticipant"> + <tp:added version="0.9.7"/> + <tp:docstring> + <p>As the core can handle multiple calls an conferences, it may happens that the client's user leave a conference to answer an incoming call or send new ones. This method is used to reintroduce SFLphone-client's user into the conference.</p> + <p>It put the current call on state HOLD or detach SFLphone-client's user from the another conference.</p> + </tp:docstring> + <arg type="s" name="confID" direction="in"> + <tp:docstring> + An existing conference ID + </tp:docstring> + </arg> + </method> + + <method name="detachParticipant" tp:name-for-bindings="detachParticipant"> + <tp:added version="0.9.7"/> + <tp:docstring> + Detach the given call from the conference. If only one participant is left, the conference is deleted and the signal <tp:member-ref>conferenceRemoved</tp:member-ref> is emited. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The call ID + </tp:docstring> + </arg> + </method> + + <method name="joinConference" tp:name-for-bindings="joinConference"> + <tp:added version="0.9.7"/> + <tp:docstring> + Join two conferences together. + </tp:docstring> + <arg type="s" name="sel_confID" direction="in"/> + <arg type="s" name="drag_confID" direction="in"/> + </method> + + <method name="getConferenceDetails" tp:name-for-bindings="getConferenceDetails"> + <tp:added version="0.9.7"/> + <tp:docstring> + Returns a hashtable containing conference details. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The call ID + </tp:docstring> + </arg> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="infos" direction="out"> + <tp:docstring> + A map containing the ID of the conferences and their states. + </tp:docstring> + </arg> + </method> + + <method name="getConferenceList" tp:name-for-bindings="getConferenceList"> + <tp:added version="0.9.7"/> + <tp:docstring> + Returns a list containing all active conferences. + </tp:docstring> + <arg type="as" name="list" direction="out"> + <tp:docstring> + The list of conferences. + </tp:docstring> + </arg> + </method> + + <method name="setRecording" tp:name-for-bindings="setRecording"> + <tp:docstring> + Start recording a call. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The ID of the call to record. + </tp:docstring> + </arg> + </method> + + <method name="getIsRecording" tp:name-for-bindings="getIsRecording"> + <tp:docstring> + Tells whether or not a call is being recorded. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The call ID. + </tp:docstring> + </arg> + <arg type="b" name="isRecording" direction="out"> + <tp:docstring> + Returns true is the call is being recorded. False otherwise. + </tp:docstring> + </arg> + </method> + + <method name="getCallDetails" tp:name-for-bindings="getCallDetails"> + <tp:docstring> + Get all the details about a specific call. + </tp:docstring> + <arg type="s" name="callID" direction="in"> + <tp:docstring> + The call ID. + </tp:docstring> + </arg> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="infos" direction="out" tp:type="String_String_Map"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p>A map containing the call details: </p> + <ul> + <li>ACCOUNTID</li> + <li>PEER_NUMBER</li> + <li>PEER_NAME</li> + <li>DISPLAY_NAME</li> + <li>CALL_STATE</li> + <li>CALL_TYPE</li> + </ul> + </tp:docstring> + </arg> + </method> + + <method name="getCallList" tp:name-for-bindings="getCallList"> + <tp:docstring> + Get the list of active calls. + <tp:rationale>To get the call details, iterate on the return value and call <tp:member-ref>getCallDetails</tp:member-ref> method.</tp:rationale> + </tp:docstring> + <arg type="as" name="list" direction="out"> + <tp:docstring> + A list of call IDs. + </tp:docstring> + </arg> + </method> + + <method name="getCurrentCallID" tp:name-for-bindings="getCurrentCallID"> + <tp:docstring> + Get the CURRENT call ID. + </tp:docstring> + @param[out] output callID + <arg type="s" name="callID" direction="out"> + <tp:docstring> + The current call ID. + </tp:docstring> + </arg> + </method> + + <method name="getCurrentCodecName" tp:name-for-bindings="getCurrentCodecName"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + <arg type="s" name="codecName" direction="out"/> + </method> + + <signal name="currentSelectedCodec" tp:name-for-bindings="currentSelectedCodec"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + <arg type="s" name="codecName"/> + </signal> + + <signal name="incomingCall" tp:name-for-bindings="incomingCall"> + <tp:docstring> + <p>Notify an incoming call.</p> + <p>The callID generated by the daemon and must be stored by the clients in order to address other action for + this call.</p> + <tp:rationale>The client must subscribe to this signal to handle incoming calls.</tp:rationale> + </tp:docstring> + <arg type="s" name="accountID"> + <tp:docstring> + The account ID of the callee. Clients must notify the right account when receiving this signal. + </tp:docstring> + </arg> + <arg type="s" name="callID"> + <tp:docstring> + A new call ID. + </tp:docstring> + </arg> + <arg type="s" name="from"> + <tp:docstring> + The caller phone number. + </tp:docstring> + </arg> + </signal> + + <signal name="incomingMessage" tp:name-for-bindings="incomingMessage"> + <tp:docstring> + Unused + </tp:docstring> + <arg type="s" name="accountID" /> + <arg type="s" name="message" /> + </signal> + + <signal name="callStateChanged" tp:name-for-bindings="callStateChanged"> + <tp:docstring> + <p>Notify of a change in a call state.</p> + <p>The client must subscribe to this signal.</p> + </tp:docstring> + <arg type="s" name="callID"> + <tp:docstring> + The call ID. + </tp:docstring> + </arg> + <arg type="s" name="state" > + <tp:docstring> + The acceptable states are: + <ul> + <li>INCOMING: Initial state of incoming calls</li> + <li>RINGING: Initial state of received outgoing call</li> + <li>CURRENT: The normal active state of an answered call</li> + <li>HUNGUP: Notify that the call has been hungup by peer</li> + <li>BUSY</li> + <li>FAILURE: Error when processing a call</li> + <li>HOLD</li> + <li>UNHOLD_CURRENT</li> + <li>UNHOLD_RECORD</li> + </ul> + </tp:docstring> + </arg> + </signal> + + <signal name="conferenceChanged" tp:name-for-bindings="conferenceChanged"> + <tp:added version="0.9.7"/> + <tp:docstring> + Notify of a change in the conferences state + </tp:docstring> + <arg type="s" name="confID"> + <tp:docstring> + The conference ID. + </tp:docstring> + </arg> + <arg type="s" name="state"> + <tp:docstring> + The acceptable states are: + <ul> + <li>ACTIVE_ATTACHED</li> + <li>ACTIVE_DETACHED</li> + <li>HOLD</li> + </ul> + </tp:docstring> + </arg> + </signal> + + <method name="getParticipantList" tp:name-for-bindings="getParticipantList"> + <tp:added version="0.9.7"/> + <tp:docstring> + Get the call IDs of every participant to a given conference. The client should keep and update the list of participant. + </tp:docstring> + <arg type="s" name="confID" direction="in"> + <tp:docstring> + The conference ID. + </tp:docstring> + </arg> + <arg type="as" name="list" direction="out"> + <tp:docstring> + The list of the call IDs. + </tp:docstring> + </arg> + </method> + + <signal name="conferenceCreated" tp:name-for-bindings="conferenceCreated"> + <tp:added version="0.9.7"/> + <tp:docstring> + Emited when a new conference is created. SFLphone-client is reponsible to store the confID and call <tp:member-ref>getParticipantList</tp:member-ref> to update the display. + </tp:docstring> + <arg type="s" name="confID"> + <tp:docstring> + A new conference ID. + </tp:docstring> + </arg> + </signal> + + <signal name="conferenceRemoved" tp:name-for-bindings="conferenceRemoved"> + <tp:added version="0.9.7"/> + <tp:docstring> + Emited when a new conference is remove. SFLphone-client should have kept a list of current participant in order to display modification. + </tp:docstring> + <arg type="s" name="confID"> + <tp:docstring> + The conference ID. + </tp:docstring> + </arg> + </signal> + + <method name="holdConference" tp:name-for-bindings="holdConference"> + <tp:added version="0.9.7"/> + <tp:docstring> + Hold on every calls participating to this conference. + </tp:docstring> + <arg type="s" name="confID" direction="in"> + <tp:docstring> + The conference ID. + </tp:docstring> + </arg> + </method> + + <method name="unholdConference" tp:name-for-bindings="unholdConference"> + <tp:added version="0.9.7"/> + <tp:docstring> + Hold off every calls participating to this conference. + </tp:docstring> + <arg type="s" name="confID" direction="in"> + <tp:docstring> + The conference ID. + </tp:docstring> + </arg> + </method> + + <signal name="sipCallStateChanged" tp:name-for-bindings="sipCallStateChanged"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + <arg type="s" name="state" /> + <arg type="i" name="code" /> + </signal> + + <signal name="registrationStateChanged" tp:name-for-bindings="registrationStateChanged"> + <tp:docstring> + <p>The state of an account has changed.</p> + <p>The clients have to subscribe to this signal to use accounts.</p> + </tp:docstring> + <arg type="s" name="accountID" > + <tp:docstring> + The account ID + </tp:docstring> + </arg> + <arg type="s" name="state"> + <tp:docstring> + The new registration state + </tp:docstring> + </arg> + <arg type="i" name="code"> + <tp:docstring> + The SIP or IAX2 code + </tp:docstring> + </arg> + </signal> + + <signal name="voiceMailNotify" tp:name-for-bindings="voiceMailNotify"> + <tp:docstring> + Notify the clients of the voicemail number for a specific account, if applicable. + </tp:docstring> + <arg type="s" name="accountID"> + <tp:docstring> + The account ID. + </tp:docstring> + </arg> + <arg type="i" name="count"> + <tp:docstring> + The number of waiting messages. + </tp:docstring> + </arg> + </signal> + + <signal name="volumeChanged" tp:name-for-bindings="volumeChanged"> + <tp:docstring> + Notify the clients of a volume level change. + </tp:docstring> + <arg type="s" name="device"> + <tp:docstring> + The device: mic or speaker + </tp:docstring> + </arg> + <arg type="d" name="value"> + <tp:docstring> + The new volume value + </tp:docstring> + </arg> + </signal> + + <signal name="transferSucceded" tp:name-for-bindings="transferSucceded"> + <tp:docstring> + The transfer has been successfully processed. + </tp:docstring> + </signal> + + <signal name="transferFailed" tp:name-for-bindings="transferFailed"> + <tp:docstring> + The transfer operation has failed. + </tp:docstring> + </signal> + + <signal name="secureSdesOn" tp:name-for-bindings="secureSdesOn"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID"/> + </signal> + + <signal name="secureSdesOff" tp:name-for-bindings="secureSdesOff"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + </signal> + + <!-- ZRTP Methods and Signals --> + <signal name="secureZrtpOn" tp:name-for-bindings="secureZrtpOn"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + <arg type="s" name="cipher" /> + </signal> + + <signal name="secureZrtpOff" tp:name-for-bindings="secureZrtpOff"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + </signal> + + <signal name="confirmGoClear" tp:name-for-bindings="confirmGoClear"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + </signal> + + <signal name="zrtpNegotiationFailed" tp:name-for-bindings="zrtpNegotiationFailed"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + <arg type="s" name="reason" /> + <arg type="s" name="severity" /> + </signal> + + <signal name="zrtpNotSuppOther" tp:name-for-bindings="zrtpNotSuppOther"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + </signal> + + <signal name="showSAS" tp:name-for-bindings="showSAS"> + <tp:added version="0.9.7"/> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" /> + <arg type="s" name="sas" /> + <arg type="b" name="verified"/> + </signal> + + <method name="setSASVerified" tp:name-for-bindings="setSASVerified"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="resetSASVerified" tp:name-for-bindings="resetSASVerified"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="setConfirmGoClear" tp:name-for-bindings="setConfirmGoClear"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="requestGoClear" tp:name-for-bindings="requestGoClear"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + </method> + + <method name="acceptEnrollment" tp:name-for-bindings="acceptEnrollment"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + <arg type="b" name="accepted" direction="in"/> + </method> + + <method name="setPBXEnrollment" tp:name-for-bindings="setPBXEnrollment"> + <tp:added version="0.9.7"/> + <tp:docstring> + </tp:docstring> + <arg type="s" name="callID" direction="in"/> + <arg type="b" name="yesNo" direction="in"/> + </method> + + </interface> </node> diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index 3c3306fda8106fe19caf2479ce509c0346e3591c..36b5aa87a958aacb1c29046f11dfb860fe278f6e 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -18,6 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <vector> + #include "global.h" #include "callmanager.h" @@ -38,25 +40,51 @@ void CallManager::placeCall (const std::string& accountID, const std::string& callID, const std::string& to) -{ - _debug ("CallManager::placeCall received"); - // Check if a destination number is available +{ // Check if a destination number is available if (to == "") _debug ("No number entered - Call stopped"); else Manager::instance().outgoingCall (accountID, callID, to); } +void +CallManager::placeCallFirstAccount (const std::string& callID, + const std::string& to) +{ + + if (to == "") { + _warn("No number entered - Call stopped"); + return; + } + + std::vector< std::string > accountOrder = Manager::instance().loadAccountOrder(); + std::vector< std::string >::iterator iter = accountOrder.begin(); + + Account *account; + while(iter != accountOrder.end()) { + account = Manager::instance().getAccount(*iter); + if((*iter != IP2IP_PROFILE) && account->isEnabled()) { + Manager::instance().outgoingCall (*iter, callID, to); + return; + } + + iter++; + } + + _warn("No enabled account found - Call stopped\n"); + +} + void CallManager::refuse (const std::string& callID) { - _debug ("CallManager::refuse received"); + _debug ("CallManager: refuse received"); Manager::instance().refuseCall (callID); } void CallManager::accept (const std::string& callID) { - _debug ("CallManager::accept received"); + _debug ("CallManager: accept received"); Manager::instance().answerCall (callID); } @@ -104,7 +132,6 @@ CallManager::transfert (const std::string& callID, const std::string& to) void CallManager::setVolume (const std::string& device, const double& value) { - _debug ("CallManager::setVolume received"); if (device == "speaker") { Manager::instance().setSpkrVolume ( (int) (value*100.0)); @@ -118,7 +145,6 @@ CallManager::setVolume (const std::string& device, const double& value) double CallManager::getVolume (const std::string& device) { - _debug ("CallManager::getVolume received "); if (device == "speaker") { _debug ("Current speaker = %d", Manager::instance().getSpkrVolume()); @@ -183,14 +209,12 @@ CallManager::unholdConference (const std::string& confID) std::map< std::string, std::string > CallManager::getConferenceDetails (const std::string& callID) { - _debug ("CallManager::getCallDetails received"); return Manager::instance().getConferenceDetails (callID); } std::vector< std::string > CallManager::getConferenceList (void) { - _debug ("CallManager::getConferenceList"); return Manager::instance().getConferenceList(); } @@ -203,14 +227,12 @@ CallManager::getParticipantList (const std::string& confID) void CallManager::setRecording (const std::string& callID) { - _debug ("CallManager::setRecording received"); Manager::instance().setRecordingCall (callID); } bool CallManager::getIsRecording (const std::string& callID) { - _debug ("CallManager::getIsRecording received "); return Manager::instance().isRecording (callID); } @@ -218,7 +240,6 @@ CallManager::getIsRecording (const std::string& callID) std::string CallManager::getCurrentCodecName (const std::string& callID) { - _debug ("CallManager::getCurrentCodecName received %s ",Manager::instance().getCurrentCodecName (callID).c_str()); return Manager::instance().getCurrentCodecName (callID).c_str(); } @@ -226,7 +247,6 @@ CallManager::getCurrentCodecName (const std::string& callID) std::map< std::string, std::string > CallManager::getCallDetails (const std::string& callID) { - _debug ("CallManager::getCallDetails received"); return Manager::instance().getCallDetails (callID); } @@ -239,7 +259,6 @@ CallManager::getCallList (void) std::string CallManager::getCurrentCallID() { - _debug ("CallManager::getCurrentCallID received"); return Manager::instance().getCurrentCallId(); } @@ -300,7 +319,6 @@ sfl::AudioZrtpSession * CallManager::getAudioZrtpSession (const std::string& cal void CallManager::setSASVerified (const std::string& callID) { - _debug ("CallManager::setSASVerified received for account %s", callID.c_str()); try { sfl::AudioZrtpSession * zSession; @@ -315,7 +333,6 @@ CallManager::setSASVerified (const std::string& callID) void CallManager::resetSASVerified (const std::string& callID) { - _debug ("CallManager::resetSASVerified received for account %s", callID.c_str()); try { sfl::AudioZrtpSession * zSession; diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h index 8c3bab14c0646a373bf83442f2a8035b17ef68e1..c49f9c9c284fdbd33ce19ff253b19bffb106ddc4 100644 --- a/sflphone-common/src/dbus/callmanager.h +++ b/sflphone-common/src/dbus/callmanager.h @@ -53,6 +53,8 @@ class CallManager /* Call related methods */ void placeCall( const std::string& accountID, const std::string& callID, const std::string& to ); + void placeCallFirstAccount( const std::string& callID, const std::string& to ); + void refuse( const std::string& callID ); void accept( const std::string& callID ); void hangUp( const std::string& callID ); diff --git a/sflphone-common/src/dbus/configurationmanager-introspec.xml b/sflphone-common/src/dbus/configurationmanager-introspec.xml index c45ff4c873df6e93614b4bb6d464258d9b82c3f1..17391ee69ca0971684a4d7ef3658cbd7d9388bcf 100644 --- a/sflphone-common/src/dbus/configurationmanager-introspec.xml +++ b/sflphone-common/src/dbus/configurationmanager-introspec.xml @@ -1,385 +1,1012 @@ <?xml version="1.0" ?> -<node name="/org/sflphone/SFLphone"> - <interface name="org.sflphone.SFLphone.ConfigurationManager"> - - <!-- Accounts-related methods --> - <method name="getAccountDetails"> - <arg type="s" name="accountID" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="details" direction="out"/> - </method> - - <method name="setAccountDetails"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> - <arg type="s" name="accountID" direction="in"/> - <arg type="a{ss}" name="details" direction="in"/> - </method> - - <method name="setCredential"> - <arg type="s" name="accountID" direction="in"/> - <arg type="i" name="index" direction="in"/> - <arg type="a{ss}" name="credentialInformation" direction="in"/> - </method> - - <method name="setNumberOfCredential"> - <arg type="s" name="accountID" direction="in"/> - <arg type="i" name="number" direction="in"/> - </method> - - <method name="deleteAllCredential"> - <arg type="s" name="accountID" direction="in"/> - </method> - - <method name="getIp2IpDetails"> - <arg type="a{ss}" name="details" direction="out"/> - </method> - - <method name="setIp2IpDetails"> - <arg type="a{ss}" name="details" direction="in"/> - </method> - - <method name="getCredential"> - <arg type="s" name="accountID" direction="in"/> - <arg type="i" name="index" direction="in"/> - <arg type="a{ss}" name="credentialInformation" direction="out"/> - </method> - - <method name="getNumberOfCredential"> - <arg type="s" name="accountID" direction="in"/> - <arg type="i" name="numberOfCredential" direction="out"/> - </method> - - <method name="addAccount"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> - <arg type="a{ss}" name="details" direction="in"/> - <arg type="s" name="createdAccountId" direction="out"/> - </method> - - <method name="setAccountsOrder"> - <arg type="s" name="order" direction="in"/> - </method> - - <method name="removeAccount"> - <arg type="s" name="accoundID" direction="in"/> - </method> - - <method name="getAccountList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="sendRegister"> - <arg type="s" name="accountID" direction="in"/> - <arg type="i" name="expire" direction="in"/> - </method> - - <!-- /////////////////////// --> - - <!-- Various audio-related methods --> - - <method name="getToneLocaleList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getVersion"> - <arg type="s" name="version" direction="out"/> - </method> - - <method name="getRingtoneList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getPlaybackDeviceList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getRecordDeviceList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="isRingtoneEnabled"> - <arg type="i" name="bool" direction="out"/> - </method> - - <method name="ringtoneEnabled"> - </method> - - <method name="getRingtoneChoice"> - <arg type="s" name="tone" direction="out"/> - </method> - - <method name="setRingtoneChoice"> - <arg type="s" name="tone" direction="in"/> - </method> - - <method name="getAudioManager"> - <arg type="i" name="api" direction="out"/> - </method> - - <method name="setAudioManager"> - <arg type="i" name="api" direction="in"/> - </method> - - <method name="getRecordPath"> - <arg type="s" name="rec" direction="out"/> - </method> - - <method name="setRecordPath"> - <arg type="s" name="rec" direction="in"/> - </method> - - <!-- /////////////////////// --> - - <!-- Codecs-related methods --> - - <method name="getCodecList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getCodecDetails"> - <arg type="i" name="payload" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="details" direction="out"/> - </method> - - <method name="getActiveCodecList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="setActiveCodecList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> - <arg type="as" name="list" direction="in"/> - </method> - - - <!-- Audio devices methods --> - - <method name="getInputAudioPluginList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getOutputAudioPluginList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="setInputAudioPlugin"> - <arg type="s" name="audioPlugin" direction="in"/> - </method> - - <method name="setOutputAudioPlugin"> - <arg type="s" name="audioPlugin" direction="in"/> - </method> - - <method name="getAudioOutputDeviceList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="setAudioOutputDevice"> - <arg type="i" name="index" direction="in"/> - </method> - - <method name="getAudioInputDeviceList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="setAudioInputDevice"> - <arg type="i" name="index" direction="in"/> - </method> - - <method name="getCurrentAudioDevicesIndex"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getAudioDeviceIndex"> - <arg type="s" name="name" direction="in"/> - <arg type="i" name="index" direction="out"/> - </method> - - <method name="getCurrentAudioOutputPlugin"> - <arg type="s" name="plugin" direction="out"/> - </method> - - <!-- General Settings Panel --> - - <method name="isMd5CredentialHashing"> - <arg type="b" name="res" direction="out"/> - </method> - - <method name="setMd5CredentialHashing"> - <arg type="b" name="enabled" direction="in"/> - </method> - - <method name="isIax2Enabled"> - <arg type="i" name="res" direction="out"/> - </method> - - <method name="setNotify"> - </method> - - <method name="getNotify"> - <arg type="i" name="level" direction="out"/> - </method> - - <method name="setMailNotify"> - </method> - - <method name="getMailNotify"> - <arg type="i" name="level" direction="out"/> - </method> - - <method name="getDialpad"> - <arg type="i" name="state" direction="out"/> - </method> - - <method name="setDialpad"> - <arg type="b" name="display" direction="in"/> - </method> - - <method name="getSearchbar"> - <arg type="i" name="state" direction="out"/> - </method> - - <method name="setSearchbar"> - </method> - - <method name="setHistoryEnabled"> - </method> - - <method name="getHistoryEnabled"> - <arg type="s" name="state" direction="out"/> - </method> - - <method name="getVolumeControls"> - <arg type="i" name="state" direction="out"/> - </method> - - <method name="setVolumeControls"> - <arg type="b" name="display" direction="in"/> - </method> - - <method name="getHistoryLimit"> - <arg type="i" name="days" direction="out"/> - </method> - - <method name="setHistoryLimit"> - <arg type="i" name="days" direction="in"/> - </method> - - <method name="startHidden"> - </method> - - <method name="isStartHidden"> - <arg type="i" name="state" direction="out"/> - </method> - - <method name="popupMode"> - <arg type="i" name="state" direction="out"/> - </method> - - <method name="switchPopupMode"> - </method> - - - <!-- Addressbook configuration --> - <method name="getAddressbookSettings"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> - <arg type="a{si}" name="settings" direction="out"/> - </method> - - <method name="setAddressbookSettings"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringInt"/> - <arg type="a{si}" name="settings" direction="in"/> - </method> - - <!-- Addressbook list --> - <method name="getAddressbookList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="settings" direction="out"/> - </method> - - <method name="setAddressbookList"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> - <arg type="as" name="settings" direction="in"/> - </method> - - <!-- Hook configuration --> - <method name="getHookSettings"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="settings" direction="out"/> - </method> - - <method name="setHookSettings"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> - <arg type="a{ss}" name="settings" direction="in"/> - </method> - - <method name="getHistory"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="entries" direction="out"/> - </method> - - <method name="setHistory"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> - <arg type="a{ss}" name="entries" direction="in"/> - </method> - - <signal name="accountsChanged"> - </signal> - - <signal name="audioManagerChanged"> - </signal> - - <signal name="errorAlert"> - <arg type="i" name="code" direction="out"/> - </signal> - - <!-- TLS Methods --> - <method name="getSupportedTlsMethod"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getTlsSettingsDefault"> - <arg type="a{ss}" name="details" direction="out"/> - </method> - - <method name="getTlsSettings"> - <arg type="s" name="accountID" direction="in"/> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> - <arg type="a{ss}" name="details" direction="out"/> - </method> - - <method name="setTlsSettings"> - <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> - <arg type="s" name="accountID" direction="in"/> - <arg type="a{ss}" name="details" direction="in"/> - </method> - - <method name="getAddrFromInterfaceName"> - <arg type="s" name="interface" direction="in"/> - <arg type="s" name="address" direction="out"/> - </method> - - <method name="getAllIpInterface"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - <method name="getAllIpInterfaceByName"> - <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> - <arg type="as" name="list" direction="out"/> - </method> - - </interface> -</node> +<node name="/configurationmanager-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <interface name="org.sflphone.SFLphone.ConfigurationManager"> + + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + Used to handle the configuration stuff: accounts settings, account registration, user preferences, ... + </tp:docstring> + + <method name="getAccountDetails" tp:name-for-bindings="getAccountDetails"> + <tp:docstring> + Get all parameters of the specified account. + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + The account ID + </tp:docstring> + </arg> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out" tp:type="String_String_Map"> + <tp:docstring> + The available keys / parameters are: + <ul> + <li>CONFIG_ACCOUNT_ENABLE: True or False (Default: True)</li> + <li>CONFIG_ACCOUNT_RESOLVE_ONCE</li> + <li>CONFIG_ACCOUNT_TYPE: SIP or IAX2 (Default: SIP)</li> + <li>HOSTNAME: The IP adress or hostname of the registrar</li> + <li>USERNAME: The username (or extension) of the account</li> + <li>PASSWORD: The password associated to the account</li> + <li>REALM</li> + <li>AUTHENTICATION_USERNAME</li> + <li>CONFIG_ACCOUNT_MAILBOX: Number to dial to access the voicemail box</li> + <li>CONFIG_ACCOUNT_REGISTRATION_EXPIRE: SIP header expiration value (Default: 1600)</li> + <li>LOCAL_INTERFACE: The network interface (Default: eth0)</li> + <li>PUBLISHED_SAMEAS_LOCAL: If False, the published address equals the local address. This is the default.</li> + <li>PUBLISHED_ADDRESS: The SIP published address</li> + <li>LOCAL_PORT: The SIP listening port (Default: 5060)</li> + <li>PUBLISHED_PORT: The SIP published port</li> + <li>DISPLAY_NAMEL: The display name</li> + <li>STUN_ENABLE: True or False (Default: False)</li> + <li>STUN_SERVER: The STUN server address</li> + <li>REGISTRATION_STATUS: The account registration status. Should be Registered to make calls.</li> + <li>REGISTRATION_STATE_CODE</li> + <li>REGISTRATION_STATE_DESCRIPTION</li> + <li>SRTP_KEY_EXCHANGE</li> + <li>SRTP_ENABLE: Whether or not voice communication are encrypted - True or False (Default: False)</li> + <li>SRTP_RTP_FALLBACK</li> + <li>ZRTP_DISPLAY_SAS</li> + <li>ZRTP_DISPLAY_SAS_ONCE</li> + <li>ZRTP_HELLO_HASH</li> + <li>ZRTP_NOT_SUPP_WARNING</li> + <li>TLS_LISTENER_PORT: TLS listening port (Default: 5061)</li> + <li>TLS_ENABLE: Whether or not signalling is encrypted - True or False (Default: False)</li> + <li>TLS_CA_LIST_FILE</li> + <li>TLS_CERTIFICATE_FILE</li> + <li>TLS_PRIVATE_KEY_FILE</li> + <li>TLS_METHOD</li> + <li>TLS_CIPHERS</li> + <li>TLS_SERVER_NAME</li> + <li>TLS_VERIFY_SERVER</li> + <li>TLS_VERIFY_CLIENT</li> + <li>TLS_REQUIRE_CLIENT_CERTIFICATE</li> + <li>TLS_NEGOTIATION_TIMEOUT_SEC</li> + <li>TLS_NEGOTIATION_TIMEOUT_MSEC</li> + </ul> + </tp:docstring> + </arg> + </method> + + <method name="setAccountDetails" tp:name-for-bindings="setAccountDetails"> + <tp:docstring> + Send new account parameters, or account parameters changes, to the core. The hash table is not required to be complete, only the updated parameters may be specified. + <tp:rationale>Account settings are written to the configuration file when sflphone properly quits.</tp:rationale> + <tp:rationale>After calling this method, the core will emit the signal <tp:member-ref>accountsChanged</tp:member-ref> with the updated data. The client must subscribe to this signal and use it to update its internal data structure.</tp:rationale> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="a{ss}" name="details" direction="in" tp:type="String_String_Map"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setCredential" tp:name-for-bindings="setCredential"> + <tp:docstring> + </tp:docstring> + + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="i" name="index" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="a{ss}" name="credentialInformation" direction="in" tp:type="String_String_Map"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setNumberOfCredential" tp:name-for-bindings="setNumberOfCredential"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="i" name="number" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="deleteAllCredential" tp:name-for-bindings="deleteAllCredential"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getIp2IpDetails" tp:name-for-bindings="getIp2IpDetails"> + <tp:docstring> + Get configuration settings of the IP2IP_PROFILE. They are sligthly different from account settings since no VoIP accounts are involved. + </tp:docstring> + <arg type="a{ss}" name="details" direction="out" tp:type="String_String_Map"> + <tp:docstring> + Available parameters are: + <ul> + <li>ACCOUNT_ID</li> + <li>SRTP_KEY_EXCHANGE</li> + <li>SRTP_ENABLE</li> + <li>SRTP_RTP_FALLBACK</li> + <li>ZRTP_DISPLAY_SAS</li> + <li>ZRTP_HELLO_HASH</li> + <li>ZRTP_NOT_SUPP_WARNING</li> + <li>ZRTP_DISPLAY_SAS_ONCE</li> + <li>LOCAL_INTERFACE</li> + <li>LOCAL_PORT</li> + <li>TLS_LISTENER_PORT</li> + <li>TLS_CA_LIST_FILE</li> + <li>TLS_CERTIFICATE_FILE</li> + <li>TLS_PRIVATE_KEY_FILE</li> + <li>TLS_PASSWORD</li> + <li>TLS_METHOD</li> + <li>TLS_CIPHERS</li> + <li>TLS_SERVER_NAME</li> + <li>TLS_VERIFY_SERVER</li> + <li>TLS_VERIFY_CLIENT</li> + <li>TLS_REQUIRE_CLIENT_CERTIFICATE</li> + <li>TLS_NEGOTIATION_TIMEOUT_SEC</li> + <li>TLS_NEGOTIATION_TIMEOUT_MSEC</li> + </ul> + </tp:docstring> + </arg> + </method> + + <method name="setIp2IpDetails" tp:name-for-bindings="setIp2IpDetails"> + <tp:docstring> + Same as <tp:member-ref>getAccountDetails</tp:member-ref>, but for the IP-to-IP profile. + </tp:docstring> + <arg type="a{ss}" name="details" direction="in" tp:type="String_String_Map"> + <tp:docstring> + The map of parameters. See <tp:member-ref>getIp2IpDetails</tp:member-ref> for complete reference. + </tp:docstring> + </arg> + </method> + + <method name="getCredential" tp:name-for-bindings="getCredential"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="i" name="index" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="a{ss}" name="credentialInformation" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getNumberOfCredential" tp:name-for-bindings="getNumberOfCredential"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="i" name="numberOfCredential" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="addAccount" tp:name-for-bindings="addAccount"> + <tp:docstring> + Add a new account. When created, the signal <tp:member-ref>accountsChanged</tp:member-ref> is emitted. The clients must then call <tp:member-ref>getAccountList</tp:member-ref> to update their internal data structure. + <tp:rationale>If no details are specified, the default parameters are used.</tp:rationale> + <tp:rationale>The core tries to register the account as soon it is created.</tp:rationale> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="in" tp:type="String_String_Map"> + <tp:docstring> + The new account settings + </tp:docstring> + </arg> + <arg type="s" name="createdAccountId" direction="out"> + <tp:docstring> + A new account ID + </tp:docstring> + </arg> + </method> + + <method name="setAccountsOrder" tp:name-for-bindings="setAccountsOrder"> + <tp:docstring> + Update the accounts order. + <tp:rationale>When placing a call, the first registered account in the list is used.</tp:rationale> + </tp:docstring> + <arg type="s" name="order" direction="in"> + <tp:docstring> + An ordered list of account IDs, delimited by '/' + </tp:docstring> + </arg> + </method> + + <method name="removeAccount" tp:name-for-bindings="removeAccount"> + <tp:docstring> + Remove an existing account. When removed, the signal <tp:member-ref>accountsChanged</tp:member-ref> is emitted. The clients must then call <tp:member-ref>getAccountList</tp:member-ref> to update their internal data structure. + </tp:docstring> + <arg type="s" name="accoundID" direction="in"> + <tp:docstring> + The account to remove, identified by its ID + </tp:docstring> + </arg> + </method> + + <method name="getAccountList" tp:name-for-bindings="getAccountList"> + <tp:docstring> + Get a list of all created accounts, as stored by the core. + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + A list of account IDs + </tp:docstring> + </arg> + </method> + + <method name="sendRegister" tp:name-for-bindings="sendRegister"> + <tp:docstring> + Send account registration (REGISTER) to the registrar. + </tp:docstring> + the account if expire=1, unregister if expire=0. + + @param[in] input accountID + --> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + The account ID + </tp:docstring> + </arg> + <arg type="i" name="expire" direction="in"> + <tp:docstring> + <p>To register, expire must be 1.</p> + <p>To un-register, expire must be 0.</p> + </tp:docstring> + </arg> + </method> + + <method name="getToneLocaleList" tp:name-for-bindings="getToneLocaleList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getVersion" tp:name-for-bindings="getVersion"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="version" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getRingtoneList" tp:name-for-bindings="getRingtoneList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getPlaybackDeviceList" tp:name-for-bindings="getPlaybackDeviceList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getRecordDeviceList" tp:name-for-bindings="getRecordDeviceList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="isRingtoneEnabled" tp:name-for-bindings="isRingtoneEnabled"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="bool" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="ringtoneEnabled" tp:name-for-bindings="ringtoneEnabled"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="getRingtoneChoice" tp:name-for-bindings="getRingtoneChoice"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="tone" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setRingtoneChoice" tp:name-for-bindings="setRingtoneChoice"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="tone" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAudioManager" tp:name-for-bindings="getAudioManager"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="api" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setAudioManager" tp:name-for-bindings="setAudioManager"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="api" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getRecordPath" tp:name-for-bindings="getRecordPath"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="rec" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setRecordPath" tp:name-for-bindings="setRecordPath"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="rec" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <!-- /////////////////////// --> + + <!-- Codecs-related methods --> + + <method name="getCodecList" tp:name-for-bindings="getCodecList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getCodecDetails" tp:name-for-bindings="getCodecDetails"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="payload" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="details" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getActiveCodecList" tp:name-for-bindings="getActiveCodecList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setActiveCodecList" tp:name-for-bindings="setActiveCodecList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> + <arg type="as" name="list" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + + <!-- Audio devices methods --> + + <method name="getInputAudioPluginList" tp:name-for-bindings="getInputAudioPluginList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getOutputAudioPluginList" tp:name-for-bindings="getOutputAudioPluginList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setInputAudioPlugin" tp:name-for-bindings="setInputAudioPlugin"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="audioPlugin" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setOutputAudioPlugin" tp:name-for-bindings="setOutputAudioPlugin"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="audioPlugin" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAudioOutputDeviceList" tp:name-for-bindings="getAudioOutputDeviceList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setAudioOutputDevice" tp:name-for-bindings="setAudioOutputDevice"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="index" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAudioInputDeviceList" tp:name-for-bindings="getAudioInputDeviceList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setAudioInputDevice" tp:name-for-bindings="setAudioInputDevice"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="index" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getCurrentAudioDevicesIndex" tp:name-for-bindings="getCurrentAudioDevicesIndex"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAudioDeviceIndex" tp:name-for-bindings="getAudioDeviceIndex"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="name" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="i" name="index" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getCurrentAudioOutputPlugin" tp:name-for-bindings="getCurrentAudioOutputPlugin"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="plugin" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <!-- General Settings Panel --> + + <method name="isMd5CredentialHashing" tp:name-for-bindings="isMd5CredentialHashing"> + <tp:docstring> + </tp:docstring> + <arg type="b" name="res" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setMd5CredentialHashing" tp:name-for-bindings="setMd5CredentialHashing"> + <tp:docstring> + </tp:docstring> + <arg type="b" name="enabled" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="isIax2Enabled" tp:name-for-bindings="isIax2Enabled"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="res" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setNotify" tp:name-for-bindings="setNotify"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="getNotify" tp:name-for-bindings="getNotify"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="level" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setMailNotify" tp:name-for-bindings="setMailNotify"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="getMailNotify" tp:name-for-bindings="getMailNotify"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="level" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getDialpad" tp:name-for-bindings="getDialpad"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="state" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setDialpad" tp:name-for-bindings="setDialpad"> + <tp:docstring> + </tp:docstring> + <arg type="b" name="display" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getSearchbar" tp:name-for-bindings="getSearchbar"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="state" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setSearchbar" tp:name-for-bindings="setSearchbar"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="setHistoryEnabled" tp:name-for-bindings="setHistoryEnabled"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="getHistoryEnabled" tp:name-for-bindings="getHistoryEnabled"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="state" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getVolumeControls" tp:name-for-bindings="getVolumeControls"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="state" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setVolumeControls" tp:name-for-bindings="setVolumeControls"> + <tp:docstring> + </tp:docstring> + <arg type="b" name="display" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getHistoryLimit" tp:name-for-bindings="getHistoryLimit"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="days" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setHistoryLimit" tp:name-for-bindings="setHistoryLimit"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="days" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="startHidden" tp:name-for-bindings="startHidden"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="isStartHidden" tp:name-for-bindings="isStartHidden"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="state" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="popupMode" tp:name-for-bindings="popupMode"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="state" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="switchPopupMode" tp:name-for-bindings="switchPopupMode"> + <tp:docstring> + </tp:docstring> + </method> + + <method name="getWindowWidth" tp:name-for-bindings="getWindowWidth"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="width" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getWindowHeight" tp:name-for-bindings="getWindowHeight"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="height" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setWindowWidth" tp:name-for-bindings="setWindowWidth"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="width" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setWindowHeight" tp:name-for-bindings="setWindowHeight"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="height" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getWindowPositionX" tp:name-for-bindings="getWindowPositionX"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="posX" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setWindowPositionX" tp:name-for-bindings="setWindowPositionX"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="posX" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getWindowPositionY" tp:name-for-bindings="getWindowPositionY"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="posY" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setWindowPositionY" tp:name-for-bindings="setWindowPositionY"> + <tp:docstring> + </tp:docstring> + <arg type="i" name="posY" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="enableStatusIcon" tp:name-for-bindings="enableStatusIcon"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="value" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="isStatusIconEnabled" tp:name-for-bindings="isStatusIconEnabled"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="value" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + + <!-- Addressbook configuration --> + <method name="getAddressbookSettings" tp:name-for-bindings="getAddressbookSettings"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> + <arg type="a{si}" name="settings" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setAddressbookSettings" tp:name-for-bindings="setAddressbookSettings"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringInt"/> + <arg type="a{si}" name="settings" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <!-- Addressbook list --> + <method name="getAddressbookList" tp:name-for-bindings="getAddressbookList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="settings" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setAddressbookList" tp:name-for-bindings="setAddressbookList"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="VectorString"/> + <arg type="as" name="settings" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <!-- Hook configuration --> + <method name="getHookSettings" tp:name-for-bindings="getHookSettings"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="settings" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setHookSettings" tp:name-for-bindings="setHookSettings"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="settings" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getHistory" tp:name-for-bindings="getHistory"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setHistory" tp:name-for-bindings="setHistory"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="entries" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <signal name="accountsChanged" tp:name-for-bindings="accountsChanged"> + </signal> + + <signal name="errorAlert" tp:name-for-bindings="errorAlert"> + <arg type="i" name="code"> + <tp:docstring> + </tp:docstring> + </arg> + </signal> + + <!-- TLS Methods --> + <method name="getSupportedTlsMethod" tp:name-for-bindings="getSupportedTlsMethod"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getTlsSettingsDefault" tp:name-for-bindings="getTlsSettingsDefault"> + <tp:docstring> + </tp:docstring> + <arg type="a{ss}" name="details" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getTlsSettings" tp:name-for-bindings="getTlsSettings"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="details" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setTlsSettings" tp:name-for-bindings="setTlsSettings"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> + <arg type="s" name="accountID" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="a{ss}" name="details" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAddrFromInterfaceName" tp:name-for-bindings="getAddrFromInterfaceName"> + <tp:docstring> + </tp:docstring> + <arg type="s" name="interface" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + <arg type="s" name="address" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAllIpInterface" tp:name-for-bindings="getAllIpInterface"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getAllIpInterfaceByName" tp:name-for-bindings="getAllIpInterfaceByName"> + <tp:docstring> + </tp:docstring> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="VectorString"/> + <arg type="as" name="list" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="getShortcuts" tp:name-for-bindings="getShortcuts"> + <tp:docstring> + </tp:docstring> + <arg type="a{si}" name="shortcutsMap" direction="out"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + + <method name="setShortcuts" tp:name-for-bindings="setShortcuts"> + <tp:docstring> + </tp:docstring> + <arg type="a{si}" name="shortcutsMap" direction="in"> + <tp:docstring> + </tp:docstring> + </arg> + </method> + </interface> + </node> diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp index 82f7b6dda2262969406a1ea1dd7b532f919842a1..b243157e772af3b07b793a7a13138b17dc846f51 100644 --- a/sflphone-common/src/dbus/configurationmanager.cpp +++ b/sflphone-common/src/dbus/configurationmanager.cpp @@ -25,780 +25,828 @@ #include "../manager.h" #include "sip/sipvoiplink.h" -const char* ConfigurationManager::SERVER_PATH = "/org/sflphone/SFLphone/ConfigurationManager"; +const char* ConfigurationManager::SERVER_PATH = + "/org/sflphone/SFLphone/ConfigurationManager"; + +ConfigurationManager::ConfigurationManager(DBus::Connection& connection) : + DBus::ObjectAdaptor(connection, SERVER_PATH) { + shortcutsKeys.push_back("pick_up"); + shortcutsKeys.push_back("hang_up"); + shortcutsKeys.push_back("popup_window"); + shortcutsKeys.push_back("toggle_pick_up_hang_up"); + shortcutsKeys.push_back("toggle_hold"); +} + +std::map<std::string, std::string> ConfigurationManager::getAccountDetails( + const std::string& accountID) { + return Manager::instance().getAccountDetails(accountID); +} + +std::map<std::string, std::string> ConfigurationManager::getTlsSettingsDefault( + void) { + + std::map<std::string, std::string> tlsSettingsDefault; + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_LISTENER_PORT, DEFAULT_SIP_TLS_PORT)); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_CA_LIST_FILE, "")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_CERTIFICATE_FILE, "")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_PRIVATE_KEY_FILE, "")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>(TLS_PASSWORD, + "")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>(TLS_METHOD, + "TLSv1")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>(TLS_CIPHERS, + "")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_SERVER_NAME, "")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_VERIFY_SERVER, "true")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_VERIFY_CLIENT, "true")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_REQUIRE_CLIENT_CERTIFICATE, "true")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_NEGOTIATION_TIMEOUT_SEC, "2")); + tlsSettingsDefault.insert(std::pair<std::string, std::string>( + TLS_NEGOTIATION_TIMEOUT_MSEC, "0")); + + return tlsSettingsDefault; +} + +std::map<std::string, std::string> ConfigurationManager::getIp2IpDetails(void) { + + std::map<std::string, std::string> ip2ipAccountDetails; + + ip2ipAccountDetails.insert(std::pair<std::string, std::string>(ACCOUNT_ID, + IP2IP_PROFILE)); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + SRTP_KEY_EXCHANGE, Manager::instance().getConfigString( + IP2IP_PROFILE, SRTP_KEY_EXCHANGE))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>(SRTP_ENABLE, + Manager::instance().getConfigString(IP2IP_PROFILE, SRTP_ENABLE))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + SRTP_RTP_FALLBACK, Manager::instance().getConfigString( + IP2IP_PROFILE, SRTP_RTP_FALLBACK))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + ZRTP_DISPLAY_SAS, Manager::instance().getConfigString( + IP2IP_PROFILE, ZRTP_DISPLAY_SAS))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + ZRTP_HELLO_HASH, Manager::instance().getConfigString(IP2IP_PROFILE, + ZRTP_HELLO_HASH))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + ZRTP_NOT_SUPP_WARNING, Manager::instance().getConfigString( + IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + ZRTP_DISPLAY_SAS_ONCE, Manager::instance().getConfigString( + IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE))); + + ip2ipAccountDetails.insert(std::pair<std::string, std::string>( + LOCAL_INTERFACE, Manager::instance().getConfigString(IP2IP_PROFILE, + LOCAL_INTERFACE))); + ip2ipAccountDetails.insert(std::pair<std::string, std::string>(LOCAL_PORT, + Manager::instance().getConfigString(IP2IP_PROFILE, LOCAL_PORT))); + + std::map<std::string, std::string> tlsSettings; + tlsSettings = getTlsSettings(IP2IP_PROFILE); + std::copy(tlsSettings.begin(), tlsSettings.end(), std::inserter( + ip2ipAccountDetails, ip2ipAccountDetails.end())); + + return ip2ipAccountDetails; + +} + +void ConfigurationManager::setIp2IpDetails(const std::map<std::string, + std::string>& details) { + std::map<std::string, std::string> map_cpy = details; + std::map<std::string, std::string>::iterator it; + + it = map_cpy.find(LOCAL_INTERFACE); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, LOCAL_INTERFACE, + it->second); + } + + it = map_cpy.find(LOCAL_PORT); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, LOCAL_PORT, it->second); + } + + it = map_cpy.find(SRTP_ENABLE); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, SRTP_ENABLE, it->second); + } + + it = map_cpy.find(SRTP_RTP_FALLBACK); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, SRTP_RTP_FALLBACK, + it->second); + } + + it = map_cpy.find(SRTP_KEY_EXCHANGE); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, SRTP_KEY_EXCHANGE, + it->second); + } + + it = map_cpy.find(ZRTP_DISPLAY_SAS); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, ZRTP_DISPLAY_SAS, + it->second); + } + + it = map_cpy.find(ZRTP_NOT_SUPP_WARNING); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING, + it->second); + } + + it = map_cpy.find(ZRTP_HELLO_HASH); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, ZRTP_HELLO_HASH, + it->second); + } + + it = map_cpy.find(ZRTP_DISPLAY_SAS_ONCE); + + if (it != details.end()) { + Manager::instance().setConfig(IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE, + it->second); + } + + setTlsSettings(IP2IP_PROFILE, details); + + Manager::instance().saveConfig(); + + // Update account details to the client side + accountsChanged(); + // Reload account settings from config + Manager::instance().getAccount(IP2IP_PROFILE)->loadConfig(); - -ConfigurationManager::ConfigurationManager (DBus::Connection& connection) - : DBus::ObjectAdaptor (connection, SERVER_PATH) -{ } +std::map<std::string, std::string> ConfigurationManager::getTlsSettings( + const std::string& section) { + std::map<std::string, std::string> tlsSettings; -std::map< std::string, std::string > -ConfigurationManager::getAccountDetails (const std::string& accountID) -{ - _debug ("ConfigurationManager::getAccountDetails"); - return Manager::instance().getAccountDetails (accountID); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_LISTENER_PORT, + Manager::instance().getConfigString(section, TLS_LISTENER_PORT))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_ENABLE, + Manager::instance().getConfigString(section, TLS_ENABLE))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_CA_LIST_FILE, + Manager::instance().getConfigString(section, TLS_CA_LIST_FILE))); + tlsSettings.insert(std::pair<std::string, std::string>( + TLS_CERTIFICATE_FILE, Manager::instance().getConfigString(section, + TLS_CERTIFICATE_FILE))); + tlsSettings.insert(std::pair<std::string, std::string>( + TLS_PRIVATE_KEY_FILE, Manager::instance().getConfigString(section, + TLS_PRIVATE_KEY_FILE))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_PASSWORD, + Manager::instance().getConfigString(section, TLS_PASSWORD))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_METHOD, + Manager::instance().getConfigString(section, TLS_METHOD))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_CIPHERS, + Manager::instance().getConfigString(section, TLS_CIPHERS))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_SERVER_NAME, + Manager::instance().getConfigString(section, TLS_SERVER_NAME))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_VERIFY_SERVER, + Manager::instance().getConfigString(section, TLS_VERIFY_SERVER))); + tlsSettings.insert(std::pair<std::string, std::string>(TLS_VERIFY_CLIENT, + Manager::instance().getConfigString(section, TLS_VERIFY_CLIENT))); + tlsSettings.insert(std::pair<std::string, std::string>( + TLS_REQUIRE_CLIENT_CERTIFICATE, + Manager::instance().getConfigString(section, + TLS_REQUIRE_CLIENT_CERTIFICATE))); + tlsSettings.insert(std::pair<std::string, std::string>( + TLS_NEGOTIATION_TIMEOUT_SEC, Manager::instance().getConfigString( + section, TLS_NEGOTIATION_TIMEOUT_SEC))); + tlsSettings.insert(std::pair<std::string, std::string>( + TLS_NEGOTIATION_TIMEOUT_MSEC, Manager::instance().getConfigString( + section, TLS_NEGOTIATION_TIMEOUT_MSEC))); + return tlsSettings; } -std::map< std::string, std::string > -ConfigurationManager::getTlsSettingsDefault (void) -{ - _debug ("ConfigurationManager::getTlsDefaultSettings"); +void ConfigurationManager::setTlsSettings(const std::string& section, + const std::map<std::string, std::string>& details) { + std::map<std::string, std::string> map_cpy = details; + std::map<std::string, std::string>::iterator it; - std::map<std::string, std::string> tlsSettingsDefault; - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_CA_LIST_FILE, "")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_CERTIFICATE_FILE, "")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_PRIVATE_KEY_FILE, "")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_PASSWORD, "")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_METHOD, "TLSv1")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_CIPHERS, "")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_SERVER_NAME, "")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_VERIFY_SERVER, "true")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_VERIFY_CLIENT, "true")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_REQUIRE_CLIENT_CERTIFICATE, "true")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_NEGOTIATION_TIMEOUT_SEC, "2")); - tlsSettingsDefault.insert (std::pair<std::string, std::string> (TLS_NEGOTIATION_TIMEOUT_MSEC, "0")); + it = map_cpy.find(TLS_LISTENER_PORT); + if (it != details.end()) { + Manager::instance().setConfig(section, TLS_LISTENER_PORT, it->second); + } - return tlsSettingsDefault; -} + it = map_cpy.find(TLS_ENABLE); -std::map< std::string, std::string > -ConfigurationManager::getIp2IpDetails (void) -{ + if (it != details.end()) { + Manager::instance().setConfig(section, TLS_ENABLE, it->second); + } - std::map<std::string, std::string> ip2ipAccountDetails; + it = map_cpy.find(TLS_CA_LIST_FILE); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (SRTP_KEY_EXCHANGE, Manager::instance().getConfigString (IP2IP_PROFILE, SRTP_KEY_EXCHANGE))); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (SRTP_ENABLE, Manager::instance().getConfigString (IP2IP_PROFILE, SRTP_ENABLE))); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_DISPLAY_SAS))); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_HELLO_HASH, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_HELLO_HASH))); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_NOT_SUPP_WARNING, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING))); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS_ONCE, Manager::instance().getConfigString (IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE))); + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_CA_LIST_FILE, it->second); + } - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_INTERFACE, Manager::instance().getConfigString(IP2IP_PROFILE, LOCAL_INTERFACE))); - ip2ipAccountDetails.insert (std::pair<std::string, std::string> (LOCAL_PORT, Manager::instance().getConfigString (IP2IP_PROFILE, LOCAL_PORT))); + it = map_cpy.find(TLS_CERTIFICATE_FILE); - std::map<std::string, std::string> tlsSettings; - tlsSettings = getTlsSettings (IP2IP_PROFILE); - std::copy (tlsSettings.begin(), tlsSettings.end(), std::inserter (ip2ipAccountDetails, ip2ipAccountDetails.end())); + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_CERTIFICATE_FILE, it->second); + } - return ip2ipAccountDetails; + it = map_cpy.find(TLS_PRIVATE_KEY_FILE); -} + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_PRIVATE_KEY_FILE, it->second); + } + + it = map_cpy.find(TLS_PASSWORD); -void -ConfigurationManager::setIp2IpDetails (const std::map< std::string, std::string >& details) -{ - std::map<std::string, std::string> map_cpy = details; - std::map<std::string, std::string>::iterator it; + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_PASSWORD, it->second); + } - it = map_cpy.find (LOCAL_INTERFACE); + it = map_cpy.find(TLS_METHOD); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, LOCAL_INTERFACE, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_METHOD, it->second); + } - it = map_cpy.find (LOCAL_PORT); + it = map_cpy.find(TLS_CIPHERS); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, LOCAL_PORT, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_CIPHERS, it->second); + } - it = map_cpy.find (SRTP_ENABLE); + it = map_cpy.find(TLS_SERVER_NAME); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, SRTP_ENABLE, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_SERVER_NAME, it->second); + } - it = map_cpy.find (SRTP_KEY_EXCHANGE); + it = map_cpy.find(TLS_VERIFY_CLIENT); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, SRTP_KEY_EXCHANGE, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_VERIFY_CLIENT, it->second); + } - it = map_cpy.find (ZRTP_DISPLAY_SAS); + it = map_cpy.find(TLS_REQUIRE_CLIENT_CERTIFICATE); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, ZRTP_DISPLAY_SAS, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_REQUIRE_CLIENT_CERTIFICATE, + it->second); + } - it = map_cpy.find (ZRTP_NOT_SUPP_WARNING); + it = map_cpy.find(TLS_NEGOTIATION_TIMEOUT_SEC); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, ZRTP_NOT_SUPP_WARNING, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_NEGOTIATION_TIMEOUT_SEC, + it->second); + } - it = map_cpy.find (ZRTP_HELLO_HASH); + it = map_cpy.find(TLS_NEGOTIATION_TIMEOUT_MSEC); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, ZRTP_HELLO_HASH, it->second); - } + if (it != map_cpy.end()) { + Manager::instance().setConfig(section, TLS_NEGOTIATION_TIMEOUT_MSEC, + it->second); + } - it = map_cpy.find (ZRTP_DISPLAY_SAS_ONCE); + Manager::instance().saveConfig(); - if (it != details.end()) { - Manager::instance().setConfig (IP2IP_PROFILE, ZRTP_DISPLAY_SAS_ONCE, it->second); - } + // Update account details to the client side + accountsChanged(); - setTlsSettings (IP2IP_PROFILE, details); +} - Manager::instance().saveConfig(); +std::map<std::string, std::string> ConfigurationManager::getCredential( + const std::string& accountID, const int32_t& index) { - // Update account details to the client side - accountsChanged(); + std::string credentialIndex; + std::stringstream streamOut; + streamOut << index; + credentialIndex = streamOut.str(); -} + std::string section = std::string("Credential") + std::string(":") + + accountID + std::string(":") + credentialIndex; + + std::map<std::string, std::string> credentialInformation; + std::string username = Manager::instance().getConfigString(section, + USERNAME); + std::string password = Manager::instance().getConfigString(section, + PASSWORD); + std::string realm = Manager::instance().getConfigString(section, REALM); + + credentialInformation.insert(std::pair<std::string, std::string>(USERNAME, + username)); + credentialInformation.insert(std::pair<std::string, std::string>(PASSWORD, + password)); + credentialInformation.insert(std::pair<std::string, std::string>(REALM, + realm)); -std::map< std::string, std::string > -ConfigurationManager::getTlsSettings (const std::string& section) -{ - std::map<std::string, std::string> tlsSettings; - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_ENABLE, Manager::instance().getConfigString (section, TLS_ENABLE))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_CA_LIST_FILE, Manager::instance().getConfigString (section, TLS_CA_LIST_FILE))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_CERTIFICATE_FILE, Manager::instance().getConfigString (section, TLS_CERTIFICATE_FILE))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_PRIVATE_KEY_FILE, Manager::instance().getConfigString (section, TLS_PRIVATE_KEY_FILE))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_PASSWORD, Manager::instance().getConfigString (section, TLS_PASSWORD))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_METHOD, Manager::instance().getConfigString (section, TLS_METHOD))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_CIPHERS, Manager::instance().getConfigString (section, TLS_CIPHERS))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_SERVER_NAME, Manager::instance().getConfigString (section, TLS_SERVER_NAME))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_VERIFY_SERVER, Manager::instance().getConfigString (section, TLS_VERIFY_SERVER))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_VERIFY_CLIENT, Manager::instance().getConfigString (section, TLS_VERIFY_CLIENT))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_REQUIRE_CLIENT_CERTIFICATE, Manager::instance().getConfigString (section, TLS_REQUIRE_CLIENT_CERTIFICATE))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_NEGOTIATION_TIMEOUT_SEC, Manager::instance().getConfigString (section, TLS_NEGOTIATION_TIMEOUT_SEC))); - tlsSettings.insert (std::pair<std::string, std::string> - (TLS_NEGOTIATION_TIMEOUT_MSEC, Manager::instance().getConfigString (section, TLS_NEGOTIATION_TIMEOUT_MSEC))); - return tlsSettings; + return credentialInformation; } -void -ConfigurationManager::setTlsSettings (const std::string& section, const std::map< std::string, std::string >& details) -{ - std::map<std::string, std::string> map_cpy = details; - std::map<std::string, std::string>::iterator it; +int32_t ConfigurationManager::getNumberOfCredential( + const std::string& accountID) { + return Manager::instance().getConfigInt(accountID, CONFIG_CREDENTIAL_NUMBER); +} - it = map_cpy.find (TLS_ENABLE); +void ConfigurationManager::setNumberOfCredential(const std::string& accountID, + const int32_t& number) { + if (accountID != AccountNULL || !accountID.empty()) { + Manager::instance().setConfig(accountID, CONFIG_CREDENTIAL_NUMBER, + number); + } +} - if (it != details.end()) { - Manager::instance().setConfig (section, TLS_ENABLE, it->second); - } +void ConfigurationManager::setCredential(const std::string& accountID, + const int32_t& index, const std::map<std::string, std::string>& details) { + Manager::instance().setCredential(accountID, index, details); +} - it = map_cpy.find (TLS_CA_LIST_FILE); +void ConfigurationManager::deleteAllCredential(const std::string& accountID) { + Manager::instance().deleteAllCredential(accountID); +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_CA_LIST_FILE, it->second); - } +void ConfigurationManager::setAccountDetails(const std::string& accountID, + const std::map<std::string, std::string>& details) { + Manager::instance().setAccountDetails(accountID, details); +} - it = map_cpy.find (TLS_CERTIFICATE_FILE); +void ConfigurationManager::sendRegister(const std::string& accountID, + const int32_t& expire) { + Manager::instance().sendRegister(accountID, expire); +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_CERTIFICATE_FILE, it->second); - } +std::string ConfigurationManager::addAccount(const std::map<std::string, + std::string>& details) { + return Manager::instance().addAccount(details); +} - it = map_cpy.find (TLS_PRIVATE_KEY_FILE); +void ConfigurationManager::removeAccount(const std::string& accoundID) { + return Manager::instance().removeAccount(accoundID); +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_PRIVATE_KEY_FILE, it->second); - } +std::vector<std::string> ConfigurationManager::getAccountList() { + return Manager::instance().getAccountList(); +} - it = map_cpy.find (TLS_PASSWORD); +//TODO +std::vector<std::string> ConfigurationManager::getToneLocaleList() { + std::vector<std::string> ret; + return ret; +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_PASSWORD, it->second); - } +//TODO +std::string ConfigurationManager::getVersion() { + std::string ret(""); + return ret; +} - it = map_cpy.find (TLS_METHOD); +//TODO +std::vector<std::string> ConfigurationManager::getRingtoneList() { + std::vector<std::string> ret; + return ret; +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_METHOD, it->second); - } +/** + * Send the list of all codecs loaded to the client through DBus. + * Can stay global, as only the active codecs will be set per accounts + */ +std::vector<std::string> ConfigurationManager::getCodecList(void) { - it = map_cpy.find (TLS_CIPHERS); + std::vector<std::string> list; - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_CIPHERS, it->second); - } + CodecsMap codecs = + Manager::instance().getCodecDescriptorMap().getCodecsMap(); + CodecsMap::iterator iter = codecs.begin(); - it = map_cpy.find (TLS_SERVER_NAME); + while (iter != codecs.end()) { + std::stringstream ss; - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_SERVER_NAME, it->second); - } + if (iter->second != NULL) { + ss << iter->first; + list.push_back((ss.str()).data()); + } - it = map_cpy.find (TLS_VERIFY_CLIENT); + iter++; + } - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_VERIFY_CLIENT, it->second); - } + return list; +} - it = map_cpy.find (TLS_REQUIRE_CLIENT_CERTIFICATE); +std::vector<std::string> ConfigurationManager::getSupportedTlsMethod(void) { + std::vector<std::string> method; + method.push_back("Default"); + method.push_back("TLSv1"); + method.push_back("SSLv2"); + method.push_back("SSLv3"); + method.push_back("SSLv23"); + return method; +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_REQUIRE_CLIENT_CERTIFICATE, it->second); - } +std::vector<std::string> ConfigurationManager::getCodecDetails( + const int32_t& payload) { - it = map_cpy.find (TLS_NEGOTIATION_TIMEOUT_SEC); + return Manager::instance().getCodecDescriptorMap().getCodecSpecifications( + payload); +} - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_NEGOTIATION_TIMEOUT_SEC, it->second); - } +std::vector<std::string> ConfigurationManager::getActiveCodecList( + const std::string& accountID) { - it = map_cpy.find (TLS_NEGOTIATION_TIMEOUT_MSEC); + _debug("Send active codec list for account %s", accountID.c_str ()); - if (it != map_cpy.end()) { - Manager::instance().setConfig (section, TLS_NEGOTIATION_TIMEOUT_MSEC, it->second); - } + std::vector<std::string> v; + Account *acc; + CodecOrder active; + unsigned int i = 0; + size_t size; - Manager::instance().saveConfig(); + acc = Manager::instance().getAccount(accountID); + if (acc != NULL) { + active = acc->getActiveCodecs(); + size = active.size(); + while (i < size) { + std::stringstream ss; + ss << active[i]; + v.push_back((ss.str()).data()); + i++; + } + } - // Update account details to the client side - accountsChanged(); + return v; } -std::map< std::string, std::string > -ConfigurationManager::getCredential (const std::string& accountID, const int32_t& index) -{ - _debug ("ConfigurationManager::getCredential number %i for accountID %s", index, accountID.c_str()); +void ConfigurationManager::setActiveCodecList( + const std::vector<std::string>& list, const std::string& accountID) { + + _debug ("ConfigurationManager::setActiveCodecList received"); + + Account *acc; - std::string credentialIndex; - std::stringstream streamOut; - streamOut << index; - credentialIndex = streamOut.str(); + // Save the codecs list per account + acc = Manager::instance().getAccount(accountID); + if (acc != NULL) { + acc->setActiveCodecs(list); + } +} - std::string section = std::string ("Credential") + std::string (":") + accountID + std::string (":") + credentialIndex; +// Audio devices related methods +std::vector<std::string> ConfigurationManager::getInputAudioPluginList() { - std::map<std::string, std::string> credentialInformation; - std::string username = Manager::instance().getConfigString (section, USERNAME); - std::string password = Manager::instance().getConfigString (section, PASSWORD); - std::string realm = Manager::instance().getConfigString (section, REALM); + std::vector<std::string> v; - credentialInformation.insert (std::pair<std::string, std::string> (USERNAME, username)); - credentialInformation.insert (std::pair<std::string, std::string> (PASSWORD, password)); - credentialInformation.insert (std::pair<std::string, std::string> (REALM, realm)); + v.push_back("default"); + v.push_back("surround40"); + v.push_back("plug:hw"); - return credentialInformation; + return v; } -int32_t -ConfigurationManager::getNumberOfCredential (const std::string& accountID) -{ - _debug ("ConfigurationManager::getNumberOfCredential"); - return Manager::instance().getConfigInt (accountID, CONFIG_CREDENTIAL_NUMBER); -} +std::vector<std::string> ConfigurationManager::getOutputAudioPluginList() { -void -ConfigurationManager::setNumberOfCredential (const std::string& accountID, const int32_t& number) -{ - if (accountID != AccountNULL || !accountID.empty()) { - Manager::instance().setConfig (accountID, CONFIG_CREDENTIAL_NUMBER, number); - } -} + std::vector<std::string> v; -void -ConfigurationManager::setCredential (const std::string& accountID, const int32_t& index, - const std::map< std::string, std::string >& details) -{ - _debug ("ConfigurationManager::setCredential received"); - Manager::instance().setCredential (accountID, index, details); -} + v.push_back(PCM_DEFAULT); + v.push_back(PCM_DMIX); -void -ConfigurationManager::deleteAllCredential (const std::string& accountID) -{ - _debug ("ConfigurationManager::deleteAllCredential received"); - Manager::instance().deleteAllCredential (accountID); + return v; } -void -ConfigurationManager::setAccountDetails (const std::string& accountID, - const std::map< std::string, std::string >& details) -{ - _debug ("ConfigurationManager::setAccountDetails received"); - Manager::instance().setAccountDetails (accountID, details); +void ConfigurationManager::setInputAudioPlugin(const std::string& audioPlugin) { + return Manager::instance().setInputAudioPlugin(audioPlugin); } -void -ConfigurationManager::sendRegister (const std::string& accountID, const int32_t& expire) -{ - _debug ("ConfigurationManager::sendRegister received"); - Manager::instance().sendRegister (accountID, expire); +void ConfigurationManager::setOutputAudioPlugin(const std::string& audioPlugin) { + return Manager::instance().setOutputAudioPlugin(audioPlugin); } -std::string -ConfigurationManager::addAccount (const std::map< std::string, std::string >& details) -{ - _debug ("ConfigurationManager::addAccount received"); - return Manager::instance().addAccount (details); +std::vector<std::string> ConfigurationManager::getAudioOutputDeviceList() { + return Manager::instance().getAudioOutputDeviceList(); } +void ConfigurationManager::setAudioOutputDevice(const int32_t& index) { + return Manager::instance().setAudioOutputDevice(index); +} -void -ConfigurationManager::removeAccount (const std::string& accoundID) -{ - _debug ("ConfigurationManager::removeAccount received"); - return Manager::instance().removeAccount (accoundID); +std::vector<std::string> ConfigurationManager::getAudioInputDeviceList() { + return Manager::instance().getAudioInputDeviceList(); } -std::vector< std::string > -ConfigurationManager::getAccountList() -{ - _debug ("ConfigurationManager::getAccountList received"); - return Manager::instance().getAccountList(); +void ConfigurationManager::setAudioInputDevice(const int32_t& index) { + return Manager::instance().setAudioInputDevice(index); } -//TODO -std::vector< std::string > -ConfigurationManager::getToneLocaleList() -{ - std::vector< std::string > ret; - _debug ("ConfigurationManager::getToneLocaleList received"); - return ret; +std::vector<std::string> ConfigurationManager::getCurrentAudioDevicesIndex() { + return Manager::instance().getCurrentAudioDevicesIndex(); } -//TODO -std::string -ConfigurationManager::getVersion() -{ - std::string ret (""); - _debug ("ConfigurationManager::getVersion received"); - return ret; +int32_t ConfigurationManager::getAudioDeviceIndex(const std::string& name) { + return Manager::instance().getAudioDeviceIndex(name); } -//TODO -std::vector< std::string > -ConfigurationManager::getRingtoneList() -{ - std::vector< std::string > ret; - _debug ("ConfigurationManager::getRingtoneList received"); - return ret; +std::string ConfigurationManager::getCurrentAudioOutputPlugin(void) { + return Manager::instance().getCurrentAudioOutputPlugin(); } +std::vector<std::string> ConfigurationManager::getPlaybackDeviceList() { + std::vector<std::string> ret; + return ret; +} +std::vector<std::string> ConfigurationManager::getRecordDeviceList() { + std::vector<std::string> ret; + return ret; -std::vector< std::string > -ConfigurationManager::getCodecList (void) -{ - _debug ("ConfigurationManager::getCodecList received"); - return Manager::instance().getCodecList(); } -std::vector<std::string> -ConfigurationManager::getSupportedTlsMethod (void) -{ - _debug ("ConfigurationManager::getSupportedTlsMethod received"); - std::vector<std::string> method; - method.push_back ("Default"); - method.push_back ("TLSv1"); - method.push_back ("SSLv2"); - method.push_back ("SSLv3"); - method.push_back ("SSLv23"); - return method; +bool ConfigurationManager::isMd5CredentialHashing(void) { + bool isEnabled = Manager::instance().getConfigBool(PREFERENCES, + CONFIG_MD5HASH); + return isEnabled; } -std::vector< std::string > -ConfigurationManager::getCodecDetails (const int32_t& payload) -{ - _debug ("ConfigurationManager::getCodecDetails received"); - return Manager::instance().getCodecDetails (payload); +void ConfigurationManager::setMd5CredentialHashing(const bool& enabled) { + if (enabled) { + Manager::instance().setConfig(PREFERENCES, CONFIG_MD5HASH, TRUE_STR); + } else { + Manager::instance().setConfig(PREFERENCES, CONFIG_MD5HASH, FALSE_STR); + } } -std::vector< std::string > -ConfigurationManager::getActiveCodecList() -{ - _debug ("ConfigurationManager::getActiveCodecList received"); - return Manager::instance().getActiveCodecList(); +int32_t ConfigurationManager::isIax2Enabled(void) { + return Manager::instance().isIax2Enabled(); } -void -ConfigurationManager::setActiveCodecList (const std::vector< std::string >& list) -{ - _debug ("ConfigurationManager::setActiveCodecList received"); - Manager::instance().setActiveCodecList (list); +void ConfigurationManager::ringtoneEnabled(void) { + Manager::instance().ringtoneEnabled(); } -// Audio devices related methods -std::vector< std::string > -ConfigurationManager::getInputAudioPluginList() -{ - _debug ("ConfigurationManager::getInputAudioPluginList received"); - return Manager::instance().getInputAudioPluginList(); +int32_t ConfigurationManager::isRingtoneEnabled(void) { + return Manager::instance().isRingtoneEnabled(); } -std::vector< std::string > -ConfigurationManager::getOutputAudioPluginList() -{ - _debug ("ConfigurationManager::getOutputAudioPluginList received"); - return Manager::instance().getOutputAudioPluginList(); +std::string ConfigurationManager::getRingtoneChoice(void) { + return Manager::instance().getRingtoneChoice(); } -void -ConfigurationManager::setInputAudioPlugin (const std::string& audioPlugin) -{ - _debug ("ConfigurationManager::setInputAudioPlugin received"); - return Manager::instance().setInputAudioPlugin (audioPlugin); +void ConfigurationManager::setRingtoneChoice(const std::string& tone) { + Manager::instance().setRingtoneChoice(tone); } -void -ConfigurationManager::setOutputAudioPlugin (const std::string& audioPlugin) -{ - _debug ("ConfigurationManager::setOutputAudioPlugin received"); - return Manager::instance().setOutputAudioPlugin (audioPlugin); +std::string ConfigurationManager::getRecordPath(void) { + return Manager::instance().getRecordPath(); } -std::vector< std::string > -ConfigurationManager::getAudioOutputDeviceList() -{ - _debug ("ConfigurationManager::getAudioOutputDeviceList received"); - return Manager::instance().getAudioOutputDeviceList(); +void ConfigurationManager::setRecordPath(const std::string& recPath) { + Manager::instance().setRecordPath(recPath); } -void -ConfigurationManager::setAudioOutputDevice (const int32_t& index) -{ - _debug ("ConfigurationManager::setAudioOutputDevice received"); - return Manager::instance().setAudioOutputDevice (index); +int32_t ConfigurationManager::getDialpad(void) { + return Manager::instance().getDialpad(); } -std::vector< std::string > -ConfigurationManager::getAudioInputDeviceList() -{ - _debug ("ConfigurationManager::getAudioInputDeviceList received"); - return Manager::instance().getAudioInputDeviceList(); +void ConfigurationManager::setDialpad(const bool& display) { + Manager::instance().setDialpad(display); } -void -ConfigurationManager::setAudioInputDevice (const int32_t& index) -{ - _debug ("ConfigurationManager::setAudioInputDevice received"); - return Manager::instance().setAudioInputDevice (index); +int32_t ConfigurationManager::getSearchbar(void) { + return Manager::instance().getSearchbar(); } -std::vector< std::string > -ConfigurationManager::getCurrentAudioDevicesIndex() -{ - _debug ("ConfigurationManager::getCurrentAudioDeviceIndex received"); - return Manager::instance().getCurrentAudioDevicesIndex(); +void ConfigurationManager::setSearchbar(void) { + Manager::instance().setSearchbar(); } -int32_t -ConfigurationManager::getAudioDeviceIndex (const std::string& name) -{ - _debug ("ConfigurationManager::getAudioDeviceIndex received"); - return Manager::instance().getAudioDeviceIndex (name); +int32_t ConfigurationManager::getVolumeControls(void) { + return Manager::instance().getVolumeControls(); } -std::string -ConfigurationManager::getCurrentAudioOutputPlugin (void) -{ - _debug ("ConfigurationManager::getCurrentAudioOutputPlugin received"); - return Manager::instance().getCurrentAudioOutputPlugin(); +void ConfigurationManager::setVolumeControls(const bool& display) { + Manager::instance().setVolumeControls(display); } - -std::vector< std::string > -ConfigurationManager::getPlaybackDeviceList() -{ - std::vector< std::string > ret; - _debug ("ConfigurationManager::getPlaybackDeviceList received"); - return ret; +int32_t ConfigurationManager::getHistoryLimit(void) { + return Manager::instance().getHistoryLimit(); } -std::vector< std::string > -ConfigurationManager::getRecordDeviceList() -{ - std::vector< std::string > ret; - _debug ("ConfigurationManager::getRecordDeviceList received"); - return ret; - +void ConfigurationManager::setHistoryLimit(const int32_t& days) { + Manager::instance().setHistoryLimit(days); } -bool -ConfigurationManager::isMd5CredentialHashing (void) -{ - bool isEnabled = Manager::instance().getConfigBool (PREFERENCES, CONFIG_MD5HASH); - return isEnabled; +void ConfigurationManager::setHistoryEnabled(void) { + Manager::instance().setHistoryEnabled(); } -void -ConfigurationManager::setMd5CredentialHashing (const bool& enabled) -{ - if (enabled) { - Manager::instance().setConfig (PREFERENCES, CONFIG_MD5HASH, TRUE_STR); - } else { - Manager::instance().setConfig (PREFERENCES, CONFIG_MD5HASH, FALSE_STR); - } +std::string ConfigurationManager::getHistoryEnabled(void) { + return Manager::instance().getHistoryEnabled(); } -int32_t -ConfigurationManager::isIax2Enabled (void) -{ - return Manager::instance().isIax2Enabled(); +void ConfigurationManager::startHidden(void) { + Manager::instance().startHidden(); } -void -ConfigurationManager::ringtoneEnabled (void) -{ - Manager::instance().ringtoneEnabled(); +int32_t ConfigurationManager::isStartHidden(void) { + return Manager::instance().isStartHidden(); } -int32_t -ConfigurationManager::isRingtoneEnabled (void) -{ - return Manager::instance().isRingtoneEnabled(); +void ConfigurationManager::switchPopupMode(void) { + Manager::instance().switchPopupMode(); } -std::string -ConfigurationManager::getRingtoneChoice (void) -{ - return Manager::instance().getRingtoneChoice(); +int32_t ConfigurationManager::popupMode(void) { + return Manager::instance().popupMode(); } -void -ConfigurationManager::setRingtoneChoice (const std::string& tone) -{ - Manager::instance().setRingtoneChoice (tone); +void ConfigurationManager::setNotify(void) { + Manager::instance().setNotify(); } -std::string -ConfigurationManager::getRecordPath (void) -{ - return Manager::instance().getRecordPath(); +int32_t ConfigurationManager::getNotify(void) { + return Manager::instance().getNotify(); } -void -ConfigurationManager::setRecordPath (const std::string& recPath) -{ - Manager::instance().setRecordPath (recPath); +void ConfigurationManager::setAudioManager(const int32_t& api) { + Manager::instance().setAudioManager(api); } -int32_t -ConfigurationManager::getDialpad (void) -{ - return Manager::instance().getDialpad(); +int32_t ConfigurationManager::getAudioManager(void) { + return Manager::instance().getAudioManager(); } -void -ConfigurationManager::setDialpad (const bool& display) -{ - Manager::instance().setDialpad (display); +void ConfigurationManager::setMailNotify(void) { + Manager::instance().setMailNotify(); } -int32_t -ConfigurationManager::getSearchbar (void) -{ - return Manager::instance().getSearchbar(); +int32_t ConfigurationManager::getMailNotify(void) { + return Manager::instance().getMailNotify(); } -void -ConfigurationManager::setSearchbar (void) -{ - Manager::instance().setSearchbar(); +std::map<std::string, int32_t> ConfigurationManager::getAddressbookSettings( + void) { + return Manager::instance().getAddressbookSettings(); } -int32_t -ConfigurationManager::getVolumeControls (void) -{ - return Manager::instance().getVolumeControls(); +void ConfigurationManager::setAddressbookSettings(const std::map<std::string, + int32_t>& settings) { + Manager::instance().setAddressbookSettings(settings); } -void -ConfigurationManager::setVolumeControls (const bool& display) -{ - Manager::instance().setVolumeControls (display); +std::vector<std::string> ConfigurationManager::getAddressbookList(void) { + return Manager::instance().getAddressbookList(); } -int32_t -ConfigurationManager::getHistoryLimit (void) -{ - return Manager::instance().getHistoryLimit(); +void ConfigurationManager::setAddressbookList( + const std::vector<std::string>& list) { + Manager::instance().setAddressbookList(list); } -void -ConfigurationManager::setHistoryLimit (const int32_t& days) -{ - Manager::instance().setHistoryLimit (days); +std::map<std::string, std::string> ConfigurationManager::getHookSettings(void) { + return Manager::instance().getHookSettings(); } - -void ConfigurationManager::setHistoryEnabled (void) -{ - Manager::instance ().setHistoryEnabled (); +void ConfigurationManager::setHookSettings(const std::map<std::string, + std::string>& settings) { + Manager::instance().setHookSettings(settings); } -std::string ConfigurationManager::getHistoryEnabled (void) -{ - return Manager::instance ().getHistoryEnabled (); +void ConfigurationManager::setAccountsOrder(const std::string& order) { + Manager::instance().setAccountsOrder(order); } -void -ConfigurationManager::startHidden (void) -{ - _debug ("Manager received startHidden"); - Manager::instance().startHidden(); +std::map<std::string, std::string> ConfigurationManager::getHistory(void) { + return Manager::instance().send_history_to_client(); } -int32_t -ConfigurationManager::isStartHidden (void) -{ - _debug ("Manager received isStartHidden"); - return Manager::instance().isStartHidden(); +void ConfigurationManager::setHistory( + const std::map<std::string, std::string>& entries) { + Manager::instance().receive_history_from_client(entries); } -void -ConfigurationManager::switchPopupMode (void) -{ - _debug ("Manager received switchPopupMode"); - Manager::instance().switchPopupMode(); -} +std::string ConfigurationManager::getAddrFromInterfaceName( + const std::string& interface) { -int32_t -ConfigurationManager::popupMode (void) -{ - _debug ("Manager received popupMode"); - return Manager::instance().popupMode(); -} + std::string address = SIPVoIPLink::instance("")->getInterfaceAddrFromName( + interface); -void -ConfigurationManager::setNotify (void) -{ - _debug ("Manager received setNotify"); - Manager::instance().setNotify(); + return address; } -int32_t -ConfigurationManager::getNotify (void) -{ - _debug ("Manager received getNotify"); - return Manager::instance().getNotify(); -} +std::vector<std::string> ConfigurationManager::getAllIpInterface(void) { -void -ConfigurationManager::setAudioManager (const int32_t& api) -{ - _debug ("Manager received setAudioManager"); - Manager::instance().setAudioManager (api); -} + std::vector<std::string> vector; + SIPVoIPLink * sipLink = NULL; + sipLink = SIPVoIPLink::instance(""); -int32_t -ConfigurationManager::getAudioManager (void) -{ - _debug ("Manager received getAudioManager"); - return Manager::instance().getAudioManager(); -} + if (sipLink != NULL) { + vector = sipLink->getAllIpInterface(); + } -void -ConfigurationManager::setMailNotify (void) -{ - _debug ("Manager received setMailNotify"); - Manager::instance().setMailNotify(); + return vector; } -int32_t -ConfigurationManager::getMailNotify (void) -{ - _debug ("Manager received getMailNotify"); - return Manager::instance().getMailNotify(); -} +std::vector<std::string> ConfigurationManager::getAllIpInterfaceByName(void) { + std::vector<std::string> vector; + SIPVoIPLink * sipLink = NULL; + sipLink = SIPVoIPLink::instance(""); + if (sipLink != NULL) { + vector = sipLink->getAllIpInterfaceByName(); + } -std::map<std::string, int32_t> ConfigurationManager::getAddressbookSettings (void) -{ - return Manager::instance().getAddressbookSettings (); + return vector; } -void ConfigurationManager::setAddressbookSettings (const std::map<std::string, int32_t>& settings) -{ - Manager::instance().setAddressbookSettings (settings); +int32_t ConfigurationManager::getWindowWidth(void) { + + return Manager::instance().getConfigInt(PREFERENCES, WINDOW_WIDTH); } -std::vector< std::string > ConfigurationManager::getAddressbookList (void) -{ - return Manager::instance().getAddressbookList(); +int32_t ConfigurationManager::getWindowHeight(void) { + + return Manager::instance().getConfigInt(PREFERENCES, WINDOW_HEIGHT); } -void ConfigurationManager::setAddressbookList (const std::vector< std::string >& list) -{ - _debug ("Manager received setAddressbookList") ; - Manager::instance().setAddressbookList (list); +void ConfigurationManager::setWindowWidth(const int32_t& width) { + + Manager::instance().setConfig(PREFERENCES, WINDOW_WIDTH, width); } -std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) -{ - return Manager::instance().getHookSettings (); +void ConfigurationManager::setWindowHeight(const int32_t& height) { + + Manager::instance().setConfig(PREFERENCES, WINDOW_HEIGHT, height); } -void ConfigurationManager::setHookSettings (const std::map<std::string, std::string>& settings) -{ - Manager::instance().setHookSettings (settings); +int32_t ConfigurationManager::getWindowPositionX(void) { + + return Manager::instance().getConfigInt(PREFERENCES, WINDOW_POSITION_X); } -void ConfigurationManager::setAccountsOrder (const std::string& order) -{ - Manager::instance().setAccountsOrder (order); +int32_t ConfigurationManager::getWindowPositionY(void) { + + return Manager::instance().getConfigInt(PREFERENCES, WINDOW_POSITION_Y); } -std::map <std::string, std::string> ConfigurationManager::getHistory (void) -{ - return Manager::instance().send_history_to_client (); +void ConfigurationManager::setWindowPositionX(const int32_t& posX) { + + Manager::instance().setConfig(PREFERENCES, WINDOW_POSITION_X, posX); } -void ConfigurationManager::setHistory (const std::map <std::string, std::string>& entries) -{ - Manager::instance().receive_history_from_client (entries); +void ConfigurationManager::setWindowPositionY(const int32_t& posY) { + + Manager::instance().setConfig(PREFERENCES, WINDOW_POSITION_Y, posY); } -std::string -ConfigurationManager::getAddrFromInterfaceName(const std::string& interface) -{ - _debug ("ConfigurationManager::getAddrFromInterfaceName received"); +std::map<std::string, int32_t> ConfigurationManager::getShortcuts() { - std::string address = SIPVoIPLink::instance("")->getInterfaceAddrFromName(interface); + std::map<std::string, int> shortcutsMap; + int shortcut; - _debug("address: %s", address.c_str()); + for (int i = 0; i < shortcutsKeys.size(); i++) { + std::string key = shortcutsKeys.at(i); + shortcut = Manager::instance().getConfigInt("Shortcuts", key); + shortcutsMap.insert(std::pair<std::string, int>(key, shortcut)); + } - return address; + return shortcutsMap; } -std::vector<std::string> ConfigurationManager::getAllIpInterface (void) -{ - _debug ("ConfigurationManager::getAllIpInterface received"); +void ConfigurationManager::setShortcuts( + const std::map<std::string, int32_t>& shortcutsMap) { - std::vector<std::string> vector; - SIPVoIPLink * sipLink = NULL; - sipLink = SIPVoIPLink::instance (""); + std::map<std::string, int> map_cpy = shortcutsMap; + std::map<std::string, int>::iterator it; - if (sipLink != NULL) { - vector = sipLink->getAllIpInterface(); - } + for (int i = 0; i < shortcutsKeys.size(); i++) { + std::string key = shortcutsKeys.at(i); + it = map_cpy.find(key); + if (it != shortcutsMap.end()) { + Manager::instance().setConfig("Shortcuts", key, it->second); + } + } - return vector; + Manager::instance().saveConfig(); } -std::vector<std::string> ConfigurationManager::getAllIpInterfaceByName(void) -{ - _debug ("ConfigurationManager::getAllIpInterface received\n"); +void ConfigurationManager::enableStatusIcon (const std::string& value) { - std::vector<std::string> vector; - SIPVoIPLink * sipLink = NULL; - sipLink = SIPVoIPLink::instance (""); + Manager::instance ().setConfig (PREFERENCES, SHOW_STATUSICON, value); +} - if (sipLink != NULL) { - vector = sipLink->getAllIpInterfaceByName(); - } +std::string ConfigurationManager::isStatusIconEnabled (void) { - return vector; + return Manager::instance ().getConfigString (PREFERENCES, SHOW_STATUSICON); } diff --git a/sflphone-common/src/dbus/configurationmanager.h b/sflphone-common/src/dbus/configurationmanager.h index 61072e16b5bb9153dce4761b143211b4733ac637..4025bc432429e267f5207c267c94df7aad4e03c3 100644 --- a/sflphone-common/src/dbus/configurationmanager.h +++ b/sflphone-common/src/dbus/configurationmanager.h @@ -37,6 +37,9 @@ public: ConfigurationManager(DBus::Connection& connection); static const char* SERVER_PATH; +private: + std::vector<std::string> shortcutsKeys; + public: std::map< std::string, std::string > getAccountDetails( const std::string& accountID ); @@ -58,8 +61,8 @@ public: std::vector< std::string > getCodecList(void); std::vector< std::string > getSupportedTlsMethod(void); std::vector< std::string > getCodecDetails( const int32_t& payload ); - std::vector< std::string > getActiveCodecList( ); - void setActiveCodecList( const std::vector< std::string >& list ); + std::vector< std::string > getActiveCodecList (const std::string& accountID); + void setActiveCodecList (const std::vector< std::string >& list, const std::string& accountID); std::vector< std::string > getInputAudioPluginList(); std::vector< std::string > getOutputAudioPluginList(); @@ -114,6 +117,18 @@ public: int32_t getMailNotify( void ); void setMailNotify( void ); + int32_t getWindowWidth (void); + int32_t getWindowHeight (void); + void setWindowWidth (const int32_t& width); + void setWindowHeight (const int32_t& height); + int32_t getWindowPositionX (void); + int32_t getWindowPositionY (void); + void setWindowPositionX (const int32_t& posX); + void setWindowPositionY (const int32_t& posY); + + void enableStatusIcon (const std::string&); + std::string isStatusIconEnabled (void); + std::map<std::string, int32_t> getAddressbookSettings (void); void setAddressbookSettings (const std::map<std::string, int32_t>& settings); std::vector< std::string > getAddressbookList ( void ); @@ -134,6 +149,9 @@ public: std::vector<std::string> getAllIpInterface(void); std::vector<std::string> getAllIpInterfaceByName(void); + + std::map< std::string, int32_t > getShortcuts (); + void setShortcuts (const std::map< std::string, int32_t >& shortcutsMap); }; diff --git a/sflphone-common/src/dbus/instance-introspec.xml b/sflphone-common/src/dbus/instance-introspec.xml index 90a60d632d04ca83039efcadcfa2f4981bfda39e..4b7d075cd87112df83744e3740f892d4f1cb26e5 100644 --- a/sflphone-common/src/dbus/instance-introspec.xml +++ b/sflphone-common/src/dbus/instance-introspec.xml @@ -1,18 +1,46 @@ <?xml version="1.0" ?> -<node name="/org/sflphone/SFLphone"> - <interface name="org.sflphone.SFLphone.Instance"> - - <method name="Register"> - <arg type="i" name="pid" direction="in"/> - <arg type="s" name="name" direction="in"/> - </method> - - <method name="Unregister"> - <arg type="i" name="pid" direction="in"/> - </method> - - <method name="getRegistrationCount"> - <arg type="i" name="count" direction="out"/> - </method> - </interface> +<node name="/instance-introspec" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <interface name="org.sflphone.SFLphone.Instance"> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p>Count the number of clients actually registered to the core. When initializing your client, you need to register it against the core by using this interface.</p> + </tp:docstring> + <method name="Register" tp:name-for-bindings="Register"> + <tp:docstring> + Register a new client to the core. Increments the registration count. + </tp:docstring> + <arg type="i" name="pid" direction="in"> + <tp:docstring> + The pid of the client process + </tp:docstring> + </arg> + <arg type="s" name="name" direction="in"> + <tp:docstring> + The name of the client + </tp:docstring> + </arg> + </method> + <method name="Unregister" tp:name-for-bindings="Unregister"> + <tp:docstring> + Unregister a connected client from the core. Decrements the registration count. If no more clients are connected, ie the registration count equals 0, the core properly quits. + </tp:docstring> + <arg type="i" name="pid" direction="in"> + <tp:docstring> + The pid of the client process + </tp:docstring> + </arg> + </method> + + <method name="getRegistrationCount" tp:name-for-bindings="getRegistrationCount"> + <tp:docstring> + Get the number of connected clients. + </tp:docstring> + <arg type="i" name="count" direction="out"> + <tp:docstring> + The number of client currently connected to the core + </tp:docstring> + </arg> + </method> + + + </interface> </node> diff --git a/sflphone-common/src/global.h b/sflphone-common/src/global.h index 474d08b0f39087de2e815f95f1aeaecef47c7040..630403fd2bb69abc1ad74a15b55b684e65556fad 100644 --- a/sflphone-common/src/global.h +++ b/sflphone-common/src/global.h @@ -33,7 +33,7 @@ #include <vector> #include "logger.h" -#define SFLPHONED_VERSION "0.9.6" /** Version number */ +#define SFLPHONED_VERSION "0.9.8~beta" /** Version number */ #define HOMEDIR (getenv ("HOME")) /** Home directory */ #define XDG_DATA_HOME (getenv ("XDG_DATA_HOME")) @@ -131,5 +131,34 @@ static const SOUND_FORMAT INT32 = 0x8; #define HOOK_DEFAULT_SIP_FIELD "X-sflphone-url" #define HOOK_DEFAULT_URL_COMMAND "x-www-browser" +/** Enumeration that contains known audio payloads */ +typedef enum { + // http://www.iana.org/assignments/rtp-parameters + // http://www.gnu.org/software/ccrtp/doc/refman/html/formats_8h.html#a0 + // 0 PCMU A 8000 1 [RFC3551] + PAYLOAD_CODEC_ULAW = 0, + // 3 GSM A 8000 1 [RFC3551] + PAYLOAD_CODEC_GSM = 3, + // 8 PCMA A 8000 1 [RFC3551] + PAYLOAD_CODEC_ALAW = 8, + // 9 G722 A 8000 1 [RFC3551] + PAYLOAD_CODEC_G722 = 9, + // http://www.ietf.org/rfc/rfc3952.txt + // 97 iLBC/8000 + PAYLOAD_CODEC_ILBC_20 = 97, + PAYLOAD_CODEC_ILBC_30 = 98, + // http://www.speex.org/drafts/draft-herlein-speex-rtp-profile-00.txt + // 97 speex/8000 + // http://support.xten.com/viewtopic.php?p=8684&sid=3367a83d01fdcad16c7459a79859b08e + // 100 speex/16000 + PAYLOAD_CODEC_SPEEX_8000 = 110, + PAYLOAD_CODEC_SPEEX_16000 = 111, + PAYLOAD_CODEC_SPEEX_32000 = 112 +} AudioCodecType; + +/** The struct to reflect the order the user wants to use the codecs */ +typedef std::vector<AudioCodecType> CodecOrder; + + #endif // __GLOBAL_H__ diff --git a/sflphone-common/src/iax/iaxcall.cpp b/sflphone-common/src/iax/iaxcall.cpp index d276abee64103b7ebed163633033c2e456bf1d7b..be152908e611ac9411a290615fccfc678568cb2d 100644 --- a/sflphone-common/src/iax/iaxcall.cpp +++ b/sflphone-common/src/iax/iaxcall.cpp @@ -19,6 +19,7 @@ */ #include "iaxcall.h" +#include "manager.h" #include "global.h" // for _debug IAXCall::IAXCall (const CallID& id, Call::CallType type) : Call (id, type), _session (NULL) @@ -27,157 +28,172 @@ IAXCall::IAXCall (const CallID& id, Call::CallType type) : Call (id, type), _ses IAXCall::~IAXCall() { - _session = NULL; // just to be sure to don't have unknown pointer, do not delete it! + _session = NULL; // just to be sure to don't have unknown pointer, do not delete it! } -void + void IAXCall::setFormat (int format) { - _format = format; - - _info ("IAX set supported format: "); - - switch (format) { - - case AST_FORMAT_ULAW: - _info("PCMU"); - setAudioCodec (PAYLOAD_CODEC_ULAW); - break; - - case AST_FORMAT_GSM: - _info ("GSM"); - setAudioCodec (PAYLOAD_CODEC_GSM); - break; - - case AST_FORMAT_ALAW: - _info ("ALAW"); - setAudioCodec (PAYLOAD_CODEC_ALAW); - break; - - case AST_FORMAT_ILBC: - _info ("ILBC"); - setAudioCodec (PAYLOAD_CODEC_ILBC_20); - break; - - case AST_FORMAT_SPEEX: - _info ("SPEEX"); - setAudioCodec (PAYLOAD_CODEC_SPEEX_8000); - break; - - default: - _info ("Error audio codec type %i not supported!", format); - setAudioCodec ( (AudioCodecType) -1); - break; - } + _format = format; + + _info ("IAX set supported format: "); + + switch (format) { + + case AST_FORMAT_ULAW: + _info("PCMU"); + setAudioCodec (PAYLOAD_CODEC_ULAW); + break; + + case AST_FORMAT_GSM: + _info ("GSM"); + setAudioCodec (PAYLOAD_CODEC_GSM); + break; + + case AST_FORMAT_ALAW: + _info ("ALAW"); + setAudioCodec (PAYLOAD_CODEC_ALAW); + break; + + case AST_FORMAT_ILBC: + _info ("ILBC"); + setAudioCodec (PAYLOAD_CODEC_ILBC_20); + break; + + case AST_FORMAT_SPEEX: + _info ("SPEEX"); + setAudioCodec (PAYLOAD_CODEC_SPEEX_8000); + break; + + default: + _info ("Error audio codec type %i not supported!", format); + setAudioCodec ( (AudioCodecType) -1); + break; + } } -int -IAXCall::getSupportedFormat() + int +IAXCall::getSupportedFormat (std::string accountID) { - CodecOrder map; - int format = 0; - unsigned int iter; + CodecOrder map; + int format = 0; + unsigned int iter; + Account *account; + + _info ("IAX get supported format: "); + + account = Manager::instance().getAccount (accountID); + if (account != NULL) { + map = account->getActiveCodecs(); + } + else { + _error ("No IAx account could be found"); + } + + for (iter=0 ; iter < map.size() ; iter++) { + switch (map[iter]) { + + case PAYLOAD_CODEC_ULAW: + _info ("PCMU "); + format |= AST_FORMAT_ULAW; + break; + + case PAYLOAD_CODEC_GSM: + _info ("GSM "); + format |= AST_FORMAT_GSM; + break; + + case PAYLOAD_CODEC_ALAW: + _info ("PCMA "); + format |= AST_FORMAT_ALAW; + break; + + case PAYLOAD_CODEC_ILBC_20: + _info ("ILBC "); + format |= AST_FORMAT_ILBC; + break; + + case PAYLOAD_CODEC_SPEEX_8000: + _info ("SPEEX "); + format |= AST_FORMAT_SPEEX; + break; + + default: + break; + } + } + + return format; - _info ("IAX get supported format: "); - - map = getCodecMap().getActiveCodecs(); - - for (iter=0 ; iter < map.size() ; iter++) { - switch (map[iter]) { - - case PAYLOAD_CODEC_ULAW: - _info ("PCMU "); - format |= AST_FORMAT_ULAW; - break; - - case PAYLOAD_CODEC_GSM: - _info ("GSM "); - format |= AST_FORMAT_GSM; - break; - - case PAYLOAD_CODEC_ALAW: - _info ("PCMA "); - format |= AST_FORMAT_ALAW; - break; - - case PAYLOAD_CODEC_ILBC_20: - _info ("ILBC "); - format |= AST_FORMAT_ILBC; - break; - - case PAYLOAD_CODEC_SPEEX_8000: - _info ("SPEEX "); - format |= AST_FORMAT_SPEEX; - break; +} - default: - break; - } - } +int IAXCall::getFirstMatchingFormat (int needles, std::string accountID) { - return format; + Account *account; + CodecOrder map; + int format = 0; + unsigned int iter; -} - -int -IAXCall::getFirstMatchingFormat (int needles) -{ - CodecOrder map = getCodecMap().getActiveCodecs(); - int format = 0; - unsigned int iter; + _debug ("IAX get first matching codec: "); - _debug ("IAX get first matching codec: "); + account = Manager::instance().getAccount (accountID); + if (account != NULL) { + map = account->getActiveCodecs(); + } + else { + _error ("No IAx account could be found"); + } - for (iter=0 ; iter < map.size() ; iter++) { - switch (map[iter]) { + for (iter=0 ; iter < map.size() ; iter++) { + switch (map[iter]) { - case PAYLOAD_CODEC_ULAW: - _debug ("PCMU"); - format = AST_FORMAT_ULAW; - break; + case PAYLOAD_CODEC_ULAW: + _debug ("PCMU"); + format = AST_FORMAT_ULAW; + break; - case PAYLOAD_CODEC_GSM: - _debug ("GSM"); - format = AST_FORMAT_GSM; - break; + case PAYLOAD_CODEC_GSM: + _debug ("GSM"); + format = AST_FORMAT_GSM; + break; - case PAYLOAD_CODEC_ALAW: - _debug ("PCMA"); - format = AST_FORMAT_ALAW; - break; + case PAYLOAD_CODEC_ALAW: + _debug ("PCMA"); + format = AST_FORMAT_ALAW; + break; - case PAYLOAD_CODEC_ILBC_20: - _debug ("ILBC"); - format = AST_FORMAT_ILBC; - break; + case PAYLOAD_CODEC_ILBC_20: + _debug ("ILBC"); + format = AST_FORMAT_ILBC; + break; - case PAYLOAD_CODEC_SPEEX_8000: - _debug ("SPEEX"); - format = AST_FORMAT_SPEEX; - break; + case PAYLOAD_CODEC_SPEEX_8000: + _debug ("SPEEX"); + format = AST_FORMAT_SPEEX; + break; - default: - break; - } + default: + break; + } - // Return the first that matches - if (format & needles) - return format; + // Return the first that matches + if (format & needles) + return format; - } + } - return 0; + return 0; } CodecDescriptor& IAXCall::getCodecMap() { - return _codecMap; + return _codecMap; } AudioCodecType IAXCall::getAudioCodec() { - return _audioCodec; + return _audioCodec; } diff --git a/sflphone-common/src/iax/iaxcall.h b/sflphone-common/src/iax/iaxcall.h index 6d8b3f60274943c55e4acf5661be63f274d22f7c..12dc670428640ae08f22e922ed1810471ce7ff4e 100644 --- a/sflphone-common/src/iax/iaxcall.h +++ b/sflphone-common/src/iax/iaxcall.h @@ -75,7 +75,7 @@ public: /** * @return int The bitwise list of supported formats */ - int getSupportedFormat(); + int getSupportedFormat (std::string accountID); /** * Return a format (int) with the first matching codec selected. @@ -90,7 +90,7 @@ public: * @param needles The format(s) (bitwise) you are looking for to match * @return int The matching format, thus 0 if none matches */ - int getFirstMatchingFormat(int needles); + int getFirstMatchingFormat(int needles, std::string accountID); // AUDIO /** diff --git a/sflphone-common/src/iax/iaxvoiplink.cpp b/sflphone-common/src/iax/iaxvoiplink.cpp index 3aedd89b8d8a85de8c9bd0c3239b1a09ff987c7b..9139b07b3be0d76540082bb26f86a85a26fb447b 100644 --- a/sflphone-common/src/iax/iaxvoiplink.cpp +++ b/sflphone-common/src/iax/iaxvoiplink.cpp @@ -712,8 +712,8 @@ IAXVoIPLink::iaxOutgoingInvite (IAXCall* call) wait = 0; /** @todo Make preference dynamic, and configurable */ - audio_format_preferred = call->getFirstMatchingFormat (call->getSupportedFormat()); - audio_format_capability = call->getSupportedFormat(); + audio_format_preferred = call->getFirstMatchingFormat (call->getSupportedFormat (getAccountID ()), getAccountID ()); + audio_format_capability = call->getSupportedFormat (getAccountID ()); _debug ("IAX New call: %s", strNum.c_str()); iax_call (newsession, username.c_str(), username.c_str(), strNum.c_str(), lang, wait, audio_format_preferred, audio_format_capability); @@ -1109,9 +1109,9 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event) * l'établissement du codec de transmission */ // Remote lists its capabilities - int format = call->getFirstMatchingFormat (event->ies.capability); + int format = call->getFirstMatchingFormat (event->ies.capability, getAccountID ()); // Remote asks for preferred codec voiceformat - int pref_format = call->getFirstMatchingFormat (event->ies.format); + int pref_format = call->getFirstMatchingFormat (event->ies.format, getAccountID ()); // Priority to remote's suggestion. In case it's a forwarding, no transcoding // will be needed from the server, thus less latency. @@ -1144,7 +1144,6 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event) id = call->getCallId(); _debug ("IAXVoIPLink::hungup::iaxHandlePrecallEvent"); Manager::instance().peerHungupCall (id); - // terminateOneCall(id); removeCall (id); break; @@ -1153,7 +1152,6 @@ IAXVoIPLink::iaxHandlePrecallEvent (iax_event* event) break; case IAX_IE_MSGCOUNT: - //_debug("messssssssssssssssssssssssssssssssssssssssssssssssages"); break; default: diff --git a/sflphone-common/src/logger.h b/sflphone-common/src/logger.h index b8a3b77b4cb27b426208aef5afd61e9b4c7aa312..ec199b21d597969dea82cd0068c471e1f44330cf 100644 --- a/sflphone-common/src/logger.h +++ b/sflphone-common/src/logger.h @@ -30,7 +30,7 @@ namespace Logger void setDebugMode(bool); }; -#define _error(...) Logger::log(LOG_ERROR, __VA_ARGS__) +#define _error(...) Logger::log(LOG_ERR, __VA_ARGS__) #define _warn(...) Logger::log(LOG_WARNING, __VA_ARGS__) #define _info(...) Logger::log(LOG_INFO, __VA_ARGS__) #define _debug(...) Logger::log(LOG_DEBUG, __VA_ARGS__) diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index f65f3d4d63a66598a022f105255de8f534c16b95..fdec6d8a8cb4b9fad95d5caaedfb8561b47da1b2 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -51,7 +51,7 @@ #include <sys/types.h> // mkdir(2) #include <sys/stat.h> // mkdir(2) #include <pwd.h> // getpwuid - +#define DIRECT_IP_CALL "IP CALL" #define fill_config_str(name, value) \ (_config.addConfigTreeItem(section, Conf::ConfigTreeItem(std::string(name), std::string(value), type_str))) @@ -60,2142 +60,1949 @@ #define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, len) -ManagerImpl::ManagerImpl (void) - : _hasTriedToRegister (false) - , _config() - , _currentCallId2() - , _currentCallMutex() - , _codecBuilder (NULL) - , _audiodriver (NULL) - , _dtmfKey (NULL) - , _codecDescriptorMap() - , _toneMutex() - , _telephoneTone (NULL) - , _audiofile() - , _spkr_volume (0) - , _mic_volume (0) - , _mutex() - , _dbus (NULL) - , _waitingCall() - , _waitingCallMutex() - , _nbIncomingWaitingCall (0) - , _path ("") - , _exist (0) - , _setupLoaded (false) - , _callAccountMap() - , _callAccountMapMutex() - , _callConfigMap() - , _accountMap() - , _directIpAccount (NULL) - , _cleaner (NULL) - , _history (NULL) -{ - - // initialize random generator for call id - srand (time (NULL)); - - _cleaner = new NumberCleaner (); - _history = new HistoryManager (); +ManagerImpl::ManagerImpl (void) : + _hasTriedToRegister(false), _config(), _currentCallId2(), + _currentCallMutex(), _codecBuilder(NULL), _audiodriver(NULL), + _dtmfKey(NULL), _codecDescriptorMap(), _toneMutex(), + _telephoneTone(NULL), _audiofile(), _spkr_volume(0), + _mic_volume(0), _mutex(), _dbus(NULL), _waitingCall(), + _waitingCallMutex(), _nbIncomingWaitingCall(0), _path(""), + _exist(0), _setupLoaded(false), _callAccountMap(), + _callAccountMapMutex(), _callConfigMap(), _accountMap(), + _directIpAccount(NULL), _cleaner(NULL), _history(NULL) { + + // initialize random generator for call id + srand(time(NULL)); + + _cleaner = new NumberCleaner(); + _history = new HistoryManager(); #ifdef TEST - testAccountMap(); - loadAccountMap(); - testCallAccountMap(); - unloadAccountMap(); + testAccountMap(); + loadAccountMap(); + testCallAccountMap(); + unloadAccountMap(); #endif - // should be call before initConfigFile - // loadAccountMap();, called in init() now. + // should be call before initConfigFile + // loadAccountMap();, called in init() now. } // never call if we use only the singleton... -ManagerImpl::~ManagerImpl (void) -{ - // terminate(); - delete _cleaner; - _cleaner=0; - _debug ("%s stop correctly.", PROGNAME); +ManagerImpl::~ManagerImpl (void) { + // terminate(); + delete _cleaner; + _cleaner = 0; + _debug ("%s stop correctly.", PROGNAME); } -void -ManagerImpl::init() -{ - - // Load accounts, init map - loadAccountMap(); +void ManagerImpl::init () { - initVolume(); + // Load accounts, init map + loadAccountMap(); - if (_exist == 0) { - _debug ("Cannot create config file in your home directory"); - } + initVolume(); - initAudioDriver(); + if (_exist == 0) { + _debug ("Cannot create config file in your home directory"); + } - selectAudioDriver(); + initAudioDriver(); - // Initialize the list of supported audio codecs - initAudioCodec(); + selectAudioDriver(); - AudioLayer *audiolayer = getAudioDriver(); + // Initialize the list of supported audio codecs + initAudioCodec(); - if (audiolayer != 0) { - unsigned int sampleRate = audiolayer->getSampleRate(); + AudioLayer *audiolayer = getAudioDriver(); - _debugInit ("Load Telephone Tone"); - std::string country = getConfigString (PREFERENCES, ZONE_TONE); - _telephoneTone = new TelephoneTone (country, sampleRate); + if (audiolayer != 0) { + unsigned int sampleRate = audiolayer->getSampleRate(); - _debugInit ("Loading DTMF key"); - _dtmfKey = new DTMF (sampleRate); - } + _debugInit ("Load Telephone Tone"); + std::string country = getConfigString(PREFERENCES, ZONE_TONE); + _telephoneTone = new TelephoneTone(country, sampleRate); - if (audiolayer == 0) - audiolayer->stopStream(); + _debugInit ("Loading DTMF key"); + _dtmfKey = new DTMF(sampleRate); + } + if (audiolayer == 0) + audiolayer->stopStream(); - // Load the history - _history->load_history (getConfigInt (PREFERENCES, CONFIG_HISTORY_LIMIT)); + // Load the history + _history->load_history(getConfigInt(PREFERENCES, CONFIG_HISTORY_LIMIT)); } -void ManagerImpl::terminate() -{ - _debug ("ManagerImpl::terminate "); - saveConfig(); +void ManagerImpl::terminate () { + _debug ("ManagerImpl::terminate "); + saveConfig(); - unloadAccountMap(); + unloadAccountMap(); - _debug ("Unload DTMF Key "); - delete _dtmfKey; + _debug ("Unload DTMF Key "); + delete _dtmfKey; - _debug ("Unload Audio Driver "); - delete _audiodriver; - _audiodriver = NULL; + _debug ("Unload Audio Driver "); + delete _audiodriver; + _audiodriver = NULL; - _debug ("Unload Telephone Tone "); - delete _telephoneTone; - _telephoneTone = NULL; + _debug ("Unload Telephone Tone "); + delete _telephoneTone; + _telephoneTone = NULL; - _debug ("Unload Audio Codecs "); - _codecDescriptorMap.deleteHandlePointer(); + _debug ("Unload Audio Codecs "); + _codecDescriptorMap.deleteHandlePointer(); } -bool -ManagerImpl::isCurrentCall (const CallID& callId) -{ - return (_currentCallId2 == callId ? true : false); +bool ManagerImpl::isCurrentCall (const CallID& callId) { + return (_currentCallId2 == callId ? true : false); } -bool -ManagerImpl::hasCurrentCall() -{ - // _debug ("ManagerImpl::hasCurrentCall current call ID = %s", _currentCallId2.c_str()); +bool ManagerImpl::hasCurrentCall () { + // _debug ("ManagerImpl::hasCurrentCall current call ID = %s", _currentCallId2.c_str()); - if (_currentCallId2 != "") { - return true; - } + if (_currentCallId2 != "") { + return true; + } - return false; + return false; } const CallID& -ManagerImpl::getCurrentCallId() -{ - return _currentCallId2; +ManagerImpl::getCurrentCallId () { + return _currentCallId2; } -void -ManagerImpl::switchCall (const CallID& id) -{ - ost::MutexLock m (_currentCallMutex); - _debug ("----- Switch current call id to %s -----", id.c_str()); - _currentCallId2 = id; +void ManagerImpl::switchCall (const CallID& id) { + ost::MutexLock m(_currentCallMutex); + _debug ("----- Switch current call id to %s -----", id.c_str()); + _currentCallId2 = id; - /* - AudioLayer *al = getAudioDriver(); + /* + AudioLayer *al = getAudioDriver(); - if (id != "") { + if (id != "") { - if(isConference(id)) { + if(isConference(id)) { - Conference *conf; + Conference *conf; - ConferenceMap::iterator iter = _conferencemap.find(id); - if(iter != _conferencemap.end()) - { - _debug(" set call recordable in audio layer"); - conf = iter->second; - al->setRecorderInstance((Recordable*)conf); - } - } - else { + ConferenceMap::iterator iter = _conferencemap.find(id); + if(iter != _conferencemap.end()) + { + _debug(" set call recordable in audio layer"); + conf = iter->second; + al->setRecorderInstance((Recordable*)conf); + } + } + else { - // set the recordable instance in audiolayer - AccountID account_id = getAccountFromCall(id); + // set the recordable instance in audiolayer + AccountID account_id = getAccountFromCall(id); - Call *call = NULL; - call = getAccountLink (account_id)->getCall(id); + Call *call = NULL; + call = getAccountLink (account_id)->getCall(id); - _debug(" set call recordable in audio layer"); - al->setRecorderInstance((Recordable*)call); - } - } - */ + _debug(" set call recordable in audio layer"); + al->setRecorderInstance((Recordable*)call); + } + } + */ } - /////////////////////////////////////////////////////////////////////////////// // Management of events' IP-phone user /////////////////////////////////////////////////////////////////////////////// /* Main Thread */ -bool -ManagerImpl::outgoingCall (const std::string& account_id, const CallID& call_id, const std::string& to) -{ - std::string pattern, to_cleaned; - Call::CallConfiguration callConfig; - SIPVoIPLink *siplink; - - _debug ("ManagerImpl::outgoingCall(%s)", call_id.c_str()); +bool ManagerImpl::outgoingCall (const std::string& account_id, + const CallID& call_id, const std::string& to) { + std::string pattern, to_cleaned; + Call::CallConfiguration callConfig; + SIPVoIPLink *siplink; - CallID current_call_id = getCurrentCallId(); + _debug ("ManagerImpl::outgoingCall(%s)", call_id.c_str()); - if (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED) == "1") - _cleaner->set_phone_number_prefix (getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX)); - else - _cleaner->set_phone_number_prefix (""); + CallID current_call_id = getCurrentCallId(); - to_cleaned = _cleaner->clean (to); + if (getConfigString(HOOKS, PHONE_NUMBER_HOOK_ENABLED) == "1") + _cleaner->set_phone_number_prefix(getConfigString(HOOKS, + PHONE_NUMBER_HOOK_ADD_PREFIX)); + else + _cleaner->set_phone_number_prefix(""); - /* Check what kind of call we are dealing with */ - check_call_configuration (call_id, to_cleaned, &callConfig); + to_cleaned = _cleaner->clean(to); - // in any cases we have to detach from current communication - if (hasCurrentCall()) { + /* Check what kind of call we are dealing with */ + check_call_configuration(call_id, to_cleaned, &callConfig); - _debug (" outgoingCall: Has current call (%s) put it onhold", current_call_id.c_str()); + // in any cases we have to detach from current communication + if (hasCurrentCall()) { - // if this is not a conferenceand this and is not a conference participant + _debug (" outgoingCall: Has current call (%s) put it onhold", current_call_id.c_str()); - if (!isConference (current_call_id) && !participToConference (current_call_id)) { - _debug (" outgoingCall: Put the current call (%s) on hold", current_call_id.c_str()); - onHoldCall (current_call_id); - } else if (isConference (current_call_id) && !participToConference (call_id)) { - _debug (" outgoingCall: detach main participant from conference"); - detachParticipant (default_id, current_call_id); - } - } + // if this is not a conferenceand this and is not a conference participant - if (callConfig == Call::IPtoIP) { - _debug (" outgoingCall: Start IP to IP call"); - /* We need to retrieve the sip voiplink instance */ - siplink = SIPVoIPLink::instance (""); + if (!isConference(current_call_id) && !participToConference( + current_call_id)) { + _debug (" outgoingCall: Put the current call (%s) on hold", current_call_id.c_str()); + onHoldCall(current_call_id); + } else if (isConference(current_call_id) && !participToConference( + call_id)) { + _debug (" outgoingCall: detach main participant from conference"); + detachParticipant(default_id, current_call_id); + } + } - if (siplink->new_ip_to_ip_call (call_id, to_cleaned)) { - switchCall (call_id); - return true; - } else { - callFailure (call_id); - } + if (callConfig == Call::IPtoIP) { + _debug (" outgoingCall: Start IP to IP call"); + /* We need to retrieve the sip voiplink instance */ + siplink = SIPVoIPLink::instance(""); - return false; - } + if (siplink->new_ip_to_ip_call(call_id, to_cleaned)) { + switchCall(call_id); + return true; + } else { + callFailure(call_id); + } - if (!accountExists (account_id)) { - _debug ("! Manager Error: Outgoing Call: account doesn't exist"); - return false; - } + return false; + } - if (getAccountFromCall (call_id) != AccountNULL) { - _debug ("! Manager Error: Outgoing Call: call id already exists"); - return false; - } + if (!accountExists(account_id)) { + _debug ("! Manager Error: Outgoing Call: account doesn't exist"); + return false; + } + if (getAccountFromCall(call_id) != AccountNULL) { + _debug ("! Manager Error: Outgoing Call: call id already exists"); + return false; + } - _debug ("- Manager Action: Adding Outgoing Call %s on account %s", call_id.data(), account_id.data()); + _debug ("- Manager Action: Adding Outgoing Call %s on account %s", call_id.data(), account_id.data()); - associateCallToAccount (call_id, account_id); + associateCallToAccount(call_id, account_id); - if (getAccountLink (account_id)->newOutgoingCall (call_id, to_cleaned)) { - switchCall (call_id); - return true; - } else { - callFailure (call_id); - _debug ("! Manager Error: An error occur, the call was not created"); - } + if (getAccountLink(account_id)->newOutgoingCall(call_id, to_cleaned)) { + switchCall(call_id); + return true; + } else { + callFailure(call_id); + _debug ("! Manager Error: An error occur, the call was not created"); + } - return false; + return false; } //THREAD=Main : for outgoing Call -bool -ManagerImpl::answerCall (const CallID& call_id) -{ - - _debug ("ManagerImpl::answerCall(%s)", call_id.c_str()); +bool ManagerImpl::answerCall (const CallID& call_id) { - stopTone (); + _debug ("ManagerImpl::answerCall(%s)", call_id.c_str()); - // store the current call id - CallID current_call_id = getCurrentCallId(); + stopTone(); - AccountID account_id = getAccountFromCall (call_id); + // store the current call id + CallID current_call_id = getCurrentCallId(); - if (account_id == AccountNULL) { - _debug (" answerCall: AccountId is null"); - } + AccountID account_id = getAccountFromCall(call_id); - Call* call = NULL; + if (account_id == AccountNULL) { + _debug (" answerCall: AccountId is null"); + } - call = getAccountLink (account_id)->getCall (call_id); + Call* call = NULL; - if (call == NULL) { - _debug (" answerCall: Call is null"); - } + call = getAccountLink(account_id)->getCall(call_id); - // in any cases we have to detach from current communication - if (hasCurrentCall()) { + if (call == NULL) { + _debug (" answerCall: Call is null"); + } - _debug (" answerCall: Currently conversing with %s", current_call_id.c_str()); - // if it is not a conference and is not a conference participant + // in any cases we have to detach from current communication + if (hasCurrentCall()) { - if (!isConference (current_call_id) && !participToConference (current_call_id)) { - _debug (" answerCall: Put the current call (%s) on hold", current_call_id.c_str()); - onHoldCall (current_call_id); - } + _debug (" answerCall: Currently conversing with %s", current_call_id.c_str()); + // if it is not a conference and is not a conference participant - // if we are talking to a conference and we are answering an incoming call - else if (isConference (current_call_id) && !participToConference (call_id)) { - _debug (" answerCall: Detach main participant from conference"); - detachParticipant (default_id, current_call_id); - } + if (!isConference(current_call_id) && !participToConference( + current_call_id)) { + _debug (" answerCall: Put the current call (%s) on hold", current_call_id.c_str()); + onHoldCall(current_call_id); + } - } + // if we are talking to a conference and we are answering an incoming call + else if (isConference(current_call_id) + && !participToConference(call_id)) { + _debug (" answerCall: Detach main participant from conference"); + detachParticipant(default_id, current_call_id); + } + } - if (!getAccountLink (account_id)->answer (call_id)) { - // error when receiving... - removeCallAccount (call_id); - return false; - } + if (!getAccountLink(account_id)->answer(call_id)) { + // error when receiving... + removeCallAccount(call_id); + return false; + } - // if it was waiting, it's waiting no more - if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "CURRENT"); + // if it was waiting, it's waiting no more + if (_dbus) + _dbus->getCallManager()->callStateChanged(call_id, "CURRENT"); - // std::string codecName = Manager::instance().getCurrentCodecName (call_id); - // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id, codecName.c_str()); + // std::string codecName = Manager::instance().getCurrentCodecName (call_id); + // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id, codecName.c_str()); - removeWaitingCall (call_id); + removeWaitingCall(call_id); - // if we dragged this call into a conference already - if (participToConference (call_id)) { + // if we dragged this call into a conference already + if (participToConference(call_id)) { - // AccountID currentAccountId; - // Call* call = NULL; + // AccountID currentAccountId; + // Call* call = NULL; - // currentAccountId = getAccountFromCall (call_id); - // call = getAccountLink (currentAccountId)->getCall (call_id); + // currentAccountId = getAccountFromCall (call_id); + // call = getAccountLink (currentAccountId)->getCall (call_id); - switchCall (call->getConfId()); - } else { - switchCall (call_id); - } + switchCall(call->getConfId()); + } else { + switchCall(call_id); + } - return true; + return true; } //THREAD=Main -bool -ManagerImpl::hangupCall (const CallID& call_id) -{ - _debug ("ManagerImpl::hangupCall(%s)", call_id.c_str()); - PulseLayer *pulselayer; - AccountID account_id; - bool returnValue = true; +bool ManagerImpl::hangupCall (const CallID& call_id) { - // store the current call id - CallID current_call_id = getCurrentCallId(); + _info("Manager: Hangup call %s", call_id.c_str()); - stopTone (); + PulseLayer *pulselayer; + AccountID account_id; + bool returnValue = true; - /* Broadcast a signal over DBus */ - _debug (" hangupCall: Send DBUS call state change (HUNGUP) for id %s", call_id.c_str()); + // store the current call id + CallID current_call_id = getCurrentCallId(); - if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HUNGUP"); + stopTone(); - if (participToConference (call_id)) { + /* Broadcast a signal over DBus */ + _debug ("Manager: Send DBUS call state change (HUNGUP) for id %s", call_id.c_str()); - Conference *conf = getConferenceFromCallID (call_id); + if (_dbus) + _dbus->getCallManager()->callStateChanged(call_id, "HUNGUP"); - if (conf != NULL) { - // remove this participant - removeParticipant (call_id); + if (participToConference(call_id)) { - processRemainingParticipant (current_call_id, conf); - } + Conference *conf = getConferenceFromCallID(call_id); - } else { - // we are not participating to a conference, current call switched to "" - if (!isConference (current_call_id)) - switchCall (""); - } + if (conf != NULL) { + // remove this participant + removeParticipant(call_id); - /* Direct IP to IP call */ - if (getConfigFromCall (call_id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)->hangup (call_id); - } - /* Classic call, attached to an account */ - else { - account_id = getAccountFromCall (call_id); + processRemainingParticipant(current_call_id, conf); + } - if (account_id == AccountNULL) { + } else { + // we are not participating to a conference, current call switched to "" + if (!isConference(current_call_id)) + switchCall(""); + } - _debug ("! Manager Hangup Call: Call doesn't exists"); - returnValue = false; - } + /* Direct IP to IP call */ + if (getConfigFromCall(call_id) == Call::IPtoIP) { + returnValue = SIPVoIPLink::instance(AccountNULL)->hangup(call_id); + } + /* Classic call, attached to an account */ else { + account_id = getAccountFromCall(call_id); + + if (account_id == AccountNULL) { - returnValue = getAccountLink (account_id)->hangup (call_id); - removeCallAccount (call_id); + _error ("Manager: Error: account id is NULL in hangup"); + returnValue = false; + } else { + + returnValue = getAccountLink(account_id)->hangup(call_id); + removeCallAccount(call_id); + } } - } - int nbCalls = getCallList().size(); + int nbCalls = getCallList().size(); - AudioLayer *audiolayer = getAudioDriver(); + AudioLayer *audiolayer = getAudioDriver(); - // stop streams - if (audiolayer && (nbCalls <= 0)) { - _debug (" hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls); - audiolayer->stopStream(); - } + // stop streams + if (audiolayer && (nbCalls <= 0)) { + _debug ("Manager: stop audio stream, ther is only %i call(s) remaining", nbCalls); + audiolayer->stopStream(); + } - if (_audiodriver->getLayerType() == PULSEAUDIO) { - pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); - } + if (_audiodriver->getLayerType() == PULSEAUDIO) { + pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); + } - return returnValue; + return returnValue; } +bool ManagerImpl::hangupConference (const ConfID& id) { -bool -ManagerImpl::hangupConference (const ConfID& id) -{ - _debug ("ManagerImpl::hangupConference()"); + _debug ("Manager: Hangup conference %s", id.c_str()); - Conference *conf; - ConferenceMap::iterator iter_conf = _conferencemap.find (id); + Conference *conf; + ConferenceMap::iterator iter_conf = _conferencemap.find(id); - AccountID currentAccountId; + AccountID currentAccountId; - // Call* call = NULL; + // Call* call = NULL; - if (iter_conf != _conferencemap.end()) { - conf = iter_conf->second; + if (iter_conf != _conferencemap.end()) { + conf = iter_conf->second; - ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet participants = conf->getParticipantList(); + ParticipantSet::iterator iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - _debug ("ManagerImpl::hangupConference participant %s", (*iter_participant).c_str()); + while (iter_participant != participants.end()) { + _debug ("Manager: Hangup onference participant %s", (*iter_participant).c_str()); - hangupCall (*iter_participant); + hangupCall(*iter_participant); - iter_participant++; + iter_participant++; - } + } - } + } - switchCall (""); + switchCall(""); - return true; + return true; } - //THREAD=Main -bool -ManagerImpl::cancelCall (const CallID& id) -{ - AccountID accountid; - bool returnValue; +bool ManagerImpl::cancelCall (const CallID& id) { + AccountID accountid; + bool returnValue; - stopTone (); + _debug("Manager: Cancel call"); - /* Direct IP to IP call */ + stopTone(); - if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)->cancel (id); - } + /* Direct IP to IP call */ - /* Classic call, attached to an account */ - else { - accountid = getAccountFromCall (id); + if (getConfigFromCall(id) == Call::IPtoIP) { + returnValue = SIPVoIPLink::instance(AccountNULL)->cancel(id); + } - if (accountid == AccountNULL) { - _debug ("! Manager Cancel Call: Call doesn't exists"); - return false; - } + /* Classic call, attached to an account */ + else { + accountid = getAccountFromCall(id); - returnValue = getAccountLink (accountid)->cancel (id); + if (accountid == AccountNULL) { + _debug ("! Manager Cancel Call: Call doesn't exists"); + return false; + } - removeCallAccount (id); - } + returnValue = getAccountLink(accountid)->cancel(id); - // it could be a waiting call? - removeWaitingCall (id); + removeCallAccount(id); + } + + // it could be a waiting call? + removeWaitingCall(id); - switchCall (""); + switchCall(""); - return returnValue; + return returnValue; } //THREAD=Main -bool -ManagerImpl::onHoldCall (const CallID& call_id) -{ - AccountID account_id; - bool returnValue; +bool ManagerImpl::onHoldCall (const CallID& call_id) { + AccountID account_id; + bool returnValue; - _debug ("ManagerImpl::onHoldCall(%s)", call_id.c_str()); + _debug ("Manager: Put call %s on hold", call_id.c_str()); - stopTone (); + stopTone(); - CallID current_call_id = getCurrentCallId(); + CallID current_call_id = getCurrentCallId(); - _debug (" onHoldCall: try to put call %s on hold", call_id.c_str()); - /* Direct IP to IP call */ + /* Direct IP to IP call */ - if (getConfigFromCall (call_id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)-> onhold (call_id); - } + if (getConfigFromCall(call_id) == Call::IPtoIP) { + returnValue = SIPVoIPLink::instance(AccountNULL)-> onhold(call_id); + } - /* Classic call, attached to an account */ - else { - account_id = getAccountFromCall (call_id); + /* Classic call, attached to an account */ + else { + account_id = getAccountFromCall(call_id); - if (account_id == AccountNULL) { - _debug (" onHoldCall: Account ID %s or callid %s doesn't exists", account_id.c_str(), call_id.c_str()); - return false; - } + if (account_id == AccountNULL) { + _debug ("Manager: Account ID %s or callid %s doesn't exists in call onHold", account_id.c_str(), call_id.c_str()); + return false; + } - returnValue = getAccountLink (account_id)->onhold (call_id); - } + returnValue = getAccountLink(account_id)->onhold(call_id); + } - removeWaitingCall (call_id); + removeWaitingCall(call_id); - // keeps current call id if the action is not holding this call or a new outgoing call + // keeps current call id if the action is not holding this call or a new outgoing call - if (current_call_id == call_id) { + if (current_call_id == call_id) { - switchCall (""); - } + switchCall(""); + } - if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HOLD"); + if (_dbus) + _dbus->getCallManager()->callStateChanged(call_id, "HOLD"); - return returnValue; + return returnValue; } //THREAD=Main -bool -ManagerImpl::offHoldCall (const CallID& call_id) -{ - - AccountID account_id; - bool returnValue, is_rec; - std::string codecName; - - is_rec = false; - - _debug ("ManagerImpl::offHoldCall(%s)", call_id.c_str()); +bool ManagerImpl::offHoldCall (const CallID& call_id) { - stopTone (); + AccountID account_id; + bool returnValue, is_rec; + std::string codecName; - CallID current_call_id = getCurrentCallId(); + is_rec = false; - //Place current call on hold if it isn't + _debug ("Manager: Put call %s off hold", call_id.c_str()); - if (hasCurrentCall()) { - // if this is not a conferenceand this and is not a conference participant - if (!isConference (current_call_id) && !participToConference (current_call_id)) { - _debug (" offHoldCall: put current call (%s) on hold", current_call_id.c_str()); - onHoldCall (current_call_id); - } else if (isConference (current_call_id) && !participToConference (call_id)) { - _debug (" offHoldCall Put current conference (%s) on hold", current_call_id.c_str()); - detachParticipant (default_id, current_call_id); - } - } + stopTone(); - // switch current call id to id since sipvoip link need it to amke a call - // switchCall(id); + CallID current_call_id = getCurrentCallId(); - /* Direct IP to IP call */ - if (getConfigFromCall (call_id) == Call::IPtoIP) { - // is_rec = SIPVoIPLink::instance (AccountNULL)-> isRecording (call_id); - returnValue = SIPVoIPLink::instance (AccountNULL)-> offhold (call_id); - } + //Place current call on hold if it isn't - /* Classic call, attached to an account */ - else { - account_id = getAccountFromCall (call_id); - - if (account_id == AccountNULL) { - _debug ("Manager OffHold Call: Call doesn't exists"); - return false; - } - - _debug ("Setting OFFHOLD, Account %s, callid %s", account_id.c_str(), call_id.c_str()); + if (hasCurrentCall()) { + // if this is not a conferenceand this and is not a conference participant + if (!isConference(current_call_id) && !participToConference( + current_call_id)) { + onHoldCall(current_call_id); + } else if (isConference(current_call_id) && !participToConference( + call_id)) { + detachParticipant(default_id, current_call_id); + } + } - is_rec = getAccountLink (account_id)->getCall (call_id)->isRecording(); - returnValue = getAccountLink (account_id)->offhold (call_id); - } + // switch current call id to id since sipvoip link need it to amke a call + // switchCall(id); + /* Direct IP to IP call */ + if (getConfigFromCall(call_id) == Call::IPtoIP) { + // is_rec = SIPVoIPLink::instance (AccountNULL)-> isRecording (call_id); + returnValue = SIPVoIPLink::instance(AccountNULL)-> offhold(call_id); + } - if (_dbus) { - if (is_rec) - _dbus->getCallManager()->callStateChanged (call_id, "UNHOLD_RECORD"); - else - _dbus->getCallManager()->callStateChanged (call_id, "UNHOLD_CURRENT"); + /* Classic call, attached to an account */ + else { + account_id = getAccountFromCall(call_id); - } + if (account_id == AccountNULL) { + _warn ("Manager: Error: Call doesn't exists in off hold"); + return false; + } - if (participToConference (call_id)) { + _debug ("Manager: Setting offhold, Account %s, callid %s", account_id.c_str(), call_id.c_str()); - AccountID currentAccountId; - Call* call = NULL; + is_rec = getAccountLink(account_id)->getCall(call_id)->isRecording(); + returnValue = getAccountLink(account_id)->offhold(call_id); + } - currentAccountId = getAccountFromCall (call_id); - call = getAccountLink (currentAccountId)->getCall (call_id); + if (_dbus) { + if (is_rec) + _dbus->getCallManager()->callStateChanged(call_id, "UNHOLD_RECORD"); + else + _dbus->getCallManager()->callStateChanged(call_id, "UNHOLD_CURRENT"); - switchCall (call->getConfId()); + } - } else { - switchCall (call_id); - _audiodriver->flushMain(); - } + if (participToConference(call_id)) { + AccountID currentAccountId; + Call* call = NULL; - // codecName = getCurrentCodecName (call_id); - // _debug("ManagerImpl::hangupCall(): broadcast codec name %s ",codecName.c_str()); + currentAccountId = getAccountFromCall(call_id); + call = getAccountLink(currentAccountId)->getCall(call_id); - // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (call_id,codecName.c_str()); + switchCall(call->getConfId()); + } else { + switchCall(call_id); + _audiodriver->flushMain(); + } - return returnValue; + return returnValue; } //THREAD=Main -bool -ManagerImpl::transferCall (const CallID& call_id, const std::string& to) -{ - AccountID accountid; - bool returnValue; - - stopTone (); - - CallID current_call_id = getCurrentCallId(); +bool ManagerImpl::transferCall (const CallID& call_id, const std::string& to) { + AccountID accountid; + bool returnValue; - if (participToConference (call_id)) { + _info("Manager: Transfer call %s\n", call_id.c_str()); - _debug("Particip to a conference\n"); + CallID current_call_id = getCurrentCallId(); - Conference *conf = getConferenceFromCallID (call_id); - - if (conf != NULL) { - // remove this participant - removeParticipant (call_id); - - processRemainingParticipant (current_call_id, conf); - } - } else { + // Direct IP to IP call + if (getConfigFromCall(call_id) == Call::IPtoIP) { + returnValue = SIPVoIPLink::instance(AccountNULL)-> transfer(call_id, to); + } + // Classic call, attached to an account + else { - _debug("Do not Particip to a conference\n"); + accountid = getAccountFromCall(call_id); - // we are not participating to a conference, current call switched to "" - if (!isConference (current_call_id)) - switchCall (""); - } + if (accountid == AccountNULL) { + _warn ("Manager: Call doesn't exists"); + return false; + } - /* Direct IP to IP call */ - if (getConfigFromCall (call_id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)-> transfer (call_id, to); - } - /* Classic call, attached to an account */ - else { - accountid = getAccountFromCall (call_id); + returnValue = getAccountLink(accountid)->transfer(call_id, to); - if (accountid == AccountNULL) { - _debug ("! Manager Transfer Call: Call doesn't exists"); - return false; - } + } - returnValue = getAccountLink (accountid)->transfer (call_id, to); + // remove waiting call in case we make transfer without even answer + removeWaitingCall(call_id); - removeCallAccount (call_id); - } + return returnValue; +} - removeWaitingCall (call_id); +void ManagerImpl::transferFailed () { - if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HUNGUP"); + _debug("UserAgent: Transfer failed"); - return returnValue; + if (_dbus) + _dbus->getCallManager()->transferFailed(); } -void ManagerImpl::transferFailed() -{ - if (_dbus) _dbus->getCallManager()->transferFailed(); -} +void ManagerImpl::transferSucceded () { -void ManagerImpl::transferSucceded() -{ - if (_dbus) _dbus->getCallManager()->transferSucceded(); + _debug("UserAgent: Transfer succeded"); -} + if (_dbus) + _dbus->getCallManager()->transferSucceded(); +} //THREAD=Main : Call:Incoming -bool -ManagerImpl::refuseCall (const CallID& id) -{ - AccountID accountid; - bool returnValue; - - CallID current_call_id = getCurrentCallId(); +bool ManagerImpl::refuseCall (const CallID& id) { + AccountID accountid; + bool returnValue; - stopTone (); + _debug("Manager: Refuse call %s", id.c_str()); + CallID current_call_id = getCurrentCallId(); - int nbCalls = getCallList().size(); + stopTone(); - // AudioLayer* audiolayer = getAudioDriver(); + int nbCalls = getCallList().size(); - if (nbCalls <= 1) { - _debug (" hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls); + // AudioLayer* audiolayer = getAudioDriver(); - AudioLayer* audiolayer = getAudioDriver(); - audiolayer->stopStream(); - } + if (nbCalls <= 1) { + _debug (" refuseCall: stop audio stream, there is only %i call(s) remaining", nbCalls); - /* Direct IP to IP call */ - - if (getConfigFromCall (id) == Call::IPtoIP) { - returnValue = SIPVoIPLink::instance (AccountNULL)-> refuse (id); - } + AudioLayer* audiolayer = getAudioDriver(); + audiolayer->stopStream(); + } - /* Classic call, attached to an account */ - else { - accountid = getAccountFromCall (id); + _debug("OK"); - if (accountid == AccountNULL) { - _debug ("! Manager OffHold Call: Call doesn't exists"); - return false; - } + /* Direct IP to IP call */ - returnValue = getAccountLink (accountid)->refuse (id); + if (getConfigFromCall(id) == Call::IPtoIP) { + returnValue = SIPVoIPLink::instance(AccountNULL)-> refuse(id); + } - removeCallAccount (id); - } + /* Classic call, attached to an account */ + else { + accountid = getAccountFromCall(id); - // if the call was outgoing or established, we didn't refuse it - // so the method did nothing - if (returnValue) { - removeWaitingCall (id); + if (accountid == AccountNULL) { + _warn ("Manager: Call doesn't exists"); + return false; + } - if (_dbus) _dbus->getCallManager()->callStateChanged (id, "HUNGUP"); + returnValue = getAccountLink(accountid)->refuse(id); - // if(current_call_id.compare("") != 0) - // switchCall (""); - } + removeCallAccount(id); + } + _debug("OK"); + // if the call was outgoing or established, we didn't refuse it + // so the method did nothing + if (returnValue) { + removeWaitingCall(id); + if (_dbus) + _dbus->getCallManager()->callStateChanged(id, "HUNGUP"); + } - return returnValue; + return returnValue; } - Conference* -ManagerImpl::createConference (const CallID& id1, const CallID& id2) -{ - _debug ("ManagerImpl::createConference()"); +ManagerImpl::createConference (const CallID& id1, const CallID& id2) { + _debug ("ManagerImpl::createConference()"); - Conference* conf = new Conference(); + Conference* conf = new Conference(); - // _conferencecall.insert(pair<CallID, Conference*>(id1, conf)); - // _conferencecall.insert(pair<CallID, Conference*>(id2, conf)); - _conferencemap.insert (pair<CallID, Conference*> (conf->getConfID(), conf)); + // _conferencecall.insert(pair<CallID, Conference*>(id1, conf)); + // _conferencecall.insert(pair<CallID, Conference*>(id2, conf)); + _conferencemap.insert(pair<CallID, Conference*> (conf->getConfID(), conf)); - conf->add (id1); - conf->add (id2); + conf->add(id1); + conf->add(id2); - // broadcast a signal over dbus - _dbus->getCallManager()->conferenceCreated (conf->getConfID()); + // broadcast a signal over dbus + _dbus->getCallManager()->conferenceCreated(conf->getConfID()); - return conf; + return conf; } -void -ManagerImpl::removeConference (const ConfID& conference_id) -{ - - _debug ("ManagerImpl::removeConference(%s)", conference_id.c_str()); +void ManagerImpl::removeConference (const ConfID& conference_id) { - Conference* conf = NULL; + _debug ("ManagerImpl::removeConference(%s)", conference_id.c_str()); - _debug (" removeConference: _conferencemap.size: %i", (int) _conferencemap.size()); - ConferenceMap::iterator iter = _conferencemap.find (conference_id); + Conference* conf = NULL; - if (iter != _conferencemap.end()) { - _debug (" removeConference: Found conference id %s in conferencemap", conference_id.c_str()); - conf = iter->second; - } + _debug (" removeConference: _conferencemap.size: %i", (int) _conferencemap.size()); + ConferenceMap::iterator iter = _conferencemap.find(conference_id); - if (conf == NULL) { + if (iter != _conferencemap.end()) { + _debug (" removeConference: Found conference id %s in conferencemap", conference_id.c_str()); + conf = iter->second; + } - _debug (" removeConference: Error conference not found"); - return; - } + if (conf == NULL) { + _debug (" removeConference: Error conference not found"); + return; + } - // We now need to bind the audio to the remain participant + // We now need to bind the audio to the remain participant - // unbind main participant from conference (just to be sure) - _audiodriver->getMainBuffer()->unBindAll (default_id); + // unbind main participant from conference (just to be sure) + _audiodriver->getMainBuffer()->unBindAll(default_id); - ParticipantSet participants = conf->getParticipantList(); + ParticipantSet participants = conf->getParticipantList(); - // bind main participant to remaining conference call - ParticipantSet::iterator iter_p = participants.begin(); + // bind main participant to remaining conference call + ParticipantSet::iterator iter_p = participants.begin(); - if (iter_p != participants.end()) { + if (iter_p != participants.end()) { - // to avoid puting onhold the call - // switchCall(""); - _audiodriver->getMainBuffer()->bindCallID (*iter_p, default_id); - } + // to avoid puting onhold the call + // switchCall(""); + _audiodriver->getMainBuffer()->bindCallID(*iter_p, default_id); + } - // Then remove the conference from the conference map - _debug ("ManagerImpl:: remove conference %s", conference_id.c_str()); + // Then remove the conference from the conference map + _debug ("ManagerImpl:: remove conference %s", conference_id.c_str()); - if (_conferencemap.erase (conference_id) == 1) - _debug ("ManagerImpl:: conference %s removed succesfully", conference_id.c_str()); - else - _debug ("ManagerImpl:: error cannot remove conference id: %s", conference_id.c_str()); + if (_conferencemap.erase(conference_id) == 1) + _debug ("ManagerImpl:: conference %s removed succesfully", conference_id.c_str()); + else + _debug ("ManagerImpl:: error cannot remove conference id: %s", conference_id.c_str()); - // broadcast a signal over dbus - _debug ("ManagerImpl::removeConference broadcast call removed on dbus: %s", conference_id.c_str()); + // broadcast a signal over dbus + _debug ("ManagerImpl::removeConference broadcast call removed on dbus: %s", conference_id.c_str()); - _dbus->getCallManager()->conferenceRemoved (conference_id); + _dbus->getCallManager()->conferenceRemoved(conference_id); } - Conference* -ManagerImpl::getConferenceFromCallID (const CallID& call_id) -{ - AccountID account_id; - Call* call = NULL; +ManagerImpl::getConferenceFromCallID (const CallID& call_id) { + AccountID account_id; + Call* call = NULL; - account_id = getAccountFromCall (call_id); - call = getAccountLink (account_id)->getCall (call_id); + account_id = getAccountFromCall(call_id); + call = getAccountLink(account_id)->getCall(call_id); - ConferenceMap::iterator iter = _conferencemap.find (call->getConfId()); + ConferenceMap::iterator iter = _conferencemap.find(call->getConfId()); - if (iter != _conferencemap.end()) { - return iter->second; - } else { - return NULL; - } + if (iter != _conferencemap.end()) { + return iter->second; + } else { + return NULL; + } } -void -ManagerImpl::holdConference (const CallID& id) -{ - _debug ("ManagerImpl::holdConference()"); +void ManagerImpl::holdConference (const CallID& id) { + _debug ("ManagerImpl::holdConference()"); - Conference *conf; - ConferenceMap::iterator iter_conf = _conferencemap.find (id); + Conference *conf; + ConferenceMap::iterator iter_conf = _conferencemap.find(id); - AccountID currentAccountId; + AccountID currentAccountId; - Call* call = NULL; + Call* call = NULL; - if (iter_conf != _conferencemap.end()) { - conf = iter_conf->second; + if (iter_conf != _conferencemap.end()) { + conf = iter_conf->second; - ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet participants = conf->getParticipantList(); + ParticipantSet::iterator iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - _debug (" holdConference: participant %s", (*iter_participant).c_str()); - currentAccountId = getAccountFromCall (*iter_participant); - call = getAccountLink (currentAccountId)->getCall (*iter_participant); + while (iter_participant != participants.end()) { + _debug (" holdConference: participant %s", (*iter_participant).c_str()); + currentAccountId = getAccountFromCall(*iter_participant); + call = getAccountLink(currentAccountId)->getCall(*iter_participant); - switchCall (*iter_participant); - onHoldCall (*iter_participant); + switchCall(*iter_participant); + onHoldCall(*iter_participant); - iter_participant++; + iter_participant++; - } - - conf->setState (Conference::Hold); - - _dbus->getCallManager()->conferenceChanged (conf->getConfID(), conf->getStateStr()); - - } + } + conf->setState(Conference::Hold); + _dbus->getCallManager()->conferenceChanged(conf->getConfID(), + conf->getStateStr()); + } } +void ManagerImpl::unHoldConference (const CallID& id) { -void -ManagerImpl::unHoldConference (const CallID& id) -{ - - _debug ("ManagerImpl::unHoldConference()"); + _debug ("ManagerImpl::unHoldConference()"); - Conference *conf; - ConferenceMap::iterator iter_conf = _conferencemap.find (id); + Conference *conf; + ConferenceMap::iterator iter_conf = _conferencemap.find(id); - AccountID currentAccountId; + AccountID currentAccountId; - Call* call = NULL; + Call* call = NULL; - if (iter_conf != _conferencemap.end()) { - conf = iter_conf->second; + if (iter_conf != _conferencemap.end()) { + conf = iter_conf->second; - ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet participants = conf->getParticipantList(); + ParticipantSet::iterator iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - _debug (" unholdConference: participant %s", (*iter_participant).c_str()); - currentAccountId = getAccountFromCall (*iter_participant); - call = getAccountLink (currentAccountId)->getCall (*iter_participant); + while (iter_participant != participants.end()) { + _debug (" unholdConference: participant %s", (*iter_participant).c_str()); + currentAccountId = getAccountFromCall(*iter_participant); + call = getAccountLink(currentAccountId)->getCall(*iter_participant); - offHoldCall (*iter_participant); + offHoldCall(*iter_participant); - iter_participant++; + iter_participant++; - } + } - conf->setState (Conference::Active_Atached); + conf->setState(Conference::Active_Atached); - _dbus->getCallManager()->conferenceChanged (conf->getConfID(), conf->getStateStr()); + _dbus->getCallManager()->conferenceChanged(conf->getConfID(), + conf->getStateStr()); - } + } } -bool -ManagerImpl::isConference (const CallID& id) -{ - ConferenceMap::iterator iter = _conferencemap.find (id); +bool ManagerImpl::isConference (const CallID& id) { + ConferenceMap::iterator iter = _conferencemap.find(id); - if (iter == _conferencemap.end()) { - return false; - } else { - return true; - } + if (iter == _conferencemap.end()) { + return false; + } else { + return true; + } } -bool -ManagerImpl::participToConference (const CallID& call_id) -{ +bool ManagerImpl::participToConference (const CallID& call_id) { - AccountID accountId; + AccountID accountId; - Call* call = NULL; + Call* call = NULL; - accountId = getAccountFromCall (call_id); - call = getAccountLink (accountId)->getCall (call_id); + accountId = getAccountFromCall(call_id); + call = getAccountLink(accountId)->getCall(call_id); - if (call == NULL) { - return false; + if (call == NULL) { + return false; - } + } - if (call->getConfId() == "") { - return false; - } else { - - return true; - } -} + if (call->getConfId() == "") { + return false; + } else { + return true; + } +} -void -ManagerImpl::addParticipant (const CallID& call_id, const CallID& conference_id) -{ - _debug ("ManagerImpl::addParticipant(%s, %s)", call_id.c_str(), conference_id.c_str()); +void ManagerImpl::addParticipant (const CallID& call_id, + const CallID& conference_id) { + _debug ("ManagerImpl::addParticipant(%s, %s)", call_id.c_str(), conference_id.c_str()); - std::map<std::string, std::string> call_details = getCallDetails (call_id); + std::map<std::string, std::string> call_details = getCallDetails(call_id); - ConferenceMap::iterator iter = _conferencemap.find (conference_id); - std::map<std::string, std::string>::iterator iter_details; + ConferenceMap::iterator iter = _conferencemap.find(conference_id); + std::map<std::string, std::string>::iterator iter_details; - // store the current call id (it will change in offHoldCall or in answerCall) - CallID current_call_id = getCurrentCallId(); + // store the current call id (it will change in offHoldCall or in answerCall) + CallID current_call_id = getCurrentCallId(); - // detach from the conference and switch to this conference + // detach from the conference and switch to this conference - if (current_call_id != call_id) { - if (isConference (current_call_id)) { - detachParticipant (default_id, current_call_id); - } else - onHoldCall (current_call_id); - } + if (current_call_id != call_id) { + if (isConference(current_call_id)) { + detachParticipant(default_id, current_call_id); + } else + onHoldCall(current_call_id); + } - // TODO: remove this ugly hack => There should be different calls when double clicking - // a conference to add main participant to it, or (in this case) adding a participant - // toconference - switchCall (""); + // TODO: remove this ugly hack => There should be different calls when double clicking + // a conference to add main participant to it, or (in this case) adding a participant + // toconference + switchCall(""); - addMainParticipant (conference_id); + addMainParticipant(conference_id); - _debug (" addParticipant: enter main process"); + _debug (" addParticipant: enter main process"); - if (iter != _conferencemap.end()) { + if (iter != _conferencemap.end()) { - Conference* conf = iter->second; - switchCall (conf->getConfID()); + Conference* conf = iter->second; + switchCall(conf->getConfID()); - AccountID currentAccountId; - Call* call = NULL; + AccountID currentAccountId; + Call* call = NULL; - currentAccountId = getAccountFromCall (call_id); - call = getAccountLink (currentAccountId)->getCall (call_id); - call->setConfId (conf->getConfID()); + currentAccountId = getAccountFromCall(call_id); + call = getAccountLink(currentAccountId)->getCall(call_id); + call->setConfId(conf->getConfID()); - conf->add (call_id); + conf->add(call_id); - iter_details = call_details.find ("CALL_STATE"); + iter_details = call_details.find("CALL_STATE"); - _debug (" addParticipant: call state: %s", iter_details->second.c_str()); + _debug (" addParticipant: call state: %s", iter_details->second.c_str()); - if (iter_details->second == "HOLD") { - _debug (" OFFHOLD %s", call_id.c_str()); + if (iter_details->second == "HOLD") { + _debug (" OFFHOLD %s", call_id.c_str()); - // offHoldCall create a new rtp session which use addStream to bind participant - offHoldCall (call_id); - } else if (iter_details->second == "INCOMING") { - _debug (" ANSWER %s", call_id.c_str()); - // answerCall create a new rtp session which use addStream to bind participant - answerCall (call_id); - } else if (iter_details->second == "CURRENT") { - // Already a curent call, so we beed to reset audio stream bindings manually - _audiodriver->getMainBuffer()->unBindAll (call_id); - conf->bindParticipant (call_id); - } + // offHoldCall create a new rtp session which use addStream to bind participant + offHoldCall(call_id); + } else if (iter_details->second == "INCOMING") { + _debug (" ANSWER %s", call_id.c_str()); + // answerCall create a new rtp session which use addStream to bind participant + answerCall(call_id); + } else if (iter_details->second == "CURRENT") { + // Already a curent call, so we beed to reset audio stream bindings manually + _audiodriver->getMainBuffer()->unBindAll(call_id); + conf->bindParticipant(call_id); + } - // _dbus->getCallManager()->conferenceChanged(conference_id, conf->getStateStr()); + // _dbus->getCallManager()->conferenceChanged(conference_id, conf->getStateStr()); - ParticipantSet participants = conf->getParticipantList(); + ParticipantSet participants = conf->getParticipantList(); - // reset ring buffer for all conference participant - ParticipantSet::iterator iter_p = participants.begin(); + // reset ring buffer for all conference participant + ParticipantSet::iterator iter_p = participants.begin(); - while (iter_p != participants.end()) { + while (iter_p != participants.end()) { - // flush conference participants only - _audiodriver->getMainBuffer()->flush (*iter_p); + // flush conference participants only + _audiodriver->getMainBuffer()->flush(*iter_p); - iter_p++; - } + iter_p++; + } - _audiodriver->getMainBuffer()->flush (default_id); - } else { - _debug (" addParticipant: Error, conference %s conference_id not found!", conference_id.c_str()); - } + _audiodriver->getMainBuffer()->flush(default_id); + } else { + _debug (" addParticipant: Error, conference %s conference_id not found!", conference_id.c_str()); + } } -void -ManagerImpl::addMainParticipant (const CallID& conference_id) -{ - if (hasCurrentCall()) { - CallID current_call_id = getCurrentCallId(); +void ManagerImpl::addMainParticipant (const CallID& conference_id) { + if (hasCurrentCall()) { + CallID current_call_id = getCurrentCallId(); - if (isConference (current_call_id)) { - detachParticipant (default_id, current_call_id); - } else { - onHoldCall (current_call_id); - } - } + if (isConference(current_call_id)) { + detachParticipant(default_id, current_call_id); + } else { + onHoldCall(current_call_id); + } + } - ConferenceMap::iterator iter = _conferencemap.find (conference_id); + ConferenceMap::iterator iter = _conferencemap.find(conference_id); - Conference *conf = NULL; + Conference *conf = NULL; - if (iter != _conferencemap.end()) { - conf = iter->second; + if (iter != _conferencemap.end()) { + conf = iter->second; - ParticipantSet participants = conf->getParticipantList(); + ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet::iterator iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - _audiodriver->getMainBuffer()->bindCallID (*iter_participant, default_id); + while (iter_participant != participants.end()) { + _audiodriver->getMainBuffer()->bindCallID(*iter_participant, + default_id); - iter_participant++; - } + iter_participant++; + } - // Reset ringbuffer's readpointers - iter_participant = participants.begin(); + // Reset ringbuffer's readpointers + iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - _audiodriver->getMainBuffer()->flush (*iter_participant); + while (iter_participant != participants.end()) { + _audiodriver->getMainBuffer()->flush(*iter_participant); - iter_participant++; - } + iter_participant++; + } - _audiodriver->getMainBuffer()->flush (default_id); + _audiodriver->getMainBuffer()->flush(default_id); - conf->setState (Conference::Active_Atached); + conf->setState(Conference::Active_Atached); - _dbus->getCallManager()->conferenceChanged (conference_id, conf->getStateStr()); + _dbus->getCallManager()->conferenceChanged(conference_id, + conf->getStateStr()); - } + } - switchCall (conference_id); + switchCall(conference_id); } +void ManagerImpl::joinParticipant (const CallID& call_id1, + const CallID& call_id2) { + _debug ("ManagerImpl::joinParticipant(%s, %s)", call_id1.c_str(), call_id2.c_str()); + // _debug(" Current call ID %s", getCurrentCallId().c_str()); -void -ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id2) -{ - _debug ("ManagerImpl::joinParticipant(%s, %s)", call_id1.c_str(), call_id2.c_str()); - // _debug(" Current call ID %s", getCurrentCallId().c_str()); - - std::map<std::string, std::string> call1_details = getCallDetails (call_id1); - std::map<std::string, std::string> call2_details = getCallDetails (call_id2); - - std::map<std::string, std::string>::iterator iter_details; - - AccountID currentAccountId; - Call* call = NULL; - - CallID current_call_id = getCurrentCallId(); - _debug (" joinParticipant: current_call_id %s", current_call_id.c_str()); + std::map<std::string, std::string> call1_details = getCallDetails(call_id1); + std::map<std::string, std::string> call2_details = getCallDetails(call_id2); + std::map<std::string, std::string>::iterator iter_details; - // detach from the conference and switch to this conference + AccountID currentAccountId; + Call* call = NULL; - if ( (current_call_id != call_id1) && (current_call_id != call_id2)) { - if (isConference (current_call_id)) - detachParticipant (default_id, current_call_id); - else - onHoldCall (current_call_id); - } + CallID current_call_id = getCurrentCallId(); + _debug (" joinParticipant: current_call_id %s", current_call_id.c_str()); - _debug (" joinParticipant: create a conference"); + // detach from the conference and switch to this conference - Conference *conf = createConference (call_id1, call_id2); - switchCall (conf->getConfID()); - - currentAccountId = getAccountFromCall (call_id1); - call = getAccountLink (currentAccountId)->getCall (call_id1); - call->setConfId (conf->getConfID()); - - iter_details = call1_details.find ("CALL_STATE"); - _debug (" joinParticipant: call1 %s state: %s", call_id1.c_str(), iter_details->second.c_str()); - - if (iter_details->second == "HOLD") { - _debug (" OFFHOLD %s", call_id1.c_str()); - offHoldCall (call_id1); - } else if (iter_details->second == "INCOMING") { - _debug (" ANSWER %s", call_id1.c_str()); - answerCall (call_id1); - } else if (iter_details->second == "CURRENT") { - _debug (" CURRENT %s", call_id1.c_str()); - _audiodriver->getMainBuffer()->unBindAll (call_id1); - conf->bindParticipant (call_id1); - } else if (iter_details->second == "INACTIVE") { - _debug (" INACTIVE %s", call_id1.c_str()); - answerCall (call_id1); - } else { - _debug (" CAll State not recognized"); - } - - currentAccountId = getAccountFromCall (call_id2); - - call = getAccountLink (currentAccountId)->getCall (call_id2); - call->setConfId (conf->getConfID()); + if ((current_call_id != call_id1) && (current_call_id != call_id2)) { + if (isConference(current_call_id)) + detachParticipant(default_id, current_call_id); + else + onHoldCall(current_call_id); + } - iter_details = call2_details.find ("CALL_STATE"); - _debug (" joinParticipant: call2 %s state: %s", call_id2.c_str(), iter_details->second.c_str()); + _debug (" joinParticipant: create a conference"); + + Conference *conf = createConference(call_id1, call_id2); + switchCall(conf->getConfID()); + + currentAccountId = getAccountFromCall(call_id1); + call = getAccountLink(currentAccountId)->getCall(call_id1); + call->setConfId(conf->getConfID()); + + iter_details = call1_details.find("CALL_STATE"); + _debug (" joinParticipant: call1 %s state: %s", call_id1.c_str(), iter_details->second.c_str()); + + if (iter_details->second == "HOLD") { + _debug (" OFFHOLD %s", call_id1.c_str()); + offHoldCall(call_id1); + } else if (iter_details->second == "INCOMING") { + _debug (" ANSWER %s", call_id1.c_str()); + answerCall(call_id1); + } else if (iter_details->second == "CURRENT") { + _debug (" CURRENT %s", call_id1.c_str()); + _audiodriver->getMainBuffer()->unBindAll(call_id1); + conf->bindParticipant(call_id1); + } else if (iter_details->second == "INACTIVE") { + _debug (" INACTIVE %s", call_id1.c_str()); + answerCall(call_id1); + } else { + _debug (" CAll State not recognized"); + } - if (iter_details->second == "HOLD") { - _debug (" OFFHOLD %s", call_id2.c_str()); - offHoldCall (call_id2); - } else if (iter_details->second == "INCOMING") { - _debug (" ANSWER %s", call_id2.c_str()); - answerCall (call_id2); - } else if (iter_details->second == "CURRENT") { - _debug (" CURRENT %s", call_id2.c_str()); - _audiodriver->getMainBuffer()->unBindAll (call_id2); - conf->bindParticipant (call_id2); - } else if (iter_details->second == "INACTIVE") { - _debug (" INACTIVE %s", call_id2.c_str()); - answerCall (call_id2); - } else { - _debug (" CAll State not recognized"); - } + currentAccountId = getAccountFromCall(call_id2); + + call = getAccountLink(currentAccountId)->getCall(call_id2); + call->setConfId(conf->getConfID()); + + iter_details = call2_details.find("CALL_STATE"); + _debug (" joinParticipant: call2 %s state: %s", call_id2.c_str(), iter_details->second.c_str()); + + if (iter_details->second == "HOLD") { + _debug (" OFFHOLD %s", call_id2.c_str()); + offHoldCall(call_id2); + } else if (iter_details->second == "INCOMING") { + _debug (" ANSWER %s", call_id2.c_str()); + answerCall(call_id2); + } else if (iter_details->second == "CURRENT") { + _debug (" CURRENT %s", call_id2.c_str()); + _audiodriver->getMainBuffer()->unBindAll(call_id2); + conf->bindParticipant(call_id2); + } else if (iter_details->second == "INACTIVE") { + _debug (" INACTIVE %s", call_id2.c_str()); + answerCall(call_id2); + } else { + _debug (" CAll State not recognized"); + } - // finally bind main participant to conference - // addMainParticipant(default_conf); + // finally bind main participant to conference + // addMainParticipant(default_conf); - // switchCall(conf->getConfID()); + // switchCall(conf->getConfID()); - if (_audiodriver) - _audiodriver->getMainBuffer()->stateInfo(); + if (_audiodriver) + _audiodriver->getMainBuffer()->stateInfo(); } +void ManagerImpl::detachParticipant (const CallID& call_id, + const CallID& current_id) { + _debug ("ManagerImpl::detachParticipant(%s)", call_id.c_str()); -void -ManagerImpl::detachParticipant (const CallID& call_id, const CallID& current_id) -{ - _debug ("ManagerImpl::detachParticipant(%s)", call_id.c_str()); - - CallID current_call_id = current_id; + CallID current_call_id = current_id; - current_call_id = getCurrentCallId(); + current_call_id = getCurrentCallId(); - if (call_id != default_id) { - AccountID currentAccountId; - Call* call = NULL; + if (call_id != default_id) { + AccountID currentAccountId; + Call* call = NULL; - currentAccountId = getAccountFromCall (call_id); - call = getAccountLink (currentAccountId)->getCall (call_id); + currentAccountId = getAccountFromCall(call_id); + call = getAccountLink(currentAccountId)->getCall(call_id); - // TODO: add conference_id as a second parameter - ConferenceMap::iterator iter = _conferencemap.find (call->getConfId()); + // TODO: add conference_id as a second parameter + ConferenceMap::iterator iter = _conferencemap.find(call->getConfId()); - Conference *conf = getConferenceFromCallID (call_id); + Conference *conf = getConferenceFromCallID(call_id); - if (conf != NULL) { + if (conf != NULL) { - _debug (" detachParticipant: detaching participant %s", call_id.c_str()); + _debug (" detachParticipant: detaching participant %s", call_id.c_str()); - std::map<std::string, std::string> call_details = getCallDetails (call_id); - std::map<std::string, std::string>::iterator iter_details; + std::map<std::string, std::string> call_details = getCallDetails( + call_id); + std::map<std::string, std::string>::iterator iter_details; - iter_details = call_details.find ("CALL_STATE"); + iter_details = call_details.find("CALL_STATE"); - if (iter_details->second == "RINGING") { - removeParticipant (call_id); - } else { - _debug (" ONHOLD %s", call_id.c_str()); - onHoldCall (call_id); + if (iter_details->second == "RINGING") { + removeParticipant(call_id); + } else { + _debug (" ONHOLD %s", call_id.c_str()); + onHoldCall(call_id); - removeParticipant (call_id); + removeParticipant(call_id); - processRemainingParticipant (current_call_id, conf); - } - } else { + processRemainingParticipant(current_call_id, conf); + } + } else { + _debug (" detachParticipant: call is not conferencing, cannot detach"); - _debug (" detachParticipant: call is not conferencing, cannot detach"); + } + } else { + _debug (" detachParticipant: unbind main participant from all"); + _audiodriver->getMainBuffer()->unBindAll(default_id); - } - } else { - _debug (" detachParticipant: unbind main participant from all"); - _audiodriver->getMainBuffer()->unBindAll (default_id); + if (isConference(current_call_id)) { - if (isConference (current_call_id)) { + ConferenceMap::iterator iter = _conferencemap.find(current_call_id); + Conference *conf = iter->second; - ConferenceMap::iterator iter = _conferencemap.find (current_call_id); - Conference *conf = iter->second; + conf->setState(Conference::Active_Detached); - conf->setState (Conference::Active_Detached); + _dbus->getCallManager()->conferenceChanged(conf->getConfID(), + conf->getStateStr()); + } - _dbus->getCallManager()->conferenceChanged (conf->getConfID(), conf->getStateStr()); - } + switchCall(""); - switchCall (""); - - } + } } +void ManagerImpl::removeParticipant (const CallID& call_id) { + _debug ("ManagerImpl::removeParticipant(%s)", call_id.c_str()); -void -ManagerImpl::removeParticipant (const CallID& call_id) -{ - _debug ("ManagerImpl::removeParticipant(%s)", call_id.c_str()); - - // TODO: add conference_id as a second parameter - Conference* conf; + // TODO: add conference_id as a second parameter + Conference* conf; - AccountID currentAccountId; - Call* call = NULL; + AccountID currentAccountId; + Call* call = NULL; - // this call is no more a conference participant - currentAccountId = getAccountFromCall (call_id); - call = getAccountLink (currentAccountId)->getCall (call_id); + // this call is no more a conference participant + currentAccountId = getAccountFromCall(call_id); + call = getAccountLink(currentAccountId)->getCall(call_id); - ConferenceMap conf_map = _conferencemap; - ConferenceMap::iterator iter = conf_map.find (call->getConfId()); + ConferenceMap conf_map = _conferencemap; + ConferenceMap::iterator iter = conf_map.find(call->getConfId()); - if (iter == conf_map.end()) { - _debug (" no conference created, cannot remove participant "); - } else { + if (iter == conf_map.end()) { + _debug (" no conference created, cannot remove participant "); + } else { - conf = iter->second; + conf = iter->second; - _debug (" removeParticipant %s", call_id.c_str()); - conf->remove (call_id); - call->setConfId (""); + _debug (" removeParticipant %s", call_id.c_str()); + conf->remove(call_id); + call->setConfId(""); - } + } - if (_audiodriver) - _audiodriver->getMainBuffer()->stateInfo(); + if (_audiodriver) + _audiodriver->getMainBuffer()->stateInfo(); } +void ManagerImpl::processRemainingParticipant (CallID current_call_id, + Conference *conf) { -void -ManagerImpl::processRemainingParticipant (CallID current_call_id, Conference *conf) -{ - - _debug ("ManagerImpl::processRemainingParticipant()"); + _debug ("ManagerImpl::processRemainingParticipant()"); - if (conf->getNbParticipants() > 1) { + if (conf->getNbParticipants() > 1) { - ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet participants = conf->getParticipantList(); + ParticipantSet::iterator iter_participant = participants.begin(); - // Reset ringbuffer's readpointers - iter_participant = participants.begin(); + // Reset ringbuffer's readpointers + iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - _audiodriver->getMainBuffer()->flush (*iter_participant); + while (iter_participant != participants.end()) { + _audiodriver->getMainBuffer()->flush(*iter_participant); - iter_participant++; - } + iter_participant++; + } - _audiodriver->getMainBuffer()->flush (default_id); + _audiodriver->getMainBuffer()->flush(default_id); - } else if (conf->getNbParticipants() == 1) { - AccountID currentAccountId; - Call* call = NULL; + } else if (conf->getNbParticipants() == 1) { + AccountID currentAccountId; + Call* call = NULL; - ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet participants = conf->getParticipantList(); + ParticipantSet::iterator iter_participant = participants.begin(); - // bind main participant to remaining conference call + // bind main participant to remaining conference call - if (iter_participant != participants.end()) { + if (iter_participant != participants.end()) { - // this call is no more a conference participant - currentAccountId = getAccountFromCall (*iter_participant); - call = getAccountLink (currentAccountId)->getCall (*iter_participant); - call->setConfId (""); + // this call is no more a conference participant + currentAccountId = getAccountFromCall(*iter_participant); + call = getAccountLink(currentAccountId)->getCall(*iter_participant); + call->setConfId(""); - // if we are not listening to this conference + // if we are not listening to this conference - if (current_call_id != conf->getConfID()) { - onHoldCall (call->getCallId()); - } else { - switchCall (*iter_participant); - } - } + if (current_call_id != conf->getConfID()) { + onHoldCall(call->getCallId()); + } else { + switchCall(*iter_participant); + } + } - removeConference (conf->getConfID()); - } else { - removeConference (conf->getConfID()); + removeConference(conf->getConfID()); + } else { + removeConference(conf->getConfID()); - switchCall (""); - } + switchCall(""); + } } -void -ManagerImpl::joinConference (const CallID& conf_id1, const CallID& conf_id2) -{ - _debug ("ManagerImpl::joinConference(%s, %s)", conf_id1.c_str(), conf_id2.c_str()); +void ManagerImpl::joinConference (const CallID& conf_id1, + const CallID& conf_id2) { + _debug ("ManagerImpl::joinConference(%s, %s)", conf_id1.c_str(), conf_id2.c_str()); - ConferenceMap::iterator iter; + ConferenceMap::iterator iter; - Conference *conf1 = NULL; - Conference *conf2 = NULL; + Conference *conf1 = NULL; + Conference *conf2 = NULL; - iter = _conferencemap.find (conf_id1); + iter = _conferencemap.find(conf_id1); - if (iter != _conferencemap.end()) - conf1 = iter->second; + if (iter != _conferencemap.end()) + conf1 = iter->second; - iter = _conferencemap.find (conf_id2); + iter = _conferencemap.find(conf_id2); - if (iter != _conferencemap.end()) - conf2 = iter->second; + if (iter != _conferencemap.end()) + conf2 = iter->second; - ParticipantSet participants = conf1->getParticipantList(); + ParticipantSet participants = conf1->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + ParticipantSet::iterator iter_participant = participants.begin(); - while (iter_participant != participants.end()) { - detachParticipant (*iter_participant, ""); - addParticipant (*iter_participant, conf_id2); + while (iter_participant != participants.end()) { + detachParticipant(*iter_participant, ""); + addParticipant(*iter_participant, conf_id2); - iter_participant++; - } + iter_participant++; + } - // detachParticipant(default_id, ""); + // detachParticipant(default_id, ""); } -void -ManagerImpl::addStream (const CallID& call_id) -{ - _debug ("ManagerImpl::addStream %s", call_id.c_str()); +void ManagerImpl::addStream (const CallID& call_id) { + _debug ("ManagerImpl::addStream %s", call_id.c_str()); - AccountID currentAccountId; - Call* call = NULL; + AccountID currentAccountId; + Call* call = NULL; - currentAccountId = getAccountFromCall (call_id); - call = getAccountLink (currentAccountId)->getCall (call_id); + currentAccountId = getAccountFromCall(call_id); + call = getAccountLink(currentAccountId)->getCall(call_id); - if (participToConference (call_id)) { + if (participToConference(call_id)) { - // bind to conference participant - ConferenceMap::iterator iter = _conferencemap.find (call->getConfId()); + // bind to conference participant + ConferenceMap::iterator iter = _conferencemap.find(call->getConfId()); - if (iter != _conferencemap.end()) { - Conference* conf = iter->second; + if (iter != _conferencemap.end()) { + Conference* conf = iter->second; + conf->bindParticipant(call_id); - conf->bindParticipant (call_id); + ParticipantSet participants = conf->getParticipantList(); + // reset ring buffer for all conference participant + ParticipantSet::iterator iter_p = participants.begin(); - ParticipantSet participants = conf->getParticipantList(); - // reset ring buffer for all conference participant - ParticipantSet::iterator iter_p = participants.begin(); + while (iter_p != participants.end()) { - while (iter_p != participants.end()) { + // to avoid puting onhold the call + // switchCall(""); + _audiodriver->getMainBuffer()->flush(*iter_p); - // to avoid puting onhold the call - // switchCall(""); - _audiodriver->getMainBuffer()->flush (*iter_p); + iter_p++; + } - iter_p++; - } + _audiodriver->getMainBuffer()->flush(default_id); + } - _audiodriver->getMainBuffer()->flush (default_id); - } + } else { - } else { + // bind to main + getAudioDriver()->getMainBuffer()->bindCallID(call_id); + // _audiodriver->getMainBuffer()->flush(default_id); + _audiodriver->flushUrgent(); + _audiodriver->flushMain(); - // bind to main - getAudioDriver()->getMainBuffer()->bindCallID (call_id); - - // _audiodriver->getMainBuffer()->flush(default_id); - _audiodriver->flushUrgent(); - _audiodriver->flushMain(); - - } + } - if (_audiodriver) - _audiodriver->getMainBuffer()->stateInfo(); + if (_audiodriver) + _audiodriver->getMainBuffer()->stateInfo(); } -void -ManagerImpl::removeStream (const CallID& call_id) -{ - _debug ("ManagerImpl::removeStream %s", call_id.c_str()); +void ManagerImpl::removeStream (const CallID& call_id) { + _debug ("ManagerImpl::removeStream %s", call_id.c_str()); - getAudioDriver()->getMainBuffer()->unBindAll (call_id); + getAudioDriver()->getMainBuffer()->unBindAll(call_id); - if (participToConference (call_id)) { - removeParticipant (call_id); - } + if (participToConference(call_id)) { + removeParticipant(call_id); + } - if (_audiodriver) - _audiodriver->getMainBuffer()->stateInfo(); + if (_audiodriver) + _audiodriver->getMainBuffer()->stateInfo(); } //THREAD=Main -bool -ManagerImpl::saveConfig (void) -{ - _debug ("Saving Configuration to XDG directory %s ... ", _path.c_str()); - setConfig (AUDIO, VOLUME_SPKR, getSpkrVolume()); - setConfig (AUDIO, VOLUME_MICRO, getMicVolume()); +bool ManagerImpl::saveConfig (void) { + _debug ("Saving Configuration to XDG directory %s ... ", _path.c_str()); + setConfig(AUDIO, VOLUME_SPKR, getSpkrVolume()); + setConfig(AUDIO, VOLUME_MICRO, getMicVolume()); - _setupLoaded = _config.saveConfigTree (_path.data()); - return _setupLoaded; + _setupLoaded = _config.saveConfigTree(_path.data()); + return _setupLoaded; } - //THREAD=Main -bool -ManagerImpl::sendDtmf (const CallID& id, char code) -{ - AccountID accountid = getAccountFromCall (id); - - if (accountid == AccountNULL) { - playDtmf (code); - return false; - } +bool ManagerImpl::sendDtmf (const CallID& id, char code) { - int sendType = getConfigInt (SIGNALISATION, SEND_DTMF_AS); + AccountID accountid = getAccountFromCall(id); - bool returnValue = false; + bool returnValue = false; - switch (sendType) { + playDtmf(code); - case 0: // SIP INFO - playDtmf (code); - returnValue = getAccountLink (accountid)->carryingDTMFdigits (id, code); - break; + CallAccountMap::iterator iter = _callAccountMap.find(id); - case 1: // Audio way - break; + // Make sure the call exist before sending DTMF, ths could be simply call dialing + if(iter != _callAccountMap.end()) + returnValue = getAccountLink(accountid)->carryingDTMFdigits(id, code); - case 2: // rfc 2833 - break; - - default: // unknown - error config? - break; - } - - return returnValue; + return returnValue; } //THREAD=Main | VoIPLink -bool -ManagerImpl::playDtmf (char code) -{ - int pulselen, layer, size; - bool ret = false; - AudioLayer *audiolayer; - SFLDataFormat *buf; - - _debug ("ManagerImpl::playDtmf"); +bool ManagerImpl::playDtmf (char code) { + int pulselen, layer, size; + bool ret = false; + AudioLayer *audiolayer; + SFLDataFormat *buf; - stopTone (); + stopTone(); - bool hasToPlayTone = getConfigBool (SIGNALISATION, PLAY_DTMF); + bool hasToPlayTone = getConfigBool(SIGNALISATION, PLAY_DTMF); - if (!hasToPlayTone) { - _debug (" playDtmf: Do not have to play a tone..."); - return false; - } - - // length in milliseconds - pulselen = getConfigInt (SIGNALISATION, PULSE_LENGTH); + if (!hasToPlayTone) { + _debug (" playDtmf: Do not have to play a tone..."); + return false; + } - if (!pulselen) { - _debug (" playDtmf: Pulse length is not set..."); - return false; - } + // length in milliseconds + pulselen = getConfigInt(SIGNALISATION, PULSE_LENGTH); - // numbers of int = length in milliseconds / 1000 (number of seconds) - // = number of seconds * SAMPLING_RATE by SECONDS - audiolayer = getAudioDriver(); + if (!pulselen) { + _debug (" playDtmf: Pulse length is not set..."); + return false; + } - layer = audiolayer->getLayerType(); + // numbers of int = length in milliseconds / 1000 (number of seconds) + // = number of seconds * SAMPLING_RATE by SECONDS + audiolayer = getAudioDriver(); - // fast return, no sound, so no dtmf - if (audiolayer==0 || _dtmfKey == 0) { - _debug (" playDtmf: Error no audio layer..."); - return false; - } + layer = audiolayer->getLayerType(); - // number of data sampling in one pulselen depends on samplerate - // size (n sampling) = time_ms * sampling/s - // --------------------- - // ms/s - size = (int) ( (pulselen * (float) audiolayer->getSampleRate()) / 1000); + // fast return, no sound, so no dtmf + if (audiolayer == 0 || _dtmfKey == 0) { + _debug (" playDtmf: Error no audio layer..."); + return false; + } - _debug ("DTMF pulselen: %i", pulselen); + // number of data sampling in one pulselen depends on samplerate + // size (n sampling) = time_ms * sampling/s + // --------------------- + // ms/s + size = (int) ((pulselen * (float) audiolayer->getSampleRate()) / 1000); + + // this buffer is for mono + // TODO <-- this should be global and hide if same size + buf = new SFLDataFormat[size]; + + // Handle dtmf + _dtmfKey->startTone(code); + + // copy the sound + if (_dtmfKey->generateDTMF(buf, size)) { + // Put buffer to urgentRingBuffer + // put the size in bytes... + // so size * 1 channel (mono) * sizeof (bytes for the data) + // audiolayer->flushUrgent(); + audiolayer->startStream(); + audiolayer->putUrgent(buf, size * sizeof(SFLDataFormat)); + } - _debug ("DTMF size: %i", size); + ret = true; - // this buffer is for mono - // TODO <-- this should be global and hide if same size - buf = new SFLDataFormat[size]; + // TODO Cache the DTMF - // Handle dtmf - _dtmfKey->startTone (code); + delete[] buf; + buf = 0; - // copy the sound - if (_dtmfKey->generateDTMF (buf, size)) { - // Put buffer to urgentRingBuffer - // put the size in bytes... - // so size * 1 channel (mono) * sizeof (bytes for the data) - // audiolayer->flushUrgent(); - audiolayer->startStream(); - audiolayer->putUrgent (buf, size * sizeof (SFLDataFormat)); - } else { - _debug (" playDtmf: Error cannot play dtmf"); - } + return ret; +} - ret = true; +// Multi-thread +bool ManagerImpl::incomingCallWaiting () { + return (_nbIncomingWaitingCall > 0) ? true : false; +} - // TODO Cache the DTMF +void ManagerImpl::addWaitingCall (const CallID& id) { - delete[] buf; - buf = 0; + ost::MutexLock m(_waitingCallMutex); + _waitingCall.insert(id); + _nbIncomingWaitingCall++; - return ret; + _info("Manager: Add waiting call %s (%d calls)", id.c_str(), _nbIncomingWaitingCall); } -// Multi-thread -bool -ManagerImpl::incomingCallWaiting() -{ - return (_nbIncomingWaitingCall > 0) ? true : false; -} +void ManagerImpl::removeWaitingCall (const CallID& id) { -void -ManagerImpl::addWaitingCall (const CallID& id) -{ - ost::MutexLock m (_waitingCallMutex); - _waitingCall.insert (id); - _nbIncomingWaitingCall++; -} + ost::MutexLock m(_waitingCallMutex); + // should return more than 1 if it erase a call -void -ManagerImpl::removeWaitingCall (const CallID& id) -{ - ost::MutexLock m (_waitingCallMutex); - // should return more than 1 if it erase a call + if (_waitingCall.erase(id)) { + _nbIncomingWaitingCall--; + } - if (_waitingCall.erase (id)) { - _nbIncomingWaitingCall--; - } + _info("Manager: Remove waiting call %s (%d calls)", id.c_str(), _nbIncomingWaitingCall); } -bool -ManagerImpl::isWaitingCall (const CallID& id) -{ - CallIDSet::iterator iter = _waitingCall.find (id); +bool ManagerImpl::isWaitingCall (const CallID& id) { + CallIDSet::iterator iter = _waitingCall.find(id); - if (iter != _waitingCall.end()) { - return false; - } + if (iter != _waitingCall.end()) { + return false; + } - return true; + return true; } /////////////////////////////////////////////////////////////////////////////// // Management of event peer IP-phone //////////////////////////////////////////////////////////////////////////////// // SipEvent Thread -bool -ManagerImpl::incomingCall (Call* call, const AccountID& accountId) -{ - PulseLayer *pulselayer; - std::string from, number, display_name, display; +bool ManagerImpl::incomingCall (Call* call, const AccountID& accountId) { - stopTone (); + std::string from, number, display_name, display; - _debug ("Incoming call %s for account %s", call->getCallId().data(), accountId.c_str()); + if(!call) + _error("Manager: Error: no call at this point"); - associateCallToAccount (call->getCallId(), accountId); + stopTone(); - // If account is null it is an ip to ip call + _debug ("Manager: Incoming call %s for account %s", call->getCallId().data(), accountId.c_str()); - if (accountId==AccountNULL) { + associateCallToAccount(call->getCallId(), accountId); - associateConfigToCall (call->getCallId(), Call::IPtoIP); - } else { - // strip sip: which is not required and bring confusion with ip to ip calls - // when placing new call from history (if call is IAX, do nothing) - std::string peerNumber = call->getPeerNumber(); - - int startIndex = peerNumber.find ("sip:"); - - // if "sip:" is found => it is not an IAX call - - if (startIndex != (int) string::npos) { - std::string strippedPeerNumber = peerNumber.substr (startIndex+4); - call->setPeerNumber (strippedPeerNumber); - } - - } - - _debug ("ManagerImpl::incomingCall :: hasCurrentCall() %i ", hasCurrentCall()); - - if (!hasCurrentCall()) { - - call->setConnectionState (Call::Ringing); - ringtone(); - // switchCall (call->getCallId()); - - } - - /* - else { - addWaitingCall(call->getCallId()); - } - */ - - addWaitingCall (call->getCallId()); - - from = call->getPeerName(); - - number = call->getPeerNumber(); + // If account is null it is an ip to ip call + if (accountId == AccountNULL) { + associateConfigToCall(call->getCallId(), Call::IPtoIP); + } + else { + // strip sip: which is not required and bring confusion with ip to ip calls + // when placing new call from history (if call is IAX, do nothing) + std::string peerNumber = call->getPeerNumber(); - display_name = call->getDisplayName(); + int startIndex = peerNumber.find("sip:"); - // _debug( "incomingCall from: %s, number: %s, display_name: %s", from.c_str(), number.c_str(), display_name.c_str()); + if (startIndex != (int) string::npos) { + std::string strippedPeerNumber = peerNumber.substr(startIndex + 4); + call->setPeerNumber(strippedPeerNumber); + } - if (from != "" && number != "") { - from.append (" <"); - from.append (number); - from.append (">"); - } else if (from.empty()) { - from.append ("<"); - from.append (number); - from.append (">"); - } + } - /* - CallIDSet::iterator iter = _waitingCall.begin(); - while (iter != _waitingCall.end()) { - CallID ident = *iter; - _debug("ManagerImpl::incomingCall :: CALL iteration: %s ",ident.c_str()); - ++iter; - } - */ + if (!hasCurrentCall()) { + _debug ("Manager: Has no current call"); - /* Broadcast a signal over DBus */ - _debug ("From: %s, Number: %s, DisplayName: %s", from.c_str(), number.c_str(), display_name.c_str()); + call->setConnectionState(Call::Ringing); + ringtone(); - display = display_name; + } + else { + _debug ("Manager: has current call"); + } - display.append (" "); + addWaitingCall(call->getCallId()); - display.append (from); + from = call->getPeerName(); + number = call->getPeerNumber(); + display_name = call->getDisplayName(); + if (from != "" && number != "") { + from.append(" <"); + from.append(number); + from.append(">"); + } else if (from.empty()) { + from.append("<"); + from.append(number); + from.append(">"); + } - if (_dbus) _dbus->getCallManager()->incomingCall (accountId, call->getCallId(), display.c_str()); + /* Broadcast a signal over DBus */ + _debug ("Manager: From: %s, Number: %s, Display Name: %s", from.c_str(), number.c_str(), display_name.c_str()); - //if (_dbus) _dbus->getCallManager()->callStateChanged(call->getCallId(), "INCOMING"); + display = display_name; + display.append(" "); + display.append(from); - if (_audiodriver->getLayerType() == PULSEAUDIO) { - pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); - } + if (_dbus) + _dbus->getCallManager()->incomingCall(accountId, call->getCallId(), display.c_str()); - return true; + return true; } //THREAD=VoIP -void -ManagerImpl::incomingMessage (const AccountID& accountId, const std::string& message) -{ - if (_dbus) { - _dbus->getCallManager()->incomingMessage (accountId, message); - } +void ManagerImpl::incomingMessage (const AccountID& accountId, + const std::string& message) { + if (_dbus) { + _dbus->getCallManager()->incomingMessage(accountId, message); + } } //THREAD=VoIP CALL=Outgoing -void -ManagerImpl::peerAnsweredCall (const CallID& id) -{ - // The if statement is usefull only if we sent two calls at the same time. - if (isCurrentCall (id)) { - stopTone (); - } +void ManagerImpl::peerAnsweredCall (const CallID& id) { + // The if statement is usefull only if we sent two calls at the same time. + if (isCurrentCall(id)) { + stopTone(); + } - if (_dbus) _dbus->getCallManager()->callStateChanged (id, "CURRENT"); + if (_dbus) + _dbus->getCallManager()->callStateChanged(id, "CURRENT"); - // std::string codecName = getCurrentCodecName (id); + // std::string codecName = getCurrentCodecName (id); - // _debug("ManagerImpl::hangupCall(): broadcast codec name %s ",codecName.c_str()); - // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); + // _debug("ManagerImpl::hangupCall(): broadcast codec name %s ",codecName.c_str()); + // if (_dbus) _dbus->getCallManager()->currentSelectedCodec (id,codecName.c_str()); - // Required if there have been no sip reinvite, in this case we must reinit buffers since the - _audiodriver->flushMain(); + // Required if there have been no sip reinvite, in this case we must reinit buffers since the + _audiodriver->flushMain(); - _audiodriver->flushUrgent(); + _audiodriver->flushUrgent(); } //THREAD=VoIP Call=Outgoing -void -ManagerImpl::peerRingingCall (const CallID& id) -{ - if (isCurrentCall (id)) { - ringback(); - } +void ManagerImpl::peerRingingCall (const CallID& id) { + if (isCurrentCall(id)) { + ringback(); + } - if (_dbus) _dbus->getCallManager()->callStateChanged (id, "RINGING"); + if (_dbus) + _dbus->getCallManager()->callStateChanged(id, "RINGING"); } //THREAD=VoIP Call=Outgoing/Ingoing -void -ManagerImpl::peerHungupCall (const CallID& call_id) -{ - PulseLayer *pulselayer; - AccountID account_id; - bool returnValue; - - _debug ("ManagerImpl::peerHungupCall(%s)", call_id.c_str()); +void ManagerImpl::peerHungupCall (const CallID& call_id) { + PulseLayer *pulselayer; + AccountID account_id; + bool returnValue; - // store the current call id - CallID current_call_id = getCurrentCallId(); + _debug ("Manager: Peer hungup call %s", call_id.c_str()); + // store the current call id + CallID current_call_id = getCurrentCallId(); - if (participToConference (call_id)) { + if (participToConference(call_id)) { - Conference *conf = getConferenceFromCallID (call_id); + Conference *conf = getConferenceFromCallID(call_id); - if (conf != NULL) { + if (conf != NULL) { - removeParticipant (call_id); + removeParticipant(call_id); - processRemainingParticipant (current_call_id, conf); - } - } else { - if (isCurrentCall (call_id)) { - stopTone (); + processRemainingParticipant(current_call_id, conf); + } + } else { + if (isCurrentCall(call_id)) { + stopTone(); - switchCall (""); - } - } - - /* Direct IP to IP call */ - if (getConfigFromCall (call_id) == Call::IPtoIP) { - SIPVoIPLink::instance (AccountNULL)->hangup (call_id); - } - - else { + switchCall(""); + } + } - account_id = getAccountFromCall (call_id); + /* Direct IP to IP call */ + if (getConfigFromCall(call_id) == Call::IPtoIP) { + SIPVoIPLink::instance(AccountNULL)->hangup(call_id); + } - if (account_id == AccountNULL) { - _debug ("peerHungupCall: Call doesn't exists"); - return; - } + else { - returnValue = getAccountLink (account_id)->peerHungup (call_id); - } + account_id = getAccountFromCall(call_id); - /* Broadcast a signal over DBus */ - if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "HUNGUP"); + returnValue = getAccountLink(account_id)->peerHungup(call_id); + } - removeWaitingCall (call_id); + /* Broadcast a signal over DBus */ + if (_dbus) + _dbus->getCallManager()->callStateChanged(call_id, "HUNGUP"); - removeCallAccount (call_id); + removeWaitingCall(call_id); - int nbCalls = getCallList().size(); + removeCallAccount(call_id); - // stop streams + int nbCalls = getCallList().size(); - if (nbCalls <= 0) { - _debug (" hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls); + // stop streams - AudioLayer* audiolayer = getAudioDriver(); - audiolayer->stopStream(); - } + if (nbCalls <= 0) { + _debug (" hangupCall: stop audio stream, ther is only %i call(s) remaining", nbCalls); + AudioLayer* audiolayer = getAudioDriver(); + audiolayer->stopStream(); + } - if (_audiodriver->getLayerType() == PULSEAUDIO) { - pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); - } + if (_audiodriver->getLayerType() == PULSEAUDIO) { + pulselayer = dynamic_cast<PulseLayer *> (getAudioDriver()); + } } //THREAD=VoIP -void -ManagerImpl::callBusy (const CallID& id) -{ - _debug ("Call busy"); +void ManagerImpl::callBusy (const CallID& id) { + _debug ("Call busy"); - if (_dbus) _dbus->getCallManager()->callStateChanged (id, "BUSY"); + if (_dbus) + _dbus->getCallManager()->callStateChanged(id, "BUSY"); - if (isCurrentCall (id)) { - playATone (Tone::TONE_BUSY); - switchCall (""); - } + if (isCurrentCall(id)) { + playATone(Tone::TONE_BUSY); + switchCall(""); + } - removeCallAccount (id); + removeCallAccount(id); - removeWaitingCall (id); + removeWaitingCall(id); } //THREAD=VoIP -void -ManagerImpl::callFailure (const CallID& call_id) -{ - if (_dbus) _dbus->getCallManager()->callStateChanged (call_id, "FAILURE"); +void ManagerImpl::callFailure (const CallID& call_id) { + if (_dbus) + _dbus->getCallManager()->callStateChanged(call_id, "FAILURE"); - if (isCurrentCall (call_id)) { - playATone (Tone::TONE_BUSY); - switchCall (""); - } + if (isCurrentCall(call_id)) { + playATone(Tone::TONE_BUSY); + switchCall(""); + } - CallID current_call_id = getCurrentCallId(); + CallID current_call_id = getCurrentCallId(); - if (participToConference (call_id)) { + if (participToConference(call_id)) { - _debug ("Call %s participating to a conference failed\n", call_id.c_str()); + _debug ("Call %s participating to a conference failed\n", call_id.c_str()); - Conference *conf = getConferenceFromCallID (call_id); + Conference *conf = getConferenceFromCallID(call_id); - if (conf != NULL) { - // remove this participant - removeParticipant (call_id); + if (conf != NULL) { + // remove this participant + removeParticipant(call_id); - processRemainingParticipant (current_call_id, conf); - } + processRemainingParticipant(current_call_id, conf); + } - } + } - removeCallAccount (call_id); + removeCallAccount(call_id); - removeWaitingCall (call_id); + removeWaitingCall(call_id); } //THREAD=VoIP -void -ManagerImpl::startVoiceMessageNotification (const AccountID& accountId, int nb_msg) -{ - if (_dbus) _dbus->getCallManager()->voiceMailNotify (accountId, nb_msg) ; +void ManagerImpl::startVoiceMessageNotification (const AccountID& accountId, + int nb_msg) { + if (_dbus) + _dbus->getCallManager()->voiceMailNotify(accountId, nb_msg); } -void ManagerImpl::connectionStatusNotification() -{ - if (_dbus != NULL) { - _dbus->getConfigurationManager()->accountsChanged(); - } +void ManagerImpl::connectionStatusNotification () { + if (_dbus != NULL) { + _dbus->getConfigurationManager()->accountsChanged(); + } } /** * Multi Thread */ -bool ManagerImpl::playATone (Tone::TONEID toneId) -{ - bool hasToPlayTone; - // AudioLoop *audioloop; - AudioLayer *audiolayer; - // unsigned int nbSamples; - - _debug ("ManagerImpl::playATone"); +bool ManagerImpl::playATone (Tone::TONEID toneId) { + bool hasToPlayTone; + // AudioLoop *audioloop; + AudioLayer *audiolayer; + // unsigned int nbSamples; - hasToPlayTone = getConfigBool (SIGNALISATION, PLAY_TONES); + _debug ("ManagerImpl::playATone"); - if (!hasToPlayTone) - return false; + hasToPlayTone = getConfigBool(SIGNALISATION, PLAY_TONES); - audiolayer = getAudioDriver(); + if (!hasToPlayTone) + return false; + audiolayer = getAudioDriver(); - if (audiolayer) { - - audiolayer->flushUrgent(); - audiolayer->startStream(); - } - - if (_telephoneTone != 0) { - _toneMutex.enterMutex(); - _telephoneTone->setCurrentTone (toneId); - _toneMutex.leaveMutex(); - /* - audioloop = getTelephoneTone(); - nbSamples = audioloop->getSize(); - SFLDataFormat buf[nbSamples]; + if (audiolayer) { + audiolayer->flushUrgent(); + audiolayer->startStream(); + } - if (audiolayer) { - audiolayer->putUrgent (buf, nbSamples); - } else - return false; - */ - } + if (_telephoneTone != 0) { + _toneMutex.enterMutex(); + _telephoneTone->setCurrentTone(toneId); + _toneMutex.leaveMutex(); + /* + audioloop = getTelephoneTone(); + nbSamples = audioloop->getSize(); + SFLDataFormat buf[nbSamples]; + + + if (audiolayer) { + audiolayer->putUrgent (buf, nbSamples); + } else + return false; + */ + } - return true; + return true; } /** * Multi Thread */ -void ManagerImpl::stopTone () -{ - bool hasToPlayTone; - - _debug ("ManagerImpl::stopTone"); +void ManagerImpl::stopTone () { + bool hasToPlayTone; - hasToPlayTone = getConfigBool (SIGNALISATION, PLAY_TONES); + hasToPlayTone = getConfigBool(SIGNALISATION, PLAY_TONES); - if (!hasToPlayTone) - return; + if (!hasToPlayTone) + return; - _toneMutex.enterMutex(); + _toneMutex.enterMutex(); - if (_telephoneTone != 0) { - _telephoneTone->setCurrentTone (Tone::TONE_NULL); - } + if (_telephoneTone != 0) { + _telephoneTone->setCurrentTone(Tone::TONE_NULL); + } - _toneMutex.leaveMutex(); + _toneMutex.leaveMutex(); - // for ringing tone.. - _toneMutex.enterMutex(); - _audiofile.stop(); - _toneMutex.leaveMutex(); + // for ringing tone.. + _toneMutex.enterMutex(); + _audiofile.stop(); + _toneMutex.leaveMutex(); } /** * Multi Thread */ -bool -ManagerImpl::playTone() -{ - playATone (Tone::TONE_DIALTONE); - return true; +bool ManagerImpl::playTone () { + playATone(Tone::TONE_DIALTONE); + return true; } /** * Multi Thread */ -bool -ManagerImpl::playToneWithMessage() -{ - playATone (Tone::TONE_CONGESTION); - return true; +bool ManagerImpl::playToneWithMessage () { + playATone(Tone::TONE_CONGESTION); + return true; } /** * Multi Thread */ -void -ManagerImpl::congestion () -{ - playATone (Tone::TONE_CONGESTION); +void ManagerImpl::congestion () { + playATone(Tone::TONE_CONGESTION); } /** * Multi Thread */ -void -ManagerImpl::ringback () -{ - _debug ("ManagerImpl::ringback"); +void ManagerImpl::ringback () { + _debug ("ManagerImpl::ringback"); - playATone (Tone::TONE_RINGTONE); + playATone(Tone::TONE_RINGTONE); } /** * Multi Thread */ -void -ManagerImpl::ringtone() -{ - _debug ("ManagerImpl::ringtone"); - std::string ringchoice; - AudioLayer *audiolayer; - AudioCodec *codecForTone; - int layer, samplerate; - bool loadFile; +void ManagerImpl::ringtone () { - if (isRingtoneEnabled()) { + _debug ("Manager: Start ringtone"); + std::string ringchoice; + AudioLayer *audiolayer; + AudioCodec *codecForTone; + int layer, samplerate; + bool loadFile; - _debug (" Tone is enabled"); - //TODO Comment this because it makes the daemon crashes since the main thread - //synchronizes the ringtone thread. + if (isRingtoneEnabled()) { - ringchoice = getConfigString (AUDIO, RING_CHOICE); - //if there is no / inside the path + _debug ("Manager: Tone is enabled"); + //TODO Comment this because it makes the daemon crashes since the main thread + //synchronizes the ringtone thread. - if (ringchoice.find (DIR_SEPARATOR_CH) == std::string::npos) { - // check inside global share directory - ringchoice = std::string (PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + ringchoice; - } + ringchoice = getConfigString(AUDIO, RING_CHOICE); + //if there is no / inside the path - audiolayer = getAudioDriver(); + if (ringchoice.find(DIR_SEPARATOR_CH) == std::string::npos) { + // check inside global share directory + ringchoice = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + + RINGDIR + DIR_SEPARATOR_STR + ringchoice; + } - layer = audiolayer->getLayerType(); + audiolayer = getAudioDriver(); - if (audiolayer == 0) - return; + if (!audiolayer) { + _error("Manager: Error: no audio layer in ringtone"); + return; + } + layer = audiolayer->getLayerType(); - samplerate = audiolayer->getSampleRate(); + samplerate = audiolayer->getSampleRate(); - codecForTone = _codecDescriptorMap.getFirstCodecAvailable(); + codecForTone = _codecDescriptorMap.getFirstCodecAvailable(); - _toneMutex.enterMutex(); + _toneMutex.enterMutex(); - loadFile = _audiofile.loadFile (ringchoice, codecForTone , samplerate); + loadFile = _audiofile.loadFile(ringchoice, codecForTone, samplerate); - _toneMutex.leaveMutex(); + _toneMutex.leaveMutex(); - if (loadFile) { + if (loadFile) { - _toneMutex.enterMutex(); - _audiofile.start(); - _toneMutex.leaveMutex(); + _toneMutex.enterMutex(); + _audiofile.start(); + _toneMutex.leaveMutex(); - // start audio if not started AND flush all buffers (main and urgent) - audiolayer->startStream(); + // start audio if not started AND flush all buffers (main and urgent) + audiolayer->startStream(); - } else { - ringback(); - } + } else { + ringback(); + } - } else { - ringback(); - } + } else { + ringback(); + } } AudioLoop* -ManagerImpl::getTelephoneTone() -{ - // _debug("ManagerImpl::getTelephoneTone()"); - if (_telephoneTone != 0) { - ost::MutexLock m (_toneMutex); - return _telephoneTone->getCurrentTone(); - } else { - return 0; - } +ManagerImpl::getTelephoneTone () { + // _debug("ManagerImpl::getTelephoneTone()"); + if (_telephoneTone != 0) { + ost::MutexLock m(_toneMutex); + return _telephoneTone->getCurrentTone(); + } else { + return 0; + } } AudioLoop* -ManagerImpl::getTelephoneFile() -{ - // _debug("ManagerImpl::getTelephoneFile()"); - ost::MutexLock m (_toneMutex); - - if (_audiofile.isStarted()) { - return &_audiofile; - } else { - return 0; - } +ManagerImpl::getTelephoneFile () { + // _debug("ManagerImpl::getTelephoneFile()"); + ost::MutexLock m(_toneMutex); + + if (_audiofile.isStarted()) { + return &_audiofile; + } else { + return 0; + } } -void ManagerImpl::notificationIncomingCall (void) -{ - AudioLayer *audiolayer; - std::ostringstream frequency; - unsigned int samplerate, nbSampling; +void ManagerImpl::notificationIncomingCall (void) { + AudioLayer *audiolayer; + std::ostringstream frequency; + unsigned int samplerate, nbSampling; - audiolayer = getAudioDriver(); + audiolayer = getAudioDriver(); - _debug ("ManagerImpl::notificationIncomingCall"); + _debug ("ManagerImpl::notificationIncomingCall"); - if (audiolayer != 0) { - samplerate = audiolayer->getSampleRate(); - frequency << "440/" << FRAME_PER_BUFFER; - Tone tone (frequency.str(), samplerate); - nbSampling = tone.getSize(); - SFLDataFormat buf[nbSampling]; - tone.getNext (buf, tone.getSize()); - /* Put the data in the urgent ring buffer */ - audiolayer->flushUrgent(); - audiolayer->putUrgent (buf, sizeof (SFLDataFormat) *nbSampling); - } + if (audiolayer != 0) { + samplerate = audiolayer->getSampleRate(); + frequency << "440/" << FRAME_PER_BUFFER; + Tone tone(frequency.str(), samplerate); + nbSampling = tone.getSize(); + SFLDataFormat buf[nbSampling]; + tone.getNext(buf, tone.getSize()); + /* Put the data in the urgent ring buffer */ + audiolayer->flushUrgent(); + audiolayer->putUrgent(buf, sizeof(SFLDataFormat) * nbSampling); + } } - /////////////////////////////////////////////////////////////////////////////// // Private functions /////////////////////////////////////////////////////////////////////////////// @@ -2204,1351 +2011,1316 @@ void ManagerImpl::notificationIncomingCall (void) * @return 1: ok -1: error directory */ -int -ManagerImpl::createSettingsPath (void) -{ - - std::string xdg_config, xdg_env; +int ManagerImpl::createSettingsPath (void) { - _debug ("XDG_CONFIG_HOME: %s", XDG_CONFIG_HOME); + std::string xdg_config, xdg_env; - xdg_config = std::string (HOMEDIR) + DIR_SEPARATOR_STR + ".config" + DIR_SEPARATOR_STR + PROGDIR; + _debug ("XDG_CONFIG_HOME: %s", XDG_CONFIG_HOME); - if (XDG_CONFIG_HOME != NULL) { - xdg_env = std::string (XDG_CONFIG_HOME); - (xdg_env.length() > 0) ? _path = xdg_env - : _path = xdg_config; - } else - _path = xdg_config; + xdg_config = std::string(HOMEDIR) + DIR_SEPARATOR_STR + ".config" + + DIR_SEPARATOR_STR + PROGDIR; - if (mkdir (_path.data(), 0700) != 0) { - // If directory creation failed - if (errno != EEXIST) { - _debug ("Cannot create directory: %s", strerror (errno)); - return -1; - } - } - - // Load user's configuration - _path = _path + DIR_SEPARATOR_STR + PROGNAME + "rc"; - - return 1; -} + if (XDG_CONFIG_HOME != NULL) { + xdg_env = std::string(XDG_CONFIG_HOME); + (xdg_env.length() > 0) ? _path = xdg_env : _path = xdg_config; + } else + _path = xdg_config; -/** - * Initialization: Main Thread - */ -void -ManagerImpl::initConfigFile (bool load_user_value, std::string alternate) -{ - _debug ("ManagerImpl::InitConfigFile"); - - // Default values, that will be overwritten by the call to - // 'populateFromFile' below. - - // Peer to peer settings - _config.addDefaultValue (std::pair<std::string, std::string> (SRTP_ENABLE, FALSE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (SRTP_KEY_EXCHANGE, "1"), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (ZRTP_HELLO_HASH, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS_ONCE, FALSE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (ZRTP_NOT_SUPP_WARNING, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_ENABLE, FALSE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_CA_LIST_FILE, EMPTY_FIELD), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_CERTIFICATE_FILE, EMPTY_FIELD), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_PRIVATE_KEY_FILE, EMPTY_FIELD), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_PASSWORD, EMPTY_FIELD), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_METHOD, "TLSv1"), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_CIPHERS, EMPTY_FIELD), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_SERVER_NAME, EMPTY_FIELD), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_VERIFY_SERVER, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_VERIFY_CLIENT, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_REQUIRE_CLIENT_CERTIFICATE, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_NEGOTIATION_TIMEOUT_SEC, "2"), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (TLS_NEGOTIATION_TIMEOUT_MSEC, "0"), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (LOCAL_INTERFACE, "default"), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (PUBLISHED_SAMEAS_LOCAL, TRUE_STR), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (LOCAL_PORT, DEFAULT_SIP_PORT), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (PUBLISHED_PORT, DEFAULT_SIP_PORT), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (PUBLISHED_ADDRESS, DEFAULT_ADDRESS), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (STUN_ENABLE, DFT_STUN_ENABLE), IP2IP_PROFILE); - _config.addDefaultValue (std::pair<std::string, std::string> (STUN_SERVER, DFT_STUN_SERVER), IP2IP_PROFILE); - - // Init display name to the username under which - // this sflphone instance is running. - std::string diplayName (""); - uid_t uid = getuid(); - - struct passwd * user_info = NULL; - user_info = getpwuid (uid); - - if (user_info != NULL) { - diplayName = user_info->pw_name; - } - - _config.addDefaultValue (std::pair<std::string, std::string> (DISPLAY_NAME, diplayName), IP2IP_PROFILE); - - // Signalisation settings - _config.addDefaultValue (std::pair<std::string, std::string> (SYMMETRIC, TRUE_STR), SIGNALISATION); - _config.addDefaultValue (std::pair<std::string, std::string> (PLAY_DTMF, TRUE_STR), SIGNALISATION); - _config.addDefaultValue (std::pair<std::string, std::string> (PLAY_TONES, TRUE_STR), SIGNALISATION); - _config.addDefaultValue (std::pair<std::string, std::string> (PULSE_LENGTH, DFT_PULSE_LENGTH_STR), SIGNALISATION); - _config.addDefaultValue (std::pair<std::string, std::string> (SEND_DTMF_AS, SIP_INFO_STR), SIGNALISATION); - _config.addDefaultValue (std::pair<std::string, std::string> (ZRTP_ZIDFILE, ZRTP_ZID_FILENAME), SIGNALISATION); - - // Audio settings - _config.addDefaultValue (std::pair<std::string, std::string> (ALSA_CARD_ID_IN, ALSA_DFT_CARD), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (ALSA_CARD_ID_OUT, ALSA_DFT_CARD), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (ALSA_SAMPLE_RATE, DFT_SAMPLE_RATE), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (ALSA_FRAME_SIZE, DFT_FRAME_SIZE), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (ALSA_PLUGIN, PCM_DEFAULT), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (RING_CHOICE, DFT_RINGTONE), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (VOLUME_SPKR, DFT_VOL_SPKR_STR), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (VOLUME_MICRO, DFT_VOL_MICRO_STR), AUDIO); - _config.addDefaultValue (std::pair<std::string, std::string> (RECORD_PATH,DFT_RECORD_PATH), AUDIO); - - // General settings - _config.addDefaultValue (std::pair<std::string, std::string> (ZONE_TONE, DFT_ZONE), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_RINGTONE, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_DIALPAD, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_SEARCHBAR, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_START, FALSE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_POPUP, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_NOTIFY, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_MAIL_NOTIFY, FALSE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_VOLUME, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_HISTORY_LIMIT, DFT_HISTORY_LIMIT), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_HISTORY_ENABLED, TRUE_STR), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_AUDIO, DFT_AUDIO_MANAGER), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_SIP_PORT, DFT_SIP_PORT), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNTS_ORDER, EMPTY_FIELD), PREFERENCES); - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_MD5HASH, FALSE_STR), PREFERENCES); - - // Addressbook settings - _config.addDefaultValue (std::pair<std::string, std::string> (ADDRESSBOOK_ENABLE, TRUE_STR), ADDRESSBOOK); - _config.addDefaultValue (std::pair<std::string, std::string> (ADDRESSBOOK_MAX_RESULTS, "25"), ADDRESSBOOK); - _config.addDefaultValue (std::pair<std::string, std::string> (ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, FALSE_STR), ADDRESSBOOK); - _config.addDefaultValue (std::pair<std::string, std::string> (ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, TRUE_STR), ADDRESSBOOK); - _config.addDefaultValue (std::pair<std::string, std::string> (ADDRESSBOOK_DISPLAY_PHONE_HOME, FALSE_STR), ADDRESSBOOK); - _config.addDefaultValue (std::pair<std::string, std::string> (ADDRESSBOOK_DISPLAY_PHONE_MOBILE, FALSE_STR), ADDRESSBOOK); - - // Hooks settings - _config.addDefaultValue (std::pair<std::string, std::string> (URLHOOK_SIP_FIELD, HOOK_DEFAULT_SIP_FIELD), HOOKS); - _config.addDefaultValue (std::pair<std::string, std::string> (URLHOOK_COMMAND, HOOK_DEFAULT_URL_COMMAND), HOOKS); - _config.addDefaultValue (std::pair<std::string, std::string> (URLHOOK_SIP_ENABLED, FALSE_STR), HOOKS); - _config.addDefaultValue (std::pair<std::string, std::string> (URLHOOK_IAX2_ENABLED, FALSE_STR), HOOKS); - _config.addDefaultValue (std::pair<std::string, std::string> (PHONE_NUMBER_HOOK_ENABLED, FALSE_STR), HOOKS); - _config.addDefaultValue (std::pair<std::string, std::string> (PHONE_NUMBER_HOOK_ADD_PREFIX, EMPTY_FIELD), HOOKS); - - std::string path; - // Loads config from ~/.sflphone/sflphonedrc or so.. - - if (createSettingsPath() == 1 && load_user_value) { - (alternate == "") ? path = _path : path = alternate; - std::cout << path << std::endl; - _exist = _config.populateFromFile (path); - } - - // Globally shared default values (not to be populated from file) - _config.addDefaultValue (std::pair<std::string, std::string> (HOSTNAME, EMPTY_FIELD)); - - _config.addDefaultValue (std::pair<std::string, std::string> (AUTHENTICATION_USERNAME, EMPTY_FIELD)); - - _config.addDefaultValue (std::pair<std::string, std::string> (USERNAME, EMPTY_FIELD)); - - _config.addDefaultValue (std::pair<std::string, std::string> (PASSWORD, EMPTY_FIELD)); - - _config.addDefaultValue (std::pair<std::string, std::string> (REALM, DEFAULT_REALM)); - - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNT_REGISTRATION_EXPIRE, DFT_EXPIRE_VALUE)); - - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNT_RESOLVE_ONCE, FALSE_STR)); - - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, EMPTY_FIELD)); - - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNT_MAILBOX, EMPTY_FIELD)); - - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ENABLE, TRUE_STR)); - - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_CREDENTIAL_NUMBER, "0")); + if (mkdir(_path.data(), 0700) != 0) { + // If directory creation failed + if (errno != EEXIST) { + _debug ("Cannot create directory: %s", strerror (errno)); + return -1; + } + } - _config.addDefaultValue (std::pair<std::string, std::string> (CONFIG_ACCOUNT_TYPE, DEFAULT_ACCOUNT_TYPE)); + // Load user's configuration + _path = _path + DIR_SEPARATOR_STR + PROGNAME + "rc"; - _setupLoaded = (_exist == 2) ? false : true; + return 1; } /** * Initialization: Main Thread */ -void -ManagerImpl::initAudioCodec (void) -{ - _debugInit ("Active Codecs List"); - // init list of all supported codecs - _codecDescriptorMap.init(); - // if the user never set the codec list, use the default configuration - - if (getConfigString (AUDIO, "ActiveCodecs") == "") { - _codecDescriptorMap.setDefaultOrder(); - } +void ManagerImpl::initConfigFile (bool load_user_value, std::string alternate) { + _debug ("ManagerImpl::InitConfigFile"); + + // Default values, that will be overwritten by the call to + // 'populateFromFile' below. + + // Peer to peer settings + _config.addDefaultValue(std::pair<std::string, std::string>(SRTP_ENABLE, + FALSE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + SRTP_RTP_FALLBACK, FALSE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + SRTP_KEY_EXCHANGE, "1"), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + ZRTP_HELLO_HASH, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + ZRTP_DISPLAY_SAS, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + ZRTP_DISPLAY_SAS_ONCE, FALSE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + ZRTP_NOT_SUPP_WARNING, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_LISTENER_PORT, DEFAULT_SIP_TLS_PORT), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(TLS_ENABLE, + FALSE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_CA_LIST_FILE, EMPTY_FIELD), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_CERTIFICATE_FILE, EMPTY_FIELD), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_PRIVATE_KEY_FILE, EMPTY_FIELD), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(TLS_PASSWORD, + EMPTY_FIELD), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(TLS_METHOD, + "TLSv1"), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(TLS_CIPHERS, + EMPTY_FIELD), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_SERVER_NAME, EMPTY_FIELD), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_VERIFY_SERVER, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_VERIFY_CLIENT, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_REQUIRE_CLIENT_CERTIFICATE, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_NEGOTIATION_TIMEOUT_SEC, "2"), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + TLS_NEGOTIATION_TIMEOUT_MSEC, "0"), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + LOCAL_INTERFACE, "default"), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + PUBLISHED_SAMEAS_LOCAL, TRUE_STR), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(LOCAL_PORT, + DEFAULT_SIP_PORT), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(PUBLISHED_PORT, + DEFAULT_SIP_PORT), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + PUBLISHED_ADDRESS, DEFAULT_ADDRESS), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(STUN_ENABLE, + DFT_STUN_ENABLE), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>(STUN_SERVER, + DFT_STUN_SERVER), IP2IP_PROFILE); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_ALIAS, EMPTY_FIELD), IP2IP_PROFILE); + + // Init display name to the username under which + // this sflphone instance is running. + std::string diplayName(""); + uid_t uid = getuid(); + + struct passwd * user_info = NULL; + user_info = getpwuid(uid); + + if (user_info != NULL) { + diplayName = user_info->pw_name; + } - // else retrieve the one set in the user config file - else { - std::vector<std::string> active_list = retrieveActiveCodecs(); - setActiveCodecList (active_list); - } -} + _config.addDefaultValue(std::pair<std::string, std::string>(DISPLAY_NAME, + diplayName), IP2IP_PROFILE); + + // Signalisation settings + _config.addDefaultValue(std::pair<std::string, std::string>(SYMMETRIC, + TRUE_STR), SIGNALISATION); + _config.addDefaultValue(std::pair<std::string, std::string>(PLAY_DTMF, + TRUE_STR), SIGNALISATION); + _config.addDefaultValue(std::pair<std::string, std::string>(PLAY_TONES, + TRUE_STR), SIGNALISATION); + _config.addDefaultValue(std::pair<std::string, std::string>(PULSE_LENGTH, + DFT_PULSE_LENGTH_STR), SIGNALISATION); + _config.addDefaultValue(std::pair<std::string, std::string>(SEND_DTMF_AS, + SIP_INFO_STR), SIGNALISATION); + _config.addDefaultValue(std::pair<std::string, std::string>(ZRTP_ZIDFILE, + ZRTP_ZID_FILENAME), SIGNALISATION); + + // Audio settings + _config.addDefaultValue(std::pair<std::string, std::string>( + ALSA_CARD_ID_IN, ALSA_DFT_CARD), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>( + ALSA_CARD_ID_OUT, ALSA_DFT_CARD), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>( + AUDIO_SAMPLE_RATE, DFT_SAMPLE_RATE), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>( + ALSA_FRAME_SIZE, DFT_FRAME_SIZE), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>(ALSA_PLUGIN, + PCM_DEFAULT), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>(RING_CHOICE, + DFT_RINGTONE), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>(VOLUME_SPKR, + DFT_VOL_SPKR_STR), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>(VOLUME_MICRO, + DFT_VOL_MICRO_STR), AUDIO); + _config.addDefaultValue(std::pair<std::string, std::string>(RECORD_PATH, + DFT_RECORD_PATH), AUDIO); + + // General settings + _config.addDefaultValue(std::pair<std::string, std::string>(ZONE_TONE, + DFT_ZONE), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_RINGTONE, TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_DIALPAD, + TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_SEARCHBAR, TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_START, + FALSE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_POPUP, + TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_NOTIFY, + TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_MAIL_NOTIFY, FALSE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_VOLUME, + TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_HISTORY_LIMIT, DFT_HISTORY_LIMIT), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_HISTORY_ENABLED, TRUE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_AUDIO, + DFT_AUDIO_MANAGER), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_SIP_PORT, DFT_SIP_PORT), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNTS_ORDER, EMPTY_FIELD), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(CONFIG_MD5HASH, + FALSE_STR), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(WINDOW_WIDTH, + DFT_WINDOW_WIDTH), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>(WINDOW_HEIGHT, + DFT_WINDOW_HEIGHT), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + WINDOW_POSITION_X, "0"), PREFERENCES); + _config.addDefaultValue(std::pair<std::string, std::string>( + WINDOW_POSITION_Y, "0"), PREFERENCES); + + // Addressbook settings + _config.addDefaultValue(std::pair<std::string, std::string>( + ADDRESSBOOK_ENABLE, TRUE_STR), ADDRESSBOOK); + _config.addDefaultValue(std::pair<std::string, std::string>( + ADDRESSBOOK_MAX_RESULTS, "25"), ADDRESSBOOK); + _config.addDefaultValue(std::pair<std::string, std::string>( + ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, FALSE_STR), ADDRESSBOOK); + _config.addDefaultValue(std::pair<std::string, std::string>( + ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, TRUE_STR), ADDRESSBOOK); + _config.addDefaultValue(std::pair<std::string, std::string>( + ADDRESSBOOK_DISPLAY_PHONE_HOME, FALSE_STR), ADDRESSBOOK); + _config.addDefaultValue(std::pair<std::string, std::string>( + ADDRESSBOOK_DISPLAY_PHONE_MOBILE, FALSE_STR), ADDRESSBOOK); + + // Hooks settings + _config.addDefaultValue(std::pair<std::string, std::string>( + URLHOOK_SIP_FIELD, HOOK_DEFAULT_SIP_FIELD), HOOKS); + _config.addDefaultValue(std::pair<std::string, std::string>( + URLHOOK_COMMAND, HOOK_DEFAULT_URL_COMMAND), HOOKS); + _config.addDefaultValue(std::pair<std::string, std::string>( + URLHOOK_SIP_ENABLED, FALSE_STR), HOOKS); + _config.addDefaultValue(std::pair<std::string, std::string>( + URLHOOK_IAX2_ENABLED, FALSE_STR), HOOKS); + _config.addDefaultValue(std::pair<std::string, std::string>( + PHONE_NUMBER_HOOK_ENABLED, FALSE_STR), HOOKS); + _config.addDefaultValue(std::pair<std::string, std::string>( + PHONE_NUMBER_HOOK_ADD_PREFIX, EMPTY_FIELD), HOOKS); + + std::string path; + // Loads config from ~/.sflphone/sflphonedrc or so.. + + if (createSettingsPath() == 1 && load_user_value) { + (alternate == "") ? path = _path : path = alternate; + std::cout << path << std::endl; + _exist = _config.populateFromFile(path); + } + // Globally shared default values (not to be populated from file) + _config.addDefaultValue(std::pair<std::string, std::string>(HOSTNAME, + EMPTY_FIELD)); -void -ManagerImpl::setActiveCodecList (const std::vector< std::string >& list) -{ - _debug ("Set active codecs list"); - _codecDescriptorMap.saveActiveCodecs (list); - // setConfig - std::string s = serialize (list); - _debug ("Setting codec with payload number %s to the active list", s.c_str()); - setConfig ("Audio", "ActiveCodecs", s); -} + _config.addDefaultValue(std::pair<std::string, std::string>( + AUTHENTICATION_USERNAME, EMPTY_FIELD)); -std::vector<std::string> -ManagerImpl::retrieveActiveCodecs() -{ - std::string s = getConfigString (AUDIO, "ActiveCodecs"); - return unserialize (s); -} + _config.addDefaultValue(std::pair<std::string, std::string>(USERNAME, + EMPTY_FIELD)); -std::vector<std::string> -ManagerImpl::unserialize (std::string s) -{ + _config.addDefaultValue(std::pair<std::string, std::string>(PASSWORD, + EMPTY_FIELD)); - std::vector<std::string> list; - std::string temp; + _config.addDefaultValue(std::pair<std::string, std::string>(REALM, + DEFAULT_REALM)); - while (s.find ("/", 0) != std::string::npos) { - size_t pos = s.find ("/", 0); - temp = s.substr (0, pos); - s.erase (0, pos + 1); - list.push_back (temp); - } + _config.addDefaultValue(std::pair<std::string, std::string>(USERAGENT, + DFT_USERAGENT)); - return list; -} + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_REGISTRATION_EXPIRE, DFT_EXPIRE_VALUE)); -std::string -ManagerImpl::serialize (std::vector<std::string> v) -{ - unsigned int i; - std::string res; + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_RESOLVE_ONCE, FALSE_STR)); - for (i=0;i<v.size();i++) { - res += v[i] + "/"; - } + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_ALIAS, EMPTY_FIELD)); - return res; -} + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_MAILBOX, EMPTY_FIELD)); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_ENABLE, TRUE_STR)); -std::vector <std::string> -ManagerImpl::getActiveCodecList (void) -{ - _debug ("ManagerImpl::getActiveCodecList"); - std::vector< std::string > v; - CodecOrder active = _codecDescriptorMap.getActiveCodecs(); - unsigned int i=0; - size_t size = active.size(); + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_CREDENTIAL_NUMBER, "0")); - while (i<size) { - std::stringstream ss; - ss << active[i]; - v.push_back ( (ss.str()).data()); - _debug ("Codec with payload number %s is active", ss.str().data()); - i++; - } + _config.addDefaultValue(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_TYPE, DEFAULT_ACCOUNT_TYPE)); - return v; + _setupLoaded = (_exist == 2) ? false : true; } - /** - * Send the list of codecs to the client through DBus. + * Initialization: Main Thread */ -std::vector< std::string > -ManagerImpl::getCodecList (void) -{ - std::vector<std::string> list; - //CodecMap codecs = _codecDescriptorMap.getCodecMap(); - CodecsMap codecs = _codecDescriptorMap.getCodecsMap(); - CodecOrder order = _codecDescriptorMap.getActiveCodecs(); - CodecsMap::iterator iter = codecs.begin(); - - while (iter!=codecs.end()) { - std::stringstream ss; +void ManagerImpl::initAudioCodec (void) { + _info("Manager: Init audio codecs"); - if (iter->second != NULL) { - ss << iter->first; - list.push_back ( (ss.str()).data()); - } + /* Init list of all supported codecs by the application. + * This is a global list. Every account will inherit it. + */ + _codecDescriptorMap.init(); +} - iter++; - } +/* + * TODO Retrieve the active codec list per account + */ +std::vector<std::string> ManagerImpl::retrieveActiveCodecs () { - return list; + // This property is now set per account basis + std::string s = getConfigString(AUDIO, "ActiveCodecs"); + _info("Manager: Retrieve active codecs: %s", s.c_str ()); + return unserialize(s); } -std::vector<std::string> -ManagerImpl::getCodecDetails (const int32_t& payload) -{ +std::vector<std::string> ManagerImpl::unserialize (std::string s) { - std::vector<std::string> v; - std::stringstream ss; + std::vector<std::string> list; + std::string temp; - v.push_back (_codecDescriptorMap.getCodecName ( (AudioCodecType) payload)); - ss << _codecDescriptorMap.getSampleRate ( (AudioCodecType) payload); - v.push_back ( (ss.str()).data()); - ss.str (""); - ss << _codecDescriptorMap.getBitRate ( (AudioCodecType) payload); - v.push_back ( (ss.str()).data()); - ss.str (""); - ss << _codecDescriptorMap.getBandwidthPerCall ( (AudioCodecType) payload); - v.push_back ( (ss.str()).data()); - ss.str (""); + while (s.find("/", 0) != std::string::npos) { + size_t pos = s.find("/", 0); + temp = s.substr(0, pos); + s.erase(0, pos + 1); + list.push_back(temp); + } - return v; + return list; } -std::string -ManagerImpl::getCurrentCodecName (const CallID& id) -{ +std::string ManagerImpl::serialize (std::vector<std::string> v) { - AccountID accountid = getAccountFromCall (id); - VoIPLink* link = getAccountLink (accountid); - Call* call = link->getCall (id); + unsigned int i; + std::string res; - if (!call) - return ""; + for (i = 0; i < v.size(); i++) { + res += v[i] + "/"; + } - if (call->getState() != Call::Active) - return ""; - else - return link->getCurrentCodecName(); + return res; } -/** - * Get list of supported input audio plugin - */ -std::vector<std::string> -ManagerImpl::getInputAudioPluginList (void) -{ - std::vector<std::string> v; - _debug ("Get input audio plugin list"); +std::string ManagerImpl::getCurrentCodecName (const CallID& id) { - v.push_back ("default"); - v.push_back ("surround40"); - v.push_back ("plug:hw"); + AccountID accountid = getAccountFromCall(id); + VoIPLink* link = getAccountLink(accountid); + Call* call = link->getCall(id); - return v; -} + if (!call) + return ""; -/** - * Get list of supported output audio plugin - */ -std::vector<std::string> -ManagerImpl::getOutputAudioPluginList (void) -{ - std::vector<std::string> v; - _debug ("Get output audio plugin list"); - - v.push_back (PCM_DEFAULT); - v.push_back (PCM_DMIX); - - return v; + if (call->getState() != Call::Active) + return ""; + else + return link->getCurrentCodecName(); } /** * Set input audio plugin */ -void -ManagerImpl::setInputAudioPlugin (const std::string& audioPlugin) -{ - int layer = _audiodriver -> getLayerType(); - - if (CHECK_INTERFACE (layer , ALSA)) { - _debug ("Set input audio plugin"); - _audiodriver -> setErrorMessage (-1); - _audiodriver -> openDevice (_audiodriver -> getIndexIn(), - _audiodriver -> getIndexOut(), - _audiodriver -> getSampleRate(), - _audiodriver -> getFrameSize(), - SFL_PCM_CAPTURE, - audioPlugin); - - if (_audiodriver -> getErrorMessage() != -1) - notifyErrClient (_audiodriver -> getErrorMessage()); - } else {} +void ManagerImpl::setInputAudioPlugin (const std::string& audioPlugin) { + int layer = _audiodriver -> getLayerType(); + + if (CHECK_INTERFACE (layer , ALSA)) { + _debug ("Set input audio plugin"); + _audiodriver -> setErrorMessage(-1); + _audiodriver -> openDevice(_audiodriver -> getIndexIn(), + _audiodriver -> getIndexOut(), _audiodriver -> getSampleRate(), + _audiodriver -> getFrameSize(), SFL_PCM_CAPTURE, audioPlugin); + + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient(_audiodriver -> getErrorMessage()); + } else { + } } /** * Set output audio plugin */ -void -ManagerImpl::setOutputAudioPlugin (const std::string& audioPlugin) -{ +void ManagerImpl::setOutputAudioPlugin (const std::string& audioPlugin) { - int res; + int res; - _debug ("Set output audio plugin"); - _audiodriver -> setErrorMessage (-1); - res = _audiodriver -> openDevice (_audiodriver -> getIndexIn(), - _audiodriver -> getIndexOut(), - _audiodriver -> getSampleRate(), - _audiodriver -> getFrameSize(), - SFL_PCM_BOTH, - audioPlugin); + _debug ("Set output audio plugin"); + _audiodriver -> setErrorMessage(-1); + res = _audiodriver -> openDevice(_audiodriver -> getIndexIn(), + _audiodriver -> getIndexOut(), _audiodriver -> getSampleRate(), + _audiodriver -> getFrameSize(), SFL_PCM_BOTH, audioPlugin); - if (_audiodriver -> getErrorMessage() != -1) - notifyErrClient (_audiodriver -> getErrorMessage()); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient(_audiodriver -> getErrorMessage()); - // set config - if (res) setConfig (AUDIO , ALSA_PLUGIN , audioPlugin); + // set config + if (res) + setConfig(AUDIO, ALSA_PLUGIN, audioPlugin); } /** * Get list of supported audio output device */ -std::vector<std::string> -ManagerImpl::getAudioOutputDeviceList (void) -{ - _debug ("Get audio output device list"); - AlsaLayer *layer; - std::vector <std::string> devices; +std::vector<std::string> ManagerImpl::getAudioOutputDeviceList (void) { + _debug ("Get audio output device list"); + AlsaLayer *layer; + std::vector<std::string> devices; - layer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); + layer = dynamic_cast<AlsaLayer*> (getAudioDriver()); - if (layer) - devices = layer -> getSoundCardsInfo (SFL_PCM_PLAYBACK); + if (layer) + devices = layer -> getSoundCardsInfo(SFL_PCM_PLAYBACK); - return devices; + return devices; } /** * Set audio output device */ -void -ManagerImpl::setAudioOutputDevice (const int index) -{ - AlsaLayer *alsalayer; - std::string alsaplugin; - _debug ("Set audio output device: %i", index); +void ManagerImpl::setAudioOutputDevice (const int index) { + AlsaLayer *alsalayer; + std::string alsaplugin; + _debug ("Set audio output device: %i", index); - _audiodriver -> setErrorMessage (-1); + _audiodriver -> setErrorMessage(-1); - alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); - alsaplugin = alsalayer->getAudioPlugin (); + alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver()); + alsaplugin = alsalayer->getAudioPlugin(); - _debug (" set output plugin: %s", alsaplugin.c_str()); + _debug (" set output plugin: %s", alsaplugin.c_str()); - _audiodriver->openDevice (_audiodriver->getIndexIn(), index, _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_PLAYBACK, alsaplugin); + _audiodriver->openDevice(_audiodriver->getIndexIn(), index, + _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), + SFL_PCM_PLAYBACK, alsaplugin); - if (_audiodriver -> getErrorMessage() != -1) - notifyErrClient (_audiodriver -> getErrorMessage()); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient(_audiodriver -> getErrorMessage()); - // set config - setConfig (AUDIO , ALSA_CARD_ID_OUT , index); + // set config + setConfig(AUDIO, ALSA_CARD_ID_OUT, index); } /** * Get list of supported audio input device */ -std::vector<std::string> -ManagerImpl::getAudioInputDeviceList (void) -{ - AlsaLayer *audiolayer; - std::vector <std::string> devices; - - audiolayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); +std::vector<std::string> ManagerImpl::getAudioInputDeviceList (void) { + AlsaLayer *audiolayer; + std::vector<std::string> devices; + audiolayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); - if (audiolayer) - devices = audiolayer->getSoundCardsInfo (SFL_PCM_CAPTURE); + if (audiolayer) + devices = audiolayer->getSoundCardsInfo(SFL_PCM_CAPTURE); - return devices; + return devices; } /** * Set audio input device */ -void -ManagerImpl::setAudioInputDevice (const int index) -{ - AlsaLayer *alsalayer; - std::string alsaplugin; +void ManagerImpl::setAudioInputDevice (const int index) { + AlsaLayer *alsalayer; + std::string alsaplugin; - _debug ("Set audio input device %i", index); + _debug ("Set audio input device %i", index); - _audiodriver -> setErrorMessage (-1); + _audiodriver -> setErrorMessage(-1); - alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); - alsaplugin = alsalayer->getAudioPlugin (); + alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver()); + alsaplugin = alsalayer->getAudioPlugin(); - _debug (" set input plugin: %s", alsaplugin.c_str()); + _debug (" set input plugin: %s", alsaplugin.c_str()); - _audiodriver->openDevice (index, _audiodriver->getIndexOut(), _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), SFL_PCM_CAPTURE, alsaplugin); + _audiodriver->openDevice(index, _audiodriver->getIndexOut(), + _audiodriver->getSampleRate(), _audiodriver->getFrameSize(), + SFL_PCM_CAPTURE, alsaplugin); - if (_audiodriver -> getErrorMessage() != -1) - notifyErrClient (_audiodriver -> getErrorMessage()); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient(_audiodriver -> getErrorMessage()); - // set config - setConfig (AUDIO , ALSA_CARD_ID_IN , index); + // set config + setConfig(AUDIO, ALSA_CARD_ID_IN, index); } /** * Get string array representing integer indexes of output and input device */ -std::vector<std::string> -ManagerImpl::getCurrentAudioDevicesIndex() -{ - _debug ("Get current audio devices index"); - std::vector<std::string> v; - std::stringstream ssi , sso; - sso << _audiodriver->getIndexOut(); - v.push_back (sso.str()); - ssi << _audiodriver->getIndexIn(); - v.push_back (ssi.str()); - return v; -} - -int -ManagerImpl::isIax2Enabled (void) -{ +std::vector<std::string> ManagerImpl::getCurrentAudioDevicesIndex () { + _debug ("Get current audio devices index"); + std::vector<std::string> v; + std::stringstream ssi, sso; + sso << _audiodriver->getIndexOut(); + v.push_back(sso.str()); + ssi << _audiodriver->getIndexIn(); + v.push_back(ssi.str()); + return v; +} + +int ManagerImpl::isIax2Enabled (void) { #ifdef USE_IAX - return true; + return true; #else - return false; + return false; #endif } -int -ManagerImpl::isRingtoneEnabled (void) -{ - return (getConfigString (PREFERENCES, CONFIG_RINGTONE) == "true") ? 1:0; +int ManagerImpl::isRingtoneEnabled (void) { + return (getConfigString(PREFERENCES, CONFIG_RINGTONE) == "true") ? 1 : 0; } -void -ManagerImpl::ringtoneEnabled (void) -{ - (getConfigString (PREFERENCES , CONFIG_RINGTONE) == RINGTONE_ENABLED) ? setConfig (PREFERENCES , CONFIG_RINGTONE , FALSE_STR) : setConfig (PREFERENCES , CONFIG_RINGTONE , TRUE_STR); +void ManagerImpl::ringtoneEnabled (void) { + (getConfigString(PREFERENCES, CONFIG_RINGTONE) == RINGTONE_ENABLED) ? setConfig( + PREFERENCES, CONFIG_RINGTONE, FALSE_STR) + : setConfig(PREFERENCES, CONFIG_RINGTONE, TRUE_STR); } -std::string -ManagerImpl::getRingtoneChoice (void) -{ - // we need the absolute path - std::string tone_name = getConfigString (AUDIO , RING_CHOICE); - std::string tone_path ; +std::string ManagerImpl::getRingtoneChoice (void) { + // we need the absolute path + std::string tone_name = getConfigString(AUDIO, RING_CHOICE); + std::string tone_path; - if (tone_name.find (DIR_SEPARATOR_CH) == std::string::npos) { - // check in ringtone directory ($(PREFIX)/share/sflphone/ringtones) - tone_path = std::string (PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + DIR_SEPARATOR_STR + tone_name ; - } else { - // the absolute has been saved; do nothing - tone_path = tone_name ; - } + if (tone_name.find(DIR_SEPARATOR_CH) == std::string::npos) { + // check in ringtone directory ($(PREFIX)/share/sflphone/ringtones) + tone_path = std::string(PROGSHAREDIR) + DIR_SEPARATOR_STR + RINGDIR + + DIR_SEPARATOR_STR + tone_name; + } else { + // the absolute has been saved; do nothing + tone_path = tone_name; + } - _debug ("%s", tone_path.c_str()); + _debug ("%s", tone_path.c_str()); - return tone_path; + return tone_path; } -void -ManagerImpl::setRingtoneChoice (const std::string& tone) -{ - // we save the absolute path - setConfig (AUDIO , RING_CHOICE , tone); +void ManagerImpl::setRingtoneChoice (const std::string& tone) { + // we save the absolute path + setConfig(AUDIO, RING_CHOICE, tone); } -std::string -ManagerImpl::getRecordPath (void) -{ - return getConfigString (AUDIO, RECORD_PATH); +std::string ManagerImpl::getRecordPath (void) { + return getConfigString(AUDIO, RECORD_PATH); } -void -ManagerImpl::setRecordPath (const std::string& recPath) -{ - _debug ("ManagerImpl::setRecordPath(%s)! ", recPath.c_str()); - setConfig (AUDIO, RECORD_PATH, recPath); +void ManagerImpl::setRecordPath (const std::string& recPath) { + _debug ("ManagerImpl::setRecordPath(%s)! ", recPath.c_str()); + setConfig(AUDIO, RECORD_PATH, recPath); } -bool -ManagerImpl::getMd5CredentialHashing (void) -{ - return getConfigBool (PREFERENCES, CONFIG_MD5HASH); +bool ManagerImpl::getMd5CredentialHashing (void) { + return getConfigBool(PREFERENCES, CONFIG_MD5HASH); } -int -ManagerImpl::getDialpad (void) -{ - if (getConfigString (PREFERENCES, CONFIG_DIALPAD) == TRUE_STR) { - return 1; - } else { - return 0; - } +int ManagerImpl::getDialpad (void) { + if (getConfigString(PREFERENCES, CONFIG_DIALPAD) == TRUE_STR) { + return 1; + } else { + return 0; + } } -void -ManagerImpl::setDialpad (bool display) -{ - std::string set; +void ManagerImpl::setDialpad (bool display) { + std::string set; - display ? set = TRUE_STR : set = FALSE_STR; - // If the value we received is different from the one saved in the config file, save the new value - // Else do nothing + display ? set = TRUE_STR : set = FALSE_STR; + // If the value we received is different from the one saved in the config file, save the new value + // Else do nothing - if ( (display && (getConfigString (PREFERENCES, CONFIG_DIALPAD) != TRUE_STR)) || - (!display && (getConfigString (PREFERENCES, CONFIG_DIALPAD) != FALSE_STR))) - setConfig (PREFERENCES, CONFIG_DIALPAD, set); + if ((display && (getConfigString(PREFERENCES, CONFIG_DIALPAD) != TRUE_STR)) + || (!display && (getConfigString(PREFERENCES, CONFIG_DIALPAD) + != FALSE_STR))) + setConfig(PREFERENCES, CONFIG_DIALPAD, set); } -int -ManagerImpl::getVolumeControls (void) -{ - if (getConfigString (PREFERENCES , CONFIG_VOLUME) == TRUE_STR) { - return 1; - } else { - return 0; - } +int ManagerImpl::getVolumeControls (void) { + if (getConfigString(PREFERENCES, CONFIG_VOLUME) == TRUE_STR) { + return 1; + } else { + return 0; + } } -void ManagerImpl::setVolumeControls (bool display) -{ - std::string set; +void ManagerImpl::setVolumeControls (bool display) { + std::string set; - display ? set = TRUE_STR : set = FALSE_STR; - // If the value we received is different from the one saved in the config file, save the new value - // Else do nothing + display ? set = TRUE_STR : set = FALSE_STR; + // If the value we received is different from the one saved in the config file, save the new value + // Else do nothing - if ( (display && (getConfigString (PREFERENCES, CONFIG_VOLUME) != TRUE_STR)) || - (!display && (getConfigString (PREFERENCES, CONFIG_VOLUME) != FALSE_STR))) - setConfig (PREFERENCES, CONFIG_VOLUME, set); + if ((display && (getConfigString(PREFERENCES, CONFIG_VOLUME) != TRUE_STR)) + || (!display && (getConfigString(PREFERENCES, CONFIG_VOLUME) + != FALSE_STR))) + setConfig(PREFERENCES, CONFIG_VOLUME, set); } -void -ManagerImpl::setRecordingCall (const CallID& id) -{ - /* - _debug ("ManagerImpl::setRecording()! "); - AccountID accountid = getAccountFromCall (id); +void ManagerImpl::setRecordingCall (const CallID& id) { + /* + _debug ("ManagerImpl::setRecording()! "); + AccountID accountid = getAccountFromCall (id); - getAccountLink (accountid)->setRecording (id); - */ - AccountID accountid = getAccountFromCall (id); - Recordable* rec = (Recordable*) getAccountLink (accountid)->getCall (id); + getAccountLink (accountid)->setRecording (id); + */ + AccountID accountid = getAccountFromCall(id); + Recordable* rec = (Recordable*) getAccountLink(accountid)->getCall(id); - rec->setRecording(); + rec->setRecording(); } -bool -ManagerImpl::isRecording (const CallID& id) -{ - /* - _debug ("ManagerImpl::isRecording()! "); - AccountID accountid = getAccountFromCall (id); +bool ManagerImpl::isRecording (const CallID& id) { + /* + _debug ("ManagerImpl::isRecording()! "); + AccountID accountid = getAccountFromCall (id); - return getAccountLink (accountid)->isRecording (id); - */ + return getAccountLink (accountid)->isRecording (id); + */ - AccountID accountid = getAccountFromCall (id); - Recordable* rec = (Recordable*) getAccountLink (accountid)->getCall (id); + AccountID accountid = getAccountFromCall(id); + Recordable* rec = (Recordable*) getAccountLink(accountid)->getCall(id); - return rec->isRecording(); + return rec->isRecording(); } -void -ManagerImpl::startHidden (void) -{ - (getConfigString (PREFERENCES, CONFIG_START) == START_HIDDEN) ? setConfig (PREFERENCES , CONFIG_START , FALSE_STR) : setConfig (PREFERENCES , CONFIG_START , TRUE_STR); +void ManagerImpl::startHidden (void) { + (getConfigString(PREFERENCES, CONFIG_START) == START_HIDDEN) ? setConfig( + PREFERENCES, CONFIG_START, FALSE_STR) : setConfig(PREFERENCES, + CONFIG_START, TRUE_STR); } -int -ManagerImpl::isStartHidden (void) -{ - return (getConfigBool (PREFERENCES, CONFIG_START) == true) ? 1:0; +int ManagerImpl::isStartHidden (void) { + return (getConfigBool(PREFERENCES, CONFIG_START) == true) ? 1 : 0; } -void -ManagerImpl::switchPopupMode (void) -{ - (getConfigString (PREFERENCES, CONFIG_POPUP) == WINDOW_POPUP) ? setConfig (PREFERENCES, CONFIG_POPUP, FALSE_STR) : setConfig (PREFERENCES, CONFIG_POPUP, TRUE_STR); +void ManagerImpl::switchPopupMode (void) { + (getConfigString(PREFERENCES, CONFIG_POPUP) == WINDOW_POPUP) ? setConfig( + PREFERENCES, CONFIG_POPUP, FALSE_STR) : setConfig(PREFERENCES, + CONFIG_POPUP, TRUE_STR); } -void ManagerImpl::setHistoryLimit (const int& days) -{ - setConfig (PREFERENCES, CONFIG_HISTORY_LIMIT, days); +void ManagerImpl::setHistoryLimit (const int& days) { + setConfig(PREFERENCES, CONFIG_HISTORY_LIMIT, days); } -int ManagerImpl::getHistoryLimit (void) -{ - return getConfigInt (PREFERENCES , CONFIG_HISTORY_LIMIT); +int ManagerImpl::getHistoryLimit (void) { + return getConfigInt(PREFERENCES, CONFIG_HISTORY_LIMIT); } -std::string ManagerImpl::getHistoryEnabled (void) -{ - return getConfigString (PREFERENCES, CONFIG_HISTORY_ENABLED); +std::string ManagerImpl::getHistoryEnabled (void) { + return getConfigString(PREFERENCES, CONFIG_HISTORY_ENABLED); } -void ManagerImpl::setHistoryEnabled (void) -{ - (getConfigString (PREFERENCES, CONFIG_HISTORY_ENABLED) == TRUE_STR) ? setConfig (PREFERENCES, CONFIG_HISTORY_ENABLED, FALSE_STR) : setConfig (PREFERENCES, CONFIG_HISTORY_ENABLED, TRUE_STR); +void ManagerImpl::setHistoryEnabled (void) { + (getConfigString(PREFERENCES, CONFIG_HISTORY_ENABLED) == TRUE_STR) ? setConfig( + PREFERENCES, CONFIG_HISTORY_ENABLED, FALSE_STR) + : setConfig(PREFERENCES, CONFIG_HISTORY_ENABLED, TRUE_STR); } -int -ManagerImpl::getSearchbar (void) -{ - return getConfigInt (PREFERENCES , CONFIG_SEARCHBAR); +int ManagerImpl::getSearchbar (void) { + return getConfigInt(PREFERENCES, CONFIG_SEARCHBAR); } -void -ManagerImpl::setSearchbar (void) -{ - (getConfigInt (PREFERENCES , CONFIG_SEARCHBAR) == 1) ? setConfig (PREFERENCES , CONFIG_SEARCHBAR , FALSE_STR) : setConfig (PREFERENCES , CONFIG_SEARCHBAR , TRUE_STR); +void ManagerImpl::setSearchbar (void) { + (getConfigInt(PREFERENCES, CONFIG_SEARCHBAR) == 1) ? setConfig(PREFERENCES, + CONFIG_SEARCHBAR, FALSE_STR) : setConfig(PREFERENCES, + CONFIG_SEARCHBAR, TRUE_STR); } -int -ManagerImpl::popupMode (void) -{ - return (getConfigBool (PREFERENCES, CONFIG_POPUP) == true) ? 1:0 ; +int ManagerImpl::popupMode (void) { + return (getConfigBool(PREFERENCES, CONFIG_POPUP) == true) ? 1 : 0; } -int32_t -ManagerImpl::getNotify (void) -{ - return (getConfigBool (PREFERENCES , CONFIG_NOTIFY) == true) ? 1:0; +int32_t ManagerImpl::getNotify (void) { + return (getConfigBool(PREFERENCES, CONFIG_NOTIFY) == true) ? 1 : 0; } -void -ManagerImpl::setNotify (void) -{ - (getConfigString (PREFERENCES, CONFIG_NOTIFY) == NOTIFY_ALL) ? setConfig (PREFERENCES, CONFIG_NOTIFY , FALSE_STR) : setConfig (PREFERENCES, CONFIG_NOTIFY , TRUE_STR); +void ManagerImpl::setNotify (void) { + (getConfigString(PREFERENCES, CONFIG_NOTIFY) == NOTIFY_ALL) ? setConfig( + PREFERENCES, CONFIG_NOTIFY, FALSE_STR) : setConfig(PREFERENCES, + CONFIG_NOTIFY, TRUE_STR); } -int32_t -ManagerImpl::getMailNotify (void) -{ - return getConfigInt (PREFERENCES, CONFIG_MAIL_NOTIFY); +int32_t ManagerImpl::getMailNotify (void) { + return getConfigInt(PREFERENCES, CONFIG_MAIL_NOTIFY); } -void ManagerImpl::setAudioManager (const int32_t& api) -{ - - int type; - std::string alsaPlugin; +void ManagerImpl::setAudioManager (const int32_t& api) { - _debug ("Setting audio manager "); + int type; + std::string alsaPlugin; - if (!_audiodriver) - return; + _debug ("Setting audio manager "); - type = _audiodriver->getLayerType(); + if (!_audiodriver) + return; - if (type == api) { - _debug ("Audio manager chosen already in use. No changes made. "); - return; - } + type = _audiodriver->getLayerType(); - setConfig (PREFERENCES , CONFIG_AUDIO , api) ; - - switchAudioManager(); + if (type == api) { + _debug ("Audio manager chosen already in use. No changes made. "); + return; + } - if (_dbus) _dbus->getConfigurationManager()->audioManagerChanged(); + setConfig(PREFERENCES, CONFIG_AUDIO, api); - return; + switchAudioManager(); + return; } -int32_t -ManagerImpl::getAudioManager (void) -{ - return getConfigInt (PREFERENCES , CONFIG_AUDIO); +int32_t ManagerImpl::getAudioManager (void) { + return getConfigInt(PREFERENCES, CONFIG_AUDIO); } -void -ManagerImpl::setMailNotify (void) -{ - (getConfigString (PREFERENCES , CONFIG_MAIL_NOTIFY) == NOTIFY_ALL) ? setConfig (PREFERENCES , CONFIG_MAIL_NOTIFY , FALSE_STR) : setConfig (PREFERENCES , CONFIG_MAIL_NOTIFY , TRUE_STR); +void ManagerImpl::setMailNotify (void) { + (getConfigString(PREFERENCES, CONFIG_MAIL_NOTIFY) == NOTIFY_ALL) ? setConfig( + PREFERENCES, CONFIG_MAIL_NOTIFY, FALSE_STR) + : setConfig(PREFERENCES, CONFIG_MAIL_NOTIFY, TRUE_STR); } -void -ManagerImpl::notifyErrClient (const int32_t& errCode) -{ - if (_dbus) { - _debug ("NOTIFY ERR NUMBER %i" , errCode); - _dbus -> getConfigurationManager() -> errorAlert (errCode); - } +void ManagerImpl::notifyErrClient (const int32_t& errCode) { + if (_dbus) { + _debug ("NOTIFY ERR NUMBER %i" , errCode); + _dbus -> getConfigurationManager() -> errorAlert(errCode); + } } -int -ManagerImpl::getAudioDeviceIndex (const std::string name) -{ - AlsaLayer *alsalayer; +int ManagerImpl::getAudioDeviceIndex (const std::string name) { + AlsaLayer *alsalayer; - _debug ("Get audio device index"); + _debug ("Get audio device index"); - alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); + alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); - if (alsalayer) - return alsalayer -> soundCardGetIndex (name); - else - return 0; + if (alsalayer) + return alsalayer -> soundCardGetIndex(name); + else + return 0; } -std::string -ManagerImpl::getCurrentAudioOutputPlugin (void) -{ - AlsaLayer *alsalayer; +std::string ManagerImpl::getCurrentAudioOutputPlugin (void) { + AlsaLayer *alsalayer; - _debug ("Get alsa plugin"); + _debug ("Get alsa plugin"); - alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); + alsalayer = dynamic_cast<AlsaLayer *> (getAudioDriver()); - if (alsalayer) return alsalayer -> getAudioPlugin (); - else return getConfigString (AUDIO , ALSA_PLUGIN); + if (alsalayer) + return alsalayer -> getAudioPlugin(); + else + return getConfigString(AUDIO, ALSA_PLUGIN); } -int ManagerImpl::app_is_running (std::string process) -{ - std::ostringstream cmd; +int ManagerImpl::app_is_running (std::string process) { + std::ostringstream cmd; - cmd << "ps -C " << process; - return system (cmd.str().c_str()); + cmd << "ps -C " << process; + return system(cmd.str().c_str()); } - /** * Initialization: Main Thread */ -bool -ManagerImpl::initAudioDriver (void) -{ - - int error; - - _debugInit ("AudioLayer Creation"); - - if (getConfigInt (PREFERENCES , CONFIG_AUDIO) == ALSA) { - _audiodriver = new AlsaLayer (this); - _audiodriver->setMainBuffer (&_mainBuffer); - } else if (getConfigInt (PREFERENCES , CONFIG_AUDIO) == PULSEAUDIO) { - if (app_is_running ("pulseaudio") == 0) { - _audiodriver = new PulseLayer (this); - _audiodriver->setMainBuffer (&_mainBuffer); - } else { - _audiodriver = new AlsaLayer (this); - setConfig (PREFERENCES, CONFIG_AUDIO, ALSA); - _audiodriver->setMainBuffer (&_mainBuffer); - } - } else - _debug ("Error - Audio API unknown"); - - if (_audiodriver == 0) { - _debug ("Init audio driver error"); - return false; - } else { - error = getAudioDriver()->getErrorMessage(); - - if (error == -1) { - _debug ("Init audio driver: %i", error); - return false; - } - } +bool ManagerImpl::initAudioDriver (void) { + + int error; + + _debugInit ("AudioLayer Creation"); + + if (getConfigInt(PREFERENCES, CONFIG_AUDIO) == ALSA) { + _audiodriver = new AlsaLayer(this); + _audiodriver->setMainBuffer(&_mainBuffer); + } else if (getConfigInt(PREFERENCES, CONFIG_AUDIO) == PULSEAUDIO) { + if (app_is_running("pulseaudio") == 0) { + _audiodriver = new PulseLayer(this); + _audiodriver->setMainBuffer(&_mainBuffer); + } else { + _audiodriver = new AlsaLayer(this); + setConfig(PREFERENCES, CONFIG_AUDIO, ALSA); + _audiodriver->setMainBuffer(&_mainBuffer); + } + } else + _debug ("Error - Audio API unknown"); + + if (_audiodriver == 0) { + _debug ("Init audio driver error"); + return false; + } else { + error = getAudioDriver()->getErrorMessage(); + + if (error == -1) { + _debug ("Init audio driver: %i", error); + return false; + } + } - return true; + return true; } /** * Initialization: Main Thread and gui */ -void -ManagerImpl::selectAudioDriver (void) -{ - int layer, numCardIn, numCardOut, sampleRate, frameSize; - std::string alsaPlugin; - AlsaLayer *alsalayer; - - layer = _audiodriver->getLayerType(); - _debug ("Audio layer type: %i" , layer); - - /* Retrieve the global devices info from the user config */ - alsaPlugin = getConfigString (AUDIO , ALSA_PLUGIN); - numCardIn = getConfigInt (AUDIO , ALSA_CARD_ID_IN); - numCardOut = getConfigInt (AUDIO , ALSA_CARD_ID_OUT); - sampleRate = getConfigInt (AUDIO , ALSA_SAMPLE_RATE); - - if (sampleRate <=0 || sampleRate > 48000) { - sampleRate = 44100; - } +void ManagerImpl::selectAudioDriver (void) { + int layer, numCardIn, numCardOut, sampleRate, frameSize; + std::string alsaPlugin; + AlsaLayer *alsalayer; + + layer = _audiodriver->getLayerType(); + _debug ("Audio layer type: %i" , layer); + + /* Retrieve the global devices info from the user config */ + alsaPlugin = getConfigString(AUDIO, ALSA_PLUGIN); + numCardIn = getConfigInt(AUDIO, ALSA_CARD_ID_IN); + numCardOut = getConfigInt(AUDIO, ALSA_CARD_ID_OUT); + sampleRate = getConfigInt(AUDIO, AUDIO_SAMPLE_RATE); + + if (sampleRate <= 0 || sampleRate > 48000) { + sampleRate = 44100; + } - frameSize = getConfigInt (AUDIO , ALSA_FRAME_SIZE); + frameSize = getConfigInt(AUDIO, ALSA_FRAME_SIZE); - /* Only for the ALSA layer, we check the sound card information */ + /* Only for the ALSA layer, we check the sound card information */ - if (layer == ALSA) { - alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver ()); + if (layer == ALSA) { + alsalayer = dynamic_cast<AlsaLayer*> (getAudioDriver()); - if (!alsalayer -> soundCardIndexExist (numCardIn , SFL_PCM_CAPTURE)) { - _debug (" Card with index %i doesn't exist or cannot capture. Switch to 0.", numCardIn); - numCardIn = ALSA_DFT_CARD_ID ; - setConfig (AUDIO , ALSA_CARD_ID_IN , ALSA_DFT_CARD_ID); - } + if (!alsalayer -> soundCardIndexExist(numCardIn, SFL_PCM_CAPTURE)) { + _debug (" Card with index %i doesn't exist or cannot capture. Switch to 0.", numCardIn); + numCardIn = ALSA_DFT_CARD_ID; + setConfig(AUDIO, ALSA_CARD_ID_IN, ALSA_DFT_CARD_ID); + } - if (!alsalayer -> soundCardIndexExist (numCardOut , SFL_PCM_PLAYBACK)) { - _debug (" Card with index %i doesn't exist or cannot playback . Switch to 0.", numCardOut); - numCardOut = ALSA_DFT_CARD_ID ; - setConfig (AUDIO , ALSA_CARD_ID_OUT , ALSA_DFT_CARD_ID); - } - } + if (!alsalayer -> soundCardIndexExist(numCardOut, SFL_PCM_PLAYBACK)) { + _debug (" Card with index %i doesn't exist or cannot playback . Switch to 0.", numCardOut); + numCardOut = ALSA_DFT_CARD_ID; + setConfig(AUDIO, ALSA_CARD_ID_OUT, ALSA_DFT_CARD_ID); + } + } - _audiodriver->setErrorMessage (-1); + _audiodriver->setErrorMessage(-1); - /* Open the audio devices */ - _audiodriver->openDevice (numCardIn , numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin); - /* Notify the error if there is one */ + /* Open the audio devices */ + _audiodriver->openDevice(numCardIn, numCardOut, sampleRate, frameSize, + SFL_PCM_BOTH, alsaPlugin); + /* Notify the error if there is one */ - if (_audiodriver -> getErrorMessage() != -1) - notifyErrClient (_audiodriver -> getErrorMessage()); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient(_audiodriver -> getErrorMessage()); } -void ManagerImpl::switchAudioManager (void) -{ - int type, samplerate, framesize, numCardIn, numCardOut; - std::string alsaPlugin; +void ManagerImpl::switchAudioManager (void) { + int type, samplerate, framesize, numCardIn, numCardOut; + std::string alsaPlugin; - _debug ("Switching audio manager "); + _debug ("Switching audio manager "); - if (!_audiodriver) - return; + if (!_audiodriver) + return; - type = _audiodriver->getLayerType(); + type = _audiodriver->getLayerType(); - samplerate = getConfigInt (AUDIO , ALSA_SAMPLE_RATE); + samplerate = getConfigInt(AUDIO, AUDIO_SAMPLE_RATE); - framesize = getConfigInt (AUDIO , ALSA_FRAME_SIZE); + framesize = getConfigInt(AUDIO, ALSA_FRAME_SIZE); - _debug ("samplerate: %i, framesize %i\n", samplerate, framesize); + _debug ("samplerate: %i, framesize %i\n", samplerate, framesize); - alsaPlugin = getConfigString (AUDIO , ALSA_PLUGIN); + alsaPlugin = getConfigString(AUDIO, ALSA_PLUGIN); - numCardIn = getConfigInt (AUDIO , ALSA_CARD_ID_IN); + numCardIn = getConfigInt(AUDIO, ALSA_CARD_ID_IN); - numCardOut = getConfigInt (AUDIO , ALSA_CARD_ID_OUT); + numCardOut = getConfigInt(AUDIO, ALSA_CARD_ID_OUT); - _debug ("Deleting current layer... "); + _debug ("Deleting current layer... "); - // ost::MutexLock lock (*getAudioLayerMutex()); - getAudioLayerMutex()->enter(); + // ost::MutexLock lock (*getAudioLayerMutex()); + getAudioLayerMutex()->enter(); - // _audiodriver->closeLayer(); - delete _audiodriver; + // _audiodriver->closeLayer(); + delete _audiodriver; - _audiodriver = NULL; + _audiodriver = NULL; - switch (type) { + switch (type) { - case ALSA: - _debug ("Creating Pulseaudio layer..."); - _audiodriver = new PulseLayer (this); - _audiodriver->setMainBuffer (&_mainBuffer); - break; + case ALSA: + _debug ("Creating Pulseaudio layer..."); + _audiodriver = new PulseLayer(this); + _audiodriver->setMainBuffer(&_mainBuffer); + break; - case PULSEAUDIO: - _debug ("Creating ALSA layer..."); - _audiodriver = new AlsaLayer (this); - _audiodriver->setMainBuffer (&_mainBuffer); - break; + case PULSEAUDIO: + _debug ("Creating ALSA layer..."); + _audiodriver = new AlsaLayer(this); + _audiodriver->setMainBuffer(&_mainBuffer); + break; - default: - _debug ("Error: audio layer unknown"); - break; - } + default: + _debug ("Error: audio layer unknown"); + break; + } - _audiodriver->setErrorMessage (-1); + _audiodriver->setErrorMessage(-1); - _audiodriver->openDevice (numCardIn , numCardOut, samplerate, framesize, SFL_PCM_BOTH, alsaPlugin); + _audiodriver->openDevice(numCardIn, numCardOut, samplerate, framesize, + SFL_PCM_BOTH, alsaPlugin); - if (_audiodriver -> getErrorMessage() != -1) - notifyErrClient (_audiodriver -> getErrorMessage()); + if (_audiodriver -> getErrorMessage() != -1) + notifyErrClient(_audiodriver -> getErrorMessage()); - _debug ("Current device: %i ", type); + _debug ("Current device: %i ", type); - _debug ("has current call: %i ", hasCurrentCall()); + _debug ("has current call: %i ", hasCurrentCall()); - if (hasCurrentCall()) - _audiodriver->startStream(); + if (hasCurrentCall()) + _audiodriver->startStream(); - // ost::MutexLock unlock (*getAudioLayerMutex()); - getAudioLayerMutex()->leave(); + // ost::MutexLock unlock (*getAudioLayerMutex()); + getAudioLayerMutex()->leave(); - // need to stop audio streams if there is currently no call - // if ( (type != PULSEAUDIO) && (!hasCurrentCall())) { - // _debug("There is currently a call!!"); - // _audiodriver->stopStream(); + // need to stop audio streams if there is currently no call + // if ( (type != PULSEAUDIO) && (!hasCurrentCall())) { + // _debug("There is currently a call!!"); + // _audiodriver->stopStream(); - // } + // } } /** * Init the volume for speakers/micro from 0 to 100 value * Initialization: Main Thread */ -void -ManagerImpl::initVolume() -{ - _debugInit ("Initiate Volume"); - setSpkrVolume (getConfigInt (AUDIO, VOLUME_SPKR)); - setMicVolume (getConfigInt (AUDIO, VOLUME_MICRO)); +void ManagerImpl::initVolume () { + _debugInit ("Initiate Volume"); + setSpkrVolume(getConfigInt(AUDIO, VOLUME_SPKR)); + setMicVolume(getConfigInt(AUDIO, VOLUME_MICRO)); } +void ManagerImpl::setSpkrVolume (unsigned short spkr_vol) { + PulseLayer *pulselayer = NULL; -void ManagerImpl::setSpkrVolume (unsigned short spkr_vol) -{ - PulseLayer *pulselayer = NULL; + /* Set the manager sound volume */ + _spkr_volume = spkr_vol; - /* Set the manager sound volume */ - _spkr_volume = spkr_vol; + /* Only for PulseAudio */ + pulselayer = dynamic_cast<PulseLayer*> (getAudioDriver()); - /* Only for PulseAudio */ - pulselayer = dynamic_cast<PulseLayer*> (getAudioDriver()); - - if (pulselayer) { - if (pulselayer->getLayerType() == PULSEAUDIO) { - if (pulselayer) pulselayer->setPlaybackVolume (spkr_vol); - } - } + if (pulselayer) { + if (pulselayer->getLayerType() == PULSEAUDIO) { + if (pulselayer) + pulselayer->setPlaybackVolume(spkr_vol); + } + } } - -void ManagerImpl::setMicVolume (unsigned short mic_vol) -{ - _mic_volume = mic_vol; +void ManagerImpl::setMicVolume (unsigned short mic_vol) { + _mic_volume = mic_vol; } - - - -int ManagerImpl::getLocalIp2IpPort (void) -{ - // The SIP port used for default account (IP to IP) calls - _debug ("Default account port %i", getConfigInt (IP2IP_PROFILE, LOCAL_PORT)); - - return getConfigInt (IP2IP_PROFILE, LOCAL_PORT); +int ManagerImpl::getLocalIp2IpPort (void) { + // The SIP port used for default account (IP to IP) calls= + return getConfigInt(IP2IP_PROFILE, LOCAL_PORT); } - // TODO: rewrite this /** * Main Thread */ -bool -ManagerImpl::getCallStatus (const std::string& sequenceId UNUSED) -{ - if (!_dbus) { - return false; - } - - ost::MutexLock m (_callAccountMapMutex); - - CallAccountMap::iterator iter = _callAccountMap.begin(); - TokenList tk; - std::string code; - std::string status; - std::string destination; - std::string number; - - while (iter != _callAccountMap.end()) { - Call* call = getAccountLink (iter->second)->getCall (iter->first); - Call::ConnectionState state = call->getConnectionState(); - - if (state != Call::Connected) { - switch (state) { - - case Call::Trying: - code="110"; - status = "Trying"; - break; - - case Call::Ringing: - code="111"; - status = "Ringing"; - break; - - case Call::Progressing: - code="125"; - status = "Progressing"; - break; - - case Call::Disconnected: - code="125"; - status = "Disconnected"; - break; - - default: - code=""; - status= ""; - } - } else { - switch (call->getState()) { - - case Call::Active: - - case Call::Conferencing: - code="112"; - status = "Established"; - break; - - case Call::Hold: - code="114"; - status = "Held"; - break; - - case Call::Busy: - code="113"; - status = "Busy"; - break; - - case Call::Refused: - code="125"; - status = "Refused"; - break; - - case Call::Error: - code="125"; - status = "Error"; - break; - - case Call::Inactive: - code="125"; - status = "Inactive"; - break; - } - } - - // No Congestion - // No Wrong Number - // 116 <CSeq> <call-id> <acc> <destination> Busy - destination = call->getPeerName(); - - number = call->getPeerNumber(); - - if (number!="") { - destination.append (" <"); - destination.append (number); - destination.append (">"); - } - - tk.push_back (iter->second); - - tk.push_back (destination); - tk.push_back (status); - tk.clear(); - - iter++; - } - - return true; +bool ManagerImpl::getCallStatus (const std::string& sequenceId UNUSED) { + if (!_dbus) { + return false; + } + + ost::MutexLock m(_callAccountMapMutex); + + CallAccountMap::iterator iter = _callAccountMap.begin(); + TokenList tk; + std::string code; + std::string status; + std::string destination; + std::string number; + + while (iter != _callAccountMap.end()) { + Call* call = getAccountLink(iter->second)->getCall(iter->first); + Call::ConnectionState state = call->getConnectionState(); + + if (state != Call::Connected) { + switch (state) { + + case Call::Trying: + code = "110"; + status = "Trying"; + break; + + case Call::Ringing: + code = "111"; + status = "Ringing"; + break; + + case Call::Progressing: + code = "125"; + status = "Progressing"; + break; + + case Call::Disconnected: + code = "125"; + status = "Disconnected"; + break; + + default: + code = ""; + status = ""; + } + } else { + switch (call->getState()) { + + case Call::Active: + + case Call::Conferencing: + code = "112"; + status = "Established"; + break; + + case Call::Hold: + code = "114"; + status = "Held"; + break; + + case Call::Busy: + code = "113"; + status = "Busy"; + break; + + case Call::Refused: + code = "125"; + status = "Refused"; + break; + + case Call::Error: + code = "125"; + status = "Error"; + break; + + case Call::Inactive: + code = "125"; + status = "Inactive"; + break; + } + } + + // No Congestion + // No Wrong Number + // 116 <CSeq> <call-id> <acc> <destination> Busy + destination = call->getPeerName(); + + number = call->getPeerNumber(); + + if (number != "") { + destination.append(" <"); + destination.append(number); + destination.append(">"); + } + + tk.push_back(iter->second); + + tk.push_back(destination); + tk.push_back(status); + tk.clear(); + + iter++; + } + + return true; } //THREAD=Main -bool -ManagerImpl::getConfig (const std::string& section, const std::string& name, TokenList& arg) -{ - return _config.getConfigTreeItemToken (section, name, arg); +bool ManagerImpl::getConfig (const std::string& section, + const std::string& name, TokenList& arg) { + return _config.getConfigTreeItemToken(section, name, arg); } //THREAD=Main // throw an Conf::ConfigTreeItemException if not found -int -ManagerImpl::getConfigInt (const std::string& section, const std::string& name) -{ - try { - return _config.getConfigTreeItemIntValue (section, name); - } catch (Conf::ConfigTreeItemException& e) { - throw e; - } +int ManagerImpl::getConfigInt (const std::string& section, + const std::string& name) { + try { + return _config.getConfigTreeItemIntValue(section, name); + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } - return 0; + return 0; } -bool -ManagerImpl::getConfigBool (const std::string& section, const std::string& name) -{ - try { - return (_config.getConfigTreeItemValue (section, name) == TRUE_STR) ? true:false; - } catch (Conf::ConfigTreeItemException& e) { - throw e; - } +bool ManagerImpl::getConfigBool (const std::string& section, + const std::string& name) { + try { + return (_config.getConfigTreeItemValue(section, name) == TRUE_STR) ? true + : false; + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } - return false; + return false; } //THREAD=Main -std::string -ManagerImpl::getConfigString (const std::string& section, const std::string& - name) -{ - try { - return _config.getConfigTreeItemValue (section, name); - } catch (Conf::ConfigTreeItemException& e) { - throw e; - } +std::string ManagerImpl::getConfigString (const std::string& section, + const std::string& name) { + try { + return _config.getConfigTreeItemValue(section, name); + } catch (Conf::ConfigTreeItemException& e) { + throw e; + } - return ""; + return ""; } //THREAD=Main -bool -ManagerImpl::setConfig (const std::string& section, const std::string& name, const std::string& value) -{ - _debug ("ManagerImpl::setConfig %s %s %s", section.c_str(), name.c_str(), value.c_str()); - return _config.setConfigTreeItem (section, name, value); +bool ManagerImpl::setConfig (const std::string& section, + const std::string& name, const std::string& value) { + _debug ("ManagerImpl::setConfig %s %s %s", section.c_str(), name.c_str(), value.c_str()); + return _config.setConfigTreeItem(section, name, value); } //THREAD=Main -bool -ManagerImpl::setConfig (const std::string& section, const std::string& name, int value) -{ - std::ostringstream valueStream; - valueStream << value; - return _config.setConfigTreeItem (section, name, valueStream.str()); -} - -void ManagerImpl::setAccountsOrder (const std::string& order) -{ - _debug ("Setcreate accounts order : %s", order.c_str()); - // Set the new config - setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, order); -} - -std::vector< std::string > -ManagerImpl::getAccountList() -{ - std::vector< std::string > v; - std::vector< std::string > account_order; - unsigned int i; - - account_order = loadAccountOrder (); - AccountMap::iterator iter; - - // If no order has been set, load the default one - // ie according to the creation date. - - if (account_order.size () == 0) { - iter = _accountMap.begin (); - - while (iter != _accountMap.end()) { - - if (iter->second != NULL && iter->first != IP2IP_PROFILE) { - //_debug("PUSHING BACK %s\n", iter->first.c_str()); - v.push_back (iter->first.data()); - } - - iter++; - } - } - - // Otherelse, load the custom one - // ie according to the saved order - else { - - for (i=0; i<account_order.size (); i++) { - // This account has not been loaded, so we ignore it - if ( (iter=_accountMap.find (account_order[i])) != _accountMap.end()) { - // If the account is valid - if (iter->second != NULL && iter->first != IP2IP_PROFILE) { - v.push_back (iter->first.data ()); - } - } - } - } - - return v; -} - -std::map< std::string, std::string > ManagerImpl::getAccountDetails (const AccountID& accountID) -{ - std::map<std::string, std::string> a; - - Account * account = _accountMap[accountID]; - - if (account == NULL) { - _debug ("Cannot getAccountDetails on a non-existing accountID %s. Defaults will be used.", accountID.c_str()); - } - - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ALIAS, getConfigString (accountID, CONFIG_ACCOUNT_ALIAS))); - - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_ENABLE, getConfigString (accountID, CONFIG_ACCOUNT_ENABLE))); - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_RESOLVE_ONCE, getConfigString (accountID, CONFIG_ACCOUNT_RESOLVE_ONCE))); - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_TYPE, getConfigString (accountID, CONFIG_ACCOUNT_TYPE))); - a.insert (std::pair<std::string, std::string> (HOSTNAME, getConfigString (accountID, HOSTNAME))); - a.insert (std::pair<std::string, std::string> (USERNAME, getConfigString (accountID, USERNAME))); - a.insert (std::pair<std::string, std::string> (PASSWORD, getConfigString (accountID, PASSWORD))); - a.insert (std::pair<std::string, std::string> (REALM, getConfigString (accountID, REALM))); - a.insert (std::pair<std::string, std::string> (AUTHENTICATION_USERNAME, getConfigString (accountID, AUTHENTICATION_USERNAME))); - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_MAILBOX, getConfigString (accountID, CONFIG_ACCOUNT_MAILBOX))); - a.insert (std::pair<std::string, std::string> (CONFIG_ACCOUNT_REGISTRATION_EXPIRE, getConfigString (accountID, CONFIG_ACCOUNT_REGISTRATION_EXPIRE))); - a.insert (std::pair<std::string, std::string> (LOCAL_INTERFACE, getConfigString (accountID, LOCAL_INTERFACE))); - a.insert (std::pair<std::string, std::string> (PUBLISHED_SAMEAS_LOCAL, getConfigString (accountID, PUBLISHED_SAMEAS_LOCAL))); - a.insert (std::pair<std::string, std::string> (PUBLISHED_ADDRESS, getConfigString (accountID, PUBLISHED_ADDRESS))); - a.insert (std::pair<std::string, std::string> (LOCAL_PORT, getConfigString (accountID, LOCAL_PORT))); - a.insert (std::pair<std::string, std::string> (PUBLISHED_PORT, getConfigString (accountID, PUBLISHED_PORT))); - a.insert (std::pair<std::string, std::string> (DISPLAY_NAME, getConfigString (accountID, DISPLAY_NAME))); - a.insert (std::pair<std::string, std::string> (STUN_ENABLE, getConfigString (accountID, STUN_ENABLE))); - a.insert (std::pair<std::string, std::string> (STUN_SERVER, getConfigString (accountID, STUN_SERVER))); - - RegistrationState state; - std::string registrationStateCode; - std::string registrationStateDescription; - - if (account != NULL) { - state = account->getRegistrationState(); - int code = account->getRegistrationStateDetailed().first; - std::stringstream out; - out << code; - registrationStateCode = out.str(); - registrationStateDescription = account->getRegistrationStateDetailed().second; - } else { - state = Unregistered; - } - - a.insert (std::pair<std::string, std::string> (REGISTRATION_STATUS, mapStateNumberToString (state))); - - a.insert (std::pair<std::string, std::string> (REGISTRATION_STATE_CODE, registrationStateCode)); - a.insert (std::pair<std::string, std::string> (REGISTRATION_STATE_DESCRIPTION, registrationStateDescription)); - a.insert (std::pair<std::string, std::string> (SRTP_KEY_EXCHANGE, getConfigString (accountID, SRTP_KEY_EXCHANGE))); - a.insert (std::pair<std::string, std::string> (SRTP_ENABLE, getConfigString (accountID, SRTP_ENABLE))); - a.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS, getConfigString (accountID, ZRTP_DISPLAY_SAS))); - a.insert (std::pair<std::string, std::string> (ZRTP_DISPLAY_SAS_ONCE, getConfigString (accountID, ZRTP_DISPLAY_SAS_ONCE))); - a.insert (std::pair<std::string, std::string> (ZRTP_HELLO_HASH, getConfigString (accountID, ZRTP_HELLO_HASH))); - a.insert (std::pair<std::string, std::string> (ZRTP_NOT_SUPP_WARNING, getConfigString (accountID, ZRTP_NOT_SUPP_WARNING))); - - a.insert (std::pair<std::string, std::string> (TLS_ENABLE, Manager::instance().getConfigString (accountID, TLS_ENABLE))); - a.insert (std::pair<std::string, std::string> (TLS_CA_LIST_FILE, Manager::instance().getConfigString (accountID, TLS_CA_LIST_FILE))); - a.insert (std::pair<std::string, std::string> (TLS_CERTIFICATE_FILE, Manager::instance().getConfigString (accountID, TLS_CERTIFICATE_FILE))); - a.insert (std::pair<std::string, std::string> (TLS_PRIVATE_KEY_FILE, Manager::instance().getConfigString (accountID, TLS_PRIVATE_KEY_FILE))); - a.insert (std::pair<std::string, std::string> (TLS_PASSWORD, Manager::instance().getConfigString (accountID, TLS_PASSWORD))); - a.insert (std::pair<std::string, std::string> (TLS_METHOD, Manager::instance().getConfigString (accountID, TLS_METHOD))); - a.insert (std::pair<std::string, std::string> (TLS_CIPHERS, Manager::instance().getConfigString (accountID, TLS_CIPHERS))); - a.insert (std::pair<std::string, std::string> (TLS_SERVER_NAME, Manager::instance().getConfigString (accountID, TLS_SERVER_NAME))); - a.insert (std::pair<std::string, std::string> (TLS_VERIFY_SERVER, Manager::instance().getConfigString (accountID, TLS_VERIFY_SERVER))); - a.insert (std::pair<std::string, std::string> (TLS_VERIFY_CLIENT, Manager::instance().getConfigString (accountID, TLS_VERIFY_CLIENT))); - a.insert (std::pair<std::string, std::string> (TLS_REQUIRE_CLIENT_CERTIFICATE, Manager::instance().getConfigString (accountID, TLS_REQUIRE_CLIENT_CERTIFICATE))); - a.insert (std::pair<std::string, std::string> (TLS_NEGOTIATION_TIMEOUT_SEC, Manager::instance().getConfigString (accountID, TLS_NEGOTIATION_TIMEOUT_SEC))); - a.insert (std::pair<std::string, std::string> (TLS_NEGOTIATION_TIMEOUT_MSEC, Manager::instance().getConfigString (accountID, TLS_NEGOTIATION_TIMEOUT_MSEC))); - - return a; +bool ManagerImpl::setConfig (const std::string& section, + const std::string& name, int value) { + std::ostringstream valueStream; + valueStream << value; + return _config.setConfigTreeItem(section, name, valueStream.str()); +} + +void ManagerImpl::setAccountsOrder (const std::string& order) { + _debug ("Setcreate accounts order : %s", order.c_str()); + // Set the new config + setConfig(PREFERENCES, CONFIG_ACCOUNTS_ORDER, order); +} + +std::vector<std::string> ManagerImpl::getAccountList () { + + std::vector<std::string> v; + std::vector<std::string> account_order; + unsigned int i; + + account_order = loadAccountOrder(); + AccountMap::iterator iter; + + // The IP2IP profile is always available, and first in the list + iter = _accountMap.find(IP2IP_PROFILE); + if (iter->second != NULL) + v.push_back(iter->first.data()); + + // If no order has been set, load the default one + // ie according to the creation date. + + if (account_order.size() == 0) { + iter = _accountMap.begin(); + + while (iter != _accountMap.end()) { + + if (iter->second != NULL && iter->first != IP2IP_PROFILE) { + //_debug("PUSHING BACK %s\n", iter->first.c_str()); + v.push_back(iter->first.data()); + } + + iter++; + } + } + + // Otherelse, load the custom one + // ie according to the saved order + else { + + for (i = 0; i < account_order.size(); i++) { + // This account has not been loaded, so we ignore it + if ((iter = _accountMap.find(account_order[i])) + != _accountMap.end()) { + // If the account is valid + if (iter->second != NULL && iter->first != IP2IP_PROFILE) { + v.push_back(iter->first.data()); + } + } + } + } + + return v; +} + +std::map<std::string, std::string> ManagerImpl::getAccountDetails ( + const AccountID& accountID) { + std::map<std::string, std::string> a; + + Account * account = _accountMap[accountID]; + + if (account == NULL) { + _debug ("Cannot getAccountDetails on a non-existing accountID %s. Defaults will be used.", accountID.c_str()); + } + + a.insert(std::pair<std::string, std::string>(ACCOUNT_ID, accountID)); + + // The IP profile does not allow to set an alias + (accountID == IP2IP_PROFILE) ? a.insert( + std::pair<std::string, std::string>(CONFIG_ACCOUNT_ALIAS, + DIRECT_IP_CALL)) : a.insert(std::pair<std::string, + std::string>(CONFIG_ACCOUNT_ALIAS, getConfigString(accountID, + CONFIG_ACCOUNT_ALIAS))); + + a.insert(std::pair<std::string, std::string>(CONFIG_ACCOUNT_ENABLE, + getConfigString(accountID, CONFIG_ACCOUNT_ENABLE))); + a.insert(std::pair<std::string, std::string>(CONFIG_ACCOUNT_RESOLVE_ONCE, + getConfigString(accountID, CONFIG_ACCOUNT_RESOLVE_ONCE))); + a.insert(std::pair<std::string, std::string>(CONFIG_ACCOUNT_TYPE, + getConfigString(accountID, CONFIG_ACCOUNT_TYPE))); + a.insert(std::pair<std::string, std::string>(HOSTNAME, getConfigString( + accountID, HOSTNAME))); + a.insert(std::pair<std::string, std::string>(USERNAME, getConfigString( + accountID, USERNAME))); + a.insert(std::pair<std::string, std::string>(PASSWORD, getConfigString( + accountID, PASSWORD))); + a.insert(std::pair<std::string, std::string>(REALM, getConfigString( + accountID, REALM))); + a.insert(std::pair<std::string, std::string>(USERAGENT, getConfigString( + accountID, USERAGENT))); + a.insert(std::pair<std::string, std::string>(AUTHENTICATION_USERNAME, + getConfigString(accountID, AUTHENTICATION_USERNAME))); + a.insert(std::pair<std::string, std::string>(CONFIG_ACCOUNT_MAILBOX, + getConfigString(accountID, CONFIG_ACCOUNT_MAILBOX))); + a.insert(std::pair<std::string, std::string>( + CONFIG_ACCOUNT_REGISTRATION_EXPIRE, getConfigString(accountID, + CONFIG_ACCOUNT_REGISTRATION_EXPIRE))); + a.insert(std::pair<std::string, std::string>(LOCAL_INTERFACE, + getConfigString(accountID, LOCAL_INTERFACE))); + a.insert(std::pair<std::string, std::string>(PUBLISHED_SAMEAS_LOCAL, + getConfigString(accountID, PUBLISHED_SAMEAS_LOCAL))); + a.insert(std::pair<std::string, std::string>(PUBLISHED_ADDRESS, + getConfigString(accountID, PUBLISHED_ADDRESS))); + a.insert(std::pair<std::string, std::string>(LOCAL_PORT, getConfigString( + accountID, LOCAL_PORT))); + a.insert(std::pair<std::string, std::string>(PUBLISHED_PORT, + getConfigString(accountID, PUBLISHED_PORT))); + a.insert(std::pair<std::string, std::string>(DISPLAY_NAME, getConfigString( + accountID, DISPLAY_NAME))); + a.insert(std::pair<std::string, std::string>(STUN_ENABLE, getConfigString( + accountID, STUN_ENABLE))); + a.insert(std::pair<std::string, std::string>(STUN_SERVER, getConfigString( + accountID, STUN_SERVER))); + a.insert(std::pair<std::string, std::string>(ACCOUNT_DTMF_TYPE, getConfigString( + accountID, ACCOUNT_DTMF_TYPE))); + + RegistrationState state; + std::string registrationStateCode; + std::string registrationStateDescription; + + if (account != NULL) { + if (accountID == IP2IP_PROFILE) { + registrationStateCode = EMPTY_FIELD; + registrationStateDescription = "Direct IP call"; + } else { + state = account->getRegistrationState(); + int code = account->getRegistrationStateDetailed().first; + std::stringstream out; + out << code; + registrationStateCode = out.str(); + registrationStateDescription + = account->getRegistrationStateDetailed().second; + } + } else { + state = Unregistered; + } + + (accountID == IP2IP_PROFILE) ? a.insert( + std::pair<std::string, std::string>(REGISTRATION_STATUS, "READY")) + : a.insert(std::pair<std::string, std::string>(REGISTRATION_STATUS, + mapStateNumberToString(state))); + + a.insert(std::pair<std::string, std::string>(REGISTRATION_STATE_CODE, + registrationStateCode)); + a.insert(std::pair<std::string, std::string>( + REGISTRATION_STATE_DESCRIPTION, registrationStateDescription)); + a.insert(std::pair<std::string, std::string>(SRTP_KEY_EXCHANGE, + getConfigString(accountID, SRTP_KEY_EXCHANGE))); + a.insert(std::pair<std::string, std::string>(SRTP_ENABLE, getConfigString( + accountID, SRTP_ENABLE))); + a.insert(std::pair<std::string, std::string>(SRTP_RTP_FALLBACK, + getConfigString(accountID, SRTP_RTP_FALLBACK))); + a.insert(std::pair<std::string, std::string>(ZRTP_DISPLAY_SAS, + getConfigString(accountID, ZRTP_DISPLAY_SAS))); + a.insert(std::pair<std::string, std::string>(ZRTP_DISPLAY_SAS_ONCE, + getConfigString(accountID, ZRTP_DISPLAY_SAS_ONCE))); + a.insert(std::pair<std::string, std::string>(ZRTP_HELLO_HASH, + getConfigString(accountID, ZRTP_HELLO_HASH))); + a.insert(std::pair<std::string, std::string>(ZRTP_NOT_SUPP_WARNING, + getConfigString(accountID, ZRTP_NOT_SUPP_WARNING))); + + // TLS listener is unique and parameters are modified through IP2IP_PROFILE + a.insert(std::pair<std::string, std::string>(TLS_LISTENER_PORT, + Manager::instance().getConfigString(IP2IP_PROFILE, + TLS_LISTENER_PORT))); + a.insert(std::pair<std::string, std::string>(TLS_ENABLE, + Manager::instance().getConfigString(accountID, TLS_ENABLE))); + a.insert(std::pair<std::string, std::string>(TLS_CA_LIST_FILE, + Manager::instance().getConfigString(accountID, TLS_CA_LIST_FILE))); + a.insert( + std::pair<std::string, std::string>(TLS_CERTIFICATE_FILE, + Manager::instance().getConfigString(accountID, + TLS_CERTIFICATE_FILE))); + a.insert( + std::pair<std::string, std::string>(TLS_PRIVATE_KEY_FILE, + Manager::instance().getConfigString(accountID, + TLS_PRIVATE_KEY_FILE))); + a.insert(std::pair<std::string, std::string>(TLS_PASSWORD, + Manager::instance().getConfigString(accountID, TLS_PASSWORD))); + a.insert(std::pair<std::string, std::string>(TLS_METHOD, + Manager::instance().getConfigString(accountID, TLS_METHOD))); + a.insert(std::pair<std::string, std::string>(TLS_CIPHERS, + Manager::instance().getConfigString(accountID, TLS_CIPHERS))); + a.insert(std::pair<std::string, std::string>(TLS_SERVER_NAME, + Manager::instance().getConfigString(accountID, TLS_SERVER_NAME))); + a.insert(std::pair<std::string, std::string>(TLS_VERIFY_SERVER, + Manager::instance().getConfigString(accountID, TLS_VERIFY_SERVER))); + a.insert(std::pair<std::string, std::string>(TLS_VERIFY_CLIENT, + Manager::instance().getConfigString(accountID, TLS_VERIFY_CLIENT))); + a.insert(std::pair<std::string, std::string>( + TLS_REQUIRE_CLIENT_CERTIFICATE, + Manager::instance().getConfigString(accountID, + TLS_REQUIRE_CLIENT_CERTIFICATE))); + a.insert(std::pair<std::string, std::string>(TLS_NEGOTIATION_TIMEOUT_SEC, + Manager::instance().getConfigString(accountID, + TLS_NEGOTIATION_TIMEOUT_SEC))); + a.insert(std::pair<std::string, std::string>(TLS_NEGOTIATION_TIMEOUT_MSEC, + Manager::instance().getConfigString(accountID, + TLS_NEGOTIATION_TIMEOUT_MSEC))); + + return a; } /* Transform digest to string. @@ -3559,1021 +3331,1063 @@ std::map< std::string, std::string > ManagerImpl::getAccountDetails (const Accou * NOTE: THE OUTPUT STRING IS NOT NULL TERMINATED! */ -void ManagerImpl::digest2str (const unsigned char digest[], char *output) -{ - int i; +void ManagerImpl::digest2str (const unsigned char digest[], char *output) { + int i; - for (i = 0; i<16; ++i) { - pj_val_to_hex_digit (digest[i], output); - output += 2; - } + for (i = 0; i < 16; ++i) { + pj_val_to_hex_digit(digest[i], output); + output += 2; + } } -std::string ManagerImpl::computeMd5HashFromCredential (const std::string& username, const std::string& password, const std::string& realm) -{ - pj_md5_context pms; - unsigned char digest[16]; - char ha1[PJSIP_MD5STRLEN]; +std::string ManagerImpl::computeMd5HashFromCredential ( + const std::string& username, const std::string& password, + const std::string& realm) { + pj_md5_context pms; + unsigned char digest[16]; + char ha1[PJSIP_MD5STRLEN]; - pj_str_t usernamePjFormat = pj_str (strdup (username.c_str())); - pj_str_t passwordPjFormat = pj_str (strdup (password.c_str())); - pj_str_t realmPjFormat = pj_str (strdup (realm.c_str())); + pj_str_t usernamePjFormat = pj_str(strdup(username.c_str())); + pj_str_t passwordPjFormat = pj_str(strdup(password.c_str())); + pj_str_t realmPjFormat = pj_str(strdup(realm.c_str())); - /* Compute md5 hash = MD5(username ":" realm ":" password) */ - pj_md5_init (&pms); - MD5_APPEND (&pms, usernamePjFormat.ptr, usernamePjFormat.slen); - MD5_APPEND (&pms, ":", 1); - MD5_APPEND (&pms, realmPjFormat.ptr, realmPjFormat.slen); - MD5_APPEND (&pms, ":", 1); - MD5_APPEND (&pms, passwordPjFormat.ptr, passwordPjFormat.slen); - pj_md5_final (&pms, digest); + /* Compute md5 hash = MD5(username ":" realm ":" password) */ + pj_md5_init(&pms); + MD5_APPEND (&pms, usernamePjFormat.ptr, usernamePjFormat.slen); + MD5_APPEND (&pms, ":", 1); + MD5_APPEND (&pms, realmPjFormat.ptr, realmPjFormat.slen); + MD5_APPEND (&pms, ":", 1); + MD5_APPEND (&pms, passwordPjFormat.ptr, passwordPjFormat.slen); + pj_md5_final(&pms, digest); - digest2str (digest, ha1); + digest2str(digest, ha1); - char ha1_null_terminated[PJSIP_MD5STRLEN+1]; - memcpy (ha1_null_terminated, ha1, sizeof (char) *PJSIP_MD5STRLEN); - ha1_null_terminated[PJSIP_MD5STRLEN] = '\0'; + char ha1_null_terminated[PJSIP_MD5STRLEN + 1]; + memcpy(ha1_null_terminated, ha1, sizeof(char) * PJSIP_MD5STRLEN); + ha1_null_terminated[PJSIP_MD5STRLEN] = '\0'; - std::string hashedDigest = ha1_null_terminated; - return hashedDigest; + std::string hashedDigest = ha1_null_terminated; + return hashedDigest; } -void ManagerImpl::setCredential (const std::string& accountID, const int32_t& index, const std::map< std::string, std::string >& details) -{ - std::map<std::string, std::string>::iterator it; - std::map<std::string, std::string> credentialInformation = details; - - std::string credentialIndex; - std::stringstream streamOut; - streamOut << index; - credentialIndex = streamOut.str(); - - std::string section = "Credential" + std::string (":") + accountID + std::string (":") + credentialIndex; +void ManagerImpl::setCredential (const std::string& accountID, + const int32_t& index, const std::map<std::string, std::string>& details) { + std::map<std::string, std::string>::iterator it; + std::map<std::string, std::string> credentialInformation = details; - _debug ("Setting credential in section %s", section.c_str()); + std::string credentialIndex; + std::stringstream streamOut; + streamOut << index; + credentialIndex = streamOut.str(); - it = credentialInformation.find (USERNAME); - std::string username; + std::string section = "Credential" + std::string(":") + accountID + + std::string(":") + credentialIndex; - if (it == credentialInformation.end()) { - username = EMPTY_FIELD; - } else { - username = it->second; - } + _debug ("Setting credential in section %s", section.c_str()); - Manager::instance().setConfig (section, USERNAME, username); + it = credentialInformation.find(USERNAME); + std::string username; - it = credentialInformation.find (REALM); - std::string realm; + if (it == credentialInformation.end()) { + username = EMPTY_FIELD; + } else { + username = it->second; + } - if (it == credentialInformation.end()) { - realm = EMPTY_FIELD; - } else { - realm = it->second; - } + Manager::instance().setConfig(section, USERNAME, username); - Manager::instance().setConfig (section, REALM, realm); + it = credentialInformation.find(REALM); + std::string realm; + if (it == credentialInformation.end()) { + realm = EMPTY_FIELD; + } else { + realm = it->second; + } - it = credentialInformation.find (PASSWORD); - std::string password; + Manager::instance().setConfig(section, REALM, realm); - if (it == credentialInformation.end()) { - password = EMPTY_FIELD; - } else { - password = it->second; - } + it = credentialInformation.find(PASSWORD); + std::string password; - if (getMd5CredentialHashing()) { - // TODO: Fix this. - // This is an extremly weak test in order to check - // if the password is a hashed value. This is done - // because deleteCredential() is called before this - // method. Therefore, we cannot check if the value - // is different from the one previously stored in - // the configuration file. This is to avoid to - // re-hash a hashed password. + if (it == credentialInformation.end()) { + password = EMPTY_FIELD; + } else { + password = it->second; + } - if (password.length() != 32) { - password = computeMd5HashFromCredential (username, password, realm); - } - } + if (getMd5CredentialHashing()) { + // TODO: Fix this. + // This is an extremly weak test in order to check + // if the password is a hashed value. This is done + // because deleteCredential() is called before this + // method. Therefore, we cannot check if the value + // is different from the one previously stored in + // the configuration file. This is to avoid to + // re-hash a hashed password. + + if (password.length() != 32) { + password = computeMd5HashFromCredential(username, password, realm); + } + } - Manager::instance().setConfig (section, PASSWORD, password); + Manager::instance().setConfig(section, PASSWORD, password); } //TODO: tidy this up. Make a macro or inline // method to reduce the if/else mess. // Even better, switch to XML ! -void ManagerImpl::setAccountDetails (const std::string& accountID, const std::map< std::string, std::string >& details) -{ - - std::string accountType; - std::map <std::string, std::string> map_cpy; - std::map<std::string, std::string>::iterator iter; - - // Work on a copy - map_cpy = details; - - std::string username; - std::string authenticationName; - std::string password; - std::string realm; - std::string voicemail_count; - - if ( (iter = map_cpy.find (AUTHENTICATION_USERNAME)) != map_cpy.end()) { - authenticationName = iter->second; - } - - if ( (iter = map_cpy.find (USERNAME)) != map_cpy.end()) { - username = iter->second; - } - - if ( (iter = map_cpy.find (PASSWORD)) != map_cpy.end()) { - password = iter->second; - } - - if ( (iter = map_cpy.find (REALM)) != map_cpy.end()) { - realm = iter->second; - } - - setConfig (accountID, REALM, realm); - - setConfig (accountID, USERNAME, username); - setConfig (accountID, AUTHENTICATION_USERNAME, authenticationName); - - if (!getMd5CredentialHashing()) { - setConfig (accountID, PASSWORD, password); - } else { - // Make sure not to re-hash the password field if - // it is already saved as a MD5 Hash. - // TODO: This test is weak. Fix this. - if ( (password.compare (getConfigString (accountID, PASSWORD)) != 0)) { - _debug ("Password sent and password from config are different. Re-hashing"); - std::string hash; - - if (authenticationName.empty()) { - hash = computeMd5HashFromCredential (username, password, realm); - } else { - hash = computeMd5HashFromCredential (authenticationName, password, realm); - } - - setConfig (accountID, PASSWORD, hash); - } - } - - std::string alias; - - std::string mailbox; - std::string accountEnable; - std::string type; - std::string resolveOnce; - std::string registrationExpire; - - std::string hostname; - std::string displayName; - std::string localInterface; - std::string publishedSameasLocal; - std::string localAddress; - std::string publishedAddress; - std::string localPort; - std::string publishedPort; - std::string stunEnable; - std::string stunServer; - std::string srtpEnable; - std::string zrtpDisplaySas; - std::string zrtpDisplaySasOnce; - std::string zrtpNotSuppWarning; - std::string zrtpHelloHash; - std::string srtpKeyExchange; - - std::string tlsEnable; - std::string tlsCaListFile; - std::string tlsCertificateFile; - std::string tlsPrivateKeyFile; - std::string tlsPassword; - std::string tlsMethod; - std::string tlsCiphers; - std::string tlsServerName; - std::string tlsVerifyServer; - std::string tlsVerifyClient; - std::string tlsRequireClientCertificate; - std::string tlsNegotiationTimeoutSec; - std::string tlsNegotiationTimeoutMsec; - - if ( (iter = map_cpy.find (HOSTNAME)) != map_cpy.end()) { - hostname = iter->second; - } - - if ( (iter = map_cpy.find (DISPLAY_NAME)) != map_cpy.end()) { - displayName = iter->second; - } - - if ( (iter = map_cpy.find (LOCAL_INTERFACE)) != map_cpy.end()) { - localInterface = iter->second; - } - - if ( (iter = map_cpy.find (PUBLISHED_SAMEAS_LOCAL)) != map_cpy.end()) { - publishedSameasLocal = iter->second; - } - - if ( (iter = map_cpy.find (PUBLISHED_ADDRESS)) != map_cpy.end()) { - publishedAddress = iter->second; - } - - if ( (iter = map_cpy.find (LOCAL_PORT)) != map_cpy.end()) { - localPort = iter->second; - } - - if ( (iter = map_cpy.find (PUBLISHED_PORT)) != map_cpy.end()) { - publishedPort = iter->second; - } - - if ( (iter = map_cpy.find (STUN_ENABLE)) != map_cpy.end()) { - stunEnable = iter->second; - } - - if ( (iter = map_cpy.find (STUN_SERVER)) != map_cpy.end()) { - stunServer = iter->second; - } - - if ( (iter = map_cpy.find (SRTP_ENABLE)) != map_cpy.end()) { - srtpEnable = iter->second; - } - - if ( (iter = map_cpy.find (ZRTP_DISPLAY_SAS)) != map_cpy.end()) { - zrtpDisplaySas = iter->second; - } - - if ( (iter = map_cpy.find (ZRTP_DISPLAY_SAS_ONCE)) != map_cpy.end()) { - zrtpDisplaySasOnce = iter->second; - } - - if ( (iter = map_cpy.find (ZRTP_NOT_SUPP_WARNING)) != map_cpy.end()) { - zrtpNotSuppWarning = iter->second; - } - - if ( (iter = map_cpy.find (ZRTP_HELLO_HASH)) != map_cpy.end()) { - zrtpHelloHash = iter->second; - } - - if ( (iter = map_cpy.find (SRTP_KEY_EXCHANGE)) != map_cpy.end()) { - srtpKeyExchange = iter->second; - } - - if ( (iter = map_cpy.find (CONFIG_ACCOUNT_ALIAS)) != map_cpy.end()) { - alias = iter->second; - } - - if ( (iter = map_cpy.find (CONFIG_ACCOUNT_MAILBOX)) != map_cpy.end()) { - mailbox = iter->second; - } - - if ( (iter = map_cpy.find (CONFIG_ACCOUNT_ENABLE)) != map_cpy.end()) { - accountEnable = iter->second; - } - - if ( (iter = map_cpy.find (CONFIG_ACCOUNT_TYPE)) != map_cpy.end()) { - type = iter->second; - } - - if ( (iter = map_cpy.find (CONFIG_ACCOUNT_RESOLVE_ONCE)) != map_cpy.end()) { - resolveOnce = iter->second; - } - - if ( (iter = map_cpy.find (CONFIG_ACCOUNT_REGISTRATION_EXPIRE)) != map_cpy.end()) { - registrationExpire = iter->second; - } - - if ( (iter = map_cpy.find (TLS_ENABLE)) != map_cpy.end()) { - tlsEnable = iter->second; - } - - if ( (iter = map_cpy.find (TLS_CA_LIST_FILE)) != map_cpy.end()) { - tlsCaListFile = iter->second; - } - - if ( (iter = map_cpy.find (TLS_CERTIFICATE_FILE)) != map_cpy.end()) { - tlsCertificateFile = iter->second; - } - - if ( (iter = map_cpy.find (TLS_PRIVATE_KEY_FILE)) != map_cpy.end()) { - tlsPrivateKeyFile = iter->second; - } - - if ( (iter = map_cpy.find (TLS_PASSWORD)) != map_cpy.end()) { - tlsPassword = iter->second; - } - - if ( (iter = map_cpy.find (TLS_METHOD)) != map_cpy.end()) { - tlsMethod = iter->second; - } - - if ( (iter = map_cpy.find (TLS_CIPHERS)) != map_cpy.end()) { - tlsCiphers = iter->second; - } - - if ( (iter = map_cpy.find (TLS_SERVER_NAME)) != map_cpy.end()) { - tlsServerName = iter->second; - } - - if ( (iter = map_cpy.find (TLS_VERIFY_SERVER)) != map_cpy.end()) { - tlsVerifyServer = iter->second; - } - - if ( (iter = map_cpy.find (TLS_VERIFY_CLIENT)) != map_cpy.end()) { - tlsVerifyClient = iter->second; - } - - if ( (iter = map_cpy.find (TLS_REQUIRE_CLIENT_CERTIFICATE)) != map_cpy.end()) { - tlsRequireClientCertificate = iter->second; - } - - if ( (iter = map_cpy.find (TLS_NEGOTIATION_TIMEOUT_SEC)) != map_cpy.end()) { - tlsNegotiationTimeoutSec = iter->second; - } - - if ( (iter = map_cpy.find (TLS_NEGOTIATION_TIMEOUT_MSEC)) != map_cpy.end()) { - tlsNegotiationTimeoutMsec = iter->second; - } - - setConfig (accountID, HOSTNAME, hostname); - - setConfig (accountID, LOCAL_INTERFACE, localInterface); - setConfig (accountID, PUBLISHED_SAMEAS_LOCAL, publishedSameasLocal); - setConfig (accountID, PUBLISHED_ADDRESS, publishedAddress); - setConfig (accountID, LOCAL_PORT, localPort); - setConfig (accountID, PUBLISHED_PORT, publishedPort); - setConfig (accountID, DISPLAY_NAME, displayName); - setConfig (accountID, SRTP_ENABLE, srtpEnable); - setConfig (accountID, ZRTP_DISPLAY_SAS, zrtpDisplaySas); - setConfig (accountID, ZRTP_DISPLAY_SAS_ONCE, zrtpDisplaySasOnce); - setConfig (accountID, ZRTP_NOT_SUPP_WARNING, zrtpNotSuppWarning); - setConfig (accountID, ZRTP_HELLO_HASH, zrtpHelloHash); - setConfig (accountID, SRTP_KEY_EXCHANGE, srtpKeyExchange); - - setConfig (accountID, STUN_ENABLE, stunEnable); - setConfig (accountID, STUN_SERVER, stunServer); - - setConfig (accountID, TLS_ENABLE, tlsEnable); - setConfig (accountID, TLS_CA_LIST_FILE, tlsCaListFile); - setConfig (accountID, TLS_CERTIFICATE_FILE, tlsCertificateFile); - setConfig (accountID, TLS_PRIVATE_KEY_FILE, tlsPrivateKeyFile); - setConfig (accountID, TLS_PASSWORD, tlsPassword); - setConfig (accountID, TLS_METHOD, tlsMethod); - setConfig (accountID, TLS_CIPHERS, tlsCiphers); - setConfig (accountID, TLS_SERVER_NAME, tlsServerName); - setConfig (accountID, TLS_VERIFY_SERVER, tlsVerifyServer); - setConfig (accountID, TLS_VERIFY_CLIENT, tlsVerifyClient); - setConfig (accountID, TLS_REQUIRE_CLIENT_CERTIFICATE, tlsRequireClientCertificate); - setConfig (accountID, TLS_NEGOTIATION_TIMEOUT_SEC, tlsNegotiationTimeoutSec); - setConfig (accountID, TLS_NEGOTIATION_TIMEOUT_MSEC, tlsNegotiationTimeoutMsec); - - setConfig (accountID, CONFIG_ACCOUNT_ALIAS, alias); - setConfig (accountID, CONFIG_ACCOUNT_MAILBOX, mailbox); - setConfig (accountID, CONFIG_ACCOUNT_ENABLE, accountEnable); - setConfig (accountID, CONFIG_ACCOUNT_TYPE, type); - setConfig (accountID, CONFIG_ACCOUNT_RESOLVE_ONCE, resolveOnce); - setConfig (accountID, CONFIG_ACCOUNT_REGISTRATION_EXPIRE, registrationExpire); - - saveConfig(); - - Account * acc = NULL; - acc = getAccount (accountID); - - if (acc != NULL) { - acc->loadConfig(); - - if (acc->isEnabled()) { - // acc->unregisterVoIPLink(); // do not need to send an unregister - acc->registerVoIPLink(); - } else { - acc->unregisterVoIPLink(); - } - } else { - _debug ("ManagerImpl::setAccountDetails: account is NULL"); - } +void ManagerImpl::setAccountDetails (const std::string& accountID, + const std::map<std::string, std::string>& details) { - // Update account details to the client side - if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); + std::string accountType; + std::map<std::string, std::string> map_cpy; + std::map<std::string, std::string>::iterator iter; -} + // Work on a copy + map_cpy = details; -std::string -ManagerImpl::addAccount (const std::map< std::string, std::string >& details) -{ + std::string username; + std::string authenticationName; + std::string password; + std::string realm; + std::string voicemail_count; + std::string ua_name; - /** @todo Deal with both the _accountMap and the Configuration */ - std::string accountType, account_list; - Account* newAccount; - std::stringstream accountID; - AccountID newAccountID; + if ((iter = map_cpy.find(AUTHENTICATION_USERNAME)) != map_cpy.end()) { + authenticationName = iter->second; + } - accountID << "Account:" << time (NULL); - newAccountID = accountID.str(); + if ((iter = map_cpy.find(USERNAME)) != map_cpy.end()) { + username = iter->second; + } - // Get the type - accountType = (*details.find (CONFIG_ACCOUNT_TYPE)).second; + if ((iter = map_cpy.find(PASSWORD)) != map_cpy.end()) { + password = iter->second; + } - _debug ("%s", newAccountID.c_str()); + if ((iter = map_cpy.find(REALM)) != map_cpy.end()) { + realm = iter->second; + } - /** @todo Verify the uniqueness, in case a program adds accounts, two in a row. */ + if ((iter = map_cpy.find(USERAGENT)) != map_cpy.end()) { + ua_name = iter->second; + } - if (accountType == "SIP") { - newAccount = AccountCreator::createAccount (AccountCreator::SIP_ACCOUNT, newAccountID); - newAccount->setVoIPLink(); - } else if (accountType == "IAX") { - newAccount = AccountCreator::createAccount (AccountCreator::IAX_ACCOUNT, newAccountID); - } else { - _debug ("Unknown %s param when calling addAccount(): %s", CONFIG_ACCOUNT_TYPE, accountType.c_str()); - return ""; - } + setConfig(accountID, REALM, realm); + setConfig(accountID, USERAGENT, ua_name); + setConfig(accountID, USERNAME, username); + setConfig(accountID, AUTHENTICATION_USERNAME, authenticationName); + + if (!getMd5CredentialHashing()) { + setConfig(accountID, PASSWORD, password); + } else { + // Make sure not to re-hash the password field if + // it is already saved as a MD5 Hash. + // TODO: This test is weak. Fix this. + if ((password.compare(getConfigString(accountID, PASSWORD)) != 0)) { + _debug ("Password sent and password from config are different. Re-hashing"); + std::string hash; + + if (authenticationName.empty()) { + hash = computeMd5HashFromCredential(username, password, realm); + } else { + hash = computeMd5HashFromCredential(authenticationName, + password, realm); + } + + setConfig(accountID, PASSWORD, hash); + } + } - _accountMap[newAccountID] = newAccount; + std::string alias; + + std::string mailbox; + std::string accountEnable; + std::string type; + std::string resolveOnce; + std::string registrationExpire; + + std::string hostname; + std::string displayName; + std::string localInterface; + std::string publishedSameasLocal; + std::string localAddress; + std::string publishedAddress; + std::string localPort; + std::string publishedPort; + std::string stunEnable; + std::string stunServer; + std::string dtmfType; + std::string srtpEnable; + std::string srtpRtpFallback; + std::string zrtpDisplaySas; + std::string zrtpDisplaySasOnce; + std::string zrtpNotSuppWarning; + std::string zrtpHelloHash; + std::string srtpKeyExchange; + + std::string tlsListenerPort; + std::string tlsEnable; + std::string tlsCaListFile; + std::string tlsCertificateFile; + std::string tlsPrivateKeyFile; + std::string tlsPassword; + std::string tlsMethod; + std::string tlsCiphers; + std::string tlsServerName; + std::string tlsVerifyServer; + std::string tlsVerifyClient; + std::string tlsRequireClientCertificate; + std::string tlsNegotiationTimeoutSec; + std::string tlsNegotiationTimeoutMsec; + + if ((iter = map_cpy.find(HOSTNAME)) != map_cpy.end()) { + hostname = iter->second; + } - setAccountDetails (accountID.str(), details); + if ((iter = map_cpy.find(DISPLAY_NAME)) != map_cpy.end()) { + displayName = iter->second; + } - // Add the newly created account in the account order list - account_list = getConfigString (PREFERENCES, CONFIG_ACCOUNTS_ORDER); + if ((iter = map_cpy.find(LOCAL_INTERFACE)) != map_cpy.end()) { + localInterface = iter->second; + } - if (account_list != "") { - newAccountID += "/"; - // Prepend the new account - account_list.insert (0, newAccountID); - setConfig (PREFERENCES, CONFIG_ACCOUNTS_ORDER, account_list); - } + if ((iter = map_cpy.find(PUBLISHED_SAMEAS_LOCAL)) != map_cpy.end()) { + publishedSameasLocal = iter->second; + } - saveConfig(); + if ((iter = map_cpy.find(PUBLISHED_ADDRESS)) != map_cpy.end()) { + publishedAddress = iter->second; + } - if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); + if ((iter = map_cpy.find(LOCAL_PORT)) != map_cpy.end()) { + localPort = iter->second; + } - return newAccountID; -} + if ((iter = map_cpy.find(PUBLISHED_PORT)) != map_cpy.end()) { + publishedPort = iter->second; + } -void -ManagerImpl::deleteAllCredential (const AccountID& accountID) -{ - int numberOfCredential = getConfigInt (accountID, CONFIG_CREDENTIAL_NUMBER); + if ((iter = map_cpy.find(STUN_ENABLE)) != map_cpy.end()) { + stunEnable = iter->second; + } - int i; + if ((iter = map_cpy.find(STUN_SERVER)) != map_cpy.end()) { + stunServer = iter->second; + } - for (i = 0; i < numberOfCredential; i++) { - std::string credentialIndex; - std::stringstream streamOut; - streamOut << i; - credentialIndex = streamOut.str(); - std::string section = "Credential" + std::string (":") + accountID + std::string (":") + credentialIndex; + if((iter = map_cpy.find(ACCOUNT_DTMF_TYPE)) != map_cpy.end()) { + dtmfType = iter->second; + } - _config.removeSection (section); - } + if ((iter = map_cpy.find(SRTP_ENABLE)) != map_cpy.end()) { + srtpEnable = iter->second; + } - if (accountID.empty() == false) { - setConfig (accountID, CONFIG_CREDENTIAL_NUMBER, 0); - } -} + if ((iter = map_cpy.find(SRTP_RTP_FALLBACK)) != map_cpy.end()) { + srtpRtpFallback = iter->second; + } -void -ManagerImpl::removeAccount (const AccountID& accountID) -{ - // Get it down and dying - Account* remAccount = NULL; - remAccount = getAccount (accountID); + if ((iter = map_cpy.find(ZRTP_DISPLAY_SAS)) != map_cpy.end()) { + zrtpDisplaySas = iter->second; + } - if (remAccount != NULL) { - remAccount->unregisterVoIPLink(); - _accountMap.erase (accountID); - // http://projects.savoirfairelinux.net/issues/show/2355 - // delete remAccount; - } + if ((iter = map_cpy.find(ZRTP_DISPLAY_SAS_ONCE)) != map_cpy.end()) { + zrtpDisplaySasOnce = iter->second; + } - _config.removeSection (accountID); + if ((iter = map_cpy.find(ZRTP_NOT_SUPP_WARNING)) != map_cpy.end()) { + zrtpNotSuppWarning = iter->second; + } - saveConfig(); + if ((iter = map_cpy.find(ZRTP_HELLO_HASH)) != map_cpy.end()) { + zrtpHelloHash = iter->second; + } - _debug ("REMOVE ACCOUNT"); + if ((iter = map_cpy.find(SRTP_KEY_EXCHANGE)) != map_cpy.end()) { + srtpKeyExchange = iter->second; + } - if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); + if ((iter = map_cpy.find(CONFIG_ACCOUNT_ALIAS)) != map_cpy.end()) { + alias = iter->second; + } -} + if ((iter = map_cpy.find(CONFIG_ACCOUNT_MAILBOX)) != map_cpy.end()) { + mailbox = iter->second; + } + + if ((iter = map_cpy.find(CONFIG_ACCOUNT_ENABLE)) != map_cpy.end()) { + accountEnable = iter->second; + } + + if ((iter = map_cpy.find(CONFIG_ACCOUNT_TYPE)) != map_cpy.end()) { + type = iter->second; + } + + if ((iter = map_cpy.find(CONFIG_ACCOUNT_RESOLVE_ONCE)) != map_cpy.end()) { + resolveOnce = iter->second; + } + + if ((iter = map_cpy.find(CONFIG_ACCOUNT_REGISTRATION_EXPIRE)) + != map_cpy.end()) { + registrationExpire = iter->second; + } + + // The TLS listener is unique and globally defined through IP2IP_PROFILE + if ((accountID == IP2IP_PROFILE) + && (iter = map_cpy.find(TLS_LISTENER_PORT)) != map_cpy.end()) { + tlsListenerPort = iter->second; + } + + if ((iter = map_cpy.find(TLS_ENABLE)) != map_cpy.end()) { + tlsEnable = iter->second; + } + + if ((iter = map_cpy.find(TLS_CA_LIST_FILE)) != map_cpy.end()) { + tlsCaListFile = iter->second; + } + + if ((iter = map_cpy.find(TLS_CERTIFICATE_FILE)) != map_cpy.end()) { + tlsCertificateFile = iter->second; + } + + if ((iter = map_cpy.find(TLS_PRIVATE_KEY_FILE)) != map_cpy.end()) { + tlsPrivateKeyFile = iter->second; + } + + if ((iter = map_cpy.find(TLS_PASSWORD)) != map_cpy.end()) { + tlsPassword = iter->second; + } + + if ((iter = map_cpy.find(TLS_METHOD)) != map_cpy.end()) { + tlsMethod = iter->second; + } + + if ((iter = map_cpy.find(TLS_CIPHERS)) != map_cpy.end()) { + tlsCiphers = iter->second; + } + + if ((iter = map_cpy.find(TLS_SERVER_NAME)) != map_cpy.end()) { + tlsServerName = iter->second; + } + + if ((iter = map_cpy.find(TLS_VERIFY_SERVER)) != map_cpy.end()) { + tlsVerifyServer = iter->second; + } + + if ((iter = map_cpy.find(TLS_VERIFY_CLIENT)) != map_cpy.end()) { + tlsVerifyClient = iter->second; + } + + if ((iter = map_cpy.find(TLS_REQUIRE_CLIENT_CERTIFICATE)) != map_cpy.end()) { + tlsRequireClientCertificate = iter->second; + } + + if ((iter = map_cpy.find(TLS_NEGOTIATION_TIMEOUT_SEC)) != map_cpy.end()) { + tlsNegotiationTimeoutSec = iter->second; + } + + if ((iter = map_cpy.find(TLS_NEGOTIATION_TIMEOUT_MSEC)) != map_cpy.end()) { + tlsNegotiationTimeoutMsec = iter->second; + } + + setConfig(accountID, HOSTNAME, hostname); + + setConfig(accountID, LOCAL_INTERFACE, localInterface); + setConfig(accountID, PUBLISHED_SAMEAS_LOCAL, publishedSameasLocal); + setConfig(accountID, PUBLISHED_ADDRESS, publishedAddress); + setConfig(accountID, LOCAL_PORT, localPort); + setConfig(accountID, PUBLISHED_PORT, publishedPort); + setConfig(accountID, DISPLAY_NAME, displayName); + setConfig(accountID, SRTP_ENABLE, srtpEnable); + setConfig(accountID, SRTP_RTP_FALLBACK, srtpRtpFallback); + setConfig(accountID, ZRTP_DISPLAY_SAS, zrtpDisplaySas); + setConfig(accountID, ZRTP_DISPLAY_SAS_ONCE, zrtpDisplaySasOnce); + setConfig(accountID, ZRTP_NOT_SUPP_WARNING, zrtpNotSuppWarning); + setConfig(accountID, ZRTP_HELLO_HASH, zrtpHelloHash); + setConfig(accountID, SRTP_KEY_EXCHANGE, srtpKeyExchange); + + setConfig(accountID, STUN_ENABLE, stunEnable); + setConfig(accountID, STUN_SERVER, stunServer); + setConfig(accountID, ACCOUNT_DTMF_TYPE, dtmfType); + + // The TLS listener is unique and globally defined through IP2IP_PROFILE + if (accountID == IP2IP_PROFILE) + setConfig(accountID, TLS_LISTENER_PORT, tlsListenerPort); + + setConfig(accountID, TLS_ENABLE, tlsEnable); + setConfig(accountID, TLS_CA_LIST_FILE, tlsCaListFile); + setConfig(accountID, TLS_CERTIFICATE_FILE, tlsCertificateFile); + setConfig(accountID, TLS_PRIVATE_KEY_FILE, tlsPrivateKeyFile); + setConfig(accountID, TLS_PASSWORD, tlsPassword); + setConfig(accountID, TLS_METHOD, tlsMethod); + setConfig(accountID, TLS_CIPHERS, tlsCiphers); + setConfig(accountID, TLS_SERVER_NAME, tlsServerName); + setConfig(accountID, TLS_VERIFY_SERVER, tlsVerifyServer); + setConfig(accountID, TLS_VERIFY_CLIENT, tlsVerifyClient); + setConfig(accountID, TLS_REQUIRE_CLIENT_CERTIFICATE, + tlsRequireClientCertificate); + setConfig(accountID, TLS_NEGOTIATION_TIMEOUT_SEC, tlsNegotiationTimeoutSec); + setConfig(accountID, TLS_NEGOTIATION_TIMEOUT_MSEC, + tlsNegotiationTimeoutMsec); + + setConfig(accountID, CONFIG_ACCOUNT_ALIAS, alias); + setConfig(accountID, CONFIG_ACCOUNT_MAILBOX, mailbox); + setConfig(accountID, CONFIG_ACCOUNT_ENABLE, accountEnable); + setConfig(accountID, CONFIG_ACCOUNT_TYPE, type); + setConfig(accountID, CONFIG_ACCOUNT_RESOLVE_ONCE, resolveOnce); + setConfig(accountID, CONFIG_ACCOUNT_REGISTRATION_EXPIRE, registrationExpire); + + saveConfig(); + + Account * acc = NULL; + acc = getAccount(accountID); + + if (acc != NULL) { + acc->loadConfig(); + + if (acc->isEnabled()) { + acc->registerVoIPLink(); + } else { + acc->unregisterVoIPLink(); + } + } else { + _debug ("ManagerImpl::setAccountDetails: account is NULL"); + } + + // Update account details to the client side + if (_dbus) + _dbus->getConfigurationManager()->accountsChanged(); -// ACCOUNT handling -bool -ManagerImpl::associateCallToAccount (const CallID& callID, const AccountID& accountID) -{ - if (getAccountFromCall (callID) == AccountNULL) { // nothing with the same ID - if (accountExists (accountID)) { // account id exist in AccountMap - ost::MutexLock m (_callAccountMapMutex); - _callAccountMap[callID] = accountID; - _debug ("Associate Call %s with Account %s", callID.data(), accountID.data()); - return true; - } else { - return false; - } - } else { - return false; - } } -AccountID -ManagerImpl::getAccountFromCall (const CallID& callID) -{ - ost::MutexLock m (_callAccountMapMutex); - CallAccountMap::iterator iter = _callAccountMap.find (callID); +std::string ManagerImpl::addAccount ( + const std::map<std::string, std::string>& details) { + + /** @todo Deal with both the _accountMap and the Configuration */ + std::string accountType, account_list; + Account* newAccount; + std::stringstream accountID; + AccountID newAccountID; + + accountID << "Account:" << time(NULL); + newAccountID = accountID.str(); + + // Get the type + accountType = (*details.find(CONFIG_ACCOUNT_TYPE)).second; + + _debug ("%s", newAccountID.c_str()); + + /** @todo Verify the uniqueness, in case a program adds accounts, two in a row. */ + + if (accountType == "SIP") { + newAccount = AccountCreator::createAccount(AccountCreator::SIP_ACCOUNT, + newAccountID); + newAccount->setVoIPLink(); + } else if (accountType == "IAX") { + newAccount = AccountCreator::createAccount(AccountCreator::IAX_ACCOUNT, + newAccountID); + } else { + _debug ("Unknown %s param when calling addAccount(): %s", CONFIG_ACCOUNT_TYPE, accountType.c_str()); + return ""; + } + + _accountMap[newAccountID] = newAccount; + + setAccountDetails(accountID.str(), details); + + // Add the newly created account in the account order list + account_list = getConfigString(PREFERENCES, CONFIG_ACCOUNTS_ORDER); + + if (account_list != "") { + newAccountID += "/"; + // Prepend the new account + account_list.insert(0, newAccountID); + setConfig(PREFERENCES, CONFIG_ACCOUNTS_ORDER, account_list); + } + + saveConfig(); + + if (_dbus) + _dbus->getConfigurationManager()->accountsChanged(); - if (iter == _callAccountMap.end()) { - return AccountNULL; - } else { - return iter->second; - } + return accountID.str(); } -bool -ManagerImpl::removeCallAccount (const CallID& callID) -{ - ost::MutexLock m (_callAccountMapMutex); +void ManagerImpl::deleteAllCredential (const AccountID& accountID) { + int numberOfCredential = getConfigInt(accountID, CONFIG_CREDENTIAL_NUMBER); - if (_callAccountMap.erase (callID)) { - return true; - } + int i; - return false; + for (i = 0; i < numberOfCredential; i++) { + std::string credentialIndex; + std::stringstream streamOut; + streamOut << i; + credentialIndex = streamOut.str(); + std::string section = "Credential" + std::string(":") + accountID + + std::string(":") + credentialIndex; + + _config.removeSection(section); + } + + if (accountID.empty() == false) { + setConfig(accountID, CONFIG_CREDENTIAL_NUMBER, 0); + } } -CallID -ManagerImpl::getNewCallID() -{ - std::ostringstream random_id ("s"); - random_id << (unsigned) rand(); +void ManagerImpl::removeAccount (const AccountID& accountID) { + // Get it down and dying + Account* remAccount = NULL; + remAccount = getAccount(accountID); - // when it's not found, it return "" - // generate, something like s10000s20000s4394040 + if (remAccount != NULL) { + remAccount->unregisterVoIPLink(); + _accountMap.erase(accountID); + // http://projects.savoirfairelinux.net/issues/show/2355 + // delete remAccount; + } - while (getAccountFromCall (random_id.str()) != AccountNULL) { - random_id.clear(); - random_id << "s"; - random_id << (unsigned) rand(); - } + _config.removeSection(accountID); - return random_id.str(); + saveConfig(); + + _debug ("REMOVE ACCOUNT"); + + if (_dbus) + _dbus->getConfigurationManager()->accountsChanged(); + +} + +// ACCOUNT handling +bool ManagerImpl::associateCallToAccount (const CallID& callID, + const AccountID& accountID) { + if (getAccountFromCall(callID) == AccountNULL) { // nothing with the same ID + if (accountExists(accountID)) { // account id exist in AccountMap + ost::MutexLock m(_callAccountMapMutex); + _callAccountMap[callID] = accountID; + _debug ("Associate Call %s with Account %s", callID.data(), accountID.data()); + return true; + } else { + return false; + } + } else { + return false; + } } -std::vector <std::string> ManagerImpl::loadAccountOrder (void) -{ +AccountID ManagerImpl::getAccountFromCall (const CallID& callID) { + ost::MutexLock m(_callAccountMapMutex); + CallAccountMap::iterator iter = _callAccountMap.find(callID); + + if (iter == _callAccountMap.end()) { + return AccountNULL; + } else { + return iter->second; + } +} - std::string account_list; - std::vector <std::string> account_vect; +bool ManagerImpl::removeCallAccount (const CallID& callID) { + ost::MutexLock m(_callAccountMapMutex); - account_list = getConfigString (PREFERENCES, CONFIG_ACCOUNTS_ORDER); - return unserialize (account_list); + if (_callAccountMap.erase(callID)) { + return true; + } + return false; } +CallID ManagerImpl::getNewCallID () { + std::ostringstream random_id("s"); + random_id << (unsigned) rand(); -short -ManagerImpl::loadAccountMap() -{ + // when it's not found, it return "" + // generate, something like s10000s20000s4394040 - _debug ("Loading account map\n"); + while (getAccountFromCall(random_id.str()) != AccountNULL) { + random_id.clear(); + random_id << "s"; + random_id << (unsigned) rand(); + } - short nbAccount = 0; - TokenList sections = _config.getSections(); - std::string accountType; - Account *tmpAccount = 0; - std::vector <std::string> account_order; + return random_id.str(); +} - TokenList::iterator iter = sections.begin(); +std::vector<std::string> ManagerImpl::loadAccountOrder (void) { - // Those calls that are placed to an uri that cannot be - // associated to an account are using that special account. - // An account, that is not account, in the sense of - // registration. This is useful since the Account object - // provides a handful of method that simplifies URI creation - // and loading of various settings. - _directIpAccount = AccountCreator::createAccount (AccountCreator::SIP_DIRECT_IP_ACCOUNT, ""); + std::string account_list; + std::vector<std::string> account_vect; - if (_directIpAccount == NULL) { + account_list = getConfigString(PREFERENCES, CONFIG_ACCOUNTS_ORDER); + return unserialize(account_list); +} - _debug ("Failed to create direct ip calls \"account\"\n"); - } else { +short ManagerImpl::loadAccountMap () { - _debug ("Succeed to create direct ip calls \"account\"\n"); - _accountMap[IP2IP_PROFILE] = _directIpAccount; + _debug ("Loading account map"); - // Force IP2IP settings to be loaded to be loaded - // No registration in the sense of the REGISTER method is performed. - _directIpAccount->registerVoIPLink(); + short nbAccount = 0; + TokenList sections = _config.getSections(); + std::string accountType; + Account *tmpAccount = 0; + std::vector<std::string> account_order; - // SIPVoIPlink is used as a singleton, it is the first call to instance here - // The SIP library initialization is done in the SIPVoIPLink constructor - // We need the IP2IP settings to be loaded at this time as they are used - // for default sip transport + TokenList::iterator iter = sections.begin(); - // _directIpAccount->setVoIPLink(SIPVoIPLink::instance ("")); - _directIpAccount->setVoIPLink(); + // Those calls that are placed to an uri that cannot be + // associated to an account are using that special account. + // An account, that is not account, in the sense of + // registration. This is useful since the Account object + // provides a handful of method that simplifies URI creation + // and loading of various settings. + _directIpAccount = AccountCreator::createAccount( + AccountCreator::SIP_DIRECT_IP_ACCOUNT, ""); - } + _debug ("Create default \"account\" (used as default UDP transport)"); + if (_directIpAccount == NULL) { - // initialize other accounts - while (iter != sections.end()) { - // Check if it starts with "Account:" (SIP and IAX pour le moment) - if ( (int) (iter->find ("Account:")) != 0) { - iter++; - continue; - } + _debug ("Failed to create default \"account\""); + } else { - accountType = getConfigString (*iter, CONFIG_ACCOUNT_TYPE); + _accountMap[IP2IP_PROFILE] = _directIpAccount; - if (accountType == "SIP") { - tmpAccount = AccountCreator::createAccount (AccountCreator::SIP_ACCOUNT, *iter); - } + // Force IP2IP settings to be loaded to be loaded + // No registration in the sense of the REGISTER method is performed. + _directIpAccount->registerVoIPLink(); - else if (accountType == "IAX") { - tmpAccount = AccountCreator::createAccount (AccountCreator::IAX_ACCOUNT, *iter); - } + // SIPVoIPlink is used as a singleton, it is the first call to instance here + // The SIP library initialization is done in the SIPVoIPLink constructor + // We need the IP2IP settings to be loaded at this time as they are used + // for default sip transport - else { - _debug ("Unknown %s param in config file (%s)", CONFIG_ACCOUNT_TYPE, accountType.c_str()); - } + // _directIpAccount->setVoIPLink(SIPVoIPLink::instance ("")); + _directIpAccount->setVoIPLink(); - if (tmpAccount != NULL) { - _debug ("Loading account %s ", iter->c_str()); - _accountMap[iter->c_str() ] = tmpAccount; - // tmpAccount->setVoIPLink(SIPVoIPLink::instance ("")); - tmpAccount->setVoIPLink(); - nbAccount++; - } + } - iter++; - } + // initialize other accounts + while (iter != sections.end()) { + // Check if it starts with "Account:" (SIP and IAX pour le moment) + if ((int) (iter->find("Account:")) != 0) { + iter++; + continue; + } + + accountType = getConfigString(*iter, CONFIG_ACCOUNT_TYPE); + + if (accountType == "SIP") { + tmpAccount = AccountCreator::createAccount( + AccountCreator::SIP_ACCOUNT, *iter); + } + + else if (accountType == "IAX") { + tmpAccount = AccountCreator::createAccount( + AccountCreator::IAX_ACCOUNT, *iter); + } + + else { + _error ("Unknown %s param in config file (%s)", CONFIG_ACCOUNT_TYPE, accountType.c_str()); + } + + if (tmpAccount != NULL) { + _debug ("Loading account %s ", iter->c_str()); + _accountMap[iter->c_str()] = tmpAccount; + // tmpAccount->setVoIPLink(SIPVoIPLink::instance ("")); + tmpAccount->setVoIPLink(); + nbAccount++; + } + + iter++; + } - _debug ("nb account loaded %i \n", nbAccount); + _debug ("nb account loaded %i \n", nbAccount); - return nbAccount; + return nbAccount; } -void -ManagerImpl::unloadAccountMap() -{ +void ManagerImpl::unloadAccountMap () { - AccountMap::iterator iter = _accountMap.begin(); + AccountMap::iterator iter = _accountMap.begin(); - while (iter != _accountMap.end()) { + while (iter != _accountMap.end()) { - _debug ("Unloading account %s\n", iter->first.c_str()); + _debug ("Unloading account %s\n", iter->first.c_str()); - delete iter->second; - iter->second = 0; + delete iter->second; + iter->second = 0; - iter++; - } + iter++; + } - _accountMap.clear(); + _accountMap.clear(); } -bool -ManagerImpl::accountExists (const AccountID& accountID) -{ - AccountMap::iterator iter = _accountMap.find (accountID); +bool ManagerImpl::accountExists (const AccountID& accountID) { + AccountMap::iterator iter = _accountMap.find(accountID); - if (iter == _accountMap.end()) { - return false; - } + if (iter == _accountMap.end()) { + return false; + } - return true; + return true; } Account* -ManagerImpl::getAccount (const AccountID& accountID) -{ - // In our definition, - // this is the "direct ip calls account" - if (accountID == AccountNULL) { - _debug ("Returns the direct IP account"); - return _directIpAccount; - } +ManagerImpl::getAccount (const AccountID& accountID) { + // In our definition, + // this is the "direct ip calls account" + if (accountID == AccountNULL) { + _debug ("Returns the direct IP account"); + return _directIpAccount; + } - AccountMap::iterator iter = _accountMap.find (accountID); + AccountMap::iterator iter = _accountMap.find(accountID); - if (iter == _accountMap.end()) { - return NULL; - } + if (iter == _accountMap.end()) { + return NULL; + } - return iter->second; + return iter->second; } -AccountID -ManagerImpl::getAccountIdFromNameAndServer (const std::string& userName, const std::string& server) -{ - AccountMap::iterator iter; - SIPAccount *account; - _debug ("getAccountIdFromNameAndServer : username = %s , server = %s", userName.c_str(), server.c_str()); - // Try to find the account id from username and server name by full match +AccountID ManagerImpl::getAccountIdFromNameAndServer ( + const std::string& userName, const std::string& server) { + + AccountMap::iterator iter; + SIPAccount *account; - for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - _debug ("for : account = %s", iter->first.c_str()); - account = dynamic_cast<SIPAccount *> (iter->second); + _info ("Manager : username = %s , server = %s", userName.c_str(), server.c_str()); + // Try to find the account id from username and server name by full match - if (account != NULL) { - if (account->fullMatch (userName, server)) { - _debug ("Matching accountId in request is a fullmatch"); - return iter->first; - } - } - } + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + account = dynamic_cast<SIPAccount *> (iter->second); - // We failed! Then only match the hostname - for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - account = dynamic_cast<SIPAccount *> (iter->second); + if (account != NULL) { + if (account->fullMatch(userName, server)) { + _debug ("Manager: Matching account id in request is a fullmatch %s@%s", userName.c_str(), server.c_str()); + return iter->first; + } + } + } - if (account != NULL) { - if (account->hostnameMatch (server)) { - _debug ("Matching accountId in request with hostname"); - return iter->first; - } - } - } + // We failed! Then only match the hostname + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + account = dynamic_cast<SIPAccount *> (iter->second); - // We failed! Then only match the username - for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { - account = dynamic_cast<SIPAccount *> (iter->second); + if (account != NULL) { + if (account->hostnameMatch(server)) { + _debug ("Manager: Matching account id in request with hostname %s", server.c_str()); + return iter->first; + } + } + } + + // We failed! Then only match the username + for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) { + account = dynamic_cast<SIPAccount *> (iter->second); + + if (account != NULL) { + if (account->userMatch(userName)) { + _debug ("Manager: Matching account id in request with username %s", userName.c_str()); + return iter->first; + } + } + } - if (account != NULL) { - if (account->userMatch (userName)) { - _debug ("Matching accountId in request with username"); - return iter->first; - } - } - } + _debug ("Manager: Username %s or server %s doesn't match any account, using IP2IP", userName.c_str(), server.c_str()); - // Failed again! return AccountNULL - return AccountNULL; + // Failed again! return AccountNULL + return AccountNULL; } -std::map<std::string, int32_t> ManagerImpl::getAddressbookSettings () -{ +std::map<std::string, int32_t> ManagerImpl::getAddressbookSettings () { - std::map<std::string, int32_t> settings; + std::map<std::string, int32_t> settings; - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_ENABLE", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_ENABLE))); - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_MAX_RESULTS", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS))); - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_CONTACT_PHOTO", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO))); - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_PHONE_BUSINESS", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS))); - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_PHONE_HOME", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_HOME))); - settings.insert (std::pair<std::string, int32_t> ("ADDRESSBOOK_DISPLAY_PHONE_MOBILE", getConfigInt (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_MOBILE))); + settings.insert(std::pair<std::string, int32_t>("ADDRESSBOOK_ENABLE", + getConfigInt(ADDRESSBOOK, ADDRESSBOOK_ENABLE))); + settings.insert(std::pair<std::string, int32_t>("ADDRESSBOOK_MAX_RESULTS", + getConfigInt(ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS))); + settings.insert(std::pair<std::string, int32_t>( + "ADDRESSBOOK_DISPLAY_CONTACT_PHOTO", getConfigInt(ADDRESSBOOK, + ADDRESSBOOK_DISPLAY_CONTACT_PHOTO))); + settings.insert(std::pair<std::string, int32_t>( + "ADDRESSBOOK_DISPLAY_PHONE_BUSINESS", getConfigInt(ADDRESSBOOK, + ADDRESSBOOK_DISPLAY_PHONE_BUSINESS))); + settings.insert(std::pair<std::string, int32_t>( + "ADDRESSBOOK_DISPLAY_PHONE_HOME", getConfigInt(ADDRESSBOOK, + ADDRESSBOOK_DISPLAY_PHONE_HOME))); + settings.insert(std::pair<std::string, int32_t>( + "ADDRESSBOOK_DISPLAY_PHONE_MOBILE", getConfigInt(ADDRESSBOOK, + ADDRESSBOOK_DISPLAY_PHONE_MOBILE))); - return settings; + return settings; } -void ManagerImpl::setAddressbookSettings (const std::map<std::string, int32_t>& settings) -{ +void ManagerImpl::setAddressbookSettings ( + const std::map<std::string, int32_t>& settings) { - setConfig (ADDRESSBOOK, ADDRESSBOOK_ENABLE, (*settings.find ("ADDRESSBOOK_ENABLE")).second); - setConfig (ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS, (*settings.find ("ADDRESSBOOK_MAX_RESULTS")).second); - setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO , (*settings.find ("ADDRESSBOOK_DISPLAY_CONTACT_PHOTO")).second); - setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS , (*settings.find ("ADDRESSBOOK_DISPLAY_PHONE_BUSINESS")).second); - setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_HOME , (*settings.find ("ADDRESSBOOK_DISPLAY_PHONE_HOME")).second); - setConfig (ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_MOBILE , (*settings.find ("ADDRESSBOOK_DISPLAY_PHONE_MOBILE")).second); + setConfig(ADDRESSBOOK, ADDRESSBOOK_ENABLE, (*settings.find( + "ADDRESSBOOK_ENABLE")).second); + setConfig(ADDRESSBOOK, ADDRESSBOOK_MAX_RESULTS, (*settings.find( + "ADDRESSBOOK_MAX_RESULTS")).second); + setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_CONTACT_PHOTO, (*settings.find( + "ADDRESSBOOK_DISPLAY_CONTACT_PHOTO")).second); + setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_BUSINESS, (*settings.find( + "ADDRESSBOOK_DISPLAY_PHONE_BUSINESS")).second); + setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_HOME, (*settings.find( + "ADDRESSBOOK_DISPLAY_PHONE_HOME")).second); + setConfig(ADDRESSBOOK, ADDRESSBOOK_DISPLAY_PHONE_MOBILE, (*settings.find( + "ADDRESSBOOK_DISPLAY_PHONE_MOBILE")).second); - // Write it to the configuration file - saveConfig (); + // Write it to the configuration file + saveConfig(); } -void -ManagerImpl::setAddressbookList (const std::vector< std::string >& list) -{ +void ManagerImpl::setAddressbookList (const std::vector<std::string>& list) { - std::string s = serialize (list); - setConfig (ADDRESSBOOK, ADDRESSBOOK_LIST, s); + std::string s = serialize(list); + setConfig(ADDRESSBOOK, ADDRESSBOOK_LIST, s); } -std::vector <std::string> -ManagerImpl::getAddressbookList (void) -{ +std::vector<std::string> ManagerImpl::getAddressbookList (void) { - std::string s = getConfigString (ADDRESSBOOK, ADDRESSBOOK_LIST); - return unserialize (s); + std::string s = getConfigString(ADDRESSBOOK, ADDRESSBOOK_LIST); + return unserialize(s); } -std::map<std::string, std::string> ManagerImpl::getHookSettings () -{ +std::map<std::string, std::string> ManagerImpl::getHookSettings () { - std::map<std::string, std::string> settings; + std::map<std::string, std::string> settings; - settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_FIELD", getConfigString (HOOKS, URLHOOK_SIP_FIELD))); - settings.insert (std::pair<std::string, std::string> ("URLHOOK_COMMAND", getConfigString (HOOKS, URLHOOK_COMMAND))); - settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_ENABLED", getConfigString (HOOKS, URLHOOK_SIP_ENABLED))); - settings.insert (std::pair<std::string, std::string> ("URLHOOK_IAX2_ENABLED", getConfigString (HOOKS, URLHOOK_IAX2_ENABLED))); - settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ENABLED", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ENABLED))); - settings.insert (std::pair<std::string, std::string> ("PHONE_NUMBER_HOOK_ADD_PREFIX", getConfigString (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX))); + settings.insert(std::pair<std::string, std::string>("URLHOOK_SIP_FIELD", + getConfigString(HOOKS, URLHOOK_SIP_FIELD))); + settings.insert(std::pair<std::string, std::string>("URLHOOK_COMMAND", + getConfigString(HOOKS, URLHOOK_COMMAND))); + settings.insert(std::pair<std::string, std::string>("URLHOOK_SIP_ENABLED", + getConfigString(HOOKS, URLHOOK_SIP_ENABLED))); + settings.insert(std::pair<std::string, std::string>("URLHOOK_IAX2_ENABLED", + getConfigString(HOOKS, URLHOOK_IAX2_ENABLED))); + settings.insert(std::pair<std::string, std::string>( + "PHONE_NUMBER_HOOK_ENABLED", getConfigString(HOOKS, + PHONE_NUMBER_HOOK_ENABLED))); + settings.insert(std::pair<std::string, std::string>( + "PHONE_NUMBER_HOOK_ADD_PREFIX", getConfigString(HOOKS, + PHONE_NUMBER_HOOK_ADD_PREFIX))); - return settings; + return settings; } -void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& settings) -{ +void ManagerImpl::setHookSettings ( + const std::map<std::string, std::string>& settings) { - setConfig (HOOKS, URLHOOK_SIP_FIELD, (*settings.find ("URLHOOK_SIP_FIELD")).second); - setConfig (HOOKS, URLHOOK_COMMAND, (*settings.find ("URLHOOK_COMMAND")).second); - setConfig (HOOKS, URLHOOK_SIP_ENABLED, (*settings.find ("URLHOOK_SIP_ENABLED")).second); - setConfig (HOOKS, URLHOOK_IAX2_ENABLED, (*settings.find ("URLHOOK_IAX2_ENABLED")).second); - setConfig (HOOKS, PHONE_NUMBER_HOOK_ENABLED, (*settings.find ("PHONE_NUMBER_HOOK_ENABLED")).second); - setConfig (HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX, (*settings.find ("PHONE_NUMBER_HOOK_ADD_PREFIX")).second); + setConfig(HOOKS, URLHOOK_SIP_FIELD, + (*settings.find("URLHOOK_SIP_FIELD")).second); + setConfig(HOOKS, URLHOOK_COMMAND, + (*settings.find("URLHOOK_COMMAND")).second); + setConfig(HOOKS, URLHOOK_SIP_ENABLED, + (*settings.find("URLHOOK_SIP_ENABLED")).second); + setConfig(HOOKS, URLHOOK_IAX2_ENABLED, (*settings.find( + "URLHOOK_IAX2_ENABLED")).second); + setConfig(HOOKS, PHONE_NUMBER_HOOK_ENABLED, (*settings.find( + "PHONE_NUMBER_HOOK_ENABLED")).second); + setConfig(HOOKS, PHONE_NUMBER_HOOK_ADD_PREFIX, (*settings.find( + "PHONE_NUMBER_HOOK_ADD_PREFIX")).second); - // Write it to the configuration file - saveConfig (); + // Write it to the configuration file + saveConfig(); } -void ManagerImpl::check_call_configuration (const CallID& id, const std::string &to, Call::CallConfiguration *callConfig) -{ - Call::CallConfiguration config; - - if (to.find (SIP_SCHEME) == 0 || to.find (SIPS_SCHEME) == 0) { - _debug ("Sending Sip Call "); - config = Call::IPtoIP; - } else { - config = Call::Classic; - } +void ManagerImpl::check_call_configuration (const CallID& id, + const std::string &to, Call::CallConfiguration *callConfig) { + Call::CallConfiguration config; + + if (to.find(SIP_SCHEME) == 0 || to.find(SIPS_SCHEME) == 0) { + _debug ("Sending Sip Call "); + config = Call::IPtoIP; + } else { + config = Call::Classic; + } - associateConfigToCall (id, config); + associateConfigToCall(id, config); - *callConfig = config; + *callConfig = config; } +bool ManagerImpl::associateConfigToCall (const CallID& callID, + Call::CallConfiguration config) { -bool ManagerImpl::associateConfigToCall (const CallID& callID, Call::CallConfiguration config) -{ - - if (getConfigFromCall (callID) == CallConfigNULL) { // nothing with the same ID - _callConfigMap[callID] = config; - _debug ("Associate Call %s with config %i", callID.data(), config); - return true; - } else { - return false; - } + if (getConfigFromCall(callID) == CallConfigNULL) { // nothing with the same ID + _callConfigMap[callID] = config; + _debug ("Manager: Associate call %s with config %i", callID.c_str(), config); + return true; + } else { + return false; + } } -Call::CallConfiguration ManagerImpl::getConfigFromCall (const CallID& callID) -{ +Call::CallConfiguration ManagerImpl::getConfigFromCall (const CallID& callID) { - CallConfigMap::iterator iter = _callConfigMap.find (callID); + CallConfigMap::iterator iter = _callConfigMap.find(callID); - if (iter == _callConfigMap.end()) { - return (Call::CallConfiguration) CallConfigNULL; - } else { - return iter->second; - } + if (iter == _callConfigMap.end()) { + return (Call::CallConfiguration) CallConfigNULL; + } else { + return iter->second; + } } -bool ManagerImpl::removeCallConfig (const CallID& callID) -{ +bool ManagerImpl::removeCallConfig (const CallID& callID) { - if (_callConfigMap.erase (callID)) { - return true; - } + if (_callConfigMap.erase(callID)) { + return true; + } - return false; + return false; } -std::map< std::string, std::string > ManagerImpl::getCallDetails (const CallID& callID) -{ +std::map<std::string, std::string> ManagerImpl::getCallDetails ( + const CallID& callID) { - std::map<std::string, std::string> call_details; - AccountID accountid; - Account *account; - VoIPLink *link; - Call *call = NULL; - std::stringstream type; + std::map<std::string, std::string> call_details; + AccountID accountid; + Account *account; + VoIPLink *link; + Call *call = NULL; + std::stringstream type; + // We need here to retrieve the call information attached to the call ID + // To achieve that, we need to get the voip link attached to the call + // But to achieve that, we need to get the account the call was made with - // We need here to retrieve the call information attached to the call ID - // To achieve that, we need to get the voip link attached to the call - // But to achieve that, we need to get the account the call was made with + // So first we fetch the account + accountid = getAccountFromCall(callID); + _debug ("%s",callID.c_str()); + // Then the VoIP link this account is linked with (IAX2 or SIP) - // So first we fetch the account - accountid = getAccountFromCall (callID); - _debug ("%s",callID.c_str()); - // Then the VoIP link this account is linked with (IAX2 or SIP) + if ((account = getAccount(accountid)) != 0) { + link = account->getVoIPLink(); - if ( (account=getAccount (accountid)) != 0) { - link = account->getVoIPLink (); - - if (link) { - call = link->getCall (callID); - } - } + if (link) { + call = link->getCall(callID); + } + } - if (call) { - type << call->getCallType (); - call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", accountid)); - call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", call->getPeerNumber ())); - call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", call->getPeerName ())); - call_details.insert (std::pair<std::string, std::string> ("DISPLAY_NAME", call->getDisplayName ())); - call_details.insert (std::pair<std::string, std::string> ("CALL_STATE", call->getStateStr ())); - call_details.insert (std::pair<std::string, std::string> ("CALL_TYPE", type.str ())); - } else { - _debug ("Error: Managerimpl - getCallDetails ()"); - call_details.insert (std::pair<std::string, std::string> ("ACCOUNTID", AccountNULL)); - call_details.insert (std::pair<std::string, std::string> ("PEER_NUMBER", "Unknown")); - call_details.insert (std::pair<std::string, std::string> ("PEER_NAME", "Unknown")); - call_details.insert (std::pair<std::string, std::string> ("CALL_STATE", "UNKNOWN")); - call_details.insert (std::pair<std::string, std::string> ("CALL_TYPE", "0")); - } + if (call) { + type << call->getCallType(); + call_details.insert(std::pair<std::string, std::string>("ACCOUNTID", + accountid)); + call_details.insert(std::pair<std::string, std::string>("PEER_NUMBER", + call->getPeerNumber())); + call_details.insert(std::pair<std::string, std::string>("PEER_NAME", + call->getPeerName())); + call_details.insert(std::pair<std::string, std::string>("DISPLAY_NAME", + call->getDisplayName())); + call_details.insert(std::pair<std::string, std::string>("CALL_STATE", + call->getStateStr())); + call_details.insert(std::pair<std::string, std::string>("CALL_TYPE", + type.str())); + } else { + _debug ("Error: Managerimpl - getCallDetails ()"); + call_details.insert(std::pair<std::string, std::string>("ACCOUNTID", + AccountNULL)); + call_details.insert(std::pair<std::string, std::string>("PEER_NUMBER", + "Unknown")); + call_details.insert(std::pair<std::string, std::string>("PEER_NAME", + "Unknown")); + call_details.insert(std::pair<std::string, std::string>("CALL_STATE", + "UNKNOWN")); + call_details.insert(std::pair<std::string, std::string>("CALL_TYPE", + "0")); + } - return call_details; + return call_details; } - -std::map<std::string, std::string> ManagerImpl::send_history_to_client (void) -{ - return _history->get_history_serialized (); +std::map<std::string, std::string> ManagerImpl::send_history_to_client (void) { + return _history->get_history_serialized(); } -void ManagerImpl::receive_history_from_client (std::map<std::string, std::string> history) -{ - _history->set_serialized_history (history, Manager::instance().getConfigInt (PREFERENCES, CONFIG_HISTORY_LIMIT)); - _history->save_history (); +void ManagerImpl::receive_history_from_client (std::map<std::string, + std::string> history) { + _history->set_serialized_history(history, Manager::instance().getConfigInt( + PREFERENCES, CONFIG_HISTORY_LIMIT)); + _history->save_history(); } +std::vector<std::string> ManagerImpl::getCallList (void) { + std::vector<std::string> v; -std::vector< std::string > -ManagerImpl::getCallList (void) -{ - std::vector< std::string > v; - - CallAccountMap::iterator iter = _callAccountMap.begin (); + CallAccountMap::iterator iter = _callAccountMap.begin(); - while (iter != _callAccountMap.end ()) { - v.push_back (iter->first.data()); - iter++; - } + while (iter != _callAccountMap.end()) { + v.push_back(iter->first.data()); + iter++; + } - return v; + return v; } +std::map<std::string, std::string> ManagerImpl::getConferenceDetails ( + const ConfID& confID) { -std::map< std::string, std::string > -ManagerImpl::getConferenceDetails (const ConfID& confID) -{ + std::map<std::string, std::string> conf_details; + ConferenceMap::iterator iter_conf; - std::map<std::string, std::string> conf_details; - ConferenceMap::iterator iter_conf; + iter_conf = _conferencemap.find(confID); - iter_conf = _conferencemap.find (confID); + Conference* conf = NULL; - Conference* conf = NULL; + if (iter_conf != _conferencemap.end()) { - if (iter_conf != _conferencemap.end()) { - - conf = iter_conf->second; - conf_details.insert (std::pair<std::string, std::string> ("CONFID", confID)); - conf_details.insert (std::pair<std::string, std::string> ("CONF_STATE", conf->getStateStr())); - } + conf = iter_conf->second; + conf_details.insert(std::pair<std::string, std::string>("CONFID", + confID)); + conf_details.insert(std::pair<std::string, std::string>("CONF_STATE", + conf->getStateStr())); + } - return conf_details; + return conf_details; } +std::vector<std::string> ManagerImpl::getConferenceList (void) { + _debug ("ManagerImpl::getConferenceList"); + std::vector<std::string> v; -std::vector< std::string > -ManagerImpl::getConferenceList (void) -{ - _debug ("ManagerImpl::getConferenceList"); - std::vector< std::string > v; - - ConferenceMap::iterator iter = _conferencemap.begin(); + ConferenceMap::iterator iter = _conferencemap.begin(); - while (iter != _conferencemap.end ()) { - v.push_back (iter->first); - iter++; - } + while (iter != _conferencemap.end()) { + v.push_back(iter->first); + iter++; + } - return v; + return v; } +std::vector<std::string> ManagerImpl::getParticipantList ( + const std::string& confID) { + _debug ("ManagerImpl::getParticipantList"); + std::vector<std::string> v; -std::vector< std::string > -ManagerImpl::getParticipantList (const std::string& confID) -{ - _debug ("ManagerImpl::getParticipantList"); - std::vector< std::string > v; - - ConferenceMap::iterator iter_conf = _conferencemap.find (confID); - Conference *conf = NULL; + ConferenceMap::iterator iter_conf = _conferencemap.find(confID); + Conference *conf = NULL; - if (iter_conf != _conferencemap.end()) - conf = iter_conf->second; + if (iter_conf != _conferencemap.end()) + conf = iter_conf->second; - if (conf != NULL) { - ParticipantSet participants = conf->getParticipantList(); - ParticipantSet::iterator iter_participant = participants.begin(); + if (conf != NULL) { + ParticipantSet participants = conf->getParticipantList(); + ParticipantSet::iterator iter_participant = participants.begin(); - while (iter_participant != participants.end ()) { + while (iter_participant != participants.end()) { - v.push_back (*iter_participant); + v.push_back(*iter_participant); - iter_participant++; - } - } + iter_participant++; + } + } - return v; + return v; } diff --git a/sflphone-common/src/managerimpl.h b/sflphone-common/src/managerimpl.h index ca88a42939c7c8fd36d316f4dad4eaa36deafed4..3e3b822c3d63c5507ab5caf0e484bd87655fff2b 100644 --- a/sflphone-common/src/managerimpl.h +++ b/sflphone-common/src/managerimpl.h @@ -424,6 +424,12 @@ class ManagerImpl { */ void setAccountsOrder (const std::string& order); + /** + * Load the accounts order set by the user from the sflphonedrc config file + * @return std::vector<std::string> A vector containing the account ID's + */ + std::vector<std::string> loadAccountOrder (); + /** * Retrieve details about a given account * @param accountID The account identifier @@ -495,20 +501,6 @@ class ManagerImpl { */ void deleteAllCredential(const AccountID& accountID); - /** - * Get the list of codecs we supports, not ordered - * @return The list of the codecs - */ - std::vector< ::std::string > getCodecList( void ); - - /** - * Get the info about one codec - * Name / Clock rate / bitrate / bandwidth - * @param payload The payload of the codec - * @return std::vector<::DBus::string> The information - */ - std::vector< ::std::string > getCodecDetails( const int32_t& payload); - /** * Get current codec name * @param call id @@ -516,18 +508,6 @@ class ManagerImpl { */ std::string getCurrentCodecName(const CallID& id); - /** - * Get a list of supported input audio plugin - * @return std::vector<std::string> List of names - */ - std::vector< std::string> getInputAudioPluginList(void); - - /** - * Get a list of supported output audio plugin - * @return std::vector<std::string> List of names - */ - std::vector< std::string> getOutputAudioPluginList(void); - /** * Set input audio plugin * @param audioPlugin The audio plugin @@ -821,12 +801,6 @@ class ManagerImpl { */ std::vector< ::std::string > getActiveCodecList( void ); - /** - * Set the list of the active codecs - * @param list The new list of active codecs - */ - void setActiveCodecList( const std::vector< ::std::string >& list); - /* * Notify the client that an error occured * @param errCode The error code. Could be: ALSA_CAPTURE_ERROR @@ -1244,12 +1218,6 @@ class ManagerImpl { */ short loadAccountMap(); - /** - * Load the accounts order set by the user from the sflphonedrc config file - * @return std::vector<std::string> A vector containing the account ID's - */ - std::vector<std::string> loadAccountOrder (); - /** * Unload the account (delete them) @@ -1331,7 +1299,7 @@ class ManagerImpl { // ConferenceMap _conferencemap; - + private: diff --git a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp index 4ab7c6c9708ac4a4d2143ee410ebec482dfce5f1..f9c7478eee33cdfbc73d23571c754195c1f8d99c 100644 --- a/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp +++ b/sflphone-common/src/plug-in/audiorecorder/audiorecord.cpp @@ -93,12 +93,12 @@ void AudioRecord::initFileName (std::string peerNumber) if (fileType_ == FILE_RAW) { if (strstr (fileName_, ".raw") == NULL) { - printf ("AudioRecord::openFile::concatenate .raw file extension: name : %s ", fileName_); + _debug("AudioRecord: concatenate .raw file extension: name : %s", fileName_); fName.append (".raw"); } } else if (fileType_ == FILE_WAV) { if (strstr (fileName_, ".wav") == NULL) { - printf ("AudioRecord::openFile::concatenate .wav file extension: name : %s ", fileName_); + _debug("AudioRecord: concatenate .wav file extension: name : %s", fileName_); fName.append (".wav"); } } @@ -109,15 +109,14 @@ void AudioRecord::initFileName (std::string peerNumber) void AudioRecord::openFile() { - - _debug ("AudioRecord::openFile()"); + _info ("AudioRecord: Open file()"); bool result = false; - _debug ("AudioRecord::openFile()"); + _debug ("AudioRecord: Open file()"); if (isFileExist()) { - _debug ("AudioRecord::Filename does not exist, creating one "); + _debug ("AudioRecord: Filename does not exist, creating one"); byteCounter_ = 0; if (fileType_ == FILE_RAW) { @@ -126,7 +125,7 @@ void AudioRecord::openFile() result = setWavFile(); } } else { - _debug ("AudioRecord::Filename already exist opening it "); + _debug ("AudioRecord: Filename already exist opening it"); if (fileType_ == FILE_RAW) { result = openExistingRawFile(); @@ -156,10 +155,8 @@ bool AudioRecord::isOpenFile() { if (fp) { - _debug ("AudioRecord::isOpenFile(): file already openend"); return true; } else { - _debug ("AudioRecord::isOpenFIle(): file not openend "); return false; } } @@ -167,7 +164,7 @@ bool AudioRecord::isOpenFile() bool AudioRecord::isFileExist() { - _debug ("AudioRecord::isFileExist(): try to open name : %s ", fileName_); + _info ("AudioRecord: Try to open name : %s ", fileName_); if (fopen (fileName_,"rb") ==0) { return true; @@ -178,8 +175,6 @@ bool AudioRecord::isFileExist() bool AudioRecord::isRecording() { - _debug ("AudioRecording::isRecording() %i ", recordingEnabled_); - if (recordingEnabled_) return true; @@ -190,19 +185,20 @@ bool AudioRecord::isRecording() bool AudioRecord::setRecording() { - _debug ("AudioRecord::setRecording() "); if (isOpenFile()) { - _debug ("AudioRecord::setRecording()::file already opened "); - - if (!recordingEnabled_) - recordingEnabled_ = true; - else - recordingEnabled_ = false; - } else { - _debug ("AudioRecord::setRecording():Opening the wave file in call during call instantiation "); + if (!recordingEnabled_) { + _info ("AudioRecording: Start recording"); + recordingEnabled_ = true; + } + else { + recordingEnabled_ = false; + _info ("AudioRecording: Stop recording"); + } + } + else { openFile(); - + recordingEnabled_ = true; // once opend file, start recording } @@ -213,7 +209,7 @@ bool AudioRecord::setRecording() void AudioRecord::stopRecording() { - _debug ("AudioRecording::stopRecording() "); + _info ("AudioRecording: Stop recording"); if (recordingEnabled_) recordingEnabled_ = false; @@ -270,7 +266,7 @@ void AudioRecord::createFilename() // fileName_ = out.str(); strncpy (fileName_, out.str().c_str(), 8192); - printf ("AudioRecord::createFilename::filename for this call %s ",fileName_); + _info("AudioRecord: create filename for this call %s ", fileName_); } bool AudioRecord::setRawFile() @@ -279,7 +275,7 @@ bool AudioRecord::setRawFile() fp = fopen (savePath_.c_str(), "wb"); if (!fp) { - _debug ("AudioRecord::setRawFile() : could not create RAW file!"); + _warn ("AudioRecord::setRawFile() : could not create RAW file!"); return false; } @@ -300,7 +296,7 @@ bool AudioRecord::setWavFile() fp = fopen (savePath_.c_str(), "wb"); if (!fp) { - _debug ("AudioRecord::setWavFile() : could not create WAV file."); + _warn("AudioRecord: Error: could not create WAV file."); return false; } @@ -328,11 +324,11 @@ bool AudioRecord::setWavFile() if (fwrite (&hdr, 4, 11, fp) != 11) { - _debug ("AudioRecord::setWavFile() : could not write WAV header for file. "); + _warn("AudioRecord: Error: could not write WAV header for file. "); return false; } - _debug ("AudioRecord::setWavFile() : created WAV file. "); + _debug ("AudioRecord: created WAV file successfully."); return true; } @@ -343,7 +339,7 @@ bool AudioRecord::openExistingRawFile() fp = fopen (fileName_, "ab+"); if (!fp) { - _debug ("AudioRecord::openExistingRawFile() : could not create RAW file!"); + _warn ("AudioRecord: could not create RAW file!"); return false; } @@ -353,42 +349,41 @@ bool AudioRecord::openExistingRawFile() bool AudioRecord::openExistingWavFile() { - _debug ("AudioRecord::openExistingWavFile() "); + _info ("AudioRecord: Open existing wave file"); fp = fopen (fileName_, "rb+"); if (!fp) { - _debug ("AudioRecord::openExistingWavFile() : could not open WAV file rb+!"); + _warn("AudioRecord: Error: could not open WAV file!"); return false; } printf ("AudioRecord::openExistingWavFile()::Tried to open %s ",fileName_); if (fseek (fp, 40, SEEK_SET) != 0) // jump to data length - _debug ("AudioRecord::OpenExistingWavFile: 1.Couldn't seek offset 40 in the file "); + _warn ("AudioRecord: Error: Couldn't seek offset 40 in the file "); if (fread (&byteCounter_, 4, 1, fp)) - _debug ("AudioRecord::OpenExistingWavFile : bytecounter Read successfully "); + _warn("AudioRecord: Error: bytecounter Read successfully "); if (fseek (fp, 0 , SEEK_END) != 0) - _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file "); + _warn ("AudioRecord: Error: Couldn't seek at the en of the file "); - printf ("AudioRecord::OpenExistingWavFile : Byte counter after oppening : %d ", (int) byteCounter_); if (fclose (fp) != 0) - _debug ("AudioRecord::openExistingWavFile()::ERROR: can't close file r+ "); + _warn ("AudioRecord: Error: Can't close file r+ "); fp = fopen (fileName_, "ab+"); if (!fp) { - _debug ("AudioRecord::openExistingWavFile() : could not createopen WAV file ab+!"); + _warn ("AudioRecord: Error: Could not createopen WAV file ab+!"); return false; } if (fseek (fp, 4 , SEEK_END) != 0) - _debug ("AudioRecors::OpenExistingWavFile : 2.Couldn't seek at the en of the file "); + _warn ("AudioRecord: Error: Couldn't seek at the en of the file "); return true; @@ -398,7 +393,7 @@ bool AudioRecord::openExistingWavFile() void AudioRecord::closeWavFile() { if (fp == 0) { - _debug ("AudioRecord:: Can't closeWavFile, a file has not yet been opened!"); + _debug ("AudioRecord: Can't closeWavFile, a file has not yet been opened!"); return; } @@ -406,29 +401,27 @@ void AudioRecord::closeWavFile() SINT32 bytes = byteCounter_ * channels_; fseek (fp, 40, SEEK_SET); // jump to data length - - if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 40"); + if (ferror (fp)) + _warn ("AudioRecord: Error: can't reach offset 40 while closing"); fwrite (&bytes, sizeof (SINT32), 1, fp); + if (ferror (fp)) + _warn ("AudioRecord: Error: can't write bytes for data length "); - if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't write bytes for data length "); - - printf ("AudioRecord::closeWavFile : data bytes: %i ", (int) bytes); bytes = byteCounter_ * channels_ + 44; // + 44 for the wave header fseek (fp, 4, SEEK_SET); // jump to file size - - if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4"); + if (ferror (fp)) + _warn ("AudioRecord: Error: can't reach offset 4"); fwrite (&bytes, 4, 1, fp); + if (ferror (fp)) + _warn("AudioRecord: Error: can't reach offset 4"); - if (ferror (fp)) perror ("AudioRecord::closeWavFile()::ERROR: can't reach offset 4"); - - printf ("AudioRecord::closeWavFile : bytes : %i ", (int) bytes); if (fclose (fp) != 0) - _debug ("AudioRecord::closeWavFile()::ERROR: can't close file"); + _warn ("AudioRecord: Error: can't close file"); } @@ -478,7 +471,7 @@ void AudioRecord::recData (SFLDataFormat* buffer, int nSamples) if (sndFormat_ == INT16) { // TODO change INT16 to SINT16 if (fwrite (buffer, sizeof (SFLDataFormat), nSamples, fp) != (unsigned int) nSamples) - _debug ("AudioRecord: Could not record data! "); + _warn ("AudioRecord: Could not record data! "); else { fflush (fp); byteCounter_ += (unsigned long) (nSamples*sizeof (SFLDataFormat)); @@ -508,7 +501,7 @@ void AudioRecord::recData (SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int if (fwrite (&mixBuffer_[k], 2, 1, fp) != 1) - _debug ("AudioRecord: Could not record data!"); + _warn ("AudioRecord: Could not record data!"); else { fflush (fp); } diff --git a/sflphone-common/src/sip/Pattern.cpp b/sflphone-common/src/sip/Pattern.cpp index 290c9f7a79c52319aae430c78f7e9d143c20e6a7..f925c8db9005e3ad986bbf20f20e4fbc3028d975 100644 --- a/sflphone-common/src/sip/Pattern.cpp +++ b/sflphone-common/src/sip/Pattern.cpp @@ -25,9 +25,9 @@ namespace sfl Pattern::Pattern (const std::string& pattern, const std::string& options) : _pattern (pattern), + _re (NULL), _ovector (NULL), _ovectorSize (0), - _re (NULL), _count (0), _options (0) { @@ -139,8 +139,6 @@ std::string Pattern::group (int groupNumber) { const char * stringPtr; - // printf("_subject.substr : %s\n", _subject.substr (_offset[0]).c_str()); - int rc = pcre_get_substring ( _subject.substr (_offset[0]).c_str(), _ovector, @@ -180,12 +178,13 @@ std::string Pattern::group (const std::string& groupName) _count, groupName.c_str(), &stringPtr); - + if (rc < 0) { switch (rc) { case PCRE_ERROR_NOSUBSTRING: - throw std::out_of_range ("Invalid group reference."); + + break; case PCRE_ERROR_NOMEMORY: throw match_error ("Memory exhausted."); @@ -195,14 +194,23 @@ std::string Pattern::group (const std::string& groupName) } } - std::string matchedStr (stringPtr); + std::string matchedStr; - pcre_free_substring (stringPtr); + if(stringPtr) { + + matchedStr = stringPtr; + pcre_free_substring (stringPtr); + } + else { + + matchedStr = ""; + } return matchedStr; + } -size_t Pattern::start (const std::string& groupName) const +void Pattern::start (const std::string& groupName) const { int index = pcre_get_stringnumber (_re, groupName.c_str()); start (index); @@ -210,7 +218,7 @@ size_t Pattern::start (const std::string& groupName) const size_t Pattern::start (unsigned int groupNumber) const { - if (groupNumber <= _count) { + if (groupNumber <= (unsigned int)_count) { return _ovector[ (groupNumber + 1) * 2]; } else { throw std::out_of_range ("Invalid group reference."); @@ -222,7 +230,7 @@ size_t Pattern::start (void) const return _ovector[0] + _offset[0]; } -size_t Pattern::end (const std::string& groupName) const +void Pattern::end (const std::string& groupName) const { int index = pcre_get_stringnumber (_re, groupName.c_str()); end (index); @@ -230,7 +238,7 @@ size_t Pattern::end (const std::string& groupName) const size_t Pattern::end (unsigned int groupNumber) const { - if (groupNumber <= _count) { + if (groupNumber <= (unsigned int)_count) { return _ovector[ ( (groupNumber + 1) * 2) + 1 ] - 1; } else { throw std::out_of_range ("Invalid group reference."); @@ -249,6 +257,7 @@ bool Pattern::matches (void) throw (match_error) bool Pattern::matches (const std::string& subject) throw (match_error) { + // Try to find a match for this pattern int rc = pcre_exec ( _re, @@ -260,6 +269,8 @@ bool Pattern::matches (const std::string& subject) throw (match_error) _ovector, _ovectorSize); + + // Matching failed. if (rc < 0) { _offset[0] = _offset[1] = 0; diff --git a/sflphone-common/src/sip/Pattern.h b/sflphone-common/src/sip/Pattern.h index b07c92acddbfd4466710c83fb6ce7e40d38e1383..870ca1b5e8b37189a1f1b4575ec27611890c2df5 100644 --- a/sflphone-common/src/sip/Pattern.h +++ b/sflphone-common/src/sip/Pattern.h @@ -143,10 +143,8 @@ namespace sfl { * Get the start position of the specified match. * * @param groupName The capturing group name. - * - * @return the start position of the specified match. */ - size_t start(const std::string& groupName) const; + void start(const std::string& groupName) const; /** * Get the end position of the overall match. @@ -171,7 +169,7 @@ namespace sfl { * * @return the end position of the specified match. */ - size_t end(const std::string& groupName) const; + void end(const std::string& groupName) const; /** * Get the number of capturing groups in the diff --git a/sflphone-common/src/sip/SdesNegotiator.cpp b/sflphone-common/src/sip/SdesNegotiator.cpp index b2d1aafd3e00e73b932da64dd6f56ce0bfaac6a6..ef2849bb75f7f58d00403c5333edfc107895d750 100644 --- a/sflphone-common/src/sip/SdesNegotiator.cpp +++ b/sflphone-common/src/sip/SdesNegotiator.cpp @@ -65,12 +65,12 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void) "F8_128_HMAC_SHA1_80|" \ "[A-Za-z0-9_]+)"); // srtp-crypto-suite-ext - keyParamsPattern = new Pattern ( - "(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \ - "(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)\\|" \ - "2\\^(?P<lifetime>[0-9]+)\\|" \ - "(?P<mkiValue>[0-9]+)\\:" \ - "(?P<mkiLength>[0-9]{1,3})\\;?", "g"); + keyParamsPattern = new Pattern ( + "(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \ + "(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)" \ + "(\\|2\\^(?P<lifetime>[0-9]+)\\|" \ + "(?P<mkiValue>[0-9]+)\\:" \ + "(?P<mkiLength>[0-9]{1,3})\\;?)?", "g"); sessionParamPattern = new Pattern ( "(?P<sessionParam>(kdr\\=[0-9]{1,2}|" \ @@ -120,7 +120,9 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void) std::string tag; if (tagPattern->matches()) { try { + // std::cout << "Parsing the tag field"; tag = tagPattern->group ("tag"); + // std::cout << ": " << tag << std::endl; } catch (match_error& exception) { throw parse_error ("Error while parsing the tag field"); } @@ -136,7 +138,9 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void) if (cryptoSuitePattern->matches()) { try { - cryptoSuite = cryptoSuitePattern->group ("cryptoSuite"); + // std::cout << "Parsing the crypto suite field"; + cryptoSuite = cryptoSuitePattern->group ("cryptoSuite"); + // std::cout << ": " << cryptoSuite << std::endl; } catch (match_error& exception) { throw parse_error ("Error while parsing the crypto-suite field"); } @@ -154,7 +158,7 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void) std::string mkiValue; try { - while (keyParamsPattern->matches()) { + while(keyParamsPattern->matches()) { srtpKeyMethod = keyParamsPattern->group ("srtpKeyMethod"); srtpKeyInfo = keyParamsPattern->group ("srtpKeyInfo"); lifetime = keyParamsPattern->group ("lifetime"); @@ -184,7 +188,7 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void) } */ // Add the new CryptoAttribute to the vector - std::cout << (*iter) << std::endl; + CryptoAttribute * cryptoAttribute = new CryptoAttribute(tag, cryptoSuite, srtpKeyMethod, srtpKeyInfo, lifetime, mkiValue, mkiLength); cryptoAttributeVector.push_back(cryptoAttribute); } @@ -194,6 +198,7 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void) bool SdesNegotiator::negotiate (void) { + std::vector<CryptoAttribute *> cryptoAttributeVector = parse(); std::vector<CryptoAttribute *>::iterator iter_offer = cryptoAttributeVector.begin(); diff --git a/sflphone-common/src/sip/SdesNegotiator.h b/sflphone-common/src/sip/SdesNegotiator.h index f038d012bacab8abbde0f72b1093aa92c155a98e..e0de86de108c0bd01b61e14fd1f657a9e1bf232f 100644 --- a/sflphone-common/src/sip/SdesNegotiator.h +++ b/sflphone-common/src/sip/SdesNegotiator.h @@ -71,9 +71,9 @@ namespace sfl { * as defined in RFC4568 (6.2) */ const CryptoSuiteDefinition CryptoSuites[3] = { - {"AES_CM_128_HMAC_SHA1_80", 128, 112, 48, 31, AESCounterMode, 128, HMACSHA1, 80, 80, 160, 160 }, - {"AES_CM_128_HMAC_SHA1_32", 128, 112, 48, 31, AESCounterMode, 128, HMACSHA1, 32, 80, 160, 160 }, - {"F8_128_HMAC_SHA1_80", 128, 112, 48, 31, AESF8Mode, 128, HMACSHA1, 80, 80, 160, 160 } }; + {(char*)"AES_CM_128_HMAC_SHA1_80", 128, 112, 48, 31, AESCounterMode, 128, HMACSHA1, 80, 80, 160, 160 }, + {(char*)"AES_CM_128_HMAC_SHA1_32", 128, 112, 48, 31, AESCounterMode, 128, HMACSHA1, 32, 80, 160, 160 }, + {(char*)"F8_128_HMAC_SHA1_80", 128, 112, 48, 31, AESF8Mode, 128, HMACSHA1, 80, 80, 160, 160 } }; class CryptoAttribute { diff --git a/sflphone-common/src/sip/sdp.cpp b/sflphone-common/src/sip/sdp.cpp index 45efccf15bb75e95544ed4ba67c6dd49030bd3d4..5b3066212a5cb1696816960df034e126ab5b7ac4 100644 --- a/sflphone-common/src/sip/sdp.cpp +++ b/sflphone-common/src/sip/sdp.cpp @@ -30,6 +30,7 @@ static const pj_str_t STR_IN = { (char*) "IN", 2 }; static const pj_str_t STR_IP4 = { (char*) "IP4", 3}; static const pj_str_t STR_IP6 = { (char*) "IP6", 3}; static const pj_str_t STR_RTP_AVP = { (char*) "RTP/AVP", 7 }; +static const pj_str_t STR_RTP_SAVP = { (char*) "RTP/SAVP", 8 }; static const pj_str_t STR_SDP_NAME = { (char*) "sflphone", 8 }; static const pj_str_t STR_SENDRECV = { (char*) "sendrecv", 8 }; static const pj_str_t STR_RTPMAP = { (char*) "rtpmap", 6 }; @@ -49,25 +50,9 @@ Sdp::Sdp (pj_pool_t *pool) _pool = pool; } -Sdp::~Sdp() -{ - - //unsigned int k; +Sdp::~Sdp() { } - /* - for( k=0; k<_session_media.size(); k++ ){ - delete _session_media[k]; - _session_media[k] = 0; - }*/ - - //for( k=0; k<_local_media_cap.size(); k++ ){ - // delete _local_media_cap[k]; - //_local_media_cap[k] = 0; - //} -} - -void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) -{ +void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) { pjmedia_sdp_media* med; pjmedia_sdp_rtpmap rtpmap; @@ -83,7 +68,16 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) (media->get_media_type() == MIME_TYPE_AUDIO) ? &STR_AUDIO : &STR_VIDEO); med->desc.port_count = 1; med->desc.port = media->get_port(); - pj_strdup (_pool, &med->desc.transport, &STR_RTP_AVP); + + // in case of sdes, media are tagged as "RTP/SAVP", RTP/AVP elsewhere + if(_srtp_crypto.empty()) { + + pj_strdup (_pool, &med->desc.transport, &STR_RTP_AVP); + } + else { + + pj_strdup (_pool, &med->desc.transport, &STR_RTP_SAVP); + } // Media format ( RTP payload ) count = media->get_media_codec_list().size(); @@ -103,9 +97,16 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) // connection, the rtpmap attribute will be useful to specify for which codec it is applicable rtpmap.pt = med->desc.fmt[i]; rtpmap.enc_name = pj_str ( (char*) codec->getCodecName().c_str()); - rtpmap.clock_rate = codec->getClockRate(); - // Add the channel number only if different from 1 + // G722 require G722/8000 media description even if it is 16000 codec + if(codec->getPayload () == 9) { + rtpmap.clock_rate = 8000; + } + else { + rtpmap.clock_rate = codec->getClockRate(); + } + + // Add the channel number only if different from 1 if (codec->getChannel() > 1) rtpmap.param = pj_str ( (char*) codec->getChannel()); else @@ -130,19 +131,20 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) throw; } } else { - _debug ("No hash specified"); + _warn ("No hash specified"); } *p_med = med; } -int Sdp::create_local_offer () -{ +int Sdp::create_local_offer (CodecOrder selectedCodecs) { + pj_status_t status; - _debug ("Create local offer"); + _info("SDP: Create local offer"); + // Build local media capabilities - set_local_media_capabilities (); + set_local_media_capabilities (selectedCodecs); // Reference: RFC 4566 [5] @@ -156,7 +158,6 @@ int Sdp::create_local_offer () sdp_add_session_name(); sdp_add_connection_info(); sdp_add_timing(); - //sdp_addAttributes( _pool ); sdp_add_media_description(); if(!_srtp_crypto.empty()) { @@ -174,17 +175,17 @@ int Sdp::create_local_offer () return PJ_SUCCESS; } -int Sdp::create_initial_offer() -{ +int Sdp::create_initial_offer (CodecOrder selectedCodecs) { + pj_status_t status; pjmedia_sdp_neg_state state; - _debug ("Create initial offer"); + _info("SDP: Create initial offer"); // Build the SDP session descriptor - status = create_local_offer(); + status = create_local_offer (selectedCodecs); if (status != PJ_SUCCESS) { - _debug (" Error: Failled to create initial offer"); + _error ("SDP: Error: Failed to create initial offer"); return status; } @@ -192,7 +193,7 @@ int Sdp::create_initial_offer() status = pjmedia_sdp_neg_create_w_local_offer (_pool, get_local_sdp_session(), &_negociator); if (status != PJ_SUCCESS) { - _debug (" Error: Failled to create an initial SDP negociator"); + _error ("SDP: Error: Failed to create an initial SDP negociator"); return status; } @@ -200,25 +201,28 @@ int Sdp::create_initial_offer() PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); - _debug (" Initial offer created succesfully"); - return PJ_SUCCESS; } -int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote) -{ +int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote, CodecOrder selectedCodecs) { + // Create the SDP negociator instance by calling // pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional ) pj_status_t status; + if (!remote) { + return !PJ_SUCCESS; + } + // Create the SDP negociator instance by calling // pjmedia_sdp_neg_create_w_remote_offer with the remote offer, and by providing the local offer ( optional ) // Build the local offer to respond - status = create_local_offer(); + status = create_local_offer (selectedCodecs); if (status != PJ_SUCCESS) { + _error ("SDP: Error: Failed to create initial offer"); return status; } @@ -226,15 +230,15 @@ int Sdp::receiving_initial_offer (pjmedia_sdp_session* remote) this->set_media_transport_info_from_remote_sdp (remote); status = pjmedia_sdp_neg_create_w_remote_offer (_pool, - get_local_sdp_session(), remote, &_negociator); + get_local_sdp_session(), remote, &_negociator); PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); return PJ_SUCCESS; } -pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata) -{ +pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata) { + static const pj_str_t str_application = { (char*) "application", 11 }; static const pj_str_t str_sdp = { (char*) "sdp", 3 }; pj_status_t status; @@ -246,17 +250,17 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata) message = rdata->msg_info.msg; if (message == NULL) { - _debug ("No message"); + _error ("SDP: No message"); return PJMEDIA_SDP_EINSDP; } if (message->body == NULL) { - _debug ("Empty message body"); + _error ("SDP: Empty message body"); return PJMEDIA_SDP_EINSDP; } if (pj_stricmp (&message->body->content_type.type, &str_application) || pj_stricmp (&message->body->content_type.subtype, &str_sdp)) { - _debug ("Incoming Message does not contain SDP"); + _error ("SDP: Incoming Message does not contain SDP"); return PJMEDIA_SDP_EINSDP; } @@ -268,17 +272,17 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata) } if (status != PJ_SUCCESS) { - _debug ("SDP cannot be validated"); + _warn ("SDP: cannot be validated"); return PJMEDIA_SDP_EINSDP; } // This is an answer - _debug ("Got SDP answer %s", pjsip_rx_data_get_info (rdata)); + _debug ("SDP: Got SDP answer %s", pjsip_rx_data_get_info (rdata)); status = pjmedia_sdp_neg_set_remote_answer (inv->pool, inv->neg, remote_sdp); if (status != PJ_SUCCESS) { - _debug ("An error occured while processing remote answer %s", pjsip_rx_data_get_info (rdata)); + _error ("SDP: Error: while processing remote answer %s", pjsip_rx_data_get_info (rdata)); return PJMEDIA_SDP_EINSDP; } @@ -296,13 +300,13 @@ pj_status_t Sdp::check_sdp_answer (pjsip_inv_session *inv, pjsip_rx_data *rdata) return status; } -void Sdp::sdp_add_protocol (void) -{ +void Sdp::sdp_add_protocol (void) { + this->_local_offer->origin.version = 0; } -void Sdp::sdp_add_origin (void) -{ +void Sdp::sdp_add_origin (void) { + pj_time_val tv; pj_gettimeofday (&tv); @@ -317,22 +321,22 @@ void Sdp::sdp_add_origin (void) this->_local_offer->origin.addr = pj_str ( (char*) _ip_addr.c_str()); } -void Sdp::sdp_add_session_name (void) -{ +void Sdp::sdp_add_session_name (void) { + this->_local_offer->name = STR_SDP_NAME; } -void Sdp::sdp_add_connection_info (void) -{ +void Sdp::sdp_add_connection_info (void) { + this->_local_offer->conn->net_type = _local_offer->origin.net_type; this->_local_offer->conn->addr_type = _local_offer->origin.addr_type; this->_local_offer->conn->addr = _local_offer->origin.addr; } -void Sdp::sdp_add_timing (void) -{ +void Sdp::sdp_add_timing (void) { + // RFC 3264: An offer/answer model session description protocol // As the session is created and destroyed through an external signaling mean (SIP), the line // should have a value of "0 0". @@ -340,8 +344,8 @@ void Sdp::sdp_add_timing (void) this->_local_offer->time.start = this->_local_offer->time.stop = 0; } -void Sdp::sdp_add_attributes() -{ +void Sdp::sdp_add_attributes() { + pjmedia_sdp_attr *a; this->_local_offer->attr_count = 1; a = PJ_POOL_ZALLOC_T (_pool, pjmedia_sdp_attr); @@ -365,7 +369,6 @@ void Sdp::sdp_add_media_description() } } -// @TODO crypto should be a vector of string void Sdp::sdp_add_sdes_attribute (std::vector<std::string>& crypto) { @@ -495,9 +498,6 @@ void Sdp::set_negotiated_sdp (const pjmedia_sdp_session *sdp) pjmedia_sdp_attr_to_rtpmap (_pool, attribute, &rtpmap); - // _debug("================== set_negociated_offer ===================== %i", pj_strtoul(&rtpmap->pt)); - // _debug("================== set_negociated_offer ===================== %s", current->desc.fmt[j].ptr); - // _debug("================== set_negociated_offer ===================== %i", atoi(current->desc.fmt[j].ptr)); iter = codecs_list.find ( (AudioCodecType) pj_strtoul (&rtpmap->pt)); if (iter==codecs_list.end()) @@ -535,6 +535,19 @@ AudioCodec* Sdp::get_session_media (void) } +pj_status_t Sdp::start_negociation() +{ + pj_status_t status; + + if (_negociator) { + status = pjmedia_sdp_neg_negotiate(_pool, _negociator, 0); + } + else { + status = !PJ_SUCCESS; + } + + return status; +} void Sdp::toString (void) { @@ -573,10 +586,8 @@ void Sdp::toString (void) _debug ("LOCAL SDP: \n%s", sdp.str().c_str()); } -void Sdp::set_local_media_capabilities () -{ +void Sdp::set_local_media_capabilities (CodecOrder selectedCodecs) { - CodecOrder selected_codecs; unsigned int i; sdpMedia *audio; CodecsMap codecs_list; @@ -592,16 +603,18 @@ void Sdp::set_local_media_capabilities () audio->set_port (get_local_extern_audio_port()); /* We retrieve the codecs selected by the user */ - selected_codecs = Manager::instance().getCodecDescriptorMap().getActiveCodecs(); codecs_list = Manager::instance().getCodecDescriptorMap().getCodecsMap(); - for (i=0; i<selected_codecs.size(); i++) { - iter=codecs_list.find (selected_codecs[i]); + for (i=0; i<selectedCodecs.size(); i++) { + iter=codecs_list.find (selectedCodecs[i]); if (iter!=codecs_list.end()) { audio->add_codec (iter->second); } - } + else { + _warn ("Couldn't find audio codec"); + } + } _local_media_cap.push_back (audio); } @@ -633,7 +646,7 @@ void Sdp::set_remote_ip_from_sdp (const pjmedia_sdp_session *r_sdp) { std::string remote_ip (r_sdp->conn->addr.ptr, r_sdp->conn->addr.slen); - _debug (" Remote IP from fetching SDP: %s", remote_ip.c_str()); + _info ("SDP: Remote IP from fetching SDP: %s", remote_ip.c_str()); this->set_remote_ip (remote_ip); } @@ -643,21 +656,24 @@ void Sdp::set_remote_audio_port_from_sdp (pjmedia_sdp_media *r_media) int remote_port; remote_port = r_media->desc.port; - _debug (" Remote Audio Port from fetching SDP: %d", remote_port); + _info ("SDP: Remote Audio Port from fetching SDP: %d", remote_port); this->set_remote_audio_port (remote_port); } void Sdp::set_media_transport_info_from_remote_sdp (const pjmedia_sdp_session *remote_sdp) { - _debug ("Fetching media from sdp"); + _info ("SDP: Fetching media from sdp"); + + if(!remote_sdp) + return; pjmedia_sdp_media *r_media; this->get_remote_sdp_media_from_offer (remote_sdp, &r_media); if (r_media==NULL) { - _debug ("SDP Failure: no remote sdp media found in the remote offer"); + _warn ("SDP: Error: no remote sdp media found in the remote offer"); return; } @@ -671,6 +687,9 @@ void Sdp::get_remote_sdp_media_from_offer (const pjmedia_sdp_session* remote_sdp { int count, i; + if(!remote_sdp) + return; + count = remote_sdp->media_count; *r_media = NULL; @@ -693,18 +712,11 @@ void Sdp::get_remote_sdp_crypto_from_offer (const pjmedia_sdp_session* remote_sd // get the number of media for this sdp session media_count = remote_sdp->media_count; - // *r_crypto = pjmedia_sdp_media_find_attr(attribute, &STR_CRYPTO, NULL); - - _debug("****************** Parse for Crypto ********************"); - CryptoOffer remoteOffer; // iterate over all media for (i = 0; i < media_count; ++i) { - // _debug("%.*s", (int)remote_sdp->attr[i]->name.slen, remote_sdp->attr[i]->name.ptr); - // _debug("%.*s", (int)remote_sdp->attr[i]->value.slen, remote_sdp->attr[i]->value.ptr); - // get media media = remote_sdp->media[i]; @@ -719,7 +731,6 @@ void Sdp::get_remote_sdp_crypto_from_offer (const pjmedia_sdp_session* remote_sd // test if this attribute is a crypto if (pj_stricmp2 (&attribute->name, "crypto") == 0) { - _debug("****************** Found a Crypto ********************"); std::string attr(attribute->value.ptr, attribute->value.slen); // @TODO our parser require the "a=crypto:" to be present diff --git a/sflphone-common/src/sip/sdp.h b/sflphone-common/src/sip/sdp.h index afba2e67d460fbaa63767f0160016f8717a033ee..8c81168adfd7d4ad76befbf5b10450b58f8e9459 100644 --- a/sflphone-common/src/sip/sdp.h +++ b/sflphone-common/src/sip/sdp.h @@ -87,7 +87,7 @@ class Sdp { /* * Build the local SDP offer */ - int create_local_offer( ); + int create_local_offer (CodecOrder selectedCodecs); /* * Build the sdp media section @@ -114,7 +114,7 @@ class Sdp { * On building an invite outside a dialog, build the local offer and create the * SDP negociator instance with it. */ - int create_initial_offer( ); + int create_initial_offer (CodecOrder selectedCodecs); /* * On receiving an invite outside a dialog, build the local offer and create the @@ -122,7 +122,7 @@ class Sdp { * * @param remote The remote offer */ - int receiving_initial_offer( pjmedia_sdp_session* remote ); + int receiving_initial_offer (pjmedia_sdp_session* remote, CodecOrder selectedCodecs); /* * On receiving a message, check if it contains SDP and negotiate. Should be used for @@ -166,10 +166,7 @@ class Sdp { * @return pj_status_t 0 on success * 1 otherwise */ - pj_status_t start_negociation( void ){ - return pjmedia_sdp_neg_negotiate( - _pool, _negociator, 0); - } + pj_status_t start_negociation( void ); /* * Retrieve the negociated sdp offer from the sip payload. @@ -197,7 +194,7 @@ class Sdp { * Set remote's IP addr. [not protected] * @param ip The remote IP address */ - void set_remote_ip(const std::string& ip) { _remote_ip_addr = ip; } + void set_remote_ip(const std::string& ip) { _remote_ip_addr = ip; } /** * Return IP of destination [mutex protected] @@ -221,7 +218,7 @@ class Sdp { std::vector<sdpMedia*> get_session_media_list (void) { return _session_media; } - void get_remote_sdp_crypto_from_offer (const pjmedia_sdp_session* remote_sdp, CryptoOffer& crypto_offer); + void get_remote_sdp_crypto_from_offer (const pjmedia_sdp_session* remote_sdp, CryptoOffer& crypto_offer); private: /** Codec Map */ @@ -253,18 +250,18 @@ class Sdp { /** Local audio port */ int _local_extern_audio_port; - /** Remote's audio port */ + /** Remote audio port */ unsigned int _remote_audio_port; std::string _zrtp_hello_hash; - /** "a=crypto" sdes local attributes obtained from AudioSrtpSession */ - std::vector<std::string> _srtp_crypto; + /** "a=crypto" sdes local attributes obtained from AudioSrtpSession */ + std::vector<std::string> _srtp_crypto; Sdp(const Sdp&); //No Copy Constructor Sdp& operator=(const Sdp&); //No Assignment Operator - void set_local_media_capabilities (); + void set_local_media_capabilities (CodecOrder selectedCodecs); /* * Mandatory field: Origin ("o=") @@ -350,12 +347,12 @@ class Sdp { void get_remote_sdp_media_from_offer (const pjmedia_sdp_session* r_sdp, pjmedia_sdp_media** r_media); - /* + /* * Adds a sdes attribute to the given media section. * * @param media The media to add the srtp attribute to - */ - void sdp_add_sdes_attribute(std::vector<std::string>& crypto); + */ + void sdp_add_sdes_attribute(std::vector<std::string>& crypto); /* * Adds a zrtp-hash attribute to diff --git a/sflphone-common/src/sip/sipaccount.cpp b/sflphone-common/src/sip/sipaccount.cpp index 29e1ace7999a4dd17639ae33118b30563c0ef960..e50ac19058458dedb75a671bb9894f35e697df69 100644 --- a/sflphone-common/src/sip/sipaccount.cpp +++ b/sflphone-common/src/sip/sipaccount.cpp @@ -33,6 +33,7 @@ SIPAccount::SIPAccount (const AccountID& accountID) , _publishedIpAddress ("") , _localPort (atoi (DEFAULT_SIP_PORT)) , _publishedPort (atoi (DEFAULT_SIP_PORT)) + , _tlsListenerPort (atoi (DEFAULT_SIP_TLS_PORT)) , _transportType (PJSIP_TRANSPORT_UNSPECIFIED) , _transport (NULL) , _resolveOnce (false) @@ -41,6 +42,7 @@ SIPAccount::SIPAccount (const AccountID& accountID) , _realm (DEFAULT_REALM) , _authenticationUsername ("") , _tlsSetting (NULL) + , _dtmfType(OVERRTP) , _displayName ("") { @@ -171,7 +173,7 @@ int SIPAccount::initCredential (void) int SIPAccount::registerVoIPLink() { - _debug ("Register account %s\n", getAccountID().c_str()); + _debug ("Register account %s", getAccountID().c_str()); // Init general settings loadConfig(); @@ -261,6 +263,10 @@ void SIPAccount::initTlsConfiguration (void) _tlsSetting = NULL; } + // TLS listener is unique and should be only modified through IP2IP_PROFILE + std::string tlsPortStr = Manager::instance().getConfigString(_accountID, TLS_LISTENER_PORT); + setTlsListenerPort(atoi(tlsPortStr.c_str())); + _tlsSetting = (pjsip_tls_setting *) malloc (sizeof (pjsip_tls_setting)); assert (_tlsSetting); @@ -357,6 +363,11 @@ void SIPAccount::loadConfig() setPublishedAddress (Manager::instance().getConfigString (_accountID, PUBLISHED_ADDRESS)); + if(Manager::instance().getConfigString (_accountID, ACCOUNT_DTMF_TYPE) == OVERRTPSTR) + _dtmfType = OVERRTP; + else + _dtmfType = SIPINFO; + // Init TLS settings if the user wants to use TLS bool tlsEnabled = Manager::instance().getConfigBool (_accountID, TLS_ENABLE); diff --git a/sflphone-common/src/sip/sipaccount.h b/sflphone-common/src/sip/sipaccount.h index ae454a533353680c23a169cc8d0945f523a7efc2..57fd602c6277d33ffbe176700350da3a3e763974 100644 --- a/sflphone-common/src/sip/sipaccount.h +++ b/sflphone-common/src/sip/sipaccount.h @@ -31,6 +31,11 @@ #include "pjsip/sip_transport_tls.h" #include "pjsip/sip_types.h" +enum DtmfType { OVERRTP, SIPINFO}; + +#define OVERRTPSTR "overrtp" +#define SIPINFOSTR "sipinfo" + class SIPVoIPLink; /** @@ -87,8 +92,23 @@ class SIPAccount : public Account inline bool isResolveOnce(void) { return _resolveOnce; } - inline std::string& getRegistrationExpire(void) { return _registrationExpire; } - + + /** + * A client sendings a REGISTER request MAY suggest an expiration + * interval that indicates how long the client would like the + * registration to be valid. + * + * @return A string describing the expiration value. + */ + inline std::string& getRegistrationExpire(void) { return _registrationExpire; } + + /** + * Setting the Expiration Interval of Contact Addresses. + * + * @param A string describing the expiration value. + */ + inline void setRegistrationExpire(std::string expr) { _registrationExpire = expr; } + bool fullMatch(const std::string& username, const std::string& hostname); bool userMatch(const std::string& username); bool hostnameMatch(const std::string& hostname); @@ -135,7 +155,7 @@ class SIPAccount : public Account * an alternate UDP transport. */ inline pj_str_t getStunServerName(void) { return _stunServerName; } - inline void setStunServerName (pj_str_t srv) { _stunServerName = srv; } + inline void setStunServerName (pj_str_t srv) { _stunServerName = srv; } /** * @return pj_uint8_t structure, filled from the configuration @@ -143,7 +163,7 @@ class SIPAccount : public Account * an alternate UDP transport. */ inline pj_uint16_t getStunPort (void) { return _stunPort; } - inline void setStunPort (pj_uint16_t port) { _stunPort = port; } + inline void setStunPort (pj_uint16_t port) { _stunPort = port; } /** * @return bool Tells if current transport for that @@ -248,6 +268,18 @@ class SIPAccount : public Account * @pram port The port used by this account. */ inline void setPublishedPort(pj_uint16_t port) { _publishedPort = port; } + + /** + * Get the local port for TLS listener. + * @return pj_uint16 The port used for that account + */ + inline pj_uint16_t getTlsListenerPort(void) { return (pj_uint16_t) _tlsListenerPort; } + + /** + * Set the local port for TLS listener. + * @pram port The port used for TLS listener. + */ + inline void setTlsListenerPort(pj_uint16_t port) { _tlsListenerPort = port; } /** * Get the public IP address set by the user for this account. @@ -270,11 +302,15 @@ class SIPAccount : public Account */ inline pjsip_transport_type_e getTransportType(void) { return _transportType; } - inline pjsip_transport* getAccountTransport (void) { return _transport; } + inline pjsip_transport* getAccountTransport (void) { return _transport; } + + inline void setAccountTransport (pjsip_transport *transport) { _transport = transport; } - inline void setAccountTransport (pjsip_transport *transport) { _transport = transport; } + std::string getTransportMapKey(void); - std::string getTransportMapKey(void); + DtmfType getDtmfType(void) { return _dtmfType; } + + void setDtmfType(DtmfType type) { _dtmfType = type; } private: @@ -326,17 +362,22 @@ class SIPAccount : public Account // Network settings std::string _registrationExpire; - // interface name on which this account is bound - std::string _interface; + // interface name on which this account is bound + std::string _interface; - // Flag which determine if _localIpAddress or _publishedIpAddress is used in + // Flag which determine if _localIpAddress or _publishedIpAddress is used in // sip headers - bool _publishedSameasLocal; + bool _publishedSameasLocal; std::string _publishedIpAddress; pj_uint16_t _localPort; pj_uint16_t _publishedPort; + + /** + * The global TLS listener port which can be configured through the IP2IP_PROFILE + */ + pj_uint16_t _tlsListenerPort; pjsip_transport_type_e _transportType; @@ -359,8 +400,10 @@ class SIPAccount : public Account // The STUN server name, if applicable pj_str_t _stunServerName; - // The STUN server port, if applicable - pj_uint16_t _stunPort; + // The STUN server port, if applicable + pj_uint16_t _stunPort; + + DtmfType _dtmfType; // Display Name that can be used in SIP URI. std::string _displayName; diff --git a/sflphone-common/src/sip/sipcall.cpp b/sflphone-common/src/sip/sipcall.cpp index d1e22660c64e97650684a27048114b875de382e2..9ed7f7a90e42b3651fdd67fddde9972fbd9a7565 100644 --- a/sflphone-common/src/sip/sipcall.cpp +++ b/sflphone-common/src/sip/sipcall.cpp @@ -33,17 +33,19 @@ SIPCall::SIPCall (const CallID& id, Call::CallType type, pj_pool_t *pool) : Call , _invSession (NULL) , _local_sdp (0) { + _debug ("SIPCall: Create new call %s", id.c_str()); + _local_sdp = new Sdp (pool); - _debug ("SIPCALL::Constructor for this class is called "); } SIPCall::~SIPCall() { + _debug ("SIPCall: Delete call"); + delete _audiortp; _audiortp = 0; delete _local_sdp; _local_sdp = 0; - _debug ("SIPCALL::Destructor for this class is called "); } diff --git a/sflphone-common/src/sip/sipcall.h b/sflphone-common/src/sip/sipcall.h index f2d93259da6872000a51a3491da79e2d37eef3b4..7d14936729055c65cbd348263fcac35b6fe620f9 100644 --- a/sflphone-common/src/sip/sipcall.h +++ b/sflphone-common/src/sip/sipcall.h @@ -97,9 +97,11 @@ class SIPCall : public Call void setTid(int tid) { _tid = tid; } void setXferSub(pjsip_evsub* sub) {_xferSub = sub;} + pjsip_evsub *getXferSub() {return _xferSub;} void setInvSession(pjsip_inv_session* inv) {_invSession = inv;} + pjsip_inv_session *getInvSession() {return _invSession;} Sdp* getLocalSDP (void) { return _local_sdp; } diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index 8d597bc2523a51a15b0aabfde9cb421168334f8b..c1e298a957663f82796b51941d7f47d0bb641a90 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -50,6 +50,8 @@ #include <sys/ioctl.h> #include <linux/if.h> +#include <map> + #define CAN_REINVITE 1 static char * invitationStateMap[] = { @@ -79,7 +81,16 @@ struct result { pjsip_server_addresses servers; }; -pjsip_transport *_localUDPTransport; +/** The default transport (5060) */ +pjsip_transport *_localUDPTransport = NULL; + +/** The local tls listener */ +pjsip_tpfactory *_localTlsListener = NULL; + +/** A map to retreive SFLphone internal call id + * Given a SIP call ID (usefull for transaction sucha as transfer)*/ +std::map<std::string, CallID> transferCallID; + const pj_str_t STR_USER_AGENT = { (char*) "User-Agent", 10 }; @@ -193,6 +204,8 @@ void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_ void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer); +void on_create_offer(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer); + /* * Registration callback */ @@ -217,6 +230,12 @@ pj_bool_t mod_on_rx_request (pjsip_rx_data *rdata); */ pj_bool_t mod_on_rx_response (pjsip_rx_data *rdata UNUSED) ; +/** + * Send an ACK message inside a transaction. PJSIP send automatically, non-2xx ACK response. + * ACK for a 2xx response must be send using this method. + */ +static void sendAck(pjsip_dialog *dlg, pjsip_rx_data *rdata); + /* * Transfer callbacks */ @@ -224,6 +243,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event); void xfer_svr_cb (pjsip_evsub *sub, pjsip_event *event); void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata); + /*************************************************************************************************/ SIPVoIPLink* SIPVoIPLink::_instance = NULL; @@ -246,7 +266,7 @@ SIPVoIPLink::SIPVoIPLink (const AccountID& accountID) SIPVoIPLink::~SIPVoIPLink() { - _debug("SIPVoIPLink destructor called"); + _debug("UserAgent: SIPVoIPLink destructor called"); terminate(); } @@ -255,7 +275,7 @@ SIPVoIPLink* SIPVoIPLink::instance (const AccountID& id) { if (!_instance) { - _debug ("Create new SIPVoIPLink instance"); + _debug ("UserAgent: Create new SIPVoIPLink instance"); _instance = new SIPVoIPLink (id); } @@ -268,7 +288,7 @@ void SIPVoIPLink::decrementClients (void) if (_clients == 0) { - _debug("No SIP account anymore, terminate SIPVoIPLink"); + _debug("UserAgent: No SIP account anymore, terminate SIPVoIPLink"); terminate(); SIPVoIPLink::_instance=NULL; } @@ -297,10 +317,10 @@ bool SIPVoIPLink::init() void SIPVoIPLink::terminate() { - _debug ("Terminating SIPVoIPLink"); + _debug ("UserAgent: Terminating SIPVoIPLink"); if (_evThread) { - _debug ("Deleting sip eventThread"); + _debug ("UserAgent: Deleting sip eventThread"); delete _evThread; _evThread = NULL; } @@ -308,7 +328,7 @@ SIPVoIPLink::terminate() /* Clean shutdown of pjsip library */ if (initDone()) { - _debug ("Shuting down PJSIP"); + _debug ("UserAgent: Shuting down PJSIP"); pjsip_shutdown(); } @@ -340,6 +360,7 @@ SIPVoIPLink::terminateSIPCall() void SIPVoIPLink::terminateOneCall (const CallID& id) { + _debug("UserAgent: Terminate call %s", id.c_str()); SIPCall *call = getSIPCall (id); @@ -378,14 +399,13 @@ std::string SIPVoIPLink::getInterfaceAddrFromName(std::string ifaceName) { struct ifreq ifr; int fd; - int rval = 0; int err; struct sockaddr_in *saddr_in; struct in_addr *addr_in; if((fd = socket (AF_INET, SOCK_DGRAM,0)) < 0) - _debug("getInterfaceAddrFromName error could not open socket\n"); + _error("UserAgent: Error: could not open socket"); memset (&ifr, 0, sizeof (struct ifreq)); @@ -393,9 +413,7 @@ std::string SIPVoIPLink::getInterfaceAddrFromName(std::string ifaceName) { ifr.ifr_addr.sa_family = AF_INET; if((err = ioctl(fd, SIOCGIFADDR, &ifr)) < 0) - _debug("getInterfaceAddrFromName use default interface (0.0.0.0)\n"); - - // printf("Local address: %s\n", inet_ntos( ((struct sockaddr_in *) &ifr.ifr_ifru.ifru_addr)->sin_addr )); + _debug("UserAgent: Use default interface (0.0.0.0)"); saddr_in = (struct sockaddr_in *)&ifr.ifr_addr; addr_in = &(saddr_in->sin_addr); @@ -406,11 +424,19 @@ std::string SIPVoIPLink::getInterfaceAddrFromName(std::string ifaceName) { } -std::string SIPVoIPLink::get_useragent_name (void) +std::string SIPVoIPLink::get_useragent_name (const AccountID& id) { - std::ostringstream useragent; + /* useragent << PROGNAME << "/" << SFLPHONED_VERSION; return useragent.str(); + */ + std::ostringstream useragent; + + useragent << Manager::instance ().getConfigString (id, USERAGENT); + if (useragent.str() == "sflphone" || useragent.str() == "") + useragent << "/" << SFLPHONED_VERSION; + + return useragent.str (); } void @@ -446,7 +472,7 @@ int SIPVoIPLink::sendRegister (AccountID id) account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); if (account == NULL) { - _debug ("In sendRegister: account is null"); + _debug ("UserAgent: In sendRegister: account is null"); return false; } @@ -491,6 +517,7 @@ int SIPVoIPLink::sendRegister (AccountID id) } } + // Create SIP transport or get existent SIP transport from internal map // according to account settings, if the transport could not be created but // one is already set in account, use this one (most likely this is the @@ -592,7 +619,7 @@ int SIPVoIPLink::sendRegister (AccountID id) // Add User-Agent Header pj_list_init (&hdr_list); - useragent = pj_str ( (char*) get_useragent_name ().c_str()); + useragent = pj_str ( (char*) get_useragent_name (id).c_str()); h = pjsip_generic_string_hdr_create (_pool, &STR_USER_AGENT, &useragent); @@ -684,7 +711,6 @@ SIPVoIPLink::sendUnregister (AccountID id) account->getAccountTransport()->info, (int)pj_atomic_get(account->getAccountTransport()->ref_cnt)); - // shutdownSipTransport(account->getAccountID()); } // This may occurs if account failed to register and is in state INVALID @@ -712,7 +738,7 @@ SIPVoIPLink::sendUnregister (AccountID id) return false; } - //account->setRegistrationInfo(regc); + // account->setRegistrationInfo(regc); account->setRegister (false); return true; @@ -731,7 +757,7 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (Manager::instance().getAccountFromCall (id))); if (account == NULL) { - _debug ("Error retrieving the account to the make the call with"); + _error ("UserAgent: Error: Could not retrieving account to make call with"); call->setConnectionState (Call::Disconnected); call->setState (Call::Error); delete call; @@ -757,20 +783,20 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) loadSIPLocalIP (&addrSdp); try { - _debug ("Creating new rtp session in newOutgoingCall"); - call->getAudioRtp()->initAudioRtpConfig (call); + _info ("UserAgent: Creating new rtp session"); + call->getAudioRtp()->initAudioRtpConfig (call); call->getAudioRtp()->initAudioRtpSession (call); } catch (...) { - _debug ("Failed to create rtp thread from newOutGoingCall"); + _error ("UserAgent: Error: Failed to create rtp thread from newOutGoingCall"); } call->initRecFileName(); - _debug ("Try to make a call to: %s with call ID: %s", toUrl.data(), id.data()); + _debug ("UserAgent: Try to make a call to: %s with call ID: %s", toUrl.data(), id.data()); + // Building the local SDP offer - // localAddr = getLocalAddressAssociatedToAccount (account->getAccountID()); call->getLocalSDP()->set_ip_address (addrSdp); - status = call->getLocalSDP()->create_initial_offer(); + status = call->getLocalSDP()->create_initial_offer (account->getActiveCodecs ()); if (status != PJ_SUCCESS) { delete call; @@ -794,30 +820,20 @@ SIPVoIPLink::newOutgoingCall (const CallID& id, const std::string& toUrl) bool SIPVoIPLink::answer (const CallID& id) { - SIPCall *call; pj_status_t status; pjsip_tx_data *tdata; - Sdp *local_sdp; pjsip_inv_session *inv_session; - _debug ("SIPVoIPLink::answer: start answering "); + _debug ("UserAgent: Answering call %s", id.c_str()); - call = getSIPCall (id); + SIPCall *call = getSIPCall (id); if (call==0) { - _debug ("! SIP Failure: SIPCall doesn't exists"); + _debug ("UserAgent: SIPCall %s doesn't exists while answering", id.c_str()); return false; } - local_sdp = call->getLocalSDP(); - - /* - try { - call->getAudioRtp()->initAudioRtpSession (call); - } catch (...) { - _debug ("Failed to create rtp thread from answer"); - } - */ + Sdp *local_sdp = call->getLocalSDP(); inv_session = call->getInvSession(); @@ -914,10 +930,12 @@ SIPVoIPLink::peerHungup (const CallID& id) pjsip_tx_data *tdata = NULL; SIPCall* call; + _info("UserAgent: Peer hungup"); + call = getSIPCall (id); if (call==0) { - _debug ("! SIP Error: Call doesn't exist"); + _warn ("UserAgent: Call doesn't exist"); return false; } @@ -940,7 +958,7 @@ SIPVoIPLink::peerHungup (const CallID& id) // Release RTP thread if (Manager::instance().isCurrentCall (id)) { - _debug ("* SIP Info: Stopping AudioRTP for hangup"); + _debug ("UserAgent: Stopping AudioRTP for hangup"); call->getAudioRtp()->stop(); } @@ -955,15 +973,15 @@ SIPVoIPLink::peerHungup (const CallID& id) bool SIPVoIPLink::cancel (const CallID& id) { + _info ("UserAgent: Cancel call %s", id.c_str()); + SIPCall* call = getSIPCall (id); - if (call==0) { - _debug ("! SIP Error: Call doesn't exist"); + if (!call) { + _warn("UserAgent: Error: Call doesn't exist"); return false; } - _debug ("- SIP Action: Cancel call %s [cid: %3d]", id.data(), call->getCid()); - terminateOneCall (id); removeCall (id); @@ -1014,18 +1032,20 @@ int SIPVoIPLink::inv_session_reinvite (SIPCall *call, std::string direction) local_sdp = call->getLocalSDP()->get_local_sdp_session(); if (local_sdp == NULL) { - _debug ("! SIP Failure: unable to find local_sdp"); + _debug ("SIP: Error: unable to find local sdp"); return !PJ_SUCCESS; } // Reinvite only if connected // Build the local SDP offer - status = call->getLocalSDP()->create_initial_offer(); + // TODO Restore Re-Invite + // status = call->getLocalSDP()->create_initial_offer(); - if (status != PJ_SUCCESS) - return 1; // !PJ_SUCCESS + // if (status != PJ_SUCCESS) + // return 1; // !PJ_SUCCESS pjmedia_sdp_media_remove_all_attr (local_sdp->media[0], "sendrecv"); + pjmedia_sdp_media_remove_all_attr (local_sdp->media[0], "sendonly"); attr = pjmedia_sdp_attr_create (_pool, direction.c_str(), NULL); @@ -1098,13 +1118,13 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to) account_id = Manager::instance().getAccountFromCall (id); account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (account_id)); - if (account == NULL) { - _debug ("SIPVoIPLink::transfer account is null. Returning."); + if (!account) { + _error("UserAgent: Error: Transfer account is null. Returning."); return false; } - if (call==0) { - _debug ("! SIP Failure: Call doesn't exist"); + if (!call) { + _error ("UserAgent: Error: Call doesn't exist"); return false; } @@ -1117,7 +1137,7 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to) pj_cstr (&pjDest, dest.c_str()); } - _debug ("Transfering to %s", dest.c_str()); + _info ("UserAgent: Transfering to %s", dest.c_str()); /* Create xfer client subscription. */ pj_bzero (&xfer_cb, sizeof (xfer_cb)); @@ -1126,13 +1146,13 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to) status = pjsip_xfer_create_uac (call->getInvSession()->dlg, &xfer_cb, &sub); if (status != PJ_SUCCESS) { - _debug ("UserAgent: Unable to create xfer -- %d", status); + _warn ("UserAgent: Unable to create xfer -- %d", status); return false; } /* Associate this voiplink of call with the client subscription * We can not just associate call with the client subscription - * because after this function, we can not find the cooresponding + * because after this function, we can no find the cooresponding * voiplink from the call any more. But the voiplink is useful! */ pjsip_evsub_set_mod_data (sub, getModId(), this); @@ -1143,15 +1163,21 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to) status = pjsip_xfer_initiate (sub, &pjDest, &tdata); if (status != PJ_SUCCESS) { - _debug ("UserAgent: Unable to create REFER request -- %d", status); + _error ("UserAgent: Unable to create REFER request -- %d", status); return false; } + // Put SIP call id in map in order to retrieve call during transfer callback + std::string callidtransfer(call->getInvSession()->dlg->call_id->id.ptr, call->getInvSession()->dlg->call_id->id.slen); + _debug("%s", callidtransfer.c_str()); + transferCallID.insert(std::pair<std::string, CallID>(callidtransfer, call->getCallId())); + + /* Send. */ status = pjsip_xfer_send_request (sub, tdata); if (status != PJ_SUCCESS) { - _debug ("UserAgent: Unable to send REFER request -- %d", status); + _error ("UserAgent: Unable to send REFER request -- %d", status); return false; } @@ -1160,7 +1186,12 @@ SIPVoIPLink::transfer (const CallID& id, const std::string& to) bool SIPVoIPLink::transferStep2 (SIPCall* call) { - call->getAudioRtp()->stop(); + + // TODO is this the best way to proceed? + Manager::instance().peerHungupCall(call->getCallId()); + + + return true; } @@ -1171,17 +1202,18 @@ SIPVoIPLink::refuse (const CallID& id) pj_status_t status; pjsip_tx_data *tdata; + _debug("UserAgent: Refuse call %s", id.c_str()); call = getSIPCall (id); if (call==0) { - _debug ("Call doesn't exist"); + _error ("UserAgent: Error: Call doesn't exist"); return false; } // can't refuse outgoing call or connected if (!call->isIncoming() || call->getConnectionState() == Call::Connected) { - _debug ("It's not an incoming call, or it's already answered"); + _debug ("UserAgent: Call %s is not in state incoming, or is already answered"); return false; } @@ -1200,6 +1232,8 @@ SIPVoIPLink::refuse (const CallID& id) terminateOneCall (id); + _debug("UserAgent: Refuse call completed"); + return true; } @@ -1226,68 +1260,104 @@ SIPVoIPLink::getCurrentCodecName() bool SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code) { + SIPCall *call = getSIPCall (id); - SIPCall *call; - int duration; - const int body_len = 1000; - char *dtmf_body; - pj_status_t status; - pjsip_tx_data *tdata; - pj_str_t methodName, content; - pjsip_method method; - pjsip_media_type ctype; + if (!call) { + _error ("UserAgent: Error: Call doesn't exist while sending DTMF"); + return false; + } - call = getSIPCall (id); + AccountID accountID = Manager::instance().getAccountFromCall(id); + SIPAccount *account = static_cast<SIPAccount *>(Manager::instance().getAccount(accountID)); - if (call==0) { - _debug ("Call doesn't exist"); - return false; + if(!account) { + _error ("UserAgent: Error: Account not found while sending DTMF"); + return false; } - duration = Manager::instance().getConfigInt (SIGNALISATION, PULSE_LENGTH); + DtmfType type = account->getDtmfType(); - dtmf_body = new char[body_len]; + if(type == OVERRTP) + dtmfOverRtp(call, code); + else if(type == SIPINFO) + dtmfSipInfo(call, code); + else { + _error("UserAgent: Error: Dtmf type does not exist"); + return false; + } - snprintf (dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration); + return true; +} - pj_strdup2 (_pool, &methodName, "INFO"); - pjsip_method_init_np (&method, &methodName); - /* Create request message. */ - status = pjsip_dlg_create_request (call->getInvSession()->dlg, &method, -1, &tdata); +bool +SIPVoIPLink::dtmfSipInfo(SIPCall *call, char code) +{ - if (status != PJ_SUCCESS) { - _debug ("UserAgent: Unable to create INFO request -- %d", status); - return false; - } + int duration; + const int body_len = 1000; + char *dtmf_body; + pj_status_t status; + pjsip_tx_data *tdata; + pj_str_t methodName, content; + pjsip_method method; + pjsip_media_type ctype; - /* Get MIME type */ - pj_strdup2 (_pool, &ctype.type, "application"); - pj_strdup2 (_pool, &ctype.subtype, "dtmf-relay"); + duration = Manager::instance().getConfigInt (SIGNALISATION, PULSE_LENGTH); - /* Create "application/dtmf-relay" message body. */ - pj_strdup2 (_pool, &content, dtmf_body); + dtmf_body = new char[body_len]; - tdata->msg->body = pjsip_msg_body_create (tdata->pool, &ctype.type, &ctype.subtype, &content); + snprintf (dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration); - if (tdata->msg->body == NULL) { - _debug ("UserAgent: Unable to create msg body!"); - pjsip_tx_data_dec_ref (tdata); - return false; - } + pj_strdup2 (_pool, &methodName, "INFO"); + pjsip_method_init_np (&method, &methodName); - /* Send the request. */ - status = pjsip_dlg_send_request (call->getInvSession()->dlg, tdata, getModId(), NULL); + /* Create request message. */ + status = pjsip_dlg_create_request (call->getInvSession()->dlg, &method, -1, &tdata); - if (status != PJ_SUCCESS) { - _debug ("UserAgent: Unable to send MESSAGE request -- %d", status); - return false; - } + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to create INFO request -- %d", status); + return false; + } - return true; + /* Get MIME type */ + pj_strdup2 (_pool, &ctype.type, "application"); + + pj_strdup2 (_pool, &ctype.subtype, "dtmf-relay"); + + /* Create "application/dtmf-relay" message body. */ + pj_strdup2 (_pool, &content, dtmf_body); + + tdata->msg->body = pjsip_msg_body_create (tdata->pool, &ctype.type, &ctype.subtype, &content); + + if (tdata->msg->body == NULL) { + _debug ("UserAgent: Unable to create msg body!"); + pjsip_tx_data_dec_ref (tdata); + return false; + } + + /* Send the request. */ + status = pjsip_dlg_send_request (call->getInvSession()->dlg, tdata, getModId(), NULL); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Unable to send MESSAGE request -- %d", status); + return false; + } + + return true; +} + +bool +SIPVoIPLink::dtmfOverRtp(SIPCall* call, char code) +{ + call->getAudioRtp()->sendDtmfDigit(atoi(&code)); + + return true; } + + bool SIPVoIPLink::SIPOutgoingInvite (SIPCall* call) { @@ -1327,25 +1397,18 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED) // Creates URI std::string fromUri; - std::string toUri; - std::string contactUri; fromUri = account->getFromUri(); - toUri = call->getPeerNumber(); // expecting a fully well formed sip uri std::string address = findLocalAddressFromUri (toUri, account->getAccountTransport ()); - int port = findLocalPortFromUri (toUri, account->getAccountTransport ()); std::stringstream ss; - std::string portStr; - ss << port; - ss >> portStr; contactUri = account->getContactHeader (address, portStr); @@ -1356,15 +1419,12 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED) contactUri.c_str()); pj_str_t pjFrom; - pj_cstr (&pjFrom, fromUri.c_str()); pj_str_t pjContact; - pj_cstr (&pjContact, contactUri.c_str()); pj_str_t pjTo; - pj_cstr (&pjTo, toUri.c_str()); // Create the dialog (UAC) @@ -1408,7 +1468,6 @@ SIPVoIPLink::SIPStartCall (SIPCall* call, const std::string& subject UNUSED) // decrement transport's ref count // pjsip_transport_dec_ref(account->getAccountTransport()); - status = pjsip_inv_send_msg (inv, tdata); if (status != PJ_SUCCESS) { @@ -1431,7 +1490,7 @@ void SIPVoIPLink::SIPCallServerFailure (SIPCall *call) { if (call != 0) { - _debug ("Server error!"); + _error ("UserAgent: Error: Server error!"); CallID id = call->getCallId(); Manager::instance().callFailure (id); terminateOneCall (id); @@ -1445,7 +1504,10 @@ SIPVoIPLink::SIPCallServerFailure (SIPCall *call) void SIPVoIPLink::SIPCallClosed (SIPCall *call) { + _info("UserAgent: Closing call"); + if (!call) { + _warn("UserAgent: Error: CAll pointer is NULL\n"); return; } @@ -1453,16 +1515,14 @@ SIPVoIPLink::SIPCallClosed (SIPCall *call) if (Manager::instance().isCurrentCall (id)) { call->setAudioStart (false); - _debug ("* SIP Info: Stopping AudioRTP when closing"); + _debug ("UserAgent: Stopping AudioRTP when closing"); call->getAudioRtp()->stop(); } - _debug ("After close RTP"); - Manager::instance().peerHungupCall (id); terminateOneCall (id); removeCall (id); - _debug ("After remove call ID"); + } void @@ -1473,7 +1533,7 @@ SIPVoIPLink::SIPCallReleased (SIPCall *call) } // if we are here.. something when wrong before... - _debug ("SIP call release"); + _debug ("UserAgent: SIP call release"); CallID id = call->getCallId(); @@ -1489,20 +1549,20 @@ void SIPVoIPLink::SIPCallAnswered (SIPCall *call, pjsip_rx_data *rdata) { - _debug ("SIPCallAnswered"); + _info ("UserAgent: SIP call answered"); if (!call) { - _debug ("! SIP Failure: unknown call"); + _warn ("UserAgent: Error: SIP failure, unknown call"); return; } if (call->getConnectionState() != Call::Connected) { - _debug ("Update call state , id = %s", call->getCallId().c_str()); + _debug ("UserAgent: Update call state , id = %s", call->getCallId().c_str()); call->setConnectionState (Call::Connected); call->setState (Call::Active); Manager::instance().peerAnsweredCall (call->getCallId()); } else { - _debug ("* SIP Info: Answering call (on/off hold to send ACK)"); + _debug ("UserAgent: Answering call (on/off hold to send ACK)"); } } @@ -1532,156 +1592,165 @@ bool SIPVoIPLink::new_ip_to_ip_call (const CallID& id, const std::string& to) call = new SIPCall (id, Call::Outgoing, _pool); if (call) { + call->setCallConfiguration (Call::IPtoIP); call->initRecFileName(); - AccountID accountId = Manager::instance().getAccountFromCall (id); + // AccountID accountId = Manager::instance().getAccountFromCall (id); SIPAccount * account = NULL; - account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (IP2IP_PROFILE)); if (account == NULL) { - - _debug ("Account %s is null. Returning", IP2IP_PROFILE); - return !PJ_SUCCESS; + _debug ("UserAgent: Account %s is null. Returning", IP2IP_PROFILE); + return !PJ_SUCCESS; } - // Set the local address - localAddress = getInterfaceAddrFromName(account->getLocalInterface ()); + // Set the local address + localAddress = getInterfaceAddrFromName(account->getLocalInterface ()); // Set SDP parameters - Set to local - addrSdp = localAddress; + addrSdp = localAddress; - _debug ("new_ip_to_ip_call localAddress: %s", localAddress.c_str()); + _debug ("UserAgent: Local Address for IP2IP call: %s", localAddress.c_str()); + // If local address bound to ANY, reslove it using PJSIP if (localAddress == "0.0.0.0") { - _debug ("Local address: %s", localAddress.c_str ()); loadSIPLocalIP (&localAddress); } - if (addrSdp == "0.0.0.0") { - addrSdp = localAddress; - } + // Local address to appear in SDP + if (addrSdp == "0.0.0.0") { + addrSdp = localAddress; + } + // Set local address for RTP media setCallAudioLocal (call, localAddress); - _debug ("toUri received in new_ip_to_ip call %s", to.c_str()); std::string toUri = account->getToUri (to); call->setPeerNumber (toUri); - _debug ("toUri in new_ip_to_ip call %s", toUri.c_str()); - // Audio Rtp Session must be initialized before creating initial offer in SDP session - // since SDES require crypto attribute. - try { - call->getAudioRtp()->initAudioRtpConfig (call); - call->getAudioRtp()->initAudioRtpSession (call); - } catch (...) { - _debug ("! SIP Failure: Unable to create RTP Session in SIPVoIPLink::new_ip_to_ip_call (%s:%d)", __FILE__, __LINE__); - } + _debug ("UserAgent: TO uri: %s", toUri.c_str()); // Building the local SDP offer call->getLocalSDP()->set_ip_address (addrSdp); - call->getLocalSDP()->create_initial_offer(); - - // If no account already set, use the default one created at pjsip initialization - if (account->getAccountTransport() == NULL) { - _debug ("No transport for this account, using the default one"); - account->setAccountTransport (_localUDPTransport); - } - - _debug ("IptoIP local port %i", account->getLocalPort()); - - _debug ("IptoIP local address in sdp %s", localAddress.c_str()); + call->getLocalSDP()->create_initial_offer (account->getActiveCodecs ()); - // Create URI - std::string fromUri; - std::string contactUri; + // Audio Rtp Session must be initialized before creating initial offer in SDP session + // since SDES require crypto attribute. + try { + call->getAudioRtp()->initAudioRtpConfig (call); + call->getAudioRtp()->initAudioRtpSession (call); + } catch (...) { + _debug ("UserAgent: Unable to create RTP Session in new IP2IP call (%s:%d)", __FILE__, __LINE__); + } - fromUri = account->getFromUri(); + // Init TLS transport if enabled + if(account->isTlsEnabled()) { - std::string address = findLocalAddressFromUri (toUri, account->getAccountTransport()); + _debug("UserAgent: TLS enabled for IP to IP calls"); + int at = toUri.find("@"); + int trns = toUri.find(";transport"); + std::string remoteAddr = toUri.substr(at+1, trns-at-1); - int port = findLocalPortFromUri (toUri, account->getAccountTransport()); + if(toUri.find("sips:") != 1) { + _debug("UserAgent: Error \"sips\" scheme required TLS call"); + return false; + } - std::stringstream ss; + if(createTlsTransport(account->getAccountID(), remoteAddr) != PJ_SUCCESS) + return false; + } - std::string portStr; + // If no transport already set, use the default one created at pjsip initialization + if (account->getAccountTransport() == NULL) { + _debug ("UserAgent: No transport for this account, using the default one"); + account->setAccountTransport (_localUDPTransport); + } - ss << port; + _debug ("UserAgent: new IP2IP local port %i", account->getLocalPort()); - ss >> portStr; + _debug ("UserAgent: new IP2IP local address in sdp %s", localAddress.c_str()); - contactUri = account->getContactHeader (address, portStr); + // Create URI + std::string fromUri = account->getFromUri(); - _debug ("new_ip_to_ip_call: fromUri: %s toUri: %s contactUri: %s", - fromUri.c_str(), - toUri.c_str(), - contactUri.c_str()); + std::string address = findLocalAddressFromUri (toUri, account->getAccountTransport()); - pj_str_t pjFrom; + int port = findLocalPortFromUri (toUri, account->getAccountTransport()); - pj_cstr (&pjFrom, fromUri.c_str()); + std::stringstream ss; + std::string portStr; + ss << port; + ss >> portStr; - pj_str_t pjTo; + std::string contactUri = account->getContactHeader (address, portStr); - pj_cstr (&pjTo, toUri.c_str()); + _debug ("UserAgent: FROM uri: %s TO uri: %s CONTACT uri: %s", + fromUri.c_str(), toUri.c_str(), contactUri.c_str()); - pj_str_t pjContact; + pj_str_t pjFrom; + pj_cstr (&pjFrom, fromUri.c_str()); - pj_cstr (&pjContact, contactUri.c_str()); + pj_str_t pjTo; + pj_cstr (&pjTo, toUri.c_str()); - // Create the dialog (UAC) - // (Parameters are "strduped" inside this function) - status = pjsip_dlg_create_uac (pjsip_ua_instance(), &pjFrom, &pjContact, &pjTo, NULL, &dialog); + pj_str_t pjContact; + pj_cstr (&pjContact, contactUri.c_str()); - PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); + // Create the dialog (UAC) + // (Parameters are "strduped" inside this function) + status = pjsip_dlg_create_uac (pjsip_ua_instance(), &pjFrom, &pjContact, &pjTo, NULL, &dialog); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); - // Create the invite session for this call - status = pjsip_inv_create_uac (dialog, call->getLocalSDP()->get_local_sdp_session(), 0, &inv); + // Create the invite session for this call + status = pjsip_inv_create_uac (dialog, call->getLocalSDP()->get_local_sdp_session(), 0, &inv); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); - PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); + // Set the appropriate transport + pjsip_tpselector *tp; - // Set the appropriate transport - pjsip_tpselector *tp; + init_transport_selector (account->getAccountTransport(), &tp); - init_transport_selector (account->getAccountTransport(), &tp); + if(!account->getAccountTransport()) { + _error("UserAgent: Error: Transport is NULL in ip to ip call"); + } - // set_transport methods increment transport's ref_count - status = pjsip_dlg_set_transport (dialog, tp); + // set_transport methods increment transport's ref_count + status = pjsip_dlg_set_transport (dialog, tp); - // decrement transport's ref count - // pjsip_transport_dec_ref(account->getAccountTransport()); + // decrement transport's ref count + // pjsip_transport_dec_ref(account->getAccountTransport()); - if (status != PJ_SUCCESS) { - _debug ("Failed to set the transport for an IP call"); - return status; - } + if (status != PJ_SUCCESS) { + _error ("UserAgent: Error: Failed to set the transport for an IP2IP call"); + return status; + } - // Associate current call in the invite session - inv->mod_data[getModId() ] = call; + // Associate current call in the invite session + inv->mod_data[getModId() ] = call; - status = pjsip_inv_invite (inv, &tdata); + status = pjsip_inv_invite (inv, &tdata); - PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); + PJ_ASSERT_RETURN (status == PJ_SUCCESS, false); - // Associate current invite session in the call - call->setInvSession (inv); + // Associate current invite session in the call + call->setInvSession (inv); - status = pjsip_inv_send_msg (inv, tdata); + status = pjsip_inv_send_msg (inv, tdata); - if (status != PJ_SUCCESS) { - delete call; - call = 0; - return false; - } + if (status != PJ_SUCCESS) { + delete call; + call = 0; + return false; + } - call->setConnectionState (Call::Progressing); + call->setConnectionState (Call::Progressing); - call->setState (Call::Active); - addCall (call); + call->setState (Call::Active); + addCall (call); - return true; - } else + return true; + } else return false; } @@ -1699,7 +1768,6 @@ bool get_dns_server_addresses (std::vector<std::string> *servers) struct sockaddr_in current_server; in_addr address; - // Read configuration files if (res_init () != 0) { @@ -1778,8 +1846,6 @@ pj_status_t SIPVoIPLink::enable_dns_srv_resolver (pjsip_endpoint *endpt, pj_dns_ bool SIPVoIPLink::pjsip_init() { pj_status_t status; - int errPjsip = 0; - int port; pjsip_inv_callback inv_cb; pj_str_t accepted; std::string name_mod; @@ -1827,69 +1893,12 @@ bool SIPVoIPLink::pjsip_init() return false; } - // Retrieve Direct IP Calls settings. - // This corresponds to the accountID set to - // AccountNULL - SIPAccount * account = NULL; - - bool directIpCallsTlsEnabled = false; - - // Use IP2IP_PROFILE to init default udp transport settings - account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (IP2IP_PROFILE)); - - // Create a UDP listener meant for all accounts for which TLS was not enabled - // Cannot acquireTransport since default UDP transport must be created regardless of TLS - errPjsip = createUDPServer(IP2IP_PROFILE); - - if(account && (errPjsip == PJ_SUCCESS)) { - - _debug("UserAgent: Initialized sip listener on port %d", account->getLocalPort ()); - addTransportToMap(account->getTransportMapKey(), account->getAccountTransport()); - - // if account is not NULL, use IP2IP trasport as default one - _localUDPTransport = account->getAccountTransport(); - - } - // If the above UDP server - // could not be created, then give it another try - // on a random sip port - else if (errPjsip != PJ_SUCCESS) { - _debug ("UserAgent: Could not initialize SIP listener on port %d", _regPort); - _regPort = RANDOM_SIP_PORT; - - _debug ("UserAgent: Trying to initialize SIP listener on port %d", _regPort); - // If no AccountID specified, pointer to transport is stored in _localUDPTransport - errPjsip = createUDPServer(); - - if (errPjsip != PJ_SUCCESS) { - _debug ("UserAgent: Fail to initialize SIP listener on port %d", _regPort); - return errPjsip; - } - } - - acquireTransport(IP2IP_PROFILE); - - /* - // Create a TLS listener meant for Direct IP calls - // if the user did enabled it. - if (account != NULL) { - - directIpCallsTlsEnabled = account->isTlsEnabled(); - port = account->getLocalPort (); - - } - - if (directIpCallsTlsEnabled) { - errPjsip = createTlsTransportRetryOnFailure (IP2IP_PROFILE); - } - - if (errPjsip != PJ_SUCCESS) { - _debug ("pj_init(): could not start TLS transport for Direct Calls"); - } - */ + // Initialize default UDP transport according to + // IP to IP settings (most likely using port 5060) + createDefaultSipUdpTransport(); - // TODO: For TLS, retry on random port, just we already do above - // for UDP transport. + // Call this method to create TLS listener + createDefaultSipTlsListener(); // Initialize transaction layer status = pjsip_tsx_layer_init_module (_endpt); @@ -1945,14 +1954,11 @@ bool SIPVoIPLink::pjsip_init() pj_bzero (&inv_cb, sizeof (inv_cb)); inv_cb.on_state_changed = &call_on_state_changed; - inv_cb.on_new_session = &call_on_forked; - inv_cb.on_media_update = &call_on_media_update; - inv_cb.on_tsx_state_changed = &call_on_tsx_changed; - inv_cb.on_rx_offer = &on_rx_offer; + inv_cb.on_create_offer = &on_create_offer; // Initialize session invite module status = pjsip_inv_usage_init (_endpt, &inv_cb); @@ -2047,6 +2053,7 @@ bool SIPVoIPLink::acquireTransport(const AccountID& accountID) { if(!account) return false; + // If an account is already bound to this account, decrease its reference // as it is going to change. If the same transport is selected, reference // counter will be increased @@ -2056,23 +2063,17 @@ bool SIPVoIPLink::acquireTransport(const AccountID& accountID) { pjsip_transport_dec_ref(account->getAccountTransport()); } - // Try to create a new transport + // Try to create a new transport in case the settings for this account + // are different than one defined for already created ones + // If TLS is enabled, TLS connection is automatically handled when sending account registration + // However, for any other sip transaction, we must create TLS connection if(createSipTransport(accountID)) { - return true; } - /* - else if(account->getAccountTransport()) { - - // Transport could not be created, account account already have one set. - // Most likely this is the transport we tried to create. - _debug("Transport (%s) already set for this account, use it\n", account->getTransportMapKey().c_str()); - - return true; - } - */ + // A transport is already created on this port, use it else { + _debug("Could not create a new transport (%s)", account->getTransportMapKey().c_str()); _debug("Searching transport (%s) in transport map", account->getTransportMapKey().c_str()); // Could not create new transport, this transport may already exists @@ -2116,66 +2117,188 @@ bool SIPVoIPLink::acquireTransport(const AccountID& accountID) { } -bool SIPVoIPLink::createSipTransport(AccountID id) { +bool SIPVoIPLink::createDefaultSipUdpTransport() +{ + int errPjsip = 0; - SIPAccount* account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); + // Retrieve Direct IP Calls settings. + SIPAccount * account = NULL; - if (!account) - return false; + // Use IP2IP_PROFILE to init default udp transport settings + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (IP2IP_PROFILE)); - pj_status_t status; + // Create a UDP listener meant for all accounts for which TLS was not enabled + // Cannot acquireTransport since default UDP transport must be created regardless of TLS + errPjsip = createUdpTransport(IP2IP_PROFILE); - // Launch a new TLS listener/transport - // if the user did choose it. - if (account->isTlsEnabled()) { + if(account && (errPjsip == PJ_SUCCESS)) { - _debug ("Create TLS transport"); - status = createTlsTransportRetryOnFailure (id); + // Store transport in transport map + addTransportToMap(account->getTransportMapKey(), account->getAccountTransport()); - if (status != PJ_SUCCESS) { - _debug ("Failed to initialize TLS transport for account %s", id.c_str()); + // if account is not NULL, use IP2IP trasport as default one + _localUDPTransport = account->getAccountTransport(); + + } + // If the above UDP server + // could not be created, then give it another try + // on a random sip port + else if (errPjsip != PJ_SUCCESS) { + _debug ("UserAgent: Could not initialize SIP listener on port %d", _regPort); + _regPort = RANDOM_SIP_PORT; + + _debug ("UserAgent: Trying to initialize SIP listener on port %d", _regPort); + // If no AccountID specified, pointer to transport is stored in _localUDPTransport + errPjsip = createUdpTransport(); + + if (errPjsip != PJ_SUCCESS) { + _debug ("UserAgent: Fail to initialize SIP listener on port %d", _regPort); return false; } } - else { - // Launch a new UDP listener/transport, using the published address - if (account->isStunEnabled ()) { + return true; - _debug ("Create Alternate UDP transport"); - status = createAlternateUdpTransport (id); +} - if (status != PJ_SUCCESS) { - _debug ("Failed to initialize UDP transport with an extern published address for account %s", id.c_str()); - return false; - } - } else { +void SIPVoIPLink::createDefaultSipTlsListener() +{ - _debug ("Create UDP transport"); - status = createUDPServer (id); + SIPAccount * account = NULL; + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (IP2IP_PROFILE)); - if (status != PJ_SUCCESS) { - _debug ("Failed to initialize UDP transport for account %s", id.c_str()); - return false; - } - else { + if(account->isTlsEnabled()) { + createTlsListener(IP2IP_PROFILE); + } +} + + +void SIPVoIPLink::createTlsListener(const AccountID& accountID) +{ + + pjsip_tpfactory *tls; + pj_sockaddr_in local_addr; + pjsip_host_port a_name; + pj_status_t status; + pj_status_t success; + + _debug("Create TLS listener"); + + /* Grab the tls settings, populated + * from configuration file. + */ + SIPAccount * account = NULL; + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (accountID)); + + if (account == NULL) { + _debug ("UserAgent: Account is null while creating TLS default listener. Returning"); + // return !PJ_SUCCESS; + } + + + // Init local address for this listener to be bound (ADDR_ANY on port 5061). + pj_sockaddr_in_init (&local_addr, 0, 0); + pj_uint16_t localTlsPort = account->getTlsListenerPort(); + local_addr.sin_port = pj_htons (localTlsPort); + + pj_str_t pjAddress; + pj_cstr (&pjAddress, PJ_INADDR_ANY); + success = pj_sockaddr_in_set_str_addr (&local_addr, &pjAddress); + + + // Init published address for this listener (Local IP address on port 5061) + std::string publishedAddress; + loadSIPLocalIP(&publishedAddress); + + pj_bzero (&a_name, sizeof (pjsip_host_port)); + pj_cstr (&a_name.host, publishedAddress.c_str()); + a_name.port = account->getTlsListenerPort(); + + /* Get TLS settings. Expected to be filled */ + pjsip_tls_setting * tls_setting = account->getTlsSetting(); + + + _debug ("UserAgent: TLS transport to be initialized with published address %.*s," + " published port %d,\n local address %.*s, local port %d", + (int) a_name.host.slen, a_name.host.ptr, + (int) a_name.port, pjAddress.slen, pjAddress.ptr, (int) localTlsPort); + + + status = pjsip_tls_transport_start (_endpt, tls_setting, &local_addr, &a_name, 1, &tls); + + if (status != PJ_SUCCESS) { + _debug ("UserAgent: Error creating SIP TLS listener (%d)", status); + } + else { + _localTlsListener = tls; + } + + // return PJ_SUCCESS; + +} + + +bool SIPVoIPLink::createSipTransport(AccountID id) +{ + + SIPAccount* account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); + + if (!account) + return false; + + pj_status_t status; + + if (account->isTlsEnabled()) { + + if(_localTlsListener == NULL) + createTlsListener(id); + + // Parse remote address to establish connection + std::string remoteSipUri = account->getServerUri(); + int sips = remoteSipUri.find("<sips:") + 6; + int trns = remoteSipUri.find(";transport"); + std::string remoteAddr = remoteSipUri.substr(sips, trns-sips); + + // Nothing to do, TLS listener already created at pjsip's startup and TLS connection + // is automatically handled in pjsip when sending registration messages. + if(createTlsTransport(id, remoteAddr) != PJ_SUCCESS) + return false; + + return true; + } + else { + + // Launch a new UDP listener/transport, using the published address + if (account->isStunEnabled ()) { + + status = createAlternateUdpTransport (id); + + if (status != PJ_SUCCESS) { + _debug ("Failed to init UDP transport with STUN published address for account %s", id.c_str()); + return false; + } + + } else { + + status = createUdpTransport (id); + + if (status != PJ_SUCCESS) { + _debug ("Failed to initialize UDP transport for account %s", id.c_str()); + return false; + } + else { // If transport succesfully created, store it in the internal map. // STUN aware transport are account specific and should not be stored in map. // TLS transport is ephemeral and is managed by PJSIP, should not be stored either. addTransportToMap(account->getTransportMapKey(), account->getAccountTransport()); } - - } - } - return true; - - + return true; } @@ -2191,7 +2314,7 @@ bool SIPVoIPLink::addTransportToMap(std::string key, pjsip_transport* transport) _transportMap.erase(iter_transport); } - _debug("Storing the newly created transport in transport map using key %s", key.c_str()); + _debug("UserAgent: Storing newly created transport in map using key %s", key.c_str()); _transportMap.insert(pair<std::string, pjsip_transport*>(key, transport)); return true; @@ -2199,7 +2322,7 @@ bool SIPVoIPLink::addTransportToMap(std::string key, pjsip_transport* transport) } -int SIPVoIPLink::createUDPServer (AccountID id) +int SIPVoIPLink::createUdpTransport (AccountID id) { pj_status_t status; @@ -2214,7 +2337,7 @@ int SIPVoIPLink::createUDPServer (AccountID id) if (!loadSIPLocalIP (&listeningAddress)) return !PJ_SUCCESS; - _debug ("Create UDP transport for account \"%s\"", id.c_str()); + _debug ("UserAgent: Create UDP transport for account \"%s\"", id.c_str()); /* * Retrieve the account information @@ -2230,12 +2353,12 @@ int SIPVoIPLink::createUDPServer (AccountID id) // Set information to the local address and port if (account == NULL) { - _debug ("Account with id \"%s\" is null in createUDPServer.", id.c_str()); + _debug ("UserAgent: Account with id \"%s\" is null in createUdpTransport.", id.c_str()); } else { // We are trying to initialize a UDP transport available for all local accounts and direct IP calls - _debug("Found account %s in map", account->getAccountID().c_str()); + _debug("UserAgent: found account %s in map", account->getAccountID().c_str()); if (account->getLocalInterface () != "default") { listeningAddress = getInterfaceAddrFromName(account->getLocalInterface()); @@ -2272,11 +2395,14 @@ int SIPVoIPLink::createUDPServer (AccountID id) listeningAddress = account->getPublishedAddress (); // Set the listening port to the published port listeningPort = account->getPublishedPort (); - _debug ("Creating UDP transport published %s:%i", listeningAddress.c_str (), listeningPort); + _debug ("UserAgent: Creating UDP transport published %s:%i", listeningAddress.c_str (), listeningPort); } - + if(listeningAddress == "" || listeningPort == 0) { + _error("UserAgent: Error invalid address for new udp transport"); + return !PJ_SUCCESS; + } //strcpy (tmpIP, listeningAddress.data()); /* Init published name */ pj_bzero (&a_name, sizeof (pjsip_host_port)); @@ -2299,25 +2425,20 @@ int SIPVoIPLink::createUDPServer (AccountID id) } else { - _debug ("UserAgent: UDP server listening on port %d", listeningPort); + _debug ("UserAgent: UDP transport initialized successfully on %s:%d", listeningAddress.c_str (), listeningPort); if (account == NULL) { - _debug("Use transport as local UDP server"); + _debug("UserAgent: Use transport as local UDP server"); _localUDPTransport = transport; } else { - _debug("Bind transport to account %s", account->getAccountID().c_str()); + _debug("UserAgent: bind transport to account %s", account->getAccountID().c_str()); account->setAccountTransport (transport); } } - if (status == PJ_SUCCESS) { - _debug ("Transport initialized successfully on %s:%i", listeningAddress.c_str (), listeningPort); - - } - return PJ_SUCCESS; } @@ -2327,7 +2448,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_ pjsip_transport_type_e transportType; pjsip_tpselector *tp_sel; - _debug ("SIPVoIPLink::findLocalAddressFromUri"); + _debug ("SIP: Find local address from URI"); // Find the transport that must be used with the given uri pj_str_t tmp; @@ -2340,7 +2461,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_ std::string machineName (pjMachineName.ptr, pjMachineName.slen); if (genericUri == NULL) { - _debug ("genericUri is NULL in findLocalAddressFromUri"); + _warn ("SIP: generic URI is NULL in findLocalAddressFromUri"); return machineName; } @@ -2349,7 +2470,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_ sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri (genericUri); if (sip_uri == NULL) { - _debug ("Invalid uri in findLocalAddressFromTransport"); + _warn ("SIP: Invalid uri in findLocalAddressFromURI"); return machineName; } @@ -2358,7 +2479,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_ } else { if (transport == NULL) { - _debug ("transport is NULL in findLocalAddressFromUri. Try the local UDP transport"); + _warn ("SIP: Transport is NULL in findLocalAddressFromUri. Try the local UDP transport"); transport = _localUDPTransport; } @@ -2372,7 +2493,7 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_ tpmgr = pjsip_endpt_get_tpmgr (_endpt); if (tpmgr == NULL) { - _debug ("Unexpected: Cannot get tpmgr from endpoint."); + _warn ("SIP: Unexpected: Cannot get tpmgr from endpoint."); return machineName; } @@ -2387,21 +2508,24 @@ std::string SIPVoIPLink::findLocalAddressFromUri (const std::string& uri, pjsip_ if (transportType == PJSIP_TRANSPORT_UDP) { status = init_transport_selector (transport, &tp_sel); - if (status == PJ_SUCCESS) + if (status == PJ_SUCCESS) { status = pjsip_tpmgr_find_local_addr (tpmgr, _pool, transportType, tp_sel, &localAddress, &port); - else - status = pjsip_tpmgr_find_local_addr (tpmgr, _pool, transportType, NULL, &localAddress, &port); - } else { - + } + else { + status = pjsip_tpmgr_find_local_addr (tpmgr, _pool, transportType, NULL, &localAddress, &port); + } + } + else { status = pjsip_tpmgr_find_local_addr (tpmgr, _pool, transportType, NULL, &localAddress, &port); } if (status != PJ_SUCCESS) { - _debug ("Failed to find local address from transport"); + _debug ("SIP: Failed to find local address from transport"); return machineName; } - _debug ("Local address discovered from attached transport: %s", localAddress.ptr); + std::string localaddr(localAddress.ptr, localAddress.slen); + _debug ("SIP: Local address discovered from attached transport: %s", localaddr.c_str()); return std::string (localAddress.ptr, localAddress.slen); } @@ -2439,7 +2563,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport * genericUri = pjsip_parse_uri (_pool, tmp.ptr, tmp.slen, 0); if (genericUri == NULL) { - _debug ("genericUri is NULL in findLocalPortFromUri"); + _debug ("UserAgent: genericUri is NULL in findLocalPortFromUri"); return atoi (DEFAULT_SIP_PORT); } @@ -2448,7 +2572,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport * sip_uri = (pjsip_sip_uri*) pjsip_uri_get_uri (genericUri); if (sip_uri == NULL) { - _debug ("Invalid uri in findLocalAddressFromTransport"); + _debug ("UserAgent: Invalid uri in findLocalAddressFromTransport"); return atoi (DEFAULT_SIP_PORT); } @@ -2457,7 +2581,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport * port = atoi (DEFAULT_SIP_TLS_PORT); } else { if (transport == NULL) { - _debug ("transport is NULL in findLocalPortFromUri - Try the local UDP transport"); + _debug ("UserAgent: transport is NULL in findLocalPortFromUri - Try the local UDP transport"); transport = _localUDPTransport; } @@ -2473,7 +2597,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport * tpmgr = pjsip_endpt_get_tpmgr (_endpt); if (tpmgr == NULL) { - _debug ("Unexpected: Cannot get tpmgr from endpoint."); + _debug ("UserAgent: unexpected, cannot get tpmgr from endpoint."); return port; } @@ -2484,7 +2608,7 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport * pj_status_t status; if (transportType == PJSIP_TRANSPORT_UDP) { - _debug ("Transport ID: %s", transport->obj_name); + _debug ("UserAgent: transport ID: %s", transport->obj_name); status = init_transport_selector (transport, &tp_sel); @@ -2497,51 +2621,50 @@ int SIPVoIPLink::findLocalPortFromUri (const std::string& uri, pjsip_transport * if (status != PJ_SUCCESS) { - _debug ("Failed to find local address from transport"); + _debug ("UserAgent: failed to find local address from transport"); } - _debug ("Local port discovered from attached transport: %i", port); + _debug ("UserAgent: local port discovered from attached transport: %i", port); return port; } -pj_status_t SIPVoIPLink::createTlsTransportRetryOnFailure (AccountID id) + +pj_status_t SIPVoIPLink::createTlsTransport(const AccountID& accountID, std::string remoteAddr) { pj_status_t success; - // Create a TLS listener. - // Note that STUN cannot be used for - // TCP NAT traversal. At the moment (20/08/09) - // user must supply the public address/port - // manually. - success = createTlsTransport (id); + _debug("Create TLS transport for account %s\n", accountID.c_str()); - if (success != PJ_SUCCESS) { - unsigned int randomPort = RANDOM_SIP_PORT; + // Retrieve the account information + SIPAccount * account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (accountID)); - // Update new port in the corresponding SIPAccount - SIPAccount * account = NULL; - account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); + if(!account) { + _debug("UserAgent: Account is NULL when creating TLS connection, returning"); + return !PJ_SUCCESS; + } - if (account == NULL) { - _debug ("createTlsTransportRetryOnFailure: Account is null. Returning"); - return !PJ_SUCCESS; - } + pj_sockaddr_in rem_addr; + pj_str_t remote; - account->setLocalPort ( (pj_uint16_t) randomPort); + pj_cstr(&remote, remoteAddr.c_str()); - // Try to start the transport again on - // the new port. - success = createTlsTransport (id); + pj_sockaddr_in_init(&rem_addr, &remote, (pj_uint16_t)5061); - if (success != PJ_SUCCESS) { - _debug ("createTlsTransportRetryOnFailure: failed to retry on random port %d", randomPort); - return success; - } + // Update TLS settings for account registration using the default listeners + // Pjsip does not allow to create multiple listener + // pjsip_tpmgr *mgr = pjsip_endpt_get_tpmgr(_endpt); + // pjsip_tls_listener_update_settings(_endpt, _pool, mgr, _localTlsListener, account->getTlsSetting()); - _debug ("createTlsTransportRetryOnFailure: TLS transport listening on port %d", randomPort); - } + // Create a new TLS connection from TLS listener + pjsip_transport *tls; + success = pjsip_endpt_acquire_transport(_endpt, PJSIP_TRANSPORT_TLS, &rem_addr, sizeof(rem_addr), NULL, &tls); - return PJ_SUCCESS; + if(success != PJ_SUCCESS) + _debug("UserAgent: Error could not create TLS transport"); + else + account->setAccountTransport(tls); + + return success; } pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) @@ -2556,6 +2679,8 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) std::string listeningAddress = ""; int listeningPort; + _debug ("UserAgent: Create Alternate UDP transport"); + /* * Retrieve the account information */ @@ -2563,7 +2688,7 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); if (account == NULL) { - _debug ("Account is null. Returning"); + _error ("UserAgent: Error: Account is null. Returning"); return !PJ_SUCCESS; } @@ -2574,19 +2699,19 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) status = stunServerResolve (id); if (status != PJ_SUCCESS) { - _debug ("Error resolving STUN server: %i", status); + _error ("UserAgent: Error: Resolving STUN server: %i", status); return status; } // Init socket sock = PJ_INVALID_SOCKET; - _debug ("Initializing IPv4 socket on %s:%i", stunServer.ptr, stunPort); + _debug ("UserAgent: Initializing IPv4 socket on %s:%i", stunServer.ptr, stunPort); status = pj_sockaddr_in_init (&boundAddr, &stunServer, 0); if (status != PJ_SUCCESS) { - _debug ("Error when initializing IPv4 socket on %s:%i", stunServer.ptr, stunPort); + _debug ("UserAgent: Error: Initializing IPv4 socket on %s:%i", stunServer.ptr, stunPort); return status; } @@ -2594,7 +2719,7 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) status = pj_sock_socket (pj_AF_INET(), pj_SOCK_DGRAM(), 0, &sock); if (status != PJ_SUCCESS) { - _debug ("Socket() error (%d)", status); + _debug ("UserAgent: Error: Unable to create or bind socket (%d)", status); return status; } @@ -2602,15 +2727,12 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) status = pjstun_get_mapped_addr (&_cp.factory, 1, &sock, &stunServer, stunPort, &stunServer, stunPort, &pub_addr); if (status != PJ_SUCCESS) { - _debug ("Error contacting STUN server (%d)", status); + _debug ("UserAgwent: Error: Contacting STUN server (%d)", status); pj_sock_close (sock); return status; } - _debug ("Firewall address : %s:%d", - - pj_inet_ntoa (pub_addr.sin_addr), - pj_ntohs (pub_addr.sin_port)); + _debug ("UserAgent: Firewall address : %s:%d", pj_inet_ntoa (pub_addr.sin_addr), pj_ntohs (pub_addr.sin_port)); a_name.host = pj_str (pj_inet_ntoa (pub_addr.sin_addr)); a_name.port = pj_ntohs (pub_addr.sin_port); @@ -2627,36 +2749,29 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) status = pjsip_udp_transport_attach2 (_endpt, PJSIP_TRANSPORT_UDP, sock, &a_name, 1, &transport); if (status != PJ_SUCCESS) { - _debug ("Error creating alternate SIP UDP listener (%d)", status); + _debug ("UserAgent: Error: Creating alternate SIP UDP listener (%d)", status); return status; } - _debug ("UDP Transport successfully created on %s:%i", listeningAddress.c_str (), listeningPort); + _debug ("UserAgent: UDP Transport successfully created on %s:%i", listeningAddress.c_str (), listeningPort); account->setAccountTransport (transport); if(transport) { - _debug("INITIAL REF COUNT: %s %s (refcnt=%i)", - transport->obj_name, - transport->info, - (int)pj_atomic_get(transport->ref_cnt)); - + _debug("UserAgent: Initial ref count: %s %s (refcnt=%i)", transport->obj_name, transport->info, + (int)pj_atomic_get(transport->ref_cnt)); - pj_sockaddr *addr = (pj_sockaddr*)&(transport->key.rem_addr); + pj_sockaddr *addr = (pj_sockaddr*)&(transport->key.rem_addr); - static char str[PJ_INET6_ADDRSTRLEN]; - pj_inet_ntop(((const pj_sockaddr*)addr)->addr.sa_family, - pj_sockaddr_get_addr(addr), - str, sizeof(str)); + static char str[PJ_INET6_ADDRSTRLEN]; + pj_inet_ntop(((const pj_sockaddr*)addr)->addr.sa_family, pj_sockaddr_get_addr(addr), str, sizeof(str)); - _debug("KEY: %s:%d", - // addr_string(account->getAccountTransport()->key.rem_addr), - str, - pj_sockaddr_get_port((const pj_sockaddr*)&(transport->key.rem_addr))); + _debug("UserAgent: KEY: %s:%d",str, pj_sockaddr_get_port((const pj_sockaddr*)&(transport->key.rem_addr))); } + pjsip_tpmgr * tpmgr = pjsip_endpt_get_tpmgr (_endpt); pjsip_tpmgr_dump_transports (tpmgr); @@ -2665,121 +2780,10 @@ pj_status_t SIPVoIPLink::createAlternateUdpTransport (AccountID id) } - -pj_status_t SIPVoIPLink::createTlsTransport (AccountID id) -{ - pjsip_tpfactory *tls; - pj_sockaddr_in local_addr; - pjsip_host_port a_name; - pj_status_t status; - - /* Grab the tls settings, populated - * from configuration file. - */ - SIPAccount * account = NULL; - account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (id)); - - if (account == NULL) { - _debug ("Account is null. Returning"); - return !PJ_SUCCESS; - } - - /** - * Init local address. - * If IP interface address is not specified, - * socket will be bound to PJ_INADDR_ANY. - * If user specified port is an empty string - * or if it is equal to 0, then the port will - * be chosen automatically by the OS. - */ - pj_sockaddr_in_init (&local_addr, 0, 0); - - pj_uint16_t localTlsPort = account->getLocalPort(); - - if (localTlsPort != 0) { - local_addr.sin_port = pj_htons (localTlsPort); - } - - /* - std::string localAddress; - if (account->getLocalInterface() == "default"){ - - // Current selected interface address is 0.0.0.0, resolve local address using - loadSIPLocalIP (&localAddress); - } - else { - - // Specific interface selected, reslove it - localAddress = getInterfaceAddrFromName(account->getLocalInterface()); - } - */ - - std::string localAddress = getInterfaceAddrFromName(account->getLocalInterface()); - - if (!localAddress.empty()) { - pj_str_t pjAddress; - pj_cstr (&pjAddress, localAddress.c_str()); - - pj_status_t success; - success = pj_sockaddr_in_set_str_addr (&local_addr, &pjAddress); - - if (success != PJ_SUCCESS) { - _debug ("Failed to set local address in %d", __LINE__); - } - } - - std::string publishedAddress; - if (account->getPublishedSameasLocal()) { - - // if "default" interface is selected, loadSIPLocalIP() is used to get local address - if (account->getLocalInterface() == "default"){ - - loadSIPLocalIP (&publishedAddress); - } - else { - - // Specific interface selected - publishedAddress = localAddress; - } - } - else { - - publishedAddress = account->getPublishedAddress(); - } - - - /* Init published name */ - pj_bzero (&a_name, sizeof (pjsip_host_port)); - - pj_cstr (&a_name.host, publishedAddress.c_str()); - - a_name.port = account->getPublishedPort(); - - /* Get TLS settings. Expected to be filled */ - pjsip_tls_setting * tls_setting = account->getTlsSetting(); - - _debug ("TLS transport to be initialized with published address %.*s," - " published port %d, local address %s, local port %d", - (int) a_name.host.slen, a_name.host.ptr, - (int) a_name.port, localAddress.c_str(), (int) localTlsPort); - - - - status = pjsip_tls_transport_start (_endpt, tls_setting, &local_addr, &a_name, 1, &tls); - - if (status != PJ_SUCCESS) { - _debug ("Error creating SIP TLS listener (%d)", status); - } - - return PJ_SUCCESS; -} - - void SIPVoIPLink::shutdownSipTransport(const AccountID& accountID) { - _debug("Shutdown Sip Transport"); - pj_status_t status = 0; + _debug("UserAgent: Shutdown Sip Transport"); SIPAccount* account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (accountID)); @@ -2792,7 +2796,9 @@ void SIPVoIPLink::shutdownSipTransport(const AccountID& accountID) // decrease reference count added by pjsip_regc_send // PJSIP's IDLE timer is set if counter reach 0 - status = pjsip_transport_dec_ref(account->getAccountTransport()); + + // there is still problems when account registration fails, so comment it for now + // status = pjsip_transport_dec_ref(account->getAccountTransport()); // detach transport from this account account->setAccountTransport(NULL); @@ -2802,21 +2808,6 @@ void SIPVoIPLink::shutdownSipTransport(const AccountID& accountID) } -void SIPVoIPLink::updateAccountInfo (const AccountID& accountID) -{ - - // createSipTransport (accountID); - acquireTransport(accountID); - - if(accountID == IP2IP_PROFILE) { - - SIPAccount* account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (accountID)); - // Store new IP2IP UDP transport as default - _localUDPTransport = account->getAccountTransport(); - } - -} - bool SIPVoIPLink::loadSIPLocalIP (std::string *addr) { @@ -2831,7 +2822,7 @@ bool SIPVoIPLink::loadSIPLocalIP (std::string *addr) returnValue = false; } else { localAddress = std::string (pj_inet_ntoa (ip_addr.ipv4.sin_addr)); - _debug ("UserAgent: Checking network, setting local IP address to: %s", localAddress.data()); + _debug ("UserAgent: Checking network, local IP address: %s", localAddress.data()); } *addr = localAddress; @@ -2957,40 +2948,41 @@ void set_voicemail_info (AccountID account, pjsip_msg_body *body) void SIPVoIPLink::handle_reinvite (SIPCall *call) { + + _debug ("UserAgent: Handle reinvite"); /* // Close the previous RTP session call->getAudioRtp()->stop (); call->setAudioStart (false); - + _debug ("Create new rtp session from handle_reinvite : %s:%i", call->getLocalIp().c_str(), call->getLocalAudioPort()); - + _debug ("UserAgent: handle_reinvite"); + try { call->getAudioRtp()->initAudioRtpSession (call); } catch (...) { _debug ("! SIP Failure: Unable to create RTP Session (%s:%d)", __FILE__, __LINE__); } + + + _debug("Handle reINVITE"); */ - _debug("******************************************"); - _debug("* handle_reinvite *"); - _debug("******************************************"); - - call->getAudioRtp()->updateDestinationIpAddress(); } // This callback is called when the invite session state has changed void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) { - _debug ("call_on_state_changed to state %s", invitationStateMap[inv->state]); + _debug ("UserAgent: Call state changed to %s", invitationStateMap[inv->state]); pjsip_rx_data *rdata; - pj_status_t status; + pj_status_t status = PJ_SUCCESS; /* Retrieve the call information */ SIPCall * call = NULL; call = reinterpret_cast<SIPCall*> (inv->mod_data[_mod_ua.id]); if (call == NULL) { - _debug ("Call is NULL in call_on_state_changed"); + _error ("UserAgent: Error: Call is NULL in call state changed callback"); return; } else { // _debug(" call_on_state_changed: call id %s", call->getCallId().c_str()); @@ -3013,7 +3005,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) } if (link == NULL) { - _debug ("Link is NULL in call_on_state_changed"); + _error ("UserAgent: Error: Link is NULL in call state changed callback"); return; } @@ -3025,7 +3017,6 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE; switch (call->getInvSession()->state) { - // switch (inv->state) { case PJSIP_INV_STATE_NULL: @@ -3064,9 +3055,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) pjsip_tx_data *tdata; pj_status_t status; - status = pjsip_xfer_notify (call->getXferSub(), - ev_state, st_code, - NULL, &tdata); + status = pjsip_xfer_notify (call->getXferSub(), ev_state, st_code, NULL, &tdata); if (status != PJ_SUCCESS) { _debug ("UserAgent: Unable to create NOTIFY -- %d", status); @@ -3106,15 +3095,6 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) Manager::instance().peerRingingCall (call->getCallId()); } - // After 2xx is sent/received. - else if (inv->state == PJSIP_INV_STATE_CONNECTING) { - status = call->getLocalSDP()->check_sdp_answer (inv, rdata); - - if (status != PJ_SUCCESS) { - _debug ("Failed to check_incoming_sdp in call_on_state_changed"); - return; - } - } // After we sent or received a ACK - The connection is established else if (inv->state == PJSIP_INV_STATE_CONFIRMED) { @@ -3125,45 +3105,35 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) _debug ("State: %s. Cause: %.*s", invitationStateMap[inv->state], (int) inv->cause_text.slen, inv->cause_text.ptr); + accId = Manager::instance().getAccountFromCall (call->getCallId()); + link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); + + // Make sure link is valid + assert(link); + switch (inv->cause) { - /* The call terminates normally - BYE / CANCEL */ + // The call terminates normally - BYE / CANCEL case PJSIP_SC_OK: - case PJSIP_SC_REQUEST_TERMINATED: - accId = Manager::instance().getAccountFromCall (call->getCallId()); - link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); - - if (link) { - link->SIPCallClosed (call); - } - + link->SIPCallClosed (call); break; - case PJSIP_SC_NOT_FOUND: /* peer not found */ - - case PJSIP_SC_DECLINE: /* We have been ignored */ + case PJSIP_SC_DECLINE: + _debug("UserAgent: Call %s is declined", call->getCallId().c_str()); + if (inv->role == PJSIP_ROLE_UAC) + link->SIPCallServerFailure (call); + break; + case PJSIP_SC_NOT_FOUND: /* peer not found */ case PJSIP_SC_REQUEST_TIMEOUT: /* request timeout */ - case PJSIP_SC_NOT_ACCEPTABLE_HERE: /* no compatible codecs */ - case PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE: - case PJSIP_SC_UNSUPPORTED_MEDIA_TYPE: - case PJSIP_SC_UNAUTHORIZED: - case PJSIP_SC_FORBIDDEN: - case PJSIP_SC_REQUEST_PENDING: - accId = Manager::instance().getAccountFromCall (call->getCallId()); - link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); - - if (link) { - link->SIPCallServerFailure (call); - } - + link->SIPCallServerFailure (call); break; default: @@ -3177,7 +3147,7 @@ void call_on_state_changed (pjsip_inv_session *inv, pjsip_event *e) // This callback is called after SDP offer/answer session has completed. void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) { - _debug ("call_on_media_update"); + _debug ("UserAgent: Call media update"); const pjmedia_sdp_session *local_sdp; const pjmedia_sdp_session *remote_sdp; @@ -3188,19 +3158,19 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) call = reinterpret_cast<SIPCall *> (inv->mod_data[getModId() ]); if (!call) { - _debug ("Call declined by peer, SDP negociation stopped"); + _debug ("UserAgent: Call declined by peer, SDP negociation stopped"); return; } link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (AccountNULL)); if (link == NULL) { - _debug ("Failed to get sip link"); + _warn ("UserAgent: Error: Failed to get sip link"); return; } if (status != PJ_SUCCESS) { - _debug ("Error while negotiating the offer"); + _warn ("UserAgent: Error: while negotiating the offer"); link->hangup (call->getCallId()); Manager::instance().callFailure (call->getCallId()); return; @@ -3226,43 +3196,46 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) // Set remote ip / port call->getLocalSDP()->set_media_transport_info_from_remote_sdp (remote_sdp); + try { + call->getAudioRtp()->updateDestinationIpAddress(); + } + catch(...) { + + } + + // Get the crypto attribute containing srtp's cryptographic context (keys, cipher) CryptoOffer crypto_offer; call->getLocalSDP()->get_remote_sdp_crypto_from_offer(remote_sdp, crypto_offer); - bool nego_success = false; if(!crypto_offer.empty()) { - _debug("Crypto attribute in SDP: init Srtp session"); + _debug("UserAgent: Crypto attribute in SDP, init SRTP session"); - // init local cryptografic capabilities for negotiation - std::vector<sfl::CryptoSuiteDefinition>localCapabilities; - for(int i = 0; i < 3; i++) { - localCapabilities.push_back(sfl::CryptoSuites[i]); - } + // init local cryptografic capabilities for negotiation + std::vector<sfl::CryptoSuiteDefinition>localCapabilities; + for(int i = 0; i < 3; i++) { + localCapabilities.push_back(sfl::CryptoSuites[i]); + } - sfl::SdesNegotiator sdesnego(localCapabilities, crypto_offer); + sfl::SdesNegotiator sdesnego(localCapabilities, crypto_offer); - if(sdesnego.negotiate()) { - _debug("SDES negociation successfull \n"); - nego_success = true; - - if(call->getAudioRtp()->getAudioRtpType() == sfl::Sdes) { - _debug("Set remote cryptographic context\n"); - call->getAudioRtp()->setRemoteCryptoInfo(sdesnego); - } - } - else { - - //@TODO Handle fallback mechanism here - // - Call may Failed if SrtpOnly - // - Call fallback to RTP (make sure PBX support it, if not ...) - // - Ask (display a pop-up message) + if(sdesnego.negotiate()) { + _debug("UserAgent: SDES negociation successfull \n"); + nego_success = true; - call->getAudioRtp()->getAudioRtpType(); + _debug("UserAgent: Set remote cryptographic context\n"); + try { + call->getAudioRtp()->setRemoteCryptoInfo(sdesnego); + } + catch(...) {} - } + DBusManager::instance().getCallManager()->secureSdesOn (call->getCallId()); + } + else { + DBusManager::instance().getCallManager()->secureSdesOff (call->getCallId()); + } } // We did not found any crypto context for this media @@ -3271,23 +3244,42 @@ void call_on_media_update (pjsip_inv_session *inv, pj_status_t status) // We did not found any crypto context for this media // @TODO if SRTPONLY, CallFail - // if RTPFALLBACK, change RTP session - _debug("Did not found any crypto or negociation failed but Sdes enabled"); + _debug("UserAgent: Did not found any crypto or negociation failed but Sdes enabled"); call->getAudioRtp()->stop(); call->getAudioRtp()->setSrtpEnabled(false); - call->getAudioRtp()->initAudioRtpSession(call); + + // if RTPFALLBACK, change RTP session + AccountID accountID = Manager::instance().getAccountFromCall (call->getCallId()); + if(Manager::instance().getConfigString (accountID, SRTP_RTP_FALLBACK) == "true") + call->getAudioRtp()->initAudioRtpSession(call); } if(nego_success && call->getAudioRtp()->getAudioRtpType() != sfl::Sdes) { // We found a crypto context for this media but Sdes is not // enabled for this call, make a try using RTP only... - _debug("Sdes not initialized for this call\n"); + _debug("UserAgent: SDES not initialized for this call\n"); } + + Sdp *sdpSession = call->getLocalSDP(); + if(!sdpSession) + return; + + AudioCodec *sessionMedia = sdpSession->get_session_media(); + if(!sessionMedia) + return; + + AudioCodecType pl = (AudioCodecType)sessionMedia->getPayload(); + AudioCodec* audiocodec = Manager::instance().getCodecDescriptorMap().instantiateCodec(pl); + + if (audiocodec == NULL) + _error ("SIP: No audiocodec found"); + + try { call->setAudioStart (true); - call->getAudioRtp()->start(); + call->getAudioRtp()->start(audiocodec); } catch (exception& rtpException) { _debug ("%s", rtpException.what()); } @@ -3300,9 +3292,9 @@ void call_on_forked (pjsip_inv_session *inv, pjsip_event *e) void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e) { - _debug("call_on_tsx_changed to state %s", transactionStateMap[tsx->state]); + assert(tsx); - + _debug("UserAgent: Transaction changed to state %s", transactionStateMap[tsx->state]); if (tsx->role==PJSIP_ROLE_UAS && tsx->state==PJSIP_TSX_STATE_TRYING && pjsip_method_cmp (&tsx->method, &pjsip_refer_method) ==0) { @@ -3312,17 +3304,27 @@ void call_on_tsx_changed (pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_ if (e && e->body.rx_msg.rdata) { + + _debug("Event"); pjsip_tx_data* t_data; pjsip_rx_data* r_data = e->body.rx_msg.rdata; - if (r_data->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) { + if (r_data && r_data->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) { - std::string method_name = "INFO"; - std::string request = r_data->msg_info.msg->line.req.method.name.ptr; + _debug("R_data"); - if (request.find (method_name) != (size_t)-1) { + std::string method_info = "INFO"; + std::string method_notify = "NOTIFY"; - _debug ("%s", pjsip_rx_data_get_info (r_data)); + std::string request = pjsip_rx_data_get_info (r_data); + + _debug("UserAgent: %s", request.c_str()); + + if(request.find (method_notify) != (size_t)-1) { + + } + // Must reply 200 OK on SIP INFO request + else if (request.find (method_info) != (size_t)-1) { pjsip_dlg_create_response (inv->dlg, r_data, PJSIP_SC_OK, NULL, &t_data); @@ -3383,6 +3385,21 @@ void regc_cb (struct pjsip_regc_cbparam *param) account->setRegistrationState (ErrorAuth); break; + case 423: { // Expiration Interval Too Brief + + int expire_value; + std::istringstream stream (account->getRegistrationExpire()); + stream >> expire_value; + + std::stringstream out; + out << (expire_value * 2); + std::string s = out.str(); + + Manager::instance().setConfig(account->getAccountID(), CONFIG_ACCOUNT_REGISTRATION_EXPIRE, s); + account->registerVoIPLink(); + } + break; + default: account->setRegistrationState (Error); break; @@ -3445,13 +3462,17 @@ mod_on_rx_request (pjsip_rx_data *rdata) std::string method_name; std::string request; - // Handle the incoming call invite in this function - _debug ("UserAgent: Callback on_rx_request is involved! "); - _debug("Receiving REQUEST using transport: %s %s (refcnt=%d)", - rdata->tp_info.transport->obj_name, - rdata->tp_info.transport->info, - (int)pj_atomic_get(rdata->tp_info.transport->ref_cnt)); + _info("UserAgent: Transaction REQUEST received using transport: %s %s (refcnt=%d)", + rdata->tp_info.transport->obj_name, + rdata->tp_info.transport->info, + (int)pj_atomic_get(rdata->tp_info.transport->ref_cnt)); + + // No need to go any further on incoming ACK + if (rdata->msg_info.msg->line.req.method.id == PJSIP_ACK_METHOD && pjsip_rdata_get_dlg(rdata) != NULL) { + _info("UserAgent: received an ACK"); + return true; + } /* First, let's got the username and server name from the invite. * We will use them to detect which account is the callee. @@ -3462,16 +3483,12 @@ mod_on_rx_request (pjsip_rx_data *rdata) userName = std::string (sip_uri->user.ptr, sip_uri->user.slen); server = std::string (sip_uri->host.ptr, sip_uri->host.slen); - _debug ("mod_on_rx_request: %s@%s", userName.c_str(), server.c_str()); - // Get the account id of callee from username and server account_id = Manager::instance().getAccountIdFromNameAndServer (userName, server); /* If we don't find any account to receive the call */ - if (account_id == AccountNULL) { - _debug ("UserAgent: Username %s doesn't match any account!",userName.c_str()); - //return false; + _debug ("UserAgent: Username %s doesn't match any account, using IP2IP!",userName.c_str()); } /* Get the voip link associated to the incoming call */ @@ -3479,21 +3496,22 @@ mod_on_rx_request (pjsip_rx_data *rdata) link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (account_id)); /* If we can't find any voIP link to handle the incoming call */ - if (link == 0) { - _debug ("ERROR: can not retrieve the voiplink from the account ID..."); + if (!link) { + _warn("UserAgent: Error: cannot retrieve the voiplink from the account ID..."); + pj_strdup2 (_pool, &reason, "ERROR: cannot retrieve the voip link from account"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, + &reason, NULL, NULL); + return true; return false; } - + // Parse the display name from "From" header char* from_header = strstr (rdata->msg_info.msg_buf, "From: "); - if (from_header) { - std::string temp (from_header); int begin_displayName = temp.find ("\"") + 1; int end_displayName = temp.rfind ("\""); - // _debug("The display name start at %i, end at %i", begin_displayName, end_displayName); - displayName = temp.substr (begin_displayName, end_displayName - begin_displayName);//display_name); + displayName = temp.substr (begin_displayName, end_displayName - begin_displayName); if(displayName.size() > 25) { displayName = std::string (""); } @@ -3501,18 +3519,12 @@ mod_on_rx_request (pjsip_rx_data *rdata) displayName = std::string (""); } - _debug ("UserAgent: The receiver is : %s@%s", userName.data(), server.data()); - + _debug ("UserAgent: The receiver is: %s@%s", userName.data(), server.data()); _debug ("UserAgent: The callee account id is %s", account_id.c_str()); /* Now, it is the time to find the information of the caller */ uri = rdata->msg_info.from->uri; - - // display_name = rdata->msg_info.from->name; - - // std::string temp("");///(char*)(&display_name)); - sip_uri = (pjsip_sip_uri *) pjsip_uri_get_uri (uri); // Store the peer number @@ -3524,8 +3536,8 @@ mod_on_rx_request (pjsip_rx_data *rdata) // Get the server voicemail notification // Catch the NOTIFY message - if (rdata->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) { + method_name = "NOTIFY"; // Retrieve all the message. Should contains only the method name but ... request = rdata->msg_info.msg->line.req.method.name.ptr; @@ -3552,19 +3564,29 @@ mod_on_rx_request (pjsip_rx_data *rdata) if (rdata->msg_info.msg->line.req.method.id != PJSIP_INVITE_METHOD) { if (rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD) { pj_strdup2 (_pool, &reason, "user agent unable to handle this request "); - pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, &reason, NULL, - NULL); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, + &reason, NULL, NULL); return true; } } + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (account_id)); + + get_remote_sdp_from_offer (rdata, &r_sdp); + if(account->getActiveCodecs().empty()) { + _warn ("UserAgent: Error: No active codec"); + pj_strdup2 (_pool, &reason, "no active codec"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_NOT_ACCEPTABLE_HERE , + &reason, NULL, NULL); + return true; + } + // Verify that we can handle the request status = pjsip_inv_verify_request (rdata, &options, NULL, NULL, _endpt, NULL); - if (status != PJ_SUCCESS) { - pj_strdup2 (_pool, &reason, "user agent unable to handle this INVITE "); - pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, &reason, NULL, - NULL); + pj_strdup2 (_pool, &reason, "user agent unable to handle this INVITE"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, + &reason, NULL, NULL); return true; } @@ -3582,49 +3604,48 @@ mod_on_rx_request (pjsip_rx_data *rdata) Manager::instance().getConfigString (HOOKS, URLHOOK_COMMAND)); } } else - throw length_error ("Url exceeds std::string max_size"); + throw length_error ("UserAgent: Url exceeds std::string max_size"); } /************************************************************************************************/ - _debug ("create a new call"); + _info ("UserAgent: Create a new call"); // Generate a new call ID for the incoming call! id = Manager::instance().getNewCallID(); call = new SIPCall (id, Call::Incoming, _pool); - /* If an error occured at the call creation */ + // If an error occured at the call creation if (!call) { - _debug ("UserAgent: unable to create an incoming call"); + _warn("UserAgent: Error: Unable to create an incoming call"); + pj_strdup2 (_pool, &reason, "unable to create an incoming call"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, + &reason, NULL, NULL); return false; } - - std::string addrToUse, addrSdp ="0.0.0.0"; pjsip_tpselector *tp; - account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount (account_id)); - if (account != NULL) { // May use the published address as well addrToUse = SIPVoIPLink::instance("")->getInterfaceAddrFromName(account->getLocalInterface ()); - account->isStunEnabled () ? addrSdp = account->getPublishedAddress () : addrSdp = addrToUse; - // Set the appropriate transport to have the right VIA header - link->init_transport_selector (account->getAccountTransport (), &tp); + account->isStunEnabled () ? addrSdp = account->getPublishedAddress () : addrSdp = addrToUse; + // Set the appropriate transport to have the right VIA header + link->init_transport_selector (account->getAccountTransport (), &tp); - if(account->getAccountTransport()) { + if(account->getAccountTransport()) { - _debug("Process INVITE request using transport: %s %s (refcnt=%i)", - account->getAccountTransport()->obj_name, - account->getAccountTransport()->info, - (int)pj_atomic_get(account->getAccountTransport()->ref_cnt)); - } + _debug("UserAgent: SIP transport for this account: %s %s (refcnt=%i)", + account->getAccountTransport()->obj_name, + account->getAccountTransport()->info, + (int)pj_atomic_get(account->getAccountTransport()->ref_cnt)); + } } @@ -3636,29 +3657,11 @@ mod_on_rx_request (pjsip_rx_data *rdata) addrSdp = addrToUse; } - call->setConnectionState (Call::Progressing); - call->setPeerNumber (peerNumber); - call->setDisplayName (displayName); - call->initRecFileName(); - // Notify UI there is an incoming call - - _debug ("Add call to account link"); - - if (Manager::instance().incomingCall (call, account_id)) { - // Add this call to the callAccountMap in ManagerImpl - Manager::instance().getAccountLink (account_id)->addCall (call); - } else { - // Fail to notify UI - delete call; - call = NULL; - _debug ("UserAgent: Fail to notify UI!"); - return false; - } // Have to do some stuff with the SDP // Set the codec map, IP, peer number and so on... for the SIPCall object @@ -3671,27 +3674,29 @@ mod_on_rx_request (pjsip_rx_data *rdata) call->getAudioRtp()->initAudioRtpConfig (call); call->getAudioRtp()->initAudioRtpSession (call); } catch (...) { - _debug ("Failed to create rtp thread from answer"); + _warn ("UserAgent: Error: Failed to create rtp thread from answer"); } - get_remote_sdp_from_offer (rdata, &r_sdp); - - status = call->getLocalSDP()->receiving_initial_offer (r_sdp); + status = call->getLocalSDP()->receiving_initial_offer (r_sdp, account->getActiveCodecs ()); if (status!=PJ_SUCCESS) { - delete call; - call=0; + delete call; call = NULL; + _warn("UserAgent: fail in receiving initial offer"); + pj_strdup2 (_pool, &reason, "fail in receiving initial offer"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, + &reason, NULL, NULL); return false; } - /* Create the local dialog (UAS) */ status = pjsip_dlg_create_uas (pjsip_ua_instance(), rdata, NULL, &dialog); - if (status != PJ_SUCCESS) { - pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, &reason, NULL, - NULL); - return true; + delete call; call = NULL; + _warn("UserAgent: Error: Failed to create uas dialog"); + pj_strdup2 (_pool, &reason, "fail to create uas dialog"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, + &reason, NULL, NULL); + return false; } // Specify media capability during invite session creation @@ -3700,15 +3705,13 @@ mod_on_rx_request (pjsip_rx_data *rdata) // Explicitly set the transport, set_transport methods increment transport's reference counter status = pjsip_dlg_set_transport (dialog, tp); - // decrement transport's reference counter - // pjsip_transport_dec_ref(rdata->tp_info.transport); - PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); // Associate the call in the invite session inv->mod_data[_mod_ua.id] = call; - // Send a 180/Ringing response + // Send a 180 Ringing response + _info ("UserAgent: Send a 180 Ringing response"); status = pjsip_inv_initial_answer (inv, rdata, PJSIP_SC_RINGING, NULL, NULL, &tdata); PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1); @@ -3723,17 +3726,66 @@ mod_on_rx_request (pjsip_rx_data *rdata) // Update the connection state call->setConnectionState (Call::Ringing); + _debug ("UserAgent: Add call to account link"); + if (Manager::instance().incomingCall (call, account_id)) { + // Add this call to the callAccountMap in ManagerImpl + Manager::instance().getAccountLink (account_id)->addCall (call); + } else { + // Fail to notify UI + delete call; call = NULL; + _warn ("UserAgent: Fail to notify UI!"); + pj_strdup2 (_pool, &reason, "fail to notify ui"); + pjsip_endpt_respond_stateless (_endpt, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, + &reason, NULL, NULL); + return false; + } + /* Done */ return true; } -pj_bool_t mod_on_rx_response (pjsip_rx_data *rdata UNUSED) +pj_bool_t mod_on_rx_response (pjsip_rx_data *rdata) { - _debug ("Mod on rx response"); + _info ("UserAgent: Transaction response using transport: %s %s (refcnt=%d)", + rdata->tp_info.transport->obj_name, + rdata->tp_info.transport->info, + (int)pj_atomic_get(rdata->tp_info.transport->ref_cnt)); + + pjsip_dialog *dlg; + dlg = pjsip_rdata_get_dlg( rdata ); + + if(dlg != NULL) { + pjsip_transaction *tsx = pjsip_rdata_get_tsx( rdata ); + if ( tsx != NULL && tsx->method.id == PJSIP_INVITE_METHOD) { + if (tsx->status_code < 200) { + _info("UserAgent: Received provisional response"); + } + else if (tsx->status_code >= 300) { + _warn("UserAgent: Dialog failed"); + // pjsip_dlg_dec_session(dlg); + // ACK for non-2xx final response is sent by transaction. + } + else { + _info("UserAgent: Received 200 OK response"); + sendAck(dlg, rdata); + } + } + } + return PJ_SUCCESS; } +static void sendAck(pjsip_dialog *dlg, pjsip_rx_data *rdata) { + + pjsip_tx_data *tdata; + + // Create ACK request + pjsip_dlg_create_request(dlg, &pjsip_ack_method, rdata->msg_info.cseq->cseq, &tdata); + + pjsip_dlg_send_request( dlg, tdata,-1, NULL); +} + void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata) { @@ -3780,8 +3832,7 @@ void onCallTransfered (pjsip_inv_session *inv, pjsip_rx_data *rdata) * request. */ ref_by_hdr = (pjsip_hdr*) - pjsip_msg_find_hdr_by_name (rdata->msg_info.msg, &str_ref_by, - NULL); + pjsip_msg_find_hdr_by_name (rdata->msg_info.msg, &str_ref_by, NULL); /* Notify callback */ code = PJSIP_SC_ACCEPTED; @@ -3967,10 +4018,9 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event) * When subscription is accepted (got 200/OK to REFER), check if * subscription suppressed. */ - if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_ACCEPTED) { - _debug ("Transfer accepted! Waiting for notifications. "); + _debug ("UserAgent: Transfer received, waiting for notifications. "); } @@ -3979,6 +4029,7 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event) */ else if (pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_ACTIVE || pjsip_evsub_get_state (sub) == PJSIP_EVSUB_STATE_TERMINATED) { + pjsip_msg *msg; pjsip_msg_body *body; pjsip_status_line status_line; @@ -3986,13 +4037,6 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event) pj_bool_t cont; pj_status_t status; - std::string noresource; - std::string ringing; - std::string request; - - noresource = "noresource"; - ringing = "Ringing"; - SIPVoIPLink *link = reinterpret_cast<SIPVoIPLink *> (pjsip_evsub_get_mod_data (sub, _mod_ua.id)); @@ -4006,101 +4050,73 @@ void xfer_func_cb (pjsip_evsub *sub, pjsip_event *event) } + /* Application is not interested with call progress status */ if (!link || !event) { - /* Application is not interested with call progress status */ - _debug ("UserAgent: Either link or event is empty!"); + _warn ("UserAgent: Either link or event is empty in transfer callback"); return; } + pjsip_rx_data* r_data = event->body.rx_msg.rdata; - /* This better be a NOTIFY request */ - if (event->type == PJSIP_EVENT_TSX_STATE && - event->body.tsx_state.type == PJSIP_EVENT_RX_MSG) { - - pjsip_rx_data *rdata; - - rdata = event->body.tsx_state.src.rdata; + std::string method_notify = "NOTIFY"; + std::string request = pjsip_rx_data_get_info (r_data); + /* This better be a NOTIFY request */ + if (r_data->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD && + request.find(method_notify) != (size_t)-1) { /* Check if there's body */ - msg = rdata->msg_info.msg; + msg = r_data->msg_info.msg; body = msg->body; if (!body) { - // if (call->getCallConfiguration () == Call::IPtoIP) { - // _debug("UserAgent: IptoIp NOTIFY without message body"); - // } - // else{ - _debug ("UserAgent: Warning! Received NOTIFY without message body"); + _warn ("UserAgent: Warning! Received NOTIFY without message body"); return; - // } } - - /* Check for appropriate content */ if (pj_stricmp2 (&body->content_type.type, "message") != 0 || pj_stricmp2 (&body->content_type.subtype, "sipfrag") != 0) { - _debug ("UserAgent: Warning! Received NOTIFY with non message/sipfrag content"); + _warn ("UserAgent: Warning! Received NOTIFY without message/sipfrag content"); return; } /* Try to parse the content */ - status = pjsip_parse_status_line ( (char*) body->data, body->len, - &status_line); + status = pjsip_parse_status_line ( (char*) body->data, body->len, &status_line); if (status != PJ_SUCCESS) { - _debug ("UserAgent: Warning! Received NOTIFY with invalid message/sipfrag content"); + _warn ("UserAgent: Warning! Received NOTIFY with invalid message/sipfrag content"); return; } } else { - _debug ("UserAgent: Set code to 500!"); + _error ("UserAgent: Error: Set code to 500 during transfer"); status_line.code = 500; status_line.reason = *pjsip_get_status_text (500); } - // Get current call - SIPCall *call = dynamic_cast<SIPCall *> (link->getCall (Manager::instance().getCurrentCallId())); + // Get call coresponding to this transaction + std::string transferID(r_data->msg_info.cid->id.ptr, r_data->msg_info.cid->id.slen); + std::map<std::string, CallID>::iterator it = transferCallID.find(transferID); + CallID cid = it->second; + SIPCall *call = dynamic_cast<SIPCall *> (link->getCall (cid)); if (!call) { - _debug ("UserAgent: Call doesn't exit!"); + _warn ("UserAgent: Call with id %s doesn't exit!", cid.c_str()); return; } - if (event->body.rx_msg.rdata->msg_info.msg_buf != NULL) { - request = event->body.rx_msg.rdata->msg_info.msg_buf; - - if ( (int) request.find (noresource) != -1) { - _debug ("UserAgent: NORESOURCE for transfer!"); - link->transferStep2 (call); - pjsip_evsub_terminate (sub, PJ_TRUE); - - Manager::instance().transferFailed(); - return; - } - - if ( (int) request.find (ringing) != -1) { - _debug ("UserAgent: transfered call RINGING!"); - link->transferStep2 (call); - pjsip_evsub_terminate (sub, PJ_TRUE); - - Manager::instance().transferSucceded(); - return; - } - } - - /* Notify application */ is_last = (pjsip_evsub_get_state (sub) ==PJSIP_EVSUB_STATE_TERMINATED); cont = !is_last; + _debug("UserAgent: Notification status line: %d", status_line.code); if (status_line.code/100 == 2) { - _debug ("UserAgent: Try to stop rtp!"); + _debug ("UserAgent: Received 200 OK on call transfered, stop call!"); pjsip_tx_data *tdata; status = pjsip_inv_end_session (call->getInvSession(), PJSIP_SC_GONE, NULL, &tdata); @@ -4157,10 +4173,11 @@ void xfer_svr_cb (pjsip_evsub *sub, pjsip_event *event) void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer) { + _info("UserAgent: Received SDP offer"); #ifdef CAN_REINVITE - _debug ("%s (%d): on_rx_offer REINVITE", __FILE__, __LINE__); + _debug ("UserAgent: %s (%d): on_rx_offer REINVITE", __FILE__, __LINE__); SIPCall *call; pj_status_t status; @@ -4176,7 +4193,7 @@ void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer) link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accId)); - call->getLocalSDP()->receiving_initial_offer ( (pjmedia_sdp_session*) offer); + // call->getLocalSDP()->receiving_initial_offer ( (pjmedia_sdp_session*) offer, account->getActiveCodecs ()); status=pjsip_inv_set_sdp_answer (call->getInvSession(), call->getLocalSDP()->get_local_sdp_session()); @@ -4187,6 +4204,50 @@ void on_rx_offer (pjsip_inv_session *inv, const pjmedia_sdp_session *offer) } +void on_create_offer(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer) +{ + _info("UserAgent: Create new SDP offer"); + + /* Retrieve the call information */ + SIPCall * call = NULL; + call = reinterpret_cast<SIPCall*> (inv->mod_data[_mod_ua.id]); + + CallID callid = call->getCallId(); + AccountID accountid = Manager::instance().getAccountFromCall(callid); + + SIPAccount *account = dynamic_cast<SIPAccount *>(Manager::instance().getAccount(accountid)); + + SIPVoIPLink *link = dynamic_cast<SIPVoIPLink *> (Manager::instance().getAccountLink (accountid)); + + // Set the local address + std::string localAddress = link->getInterfaceAddrFromName(account->getLocalInterface ()); + // Set SDP parameters - Set to local + std::string addrSdp = localAddress; + + _debug ("UserAgent: Local Address for IP2IP call: %s", localAddress.c_str()); + + // If local address bound to ANY, reslove it using PJSIP + if (localAddress == "0.0.0.0") { + link->loadSIPLocalIP (&localAddress); + } + + // Local address to appear in SDP + if (addrSdp == "0.0.0.0") { + addrSdp = localAddress; + } + + // Set local address for RTP media + setCallAudioLocal (call, localAddress); + + // Building the local SDP offer + call->getLocalSDP()->set_ip_address (addrSdp); + call->getLocalSDP()->create_initial_offer( account->getActiveCodecs() ); + + *p_offer = call->getLocalSDP()->get_local_sdp_session(); + +} + + void handle_incoming_options (pjsip_rx_data *rdata) { diff --git a/sflphone-common/src/sip/sipvoiplink.h b/sflphone-common/src/sip/sipvoiplink.h index 94b08bdc898182a9c22163b5634942cca67275a1..119c83c3dc9fb0215f8d8abda095d6443ce3dbee 100644 --- a/sflphone-common/src/sip/sipvoiplink.h +++ b/sflphone-common/src/sip/sipvoiplink.h @@ -47,7 +47,7 @@ class SIPCall; #define RANDOM_SIP_PORT rand() % 64000 + 1024 // To set the verbosity. From 0 (min) to 6 (max) -#define PJ_LOG_LEVEL 6 +#define PJ_LOG_LEVEL 0 #define SipTransportMap std::map<std::string, pjsip_transport*> @@ -178,13 +178,23 @@ class SIPVoIPLink : public VoIPLink bool refuse (const CallID& id); /** - * Send DTMF + * Send DTMF refering to account configuration * @param id The call identifier * @param code The char code * @return bool True on success */ bool carryingDTMFdigits(const CallID& id, char code); + /** + * Send Dtmf using SIP INFO message + */ + bool dtmfSipInfo(SIPCall *call, char code); + + /** + * Send Dtmf over RTP + */ + bool dtmfOverRtp(SIPCall* call, char code); + /** * Terminate every call not hangup | brutal | Protected by mutex */ @@ -280,7 +290,7 @@ class SIPVoIPLink : public VoIPLink bool new_ip_to_ip_call (const CallID& id, const std::string& to); - std::string get_useragent_name (void); + std::string get_useragent_name (const AccountID& id); /** * List all the interfaces on the system and return @@ -332,10 +342,6 @@ class SIPVoIPLink : public VoIPLink */ bool loadSIPLocalIP (std::string *addr); - /** - * This method is used to create a new transport and attach it to the appropriate account - */ - void updateAccountInfo(const AccountID& accountID); /** * This function unset the transport for a given account. It tests wether the @@ -375,7 +381,7 @@ class SIPVoIPLink : public VoIPLink bool pjsip_init(); /** - * Delete link-related stuuf like calls + * Delete link-related stuff like calls */ bool pjsip_shutdown(void); @@ -386,69 +392,93 @@ class SIPVoIPLink : public VoIPLink * Function used to create a new sip transport or get an existing one from the map. * The SIP transport is "acquired" according to account's current settings. * This function should be called before registering an account - * @param accountID An account id for which transport is to be set + * @param accountID An account id for which transport is to be set * - * @return bool True if the account is succesfully created or - * successfully obtained from the transport map + * @return bool True if the account is succesfully created or successfully obtained + * from the transport map */ bool acquireTransport(const AccountID& accountID); /** - * Create a new sip transport according to the trasport type specified in account settings + * Create the default UDP transport according ot Ip2Ip profile settings + */ + bool createDefaultSipUdpTransport(); + + + /** + * Create the default TLS litener using IP2IP_PROFILE settings + */ + void createDefaultSipTlsListener(); + + + /** + * Create the default TLS litener according to account settings. + */ + void createTlsListener(const AccountID& accountID); + + + /** + * General Sip transport creation method according to the + * transport type specified in account settings + * @param id The account id for which a transport must + * be created. */ bool createSipTransport(AccountID id); + /** + * Method to store newly created UDP transport in internal transport map. + * Transports are stored in order to retreive them in case + * several accounts would share the same port number for UDP transprt. + * @param key The transport's port number + * @param transport A pointer to the UDP transport + */ bool addTransportToMap(std::string key, pjsip_transport* transport); - /** Create SIP UDP Listener */ - int createUDPServer (AccountID = ""); - - /** - * Try to create a new TLS transport - * with the settings defined in the corresponding - * SIPAccount with id "id". If creatation fails - * for whatever reason, it will try to start - * it again on a randomly chosen port. - * - * A better idea would be to list all the transports - * registered to the transport manager in order to find - * an available port. Note that creation might also fail - * for other reason than just a wrong port. - * - * @param id The account id for which a tranport must - * be created. - * @return pj_status_t PJ_SUCCESS on success - */ - pj_status_t createTlsTransportRetryOnFailure(AccountID id); + /** + * Create SIP UDP transport from account's setting + * @param id The account id for which a transport must + * be created. + * @return pj_status_t PJ_SUCCESS on success + */ + int createUdpTransport (AccountID = ""); - /** - * Try to create a TLS transport with the settings - * defined in the corresponding SIPAccount with id - * "id". - * @param id The account id for which a transport must - * be created. - * @return pj_status_t PJ_SUCCESS on success - */ - pj_status_t createTlsTransport(AccountID id); + /** + * Create a TLS transport from the default TLS listener from + * @param id The account id for which a transport must + * be created. + * @return pj_status_t PJ_SUCCESS on success + */ + pj_status_t createTlsTransport(const AccountID& id, std::string remoteAddr); + /** + * Create a UDP transport using stun server to resove public address + * @param id The account id for which a transport must + * be created. + * @return pj_status_t PJ_SUCCESS on success + */ pj_status_t createAlternateUdpTransport (AccountID id); + + /** + * UDP Transports are stored in this map in order to retreive them in case + * several accounts would share the same port number. + */ SipTransportMap _transportMap; - /** For registration use only */ - int _regPort; + /** For registration use only */ + int _regPort; - /** Threading object */ - EventThread* _evThread; - ost::Mutex _mutexSIP; + /** Threading object */ + EventThread* _evThread; + ost::Mutex _mutexSIP; - /* Number of SIP accounts connected to the link */ - int _clients; + /* Number of SIP accounts connected to the link */ + int _clients; - /* - * Get the correct address to use (ie advertised) from + /* + * Get the correct address to use (ie advertised) from * a uri. The corresponding transport that should be used * with that uri will be discovered. * diff --git a/sflphone-common/src/user_cfg.h b/sflphone-common/src/user_cfg.h index 652027dc7481634f47d04c5d084c446627a90e37..4e8ce791b81fe8d0d6d221519bc3c35deebeab64 100644 --- a/sflphone-common/src/user_cfg.h +++ b/sflphone-common/src/user_cfg.h @@ -31,44 +31,50 @@ #define ACCOUNT_IAX0 "IAX0" /** Account type IAX */ /** User configuration file fields */ -#define AUDIO "Audio" /** Section Audio */ -#define CODECS "ActiveCodecs" /** List of active codecs */ +#define AUDIO "Audio" /** Section Audio */ +#define CODECS "ActiveCodecs" /** List of active codecs */ #define ALSA_CARD_ID_IN "Alsa.cardID_In" /** Soundcard index to use for capture */ #define ALSA_CARD_ID_OUT "Alsa.cardID_Out" /** Soundcard index to use for playback */ #define ALSA_FRAME_SIZE "Alsa.framesize" /** Audio layer frame size */ -#define ALSA_PLUGIN "Alsa.plugin" /** Alsa plugin */ -#define ALSA_SAMPLE_RATE "Alsa.sampleRate" /** Audio layer sample rate */ -#define RING_CHOICE "Rings.ringChoice" /** Ringtone */ -#define VOLUME_SPKR "Volume.speakers" /** Speaker volume */ +#define ALSA_PLUGIN "Alsa.plugin" /** Alsa plugin */ +#define AUDIO_SAMPLE_RATE "Alsa.sampleRate" /** Audio layer sample rate */ +#define RING_CHOICE "Rings.ringChoice" /** Ringtone */ +#define VOLUME_SPKR "Volume.speakers" /** Speaker volume */ #define VOLUME_MICRO "Volume.micro" /** Mic volume */ #define RECORD_PATH "Record.path" /** Recording path */ -#define PREFERENCES "Preferences" /** Section Preferences */ +#define PREFERENCES "Preferences" /** Section Preferences */ #define CONFIG_MD5HASH "md5Hash" /** Option to store credential as md5 hash*/ -#define CONFIG_DIALPAD "Dialpad.display" /** Display dialpad preferences */ +#define CONFIG_DIALPAD "Dialpad.display" /** Display dialpad preferences */ #define CONFIG_SEARCHBAR "Searchbar.display" /** Whether or nor display the search bar */ #define CONFIG_HISTORY_LIMIT "History.limit" /** Set the maximum number of days kept */ #define CONFIG_HISTORY_ENABLED "History.enabled" /** Is the history enabled or not */ #define CONFIG_NOTIFY "Notify.all" /** Desktop notification level */ #define CONFIG_MAIL_NOTIFY "Notify.mails" /** Desktop mail notification level */ -#define ZONE_TONE "Options.zoneToneChoice" /** Country tone */ -#define CONFIG_RINGTONE "Ringtones.enable" /** Ringtones preferences */ -#define CONFIG_START "Start.hidden" /** SFLphone starts in the systm tray or not */ -#define CONFIG_POPUP "Window.popup" /** SFLphone pops up on incoming calls or not */ -#define CONFIG_VOLUME "Volume.display" /** Display the mic and speaker volume controls */ +#define ZONE_TONE "Options.zoneToneChoice" /** Country tone */ +#define CONFIG_RINGTONE "Ringtones.enable" /** Ringtones preferences */ +#define CONFIG_START "Start.hidden" /** SFLphone starts in the systm tray or not */ +#define CONFIG_POPUP "Window.popup" /** SFLphone pops up on incoming calls or not */ +#define CONFIG_VOLUME "Volume.display" /** Display the mic and speaker volume controls */ #define CONFIG_AUDIO "Audio.api" /** Audio manager (ALSA or pulseaudio) */ #define CONFIG_PA_VOLUME_CTRL "Pulseaudio.volumeCtrl" /** Whether or not PA should modify volume of other applications on the same sink */ #define CONFIG_SIP_PORT "SIP.portNum" #define CONFIG_ACCOUNTS_ORDER "Accounts.order" /** To restore account order */ +#define WINDOW_WIDTH "Window.width" +#define WINDOW_HEIGHT "Window.height" +#define WINDOW_POSITION_X "Window.positionX" +#define WINDOW_POSITION_Y "Window.positionY" +#define SHOW_STATUSICON "Statusicon.show" + #define IP2IP_PROFILE "IP2IP" #define SIGNALISATION "VoIPLink" /** Section Signalisation */ #define ZRTP_ZIDFILE "ZRTP.zidFile" /** The filename used for storing ZIDs */ -#define PLAY_DTMF "DTMF.playDtmf" /** Whether or not should play dtmf */ -#define PLAY_TONES "DTMF.playTones" /** Whether or not should play tones */ +#define PLAY_DTMF "DTMF.playDtmf" /** Whether or not should play dtmf */ +#define PLAY_TONES "DTMF.playTones" /** Whether or not should play tones */ #define PULSE_LENGTH "DTMF.pulseLength" /** Length of the DTMF in millisecond */ #define SEND_DTMF_AS "DTMF.sendDTMFas" /** DTMF send mode */ -#define SYMMETRIC "VoIPLink.symmetric" /** VoIP link type */ +#define SYMMETRIC "VoIPLink.symmetric" /** VoIP link type */ #define ADDRESSBOOK "Addressbook" /** Address book section */ #define ADDRESSBOOK_ENABLE "Addressbook.enable" /** Enable address book */ @@ -87,28 +93,31 @@ #define PHONE_NUMBER_HOOK_ENABLED "Hooks.phone_number_enabled" #define PHONE_NUMBER_HOOK_ADD_PREFIX "Hooks.phone_number_add_prefix" -#define EMPTY_FIELD "" /** Default value for empty field */ +#define EMPTY_FIELD "" /** Default value for empty field */ #define DEFAULT_ACCOUNT_TYPE "SIP" -#define DFT_STUN_SERVER "stun.sflphone.org" /** Default STUN server address */ -#define TRUE_STR "true" /** Default YES value */ -#define FALSE_STR "false" /** Default NO value */ +#define DFT_STUN_SERVER "stun.sflphone.org" /** Default STUN server address */ +#define TRUE_STR "true" /** Default YES value */ +#define FALSE_STR "false" /** Default NO value */ #define DFT_PULSE_LENGTH_STR "250" /** Default DTMF lenght */ -#define SIP_INFO_STR "0" /** Default DTMF transport mode */ -#define ALSA_DFT_CARD "0" /** Default sound card index */ -#define DFT_VOL_SPKR_STR "100" /** Default speaker volume */ -#define DFT_VOL_MICRO_STR "100" /** Default mic volume */ -#define DFT_RINGTONE "konga.ul" /** Default ringtone */ -#define DFT_ZONE "North America" /** Default geographical zone */ -#define DFT_VOICEMAIL "888" /** Default voicemail number */ -#define DFT_FRAME_SIZE "20" /** Default frame size in millisecond */ -#define DFT_SAMPLE_RATE "44100" /** Default sample rate in HZ */ -#define DFT_NOTIF_LEVEL "2" /** Default desktop notification level : maximum */ -#define DFT_HISTORY_LIMIT "30" /** Default maximum days in history */ -#define DFT_EXPIRE_VALUE "600" /** Default expire value for registration */ -#define DFT_RESOLVE_ONCE FALSE_STR -#define DFT_AUDIO_MANAGER "1" /** Default audio manager */ +#define SIP_INFO_STR "0" /** Default DTMF transport mode */ +#define ALSA_DFT_CARD "0" /** Default sound card index */ +#define DFT_VOL_SPKR_STR "100" /** Default speaker volume */ +#define DFT_VOL_MICRO_STR "100" /** Default mic volume */ +#define DFT_RINGTONE "konga.ul" /** Default ringtone */ +#define DFT_ZONE "North America" /** Default geographical zone */ +#define DFT_VOICEMAIL "888" /** Default voicemail number */ +#define DFT_FRAME_SIZE "20" /** Default frame size in millisecond */ +#define DFT_SAMPLE_RATE "44100" /** Default sample rate in HZ */ +#define DFT_NOTIF_LEVEL "2" /** Default desktop notification level : maximum */ +#define DFT_HISTORY_LIMIT "30" /** Default maximum days in history */ +#define DFT_EXPIRE_VALUE "600" /** Default expire value for registration */ +#define DFT_RESOLVE_ONCE FALSE_STR +#define DFT_AUDIO_MANAGER "1" /** Default audio manager */ #define DFT_SIP_PORT "5060" #define DFT_STUN_ENABLE FALSE_STR #define DFT_RECORD_PATH HOMEDIR +#define DFT_WINDOW_WIDTH "240" +#define DFT_WINDOW_HEIGHT "320" +#define DFT_USERAGENT "sflphone" //PROGNAME + "/" + SFLPHONED_VERSION #endif // __USER_CFG_H__ diff --git a/sflphone-common/test/Makefile.am b/sflphone-common/test/Makefile.am index e3679eb678549f698cf3d25c20c994b7c10a4bdf..c2371cd96a0f32b938b6be9b31d5cfb48021443d 100644 --- a/sflphone-common/test/Makefile.am +++ b/sflphone-common/test/Makefile.am @@ -1,9 +1,51 @@ include ../globals.mak - -noinst_PROGRAMS = numbercleanerTester pluginmanagerTester hookmanagerTester audiolayerTester historyTester mainbufferTester sdesnegotiatorTester #rtpTester - -OBJECT_FILES= \ +TESTS = test +check_PROGRAMS = $(TESTS) +test_CXXFLAGS = $(CPPUNIT_CFLAGS) +test_LDADD = $(LLIBS) +test_LDFLAGS = -ldl +test_SOURCES = main.cpp \ + validator.cpp \ + validator.h \ + accounttest.h \ + accounttest.cpp \ + audiolayertest.h \ + audiolayertest.cpp \ + configurationtest.h \ + configurationtest.cpp \ + historytest.h \ + historytest.cpp \ + hookmanagertest.h \ + hookmanagertest.cpp \ + mainbuffertest.h \ + mainbuffertest.cpp \ + numbercleanertest.h \ + numbercleanertest.cpp \ + pluginmanagertest.h \ + pluginmanagertest.cpp \ + rtptest.h \ + rtptest.cpp \ + sdesnegotiatortest.h \ + sdesnegotiatortest.cpp + + + + +LLIBS=$(CPPUNIT_LIBS) \ + ../src/libsflphone.la \ + $(ZEROCONFLIB) \ + $(LIB_DNSSD) \ + @ALSA_LIBS@ \ + @PULSEAUDIO_LIBS@ \ + @CPPUNIT_LIBS@ \ + @CCEXT2_LIBS@ \ + @CCGNU2_LIBS@ \ + @CCRTP_LIBS@ \ + @ZRTPCPP_LIBS@ \ + @libssl_LIBS@ \ + @SAMPLERATE_LIBS@ \ + $(PJSIP_LIBS) \ ../src/sflphoned-logger.o \ ../src/sflphoned-managerimpl.o \ ../src/sflphoned-account.o\ @@ -26,145 +68,4 @@ OBJECT_FILES= \ ../src/plug-in/pluginmanager.o \ ../src/plug-in/audiorecorder/audiorecord.o \ ../src/audio/samplerateconverter.o \ - ../src/history/historymanager.o - ../ - -numbercleanerTester_SOURCES = \ - numbercleanerTest.h \ - numbercleanerTest.cpp \ - TestMain.cpp - -numbercleanerTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @SAMPLERATE_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) - -pluginmanagerTester_SOURCES = \ - pluginmanagerTest.h \ - pluginmanagerTest.cpp \ - TestMain.cpp - -pluginmanagerTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - @SAMPLERATE_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) - -hookmanagerTester_SOURCES = \ - hookmanagerTest.cpp \ - TestMain.cpp - -hookmanagerTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - @SAMPLERATE_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) - -audiolayerTester_SOURCES = \ - audiolayerTest.h \ - audiolayerTest.cpp \ - TestMain.cpp - -audiolayerTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - @SAMPLERATE_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) - -historyTester_SOURCES = \ - historyTest.h \ - historyTest.cpp \ - TestMain.cpp - -historyTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - @SAMPLERATE_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) - - -mainbufferTester_SOURCES = \ - mainbufferTest.h \ - mainbufferTest.cpp \ - TestMain.cpp - -mainbufferTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - @SAMPLERATE_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) - -sdesnegotiatorTester_SOURCES = \ - sdesnegotiatorTest.h \ - sdesnegotiatorTest.cpp \ - TestMain.cpp - -sdesnegotiatorTester_LDADD = \ - ../src/libsflphone.la \ - $(SFLPHONE_LIBS) $(ZEROCONFLIB) $(LIB_DNSSD) \ - @ALSA_LIBS@ \ - @PULSEAUDIO_LIBS@ \ - @CPPUNIT_LIBS@ \ - @CCEXT2_LIBS@ \ - @CCGNU2_LIBS@ \ - @CCRTP_LIBS@ \ - @ZRTPCPP_LIBS@ \ - @libssl_LIBS@ \ - @SAMPLERATE_LIBS@ \ - $(PJSIP_LIBS) \ - $(OBJECT_FILES) + ../src/history/historymanager.o \ No newline at end of file diff --git a/sflphone-common/test/README b/sflphone-common/test/README deleted file mode 100644 index d090ea2cea1700e290c7f42e1e7da091b3ac4f47..0000000000000000000000000000000000000000 --- a/sflphone-common/test/README +++ /dev/null @@ -1 +0,0 @@ -The daemon has to be recompiled before compiling the unitary tests. diff --git a/sflphone-common/test/TestMain.cpp b/sflphone-common/test/TestMain.cpp deleted file mode 100644 index d6e9f932bfb83bbba4442748945c5fd8c53e406b..0000000000000000000000000000000000000000 --- a/sflphone-common/test/TestMain.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include <cppunit/TextTestRunner.h> -#include <cppunit/extensions/TestFactoryRegistry.h> - -int main (int argc, const char* argv[]) -{ - CppUnit::TextTestRunner runner; - runner.addTest (CppUnit::TestFactoryRegistry::getRegistry().makeTest()); - - return runner.run(); - -} - diff --git a/sflphone-common/test/accounttest.cpp b/sflphone-common/test/accounttest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..412a1b8b96f17dbd126ce7b3a25a33cac2e53f65 --- /dev/null +++ b/sflphone-common/test/accounttest.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2004-2007 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <cppunit/extensions/HelperMacros.h> +#include <map> +#include "accounttest.h" +#include "manager.h" +#include "logger.h" +#include "validator.h" + +void AccountTest::TestAddRemove(void) { + _debug ("-------------------- AccountTest::TestAddRemove --------------------\n"); + + std::map<std::string, std::string> details; + details[CONFIG_ACCOUNT_TYPE] = "SIP"; + details[CONFIG_ACCOUNT_ENABLE] = "false"; + + std::string accountId = Manager::instance().addAccount(details); + CPPUNIT_ASSERT(Validator::isNotNull(accountId)); + CPPUNIT_ASSERT(Manager::instance().accountExists(accountId)); + + Manager::instance().removeAccount(accountId); + + CPPUNIT_ASSERT(!Manager::instance().accountExists(accountId)); +} diff --git a/sflphone-common/test/accounttest.h b/sflphone-common/test/accounttest.h new file mode 100644 index 0000000000000000000000000000000000000000..61541c306881ee79bee6ed40a6307fb59017c213 --- /dev/null +++ b/sflphone-common/test/accounttest.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2004-2007 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef ACCOUNTTEST_H_ +#define ACCOUNTTEST_H_ + +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> + +class AccountTest : public CppUnit::TestFixture { + + CPPUNIT_TEST_SUITE( AccountTest ); + CPPUNIT_TEST( TestAddRemove ); + CPPUNIT_TEST_SUITE_END(); + + public: + void TestAddRemove(void); +}; +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AccountTest, "AccountTest"); +CPPUNIT_TEST_SUITE_REGISTRATION( AccountTest ); + +#endif /* ACCOUNTTEST_H_ */ diff --git a/sflphone-common/test/audiolayerTest.cpp b/sflphone-common/test/audiolayerTest.cpp deleted file mode 100644 index 065b396c47ba801d95da7aa082610f4c861322dd..0000000000000000000000000000000000000000 --- a/sflphone-common/test/audiolayerTest.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <sstream> - -#include "audiolayerTest.h" - -#include <unistd.h> - - -using std::cout; -using std::endl; - - - -void AudioLayerTest::setUp() -{ - - // Instanciate the manager - Manager::instance().init(); - Manager::instance().initConfigFile(); - - // _audiodriver = Manager::instance().getAudioDriver(); - - // std::string alsaPlugin; - // AlsaLayer *alsalayer; - - // int numCardIn, numCardOut, sampleRate, frameSize; - // layer = _audiodriver->getLayerType(); - - /* - alsaPlugin = Manager::instance().getConfigString( AUDIO , ALSA_PLUGIN ); - numCardIn = Manager::instance().getConfigInt( AUDIO , ALSA_CARD_ID_IN ); - numCardOut = Manager::instance().getConfigInt( AUDIO , ALSA_CARD_ID_OUT ); - sampleRate = Manager::instance().getConfigInt( AUDIO , ALSA_SAMPLE_RATE ); - if (sampleRate <=0 || sampleRate > 48000) { - sampleRate = 44100; - } - frameSize = Manager::instance().getConfigInt(AUDIO, ALSA_FRAME_SIZE ); - */ - - // get a pointer to the audio layer - // _audiodriver = Manager::instance().getAudioDriver(); - -} - -void AudioLayerTest::testAudioLayerConfig() -{ - int sampling_rate = Manager::instance().getConfigInt (AUDIO, ALSA_SAMPLE_RATE); - int frame_size = Manager::instance().getConfigInt (AUDIO, ALSA_FRAME_SIZE); - frame_size = 0; // frame size in config not used anymore - - int layer = Manager::instance().getAudioDriver()->getLayerType(); - - if (layer != ALSA) - Manager::instance().switchAudioManager(); - - CPPUNIT_ASSERT ( (int) Manager::instance().getAudioDriver()->getSampleRate() == sampling_rate); - - CPPUNIT_ASSERT ( (int) Manager::instance().getAudioDriver()->getFrameSize() == frame_size); -} - -void AudioLayerTest::testAudioLayerSwitch() -{ - - _debug ("---------- AudioLayerTest::testAudioLayerSwitch ---------------------------"); - - - int previous_layer = Manager::instance().getAudioDriver()->getLayerType(); - - for (int i = 0; i < 2; i++) { - _debug ("---------- AudioLayerTest::testAudioLayerSwitch - %i -------------",i); - Manager::instance().switchAudioManager(); - - if (previous_layer == ALSA) { - CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getLayerType() == PULSEAUDIO); - } else { - CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getLayerType() == ALSA); - } - - previous_layer = Manager::instance().getAudioDriver()->getLayerType(); - - usleep (100000); - } -} - - - -void AudioLayerTest::testPulseConnect() -{ - - _debug ("---------- AudioLayerTest::testPulseConnect ---------------------------"); - - ManagerImpl* manager; - manager = &Manager::instance(); - - // _pulselayer = new PulseLayer (manager); - _pulselayer = (PulseLayer*) Manager::instance().getAudioDriver(); - - CPPUNIT_ASSERT (_pulselayer->getLayerType() == PULSEAUDIO); - - std::string alsaPlugin; - int numCardIn, numCardOut, sampleRate, frameSize; - - alsaPlugin = manager->getConfigString (AUDIO , ALSA_PLUGIN); - numCardIn = manager->getConfigInt (AUDIO , ALSA_CARD_ID_IN); - numCardOut = manager->getConfigInt (AUDIO , ALSA_CARD_ID_OUT); - sampleRate = manager->getConfigInt (AUDIO , ALSA_SAMPLE_RATE); - frameSize = manager->getConfigInt (AUDIO, ALSA_FRAME_SIZE); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream() == NULL); - CPPUNIT_ASSERT (_pulselayer->getRecordStream() == NULL); - - _pulselayer->setErrorMessage (-1); - - try { - CPPUNIT_ASSERT (_pulselayer->openDevice (numCardIn, numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin) == true); - } catch (...) { - _debug ("Exception occured wile opening device! "); - } - - usleep (100000); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream() == NULL); - CPPUNIT_ASSERT (_pulselayer->getRecordStream() == NULL); - - // CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); - // CPPUNIT_ASSERT (_pulselayer->getRecordStream()->pulseStream() != NULL); - - // Must return Access failure "PA_ERR_ACCESS" == 2 - // CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 2); - // CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 2); - _debug ("-------------------------- \n"); - _pulselayer->startStream (); - - // usleep(1000000); - - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); - - // Must return No error "PA_OK" == 1 - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); - CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->disconnectStream() == true); - CPPUNIT_ASSERT (_pulselayer->getRecordStream()->disconnectStream() == true); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true); - CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); - CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true); - CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true); - - CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); - CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); - - // usleep(1000000); - CPPUNIT_ASSERT (_pulselayer->disconnectAudioStream() == true); - -} - - -void AudioLayerTest::testAlsaConnect() -{ - - _debug ("---------- AudioLayerTest::testAlsaConnect ---------------------------"); - - int layer = Manager::instance().getAudioDriver()->getLayerType(); - - std::string alsaPlugin; - - if (layer != ALSA) { - Manager::instance().switchAudioManager(); - usleep (100000); - } - - // _audiolayer = Manager::instance().getAudioDriver(); - - // CPPUNIT_ASSERT(_audiolayer->closeLayer() == true); - // usleep(100000); - - // delete _audiolayer; _audiolayer == NULL; - - Manager::instance().setConfig (PREFERENCES, CONFIG_AUDIO, ALSA); - - - // _audiolayer->setErrorMessage(-1); - // CPPUNIT_ASSERT(Manager::instance().initAudioDriver() == true); - - // _audiolayer = Manager::instance().getAudioDriver(); - - // CPPUNIT_ASSERT(_audiolayer->getLayerType() == ALSA); - -} - -void AudioLayerTest::tearDown() -{ - // Delete the audio recorder module - // delete _ar; _ar = NULL; -} diff --git a/sflphone-common/test/audiolayertest.cpp b/sflphone-common/test/audiolayertest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7ea619ae2a84ccddbb11e17cc1d4e747e3f64ee2 --- /dev/null +++ b/sflphone-common/test/audiolayertest.cpp @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> + +#include "audiolayertest.h" + +#include <unistd.h> + +using std::cout; +using std::endl; + +void AudioLayerTest::testAudioLayerConfig() { + _debug ("-------------------- AudioLayerTest::testAudioLayerConfig --------------------\n"); + + int sampling_rate = Manager::instance().getConfigInt(AUDIO, + AUDIO_SAMPLE_RATE); + int frame_size = Manager::instance().getConfigInt(AUDIO, ALSA_FRAME_SIZE); + + int layer = Manager::instance().getAudioDriver()->getLayerType(); + + if (layer != ALSA) + Manager::instance().switchAudioManager(); + + // TODO: Fix tests + //CPPUNIT_ASSERT ( (int) Manager::instance().getAudioDriver()->getSampleRate() == sampling_rate); + + //CPPPUNIT_ASSERT ( (int) Manager::instance().getAudioDriver()->getFrameSize() == frame_size); +} + +void AudioLayerTest::testAudioLayerSwitch() { + _debug ("-------------------- AudioLayerTest::testAudioLayerSwitch --------------------\n"); + + int previous_layer = Manager::instance().getAudioDriver()->getLayerType(); + + for (int i = 0; i < 2; i++) { + _debug ("iter - %i",i); + Manager::instance().switchAudioManager(); + + if (previous_layer == ALSA) { + CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getLayerType() == PULSEAUDIO); + } else { + CPPUNIT_ASSERT (Manager::instance().getAudioDriver()->getLayerType() == ALSA); + } + + previous_layer = Manager::instance().getAudioDriver()->getLayerType(); + + usleep(100000); + } +} + +void AudioLayerTest::testPulseConnect() { + _debug ("-------------------- AudioLayerTest::testPulseConnect --------------------\n"); + + if (Manager::instance().getAudioDriver()->getLayerType() == ALSA) + return; + + ManagerImpl* manager; + manager = &Manager::instance(); + + _pulselayer = (PulseLayer*) Manager::instance().getAudioDriver(); + + CPPUNIT_ASSERT (_pulselayer->getLayerType() == PULSEAUDIO); + + std::string alsaPlugin; + int numCardIn, numCardOut, sampleRate, frameSize; + + alsaPlugin = manager->getConfigString(AUDIO, ALSA_PLUGIN); + numCardIn = manager->getConfigInt(AUDIO, ALSA_CARD_ID_IN); + numCardOut = manager->getConfigInt(AUDIO, ALSA_CARD_ID_OUT); + sampleRate = manager->getConfigInt(AUDIO, AUDIO_SAMPLE_RATE); + frameSize = manager->getConfigInt(AUDIO, ALSA_FRAME_SIZE); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream() == NULL); + CPPUNIT_ASSERT (_pulselayer->getRecordStream() == NULL); + + _pulselayer->setErrorMessage(-1); + + try { + CPPUNIT_ASSERT (_pulselayer->openDevice (numCardIn, numCardOut, sampleRate, frameSize, SFL_PCM_BOTH, alsaPlugin) == true); + } catch (...) { + _debug ("Exception occured wile opening device! "); + } + + usleep(100000); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream() == NULL); + CPPUNIT_ASSERT (_pulselayer->getRecordStream() == NULL); + + _debug ("-------------------------- \n"); + _pulselayer->startStream(); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->pulseStream() != NULL); + + // Must return No error "PA_OK" == 1 + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->disconnectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->disconnectStream() == true); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->connectStream() == true); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->connectStream() == true); + + CPPUNIT_ASSERT (_pulselayer->getPlaybackStream()->getStreamState() == 1); + CPPUNIT_ASSERT (_pulselayer->getRecordStream()->getStreamState() == 1); + + CPPUNIT_ASSERT (_pulselayer->disconnectAudioStream() == true); +} diff --git a/sflphone-common/test/audiolayerTest.h b/sflphone-common/test/audiolayertest.h similarity index 55% rename from sflphone-common/test/audiolayerTest.h rename to sflphone-common/test/audiolayertest.h index 7bda91c508c61ce2c100bffe42e798f9f0a0c434..b67edfe19c40e038042bc60e82ba3b6a1752017b 100644 --- a/sflphone-common/test/audiolayerTest.h +++ b/sflphone-common/test/audiolayertest.h @@ -17,6 +17,14 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* + * @file audiorecorderTest.cpp + * @brief Regroups unitary tests related to the plugin manager. + */ + +#ifndef _AUDIOLAYER_TEST_ +#define _AUDIOLAYER_TEST_ + // Cppunit import #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestCaller.h> @@ -35,58 +43,30 @@ #include "audio/alsa/alsalayer.h" #include "audio/pulseaudio/pulselayer.h" -/* - * @file audiorecorderTest.cpp - * @brief Regroups unitary tests related to the plugin manager. - */ +class AudioLayerTest: public CppUnit::TestFixture { -#ifndef _AUDIOLAYER_TEST_ -#define _AUDIOLAYER_TEST_ +CPPUNIT_TEST_SUITE( AudioLayerTest ); + CPPUNIT_TEST( testAudioLayerConfig ); + CPPUNIT_TEST( testPulseConnect ); + //TODO: this test ends the test sequence when using on a alsa only system + //CPPUNIT_TEST(testAudioLayerSwitch); + CPPUNIT_TEST_SUITE_END(); +public: + void testAudioLayerConfig(); + void testPulseConnect(); + void testAudioLayerSwitch(); -class AudioLayerTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE( AudioLayerTest ); - CPPUNIT_TEST( testAudioLayerConfig ); - // CPPUNIT_TEST( testAudioLayerSwitch ); - CPPUNIT_TEST( testPulseConnect ); - // CPPUNIT_TEST( testAlsaConnect ); - CPPUNIT_TEST_SUITE_END(); - - public: - AudioLayerTest() : CppUnit::TestCase("Audio Layer Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - inline void tearDown(); - - void testAudioLayerConfig(); - void testAudioLayerSwitch(); - void testPulseConnect(); - void testAlsaConnect(); - - private: - - ManagerImpl* manager; - - PulseLayer* _pulselayer; - - int layer; -}; +private: + + ManagerImpl* manager; -/* Register our test module */ + PulseLayer* _pulselayer; + + int layer; +}; +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(AudioLayerTest, "AudioLayerTest"); CPPUNIT_TEST_SUITE_REGISTRATION( AudioLayerTest ); #endif diff --git a/sflphone-common/test/audiorecorderTest.cpp b/sflphone-common/test/audiorecorderTest.cpp deleted file mode 100644 index d4dda35db6300499aeba05c5019a04ceec205349..0000000000000000000000000000000000000000 --- a/sflphone-common/test/audiorecorderTest.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software- - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <sstream> - -#include "audiorecorderTest.h" - -using std::cout; -using std::endl; - -void AudioRecorderTest::setUp() -{ - // Instanciate the object - _ar = new AudioRecord(); -} - -void AudioRecorderTest::testRecordData() -{ - - /* - FILE_TYPE ft = FILE_WAV; - SOUND_FORMAT sf = INT16; - _ar->setSndSamplingRate(44100); - _ar->openFile("theWavFile.wav",ft,sf); - - cout << "file opened!"; - - SFLDataFormat buf [2]; - for (SFLDataFormat i = -32768; i < 32767; i++ ){ - buf[0] = i; - buf[1] = i; - _ar->recData(buf,2); - } - - _ar->closeFile(); - */ -} - -void AudioRecorderTest::tearDown() -{ - // Delete the audio recorder module - delete _ar; - _ar = NULL; -} diff --git a/sflphone-common/test/audiorecorderTest.h b/sflphone-common/test/audiorecorderTest.h deleted file mode 100644 index 216b657079562007a1eb04955f390e3263ef1c87..0000000000000000000000000000000000000000 --- a/sflphone-common/test/audiorecorderTest.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include <assert.h> - -// Application import -#include "plug-in/pluginmanager.h" -#include "plug-in/audiorecorder/audiorecord.h" - -/* - * @file audiorecorderTest.cpp - * @brief Regroups unitary tests related to the plugin manager. - */ - -#ifndef _AUDIORECORDER_TEST_ -#define _AUDIORECORDER_TEST_ - -class AudioRecorderTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE( AudioRecorderTest ); - CPPUNIT_TEST( testRecordData ); - CPPUNIT_TEST_SUITE_END(); - - public: - AudioRecorderTest() : CppUnit::TestCase("Audio Recorder Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - inline void tearDown(); - - void testRecordData(); - - private: - AudioRecord *_ar; -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_REGISTRATION( AudioRecorderTest ); - -#endif diff --git a/sflphone-common/test/configurationTest.cpp b/sflphone-common/test/configurationTest.cpp deleted file mode 100644 index 1819c92db1afc0a5073a3b5bbfc3a1be28569f55..0000000000000000000000000000000000000000 --- a/sflphone-common/test/configurationTest.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <sstream> - -#include "configurationTest.h" - -using std::cout; -using std::endl; - -void ConfigurationTest::setUp() -{ - // Load the default configuration - Manager::instance().initConfigFile(); -} - -void ConfigurationTest::testDefaultValueAudio() -{ - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_CARD_ID_IN) == ALSA_DFT_CARD) ; - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_CARD_ID_OUT) == ALSA_DFT_CARD); - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_SAMPLE_RATE) == DFT_SAMPLE_RATE); - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_FRAME_SIZE) == DFT_FRAME_SIZE) ; - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_PLUGIN) == PCM_DEFAULT); - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, VOLUME_SPKR) == DFT_VOL_SPKR_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, VOLUME_MICRO) == DFT_VOL_MICRO_STR); -} - -void ConfigurationTest::testDefaultValuePreferences() -{ - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, ZONE_TONE) == DFT_ZONE); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_DIALPAD) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_RINGTONE) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_SEARCHBAR) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_START) == NO_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_POPUP) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_NOTIFY) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_MAIL_NOTIFY) == NO_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_VOLUME) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, REGISTRATION_EXPIRE) == DFT_EXPIRE_VALUE); - CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_AUDIO) == DFT_AUDIO_MANAGER); - -} - -void ConfigurationTest::testDefaultValueSignalisation() -{ - CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , SYMMETRIC) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PLAY_DTMF) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PLAY_TONES) == YES_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PULSE_LENGTH) == DFT_PULSE_LENGTH_STR); - CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , SEND_DTMF_AS) == SIP_INFO_STR); -} - -void ConfigurationTest::testLoadSIPAccount() -{ - - AccountMap accounts; - Account *current; - std::ostringstream ss; - int nb_account; // Must be 1 - - // Load the account from the user file - nb_account = Manager::instance().loadAccountMap(); - CPPUNIT_ASSERT_EQUAL (1, nb_account); - // Save the account information - accounts = Manager::instance()._accountMap; - - AccountMap::iterator iter = accounts.begin(); - CPPUNIT_ASSERT (Manager::instance().accountExists (iter->first) == true); - - while (iter != accounts.end()) { - current = iter->second; - CPPUNIT_ASSERT (iter->first == current->getAccountID()); - CPPUNIT_ASSERT (0 == current->getVoIPLink()); - iter++; - } -} - -void ConfigurationTest::testUnloadSIPAccount() -{ - - AccountMap accounts; - - // Load the accounts from the user file - Manager::instance().loadAccountMap(); - // Unload the accounts - Manager::instance().unloadAccountMap(); - // Save the account information - accounts = Manager::instance()._accountMap; - - AccountMap::iterator iter = accounts.begin(); - CPPUNIT_ASSERT (Manager::instance().accountExists (iter->first) == false); - - if (iter != accounts.end()) { - CPPUNIT_FAIL ("Unload account map failed\n"); - } -} - -void ConfigurationTest::testInitVolume() -{ - - Manager::instance().initVolume(); - - CPPUNIT_ASSERT (Manager::instance().getConfigInt (AUDIO, VOLUME_SPKR) == Manager::instance().getSpkrVolume()); - CPPUNIT_ASSERT (Manager::instance().getConfigInt (AUDIO, VOLUME_MICRO) == Manager::instance().getMicVolume()); -} - -void ConfigurationTest::testInitAudioDriver() -{ - - // Load the audio driver - Manager::instance().initAudioDriver(); - - // Check the creation - - if (Manager::instance().getAudioDriver() == NULL) - CPPUNIT_FAIL ("Error while loading audio layer"); - - // Check if it has been created with the right type - if (Manager::instance().getConfigInt (PREFERENCES, CONFIG_AUDIO) == ALSA) - CPPUNIT_ASSERT_EQUAL (Manager::instance().getAudioDriver()->getLayerType(), ALSA); - else if (Manager::instance().getConfigInt (PREFERENCES, CONFIG_AUDIO) == PULSEAUDIO) - CPPUNIT_ASSERT_EQUAL (Manager::instance().getAudioDriver()->getLayerType(), PULSEAUDIO); - else - CPPUNIT_FAIL ("Wrong audio layer type"); -} - -void ConfigurationTest::testSelectAudioDriver() -{ -} diff --git a/sflphone-common/test/configurationTest.h b/sflphone-common/test/configurationTest.h deleted file mode 100644 index 87828521eed303cbe2b195684f0ffbe45048db74..0000000000000000000000000000000000000000 --- a/sflphone-common/test/configurationTest.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2008 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include <assert.h> - -// Application import -#include "manager.h" -#include "audio/audiolayer.h" -#include "global.h" -#include "user_cfg.h" - -/* - * @file configurationTest.cpp - * @brief Regroups unitary tests related to the user configuration. - * Check if the default configuration has been successfully loaded - */ - -#ifndef _CONFIGURATION_TEST_ -#define _CONFIGURATION_TEST_ - -class ConfigurationTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE( ConfigurationTest ); - CPPUNIT_TEST( testDefaultValueAudio ); - CPPUNIT_TEST( testDefaultValuePreferences ); - CPPUNIT_TEST( testDefaultValueSignalisation ); - CPPUNIT_TEST( testLoadSIPAccount ); - CPPUNIT_TEST( testUnloadSIPAccount ); - CPPUNIT_TEST( testInitVolume ); - CPPUNIT_TEST( testInitAudioDriver ); - CPPUNIT_TEST( testSelectAudioDriver ); - CPPUNIT_TEST_SUITE_END(); - - public: - ConfigurationTest() : CppUnit::TestCase("Configuration Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - inline void tearDown(){ - // Not much to do - } - - /* - * Unit tests related to the audio preferences - */ - void testDefaultValueAudio(); - - /* - * Unit tests related to the global settings - */ - void testDefaultValuePreferences(); - - /* - * Unit tests related to the global settings - */ - void testDefaultValueSignalisation(); - - /* - * Try to load one SIP account. - * So be sure to have only one SIP account so that the test could succeed - */ - void testLoadSIPAccount(); - void testUnloadSIPAccount(); - - void testInitVolume(); - - void testInitAudioDriver(); - void testSelectAudioDriver(); - -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_REGISTRATION( ConfigurationTest ); - -#endif diff --git a/sflphone-common/test/configurationtest.cpp b/sflphone-common/test/configurationtest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3ccee26112b4983f28d566d48930988082bf4a48 --- /dev/null +++ b/sflphone-common/test/configurationtest.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2008 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> + +#include "configurationtest.h" +#include "constants.h" + +using std::cout; +using std::endl; + +void ConfigurationTest::testDefaultValueAudio() { + _debug ("-------------------- ConfigurationTest::testDefaultValueAudio() --------------------\n"); + + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_CARD_ID_IN) == ALSA_DFT_CARD); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_CARD_ID_OUT) == ALSA_DFT_CARD); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, AUDIO_SAMPLE_RATE) == DFT_SAMPLE_RATE); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_FRAME_SIZE) == DFT_FRAME_SIZE); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, ALSA_PLUGIN) == PCM_DEFAULT); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, VOLUME_SPKR) == DFT_VOL_SPKR_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (AUDIO, VOLUME_MICRO) == DFT_VOL_MICRO_STR); +} + +void ConfigurationTest::testDefaultValuePreferences() { + _debug ("-------------------- ConfigurationTest::testDefaultValuePreferences --------------------\n"); + + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, ZONE_TONE) == DFT_ZONE); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_DIALPAD) == NO_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_RINGTONE) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_SEARCHBAR) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_START) == NO_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_POPUP) == NO_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_NOTIFY) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_MAIL_NOTIFY) == NO_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_VOLUME) == NO_STR); + //CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, REGISTRATION_EXPIRE) == DFT_EXPIRE_VALUE); + //CPPUNIT_ASSERT (Manager::instance().getConfigString (PREFERENCES, CONFIG_AUDIO) == DFT_AUDIO_MANAGER); + +} + +void ConfigurationTest::testDefaultValueSignalisation() { + _debug ("-------------------- ConfigurationTest::testDefaultValueSignalisation --------------------\n"); + + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , SYMMETRIC) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PLAY_DTMF) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PLAY_TONES) == YES_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , PULSE_LENGTH) == DFT_PULSE_LENGTH_STR); + CPPUNIT_ASSERT (Manager::instance().getConfigString (SIGNALISATION , SEND_DTMF_AS) == SIP_INFO_STR); +} + +void ConfigurationTest::testLoadSIPAccount() { + _debug ("-------------------- ConfigurationTest::testLoadSIPAccount --------------------\n"); + + AccountMap accounts; + Account *current; + std::ostringstream ss; + int nb_account; // Must be 1 + + // Load the account from the user file + nb_account = Manager::instance().loadAccountMap(); + CPPUNIT_ASSERT_EQUAL (1, nb_account); + // Save the account information + accounts = Manager::instance()._accountMap; + + AccountMap::iterator iter = accounts.begin(); + CPPUNIT_ASSERT (Manager::instance().accountExists (iter->first) == true); + + while (iter != accounts.end()) { + current = iter->second; + CPPUNIT_ASSERT (iter->first == current->getAccountID()); + CPPUNIT_ASSERT (0 == current->getVoIPLink()); + iter++; + } +} + +void ConfigurationTest::testUnloadSIPAccount() { + _debug ("-------------------- ConfigurationTest::testUnloadSIPAccount --------------------\n"); + + AccountMap accounts; + + // Load the accounts from the user file + Manager::instance().loadAccountMap(); + // Unload the accounts + Manager::instance().unloadAccountMap(); + // Save the account information + accounts = Manager::instance()._accountMap; + + AccountMap::iterator iter = accounts.begin(); + CPPUNIT_ASSERT (Manager::instance().accountExists (iter->first) == false); + + if (iter != accounts.end()) { + CPPUNIT_FAIL ("Unload account map failed\n"); + } +} + +void ConfigurationTest::testInitVolume() { + _debug ("-------------------- ConfigurationTest::testInitVolume --------------------\n"); + + Manager::instance().initVolume(); + + CPPUNIT_ASSERT (Manager::instance().getConfigInt (AUDIO, VOLUME_SPKR) == Manager::instance().getSpkrVolume()); + CPPUNIT_ASSERT (Manager::instance().getConfigInt (AUDIO, VOLUME_MICRO) == Manager::instance().getMicVolume()); +} + +void ConfigurationTest::testInitAudioDriver() { + _debug ("-------------------- ConfigurationTest::testInitAudioDriver --------------------\n"); + + // Load the audio driver + Manager::instance().initAudioDriver(); + + // Check the creation + + if (Manager::instance().getAudioDriver() == NULL) + CPPUNIT_FAIL ("Error while loading audio layer"); + + // Check if it has been created with the right type + if (Manager::instance().getConfigInt(PREFERENCES, CONFIG_AUDIO) == ALSA) + CPPUNIT_ASSERT_EQUAL (Manager::instance().getAudioDriver()->getLayerType(), ALSA); + else if (Manager::instance().getConfigInt(PREFERENCES, CONFIG_AUDIO) + == PULSEAUDIO) + CPPUNIT_ASSERT_EQUAL (Manager::instance().getAudioDriver()->getLayerType(), PULSEAUDIO); + else + CPPUNIT_FAIL ("Wrong audio layer type"); +} diff --git a/sflphone-common/test/configurationtest.h b/sflphone-common/test/configurationtest.h new file mode 100644 index 0000000000000000000000000000000000000000..7fe7c30ae0fcdcbea913cfbc39bf475e9888371d --- /dev/null +++ b/sflphone-common/test/configurationtest.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2008 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * @file configurationTest.cpp + * @brief Regroups unitary tests related to the user configuration. + * Check if the default configuration has been successfully loaded + */ + +#ifndef _CONFIGURATION_TEST_ +#define _CONFIGURATION_TEST_ + +// Cppunit import +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/TestCaller.h> +#include <cppunit/TestCase.h> +#include <cppunit/TestSuite.h> + +#include <assert.h> + +// Application import +#include "manager.h" +#include "audio/audiolayer.h" +#include "global.h" +#include "user_cfg.h" + +class ConfigurationTest: public CppUnit::TestFixture { + + /* + * Use cppunit library macros to add unit test the factory + */ +CPPUNIT_TEST_SUITE( ConfigurationTest ); + CPPUNIT_TEST( testInitVolume ); + CPPUNIT_TEST( testDefaultValueAudio ); + CPPUNIT_TEST( testDefaultValuePreferences ); + CPPUNIT_TEST( testDefaultValueSignalisation ); + CPPUNIT_TEST( testInitAudioDriver ); + CPPUNIT_TEST_SUITE_END(); + +public: + /* + * Unit tests related to the audio preferences + */ + void testDefaultValueAudio(); + + /* + * Unit tests related to the global settings + */ + void testDefaultValuePreferences(); + + /* + * Unit tests related to the global settings + */ + void testDefaultValueSignalisation(); + + /* + * Try to load one SIP account. + * So be sure to have only one SIP account so that the test could succeed + */ + void testLoadSIPAccount(); + + void testUnloadSIPAccount(); + + void testInitVolume(); + + void testInitAudioDriver(); +}; +/* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(ConfigurationTest, "ConfigurationTest"); +CPPUNIT_TEST_SUITE_REGISTRATION( ConfigurationTest ); + +#endif diff --git a/sflphone-common/test/constants.h b/sflphone-common/test/constants.h new file mode 100644 index 0000000000000000000000000000000000000000..28b27a69d6f3cf1464c565180c34ed1a93597ed3 --- /dev/null +++ b/sflphone-common/test/constants.h @@ -0,0 +1,18 @@ +/* + * constants.h + * + * Created on: 2010-03-15 + * Author: jb + */ + +#ifndef CONSTANTS_H_ +#define CONSTANTS_H_ + +#define YES_STR "1" +#define NO_STR "0" +#define HISTORY_SAMPLE "history-sample" +#define HISTORY_SAMPLE_SIZE 3 +#define CONFIG_SAMPLE "sflphonedrc-sample" +#define HUGE_HISTORY_LIMIT 20000 + +#endif /* CONSTANTS_H_ */ diff --git a/sflphone-common/test/historyTest.cpp b/sflphone-common/test/historyTest.cpp deleted file mode 100644 index b21179bb7883918fbf19ec2a8e90f902d2cdb41b..0000000000000000000000000000000000000000 --- a/sflphone-common/test/historyTest.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <sstream> - -#include "historyTest.h" -#include "manager.h" - -using std::cout; -using std::endl; - -#define HISTORY_SAMPLE "history-sample" -#define HISTORY_SAMPLE_SIZE 3 -#define CONFIG_SAMPLE "sflphonedrc-sample" -#define HUGE_HISTORY_LIMIT 20000 - -void HistoryTest::setUp() -{ - // Instanciate the cleaner singleton - history = new HistoryManager (); -} - -void HistoryTest::test_create_history_path () -{ - - int result; - char *cpath; - std::string path; - - cpath = getenv ("XDG_DATA_HOME"); - (cpath != NULL) ? path = std::string (cpath) : path = std::string (HOMEDIR) + "/.local/share/sflphone/history"; - - result = history->create_history_path (); - CPPUNIT_ASSERT (result == 0); - CPPUNIT_ASSERT (!history->is_loaded ()); - CPPUNIT_ASSERT (history->_history_path == path); -} - -void HistoryTest::test_load_history_from_file () -{ - bool res; - Conf::ConfigTree history_list; - - history->create_history_path (); - res = history->load_history_from_file (&history_list); - - CPPUNIT_ASSERT (history->is_loaded ()); - CPPUNIT_ASSERT (res == true); -} - -void HistoryTest::test_load_history_items_map () -{ - std::string path; - int nb_items; - Conf::ConfigTree history_list; - - history->set_history_path (HISTORY_SAMPLE); - history->load_history_from_file (&history_list); - nb_items = history->load_history_items_map (&history_list, HUGE_HISTORY_LIMIT); - CPPUNIT_ASSERT (nb_items == HISTORY_SAMPLE_SIZE); - CPPUNIT_ASSERT (history->get_history_size () == HISTORY_SAMPLE_SIZE); -} - -void HistoryTest::test_save_history_items_map () -{ - std::string path; - int nb_items_loaded, nb_items_saved; - Conf::ConfigTree history_list, history_list2; - - history->set_history_path (HISTORY_SAMPLE); - history->load_history_from_file (&history_list); - nb_items_loaded = history->load_history_items_map (&history_list, HUGE_HISTORY_LIMIT); - nb_items_saved = history->save_history_items_map (&history_list2); - CPPUNIT_ASSERT (nb_items_loaded == nb_items_saved); -} - -void HistoryTest::test_save_history_to_file () -{ - std::string path; - Conf::ConfigTree history_list, history_list2; - std::map <std::string, std::string> res; - std::map <std::string, std::string>::iterator iter; - - history->set_history_path (HISTORY_SAMPLE); - history->load_history_from_file (&history_list); - history->load_history_items_map (&history_list, HUGE_HISTORY_LIMIT); - history->save_history_items_map (&history_list2); - CPPUNIT_ASSERT (history->save_history_to_file (&history_list2)); -} - -void HistoryTest::test_get_history_serialized () -{ - std::map <std::string, std::string> res; - std::map <std::string, std::string>::iterator iter; - std::string tmp; - - // Load the sample user config - Manager::instance().initConfigFile (true, CONFIG_SAMPLE); - Manager::instance().loadAccountMap (); - - CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); - res = history->get_history_serialized (); - CPPUNIT_ASSERT (res.size() ==HISTORY_SAMPLE_SIZE); - - // Warning - If you change the history-sample file, you must change the following lines also so that the tests could work - // The reference here is the file history-sample in this test directory - // The serialized form is: calltype%to%from%callid - - // Check the first - tmp = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; - CPPUNIT_ASSERT (tmp == res ["144562436"]); - - tmp = "2|136|Emmanuel Milou|747638765|Account:1239059899"; - CPPUNIT_ASSERT (tmp == res ["747638685"]); - - // the account ID does not correspond to a loaded account - tmp = "1|5143848557|empty|775354987|empty"; - CPPUNIT_ASSERT (tmp == res ["775354456"]); -} - -void HistoryTest::test_set_serialized_history () -{ - // We build a map to have an efficient test - std::map <std::string, std::string> map_test; - std::string tmp; - Conf::ConfigTree history_list; - - map_test["144562436"] = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; - map_test["747638685"] = "2|136|Emmanuel Milou|747638765|Account:1239059899"; - map_test["775354456"] = "1|5143848557|empty|775354987|Account:43789459478"; - - CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); - // We use a large history limit to be able to interpret results - CPPUNIT_ASSERT (history->set_serialized_history (map_test, HUGE_HISTORY_LIMIT) == 3); - CPPUNIT_ASSERT (history->get_history_size () == 3); - - map_test.clear (); - map_test = history->get_history_serialized (); - CPPUNIT_ASSERT (map_test.size() ==3); - - // Check the first - tmp = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; - CPPUNIT_ASSERT (tmp == map_test ["144562436"]); - - tmp = "2|136|Emmanuel Milou|747638765|Account:1239059899"; - CPPUNIT_ASSERT (tmp == map_test ["747638685"]); - - // the account ID does not correspond to a loaded account - tmp = "1|5143848557|empty|775354987|empty"; - CPPUNIT_ASSERT (tmp == map_test ["775354456"]); - - history->save_history_items_map (&history_list); - CPPUNIT_ASSERT (history->save_history_to_file (&history_list)); -} - -void HistoryTest::test_set_serialized_history_with_limit () -{ - // We build a map to have an efficient test - std::map <std::string, std::string> map_test; - std::string tmp; - Conf::ConfigTree history_list; - time_t current, day=86400; // One day in unix timestamp - std::stringstream current_1, current_2, current_3; - - (void) time (¤t); - current_1 << (current - 2*day) << std::endl; - current_2 << (current - 5*day) << std::endl; - current_3 << (current - 11*day) << std::endl; - - map_test[current_1.str () ] = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; - map_test[current_2.str () ] = "2|136|Emmanuel Milou|747638765|Account:1239059899"; - map_test[current_3.str () ] = "1|5143848557|empty|775354987|Account:43789459478"; - - CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); - // We use different value of history limit - // 10 days - the last entry should not be saved - CPPUNIT_ASSERT (history->set_serialized_history (map_test, 10) == 2); - CPPUNIT_ASSERT (history->get_history_size () == 2); - - // 4 days - the two last entries should not be saved - CPPUNIT_ASSERT (history->set_serialized_history (map_test, 4) == 1); - CPPUNIT_ASSERT (history->get_history_size () == 1); - - // 1 day - no entry should not be saved - CPPUNIT_ASSERT (history->set_serialized_history (map_test, 1) == 0); - CPPUNIT_ASSERT (history->get_history_size () == 0); -} - -void HistoryTest::tearDown() -{ - // Delete the history object - delete history; - history=0; -} diff --git a/sflphone-common/test/historytest.cpp b/sflphone-common/test/historytest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e8634b60e48fa27000694cdf39735a0a0a8e54c8 --- /dev/null +++ b/sflphone-common/test/historytest.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> + +#include "historytest.h" +#include "manager.h" +#include "constants.h" +#include "validator.h" + +using std::cout; +using std::endl; + +void HistoryTest::setUp() { + // Instanciate the cleaner singleton + history = new HistoryManager(); +} + +void HistoryTest::test_create_history_path() { + _debug ("-------------------- HistoryTest::test_create_history_path --------------------\n"); + + int result; + char *cpath; + std::string path; + + cpath = getenv("XDG_DATA_HOME"); + (cpath != NULL) ? path = std::string(cpath) : path = std::string(HOMEDIR) + + "/.local/share/sflphone/history"; + + result = history->create_history_path(); + CPPUNIT_ASSERT (result == 0); + CPPUNIT_ASSERT (!history->is_loaded ()); + CPPUNIT_ASSERT (history->_history_path == path); +} + +void HistoryTest::test_load_history_from_file() { + _debug ("-------------------- HistoryTest::test_load_history_from_file --------------------\n"); + + bool res; + Conf::ConfigTree history_list; + + history->create_history_path(); + res = history->load_history_from_file(&history_list); + + CPPUNIT_ASSERT (history->is_loaded ()); + CPPUNIT_ASSERT (res == true); +} + +void HistoryTest::test_load_history_items_map() { + _debug ("-------------------- HistoryTest::test_load_history_items_map --------------------\n"); + + std::string path; + int nb_items; + Conf::ConfigTree history_list; + + history->set_history_path(HISTORY_SAMPLE); + history->load_history_from_file(&history_list); + nb_items = history->load_history_items_map(&history_list, + HUGE_HISTORY_LIMIT); + CPPUNIT_ASSERT (nb_items == HISTORY_SAMPLE_SIZE); + CPPUNIT_ASSERT (history->get_history_size () == HISTORY_SAMPLE_SIZE); +} + +void HistoryTest::test_save_history_items_map() { + _debug ("-------------------- HistoryTest::test_save_history_items_map --------------------\n"); + + std::string path; + int nb_items_loaded, nb_items_saved; + Conf::ConfigTree history_list, history_list2; + + history->set_history_path(HISTORY_SAMPLE); + history->load_history_from_file(&history_list); + nb_items_loaded = history->load_history_items_map(&history_list, + HUGE_HISTORY_LIMIT); + nb_items_saved = history->save_history_items_map(&history_list2); + CPPUNIT_ASSERT (nb_items_loaded == nb_items_saved); +} + +void HistoryTest::test_save_history_to_file() { + _debug ("-------------------- HistoryTest::test_save_history_to_file --------------------\n"); + + std::string path; + Conf::ConfigTree history_list, history_list2; + std::map<std::string, std::string> res; + std::map<std::string, std::string>::iterator iter; + + history->set_history_path(HISTORY_SAMPLE); + history->load_history_from_file(&history_list); + history->load_history_items_map(&history_list, HUGE_HISTORY_LIMIT); + history->save_history_items_map(&history_list2); + CPPUNIT_ASSERT (history->save_history_to_file (&history_list2)); +} + +void HistoryTest::test_get_history_serialized() { + _debug ("-------------------- HistoryTest::test_get_history_serialized --------------------\n"); + + std::map<std::string, std::string> res; + std::map<std::string, std::string>::iterator iter; + std::string tmp; + + CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); + res = history->get_history_serialized(); + CPPUNIT_ASSERT (res.size() ==HISTORY_SAMPLE_SIZE); + + // Warning - If you change the history-sample file, you must change the following lines also so that the tests could work + // The reference here is the file history-sample in this test directory + // The serialized form is: calltype%to%from%callid + + // Check the first + tmp = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + CPPUNIT_ASSERT (Validator::isEqual(tmp, res ["144562436"])); + + tmp = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + CPPUNIT_ASSERT (Validator::isEqual(tmp, res ["747638685"])); + + // the account ID does not correspond to a loaded account + tmp = "1|5143848557|empty|775354987|empty"; + CPPUNIT_ASSERT (Validator::isEqual(tmp, res ["775354456"])); +} + +void HistoryTest::test_set_serialized_history() { + _debug ("-------------------- HistoryTest::test_set_serialized_history --------------------\n"); + + // We build a map to have an efficient test + std::map<std::string, std::string> map_test; + std::string tmp; + Conf::ConfigTree history_list; + + map_test["144562436"] = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + map_test["747638685"] = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + map_test["775354456"] = "1|5143848557|empty|775354987|Account:43789459478"; + + CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); + // We use a large history limit to be able to interpret results + CPPUNIT_ASSERT (history->set_serialized_history (map_test, HUGE_HISTORY_LIMIT) == 3); + CPPUNIT_ASSERT (history->get_history_size () == 3); + + map_test.clear(); + map_test = history->get_history_serialized(); + CPPUNIT_ASSERT (map_test.size() ==3); + + // Check the first + tmp = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + CPPUNIT_ASSERT (Validator::isEqual(tmp, map_test ["144562436"])); + + tmp = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + CPPUNIT_ASSERT (Validator::isEqual(tmp, map_test ["747638685"])); + + // the account ID does not correspond to a loaded account + tmp = "1|5143848557|empty|775354987|empty"; + CPPUNIT_ASSERT (Validator::isEqual(tmp, map_test ["775354456"])); + + history->save_history_items_map(&history_list); + CPPUNIT_ASSERT (history->save_history_to_file (&history_list)); +} + +void HistoryTest::test_set_serialized_history_with_limit() { + _debug ("-------------------- HistoryTest::test_set_serialized_history_with_limit --------------------\n"); + + // We build a map to have an efficient test + std::map<std::string, std::string> map_test; + std::string tmp; + Conf::ConfigTree history_list; + time_t current, day = 86400; // One day in unix timestamp + std::stringstream current_1, current_2, current_3; + + (void) time(¤t); + current_1 << (current - 2 * day) << std::endl; + current_2 << (current - 5 * day) << std::endl; + current_3 << (current - 11 * day) << std::endl; + + map_test[current_1.str()] + = "0|514-276-5468|Savoir-faire Linux|144562458|empty"; + map_test[current_2.str()] + = "2|136|Emmanuel Milou|747638765|Account:1239059899"; + map_test[current_3.str()] + = "1|5143848557|empty|775354987|Account:43789459478"; + + CPPUNIT_ASSERT (history->load_history (HUGE_HISTORY_LIMIT, HISTORY_SAMPLE) == HISTORY_SAMPLE_SIZE); + // We use different value of history limit + // 10 days - the last entry should not be saved + CPPUNIT_ASSERT (history->set_serialized_history (map_test, 10) == 2); + CPPUNIT_ASSERT (history->get_history_size () == 2); + + // 4 days - the two last entries should not be saved + CPPUNIT_ASSERT (history->set_serialized_history (map_test, 4) == 1); + CPPUNIT_ASSERT (history->get_history_size () == 1); + + // 1 day - no entry should not be saved + CPPUNIT_ASSERT (history->set_serialized_history (map_test, 1) == 0); + CPPUNIT_ASSERT (history->get_history_size () == 0); +} + +void HistoryTest::tearDown() { + // Delete the history object + delete history; + history = 0; +} diff --git a/sflphone-common/test/historyTest.h b/sflphone-common/test/historytest.h similarity index 97% rename from sflphone-common/test/historyTest.h rename to sflphone-common/test/historytest.h index 38ac517c9faf9b80b478df268830a8872a086f37..334b9af7ffa2dbe9d588f6a0152212c51b5f9dfa 100644 --- a/sflphone-common/test/historyTest.h +++ b/sflphone-common/test/historytest.h @@ -43,10 +43,10 @@ class HistoryTest : public CppUnit::TestCase { */ CPPUNIT_TEST_SUITE (HistoryTest); CPPUNIT_TEST (test_create_history_path); + CPPUNIT_TEST (test_save_history_to_file); + CPPUNIT_TEST (test_save_history_items_map); CPPUNIT_TEST (test_load_history_from_file); CPPUNIT_TEST (test_load_history_items_map); - CPPUNIT_TEST (test_save_history_items_map); - CPPUNIT_TEST (test_save_history_to_file); CPPUNIT_TEST (test_get_history_serialized); CPPUNIT_TEST (test_set_serialized_history); CPPUNIT_TEST (test_set_serialized_history_with_limit); @@ -88,6 +88,7 @@ class HistoryTest : public CppUnit::TestCase { }; /* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(HistoryTest, "HistoryTest"); CPPUNIT_TEST_SUITE_REGISTRATION( HistoryTest ); #endif diff --git a/sflphone-common/test/hookmanagerTest.cpp b/sflphone-common/test/hookmanagertest.cpp similarity index 86% rename from sflphone-common/test/hookmanagerTest.cpp rename to sflphone-common/test/hookmanagertest.cpp index 817533a9277592570a8c2b5db7e5e7c0630dcd62..57fc138a0a2cf230178eba3219a317940c9887cd 100644 --- a/sflphone-common/test/hookmanagerTest.cpp +++ b/sflphone-common/test/hookmanagertest.cpp @@ -20,8 +20,9 @@ #include <stdio.h> #include <sstream> #include <dlfcn.h> +#include "global.h" -#include "hookmanagerTest.h" +#include "hookmanagertest.h" using std::cout; using std::endl; @@ -35,6 +36,7 @@ void HookManagerTest::setUp() void HookManagerTest::testAddAction () { + _debug ("-------------------- HookManagerTest::testAddAction --------------------\n"); int status; @@ -44,6 +46,7 @@ void HookManagerTest::testAddAction () void HookManagerTest::testLargeUrl () { + _debug ("-------------------- HookManagerTest::testLargeUrl --------------------\n"); std::string url; std::cout << url.max_size() << std::endl; diff --git a/sflphone-common/test/hookmanagerTest.h b/sflphone-common/test/hookmanagertest.h similarity index 89% rename from sflphone-common/test/hookmanagerTest.h rename to sflphone-common/test/hookmanagertest.h index 9c7464125d8dff6f8d63471ace6a476bd1bc550f..d9e130c0a5c781bd5f54bd40d7070a009f3df135 100644 --- a/sflphone-common/test/hookmanagerTest.h +++ b/sflphone-common/test/hookmanagertest.h @@ -17,6 +17,14 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* + * @file hookmanagerTest.cpp + * @brief Regroups unitary tests related to the hook manager. + */ + +#ifndef _HOOKMANAGER_TEST_ +#define _HOOKMANAGER_TEST_ + // Cppunit import #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestCaller.h> @@ -28,15 +36,7 @@ // Application import #include "hooks/urlhook.h" -/* - * @file hookmanagerTest.cpp - * @brief Regroups unitary tests related to the hook manager. - */ - -#ifndef _HOOKMANAGER_TEST_ -#define _HOOKMANAGER_TEST_ - -class HookManagerTest : public CppUnit::TestCase { +class HookManagerTest : public CppUnit::TestFixture { /** * Use cppunit library macros to add unit test the factory @@ -47,8 +47,6 @@ class HookManagerTest : public CppUnit::TestCase { CPPUNIT_TEST_SUITE_END (); public: - HookManagerTest() : CppUnit::TestCase("Hook Manager Tests") {} - /* * Code factoring - Common resources can be initialized here. * This method is called by unitcpp before each test @@ -62,13 +60,12 @@ class HookManagerTest : public CppUnit::TestCase { * Code factoring - Common resources can be released here. * This method is called by unitcpp after each test */ - inline void tearDown (); + void tearDown (); private: UrlHook *urlhook; }; - -/* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(HookManagerTest, "HookManagerTest"); CPPUNIT_TEST_SUITE_REGISTRATION( HookManagerTest ); #endif diff --git a/sflphone-common/test/hooksTest.h b/sflphone-common/test/hooksTest.h deleted file mode 100644 index a08e7e3ecd19a5e6695f0da45c8c7a3d72f19cf3..0000000000000000000000000000000000000000 --- a/sflphone-common/test/hooksTest.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -// Cppunit import -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCaller.h> -#include <cppunit/TestCase.h> -#include <cppunit/TestSuite.h> - -#include <assert.h> - -/* - * @file hooksTest.cpp - * @brief Regroups unitary tests related to the hooks. - */ - -#ifndef _HOOKS_TEST_ -#define _HOOKS_TEST_ - -class HooksTest : public CppUnit::TestCase { - - /** - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE (HooksTest); - CPPUNIT_TEST (); - CPPUNIT_TEST_SUITE_END(); - - public: - HooksTest() : CppUnit::TestCase("Hooks implementation Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - inline void tearDown (); - - void testUnloadPlugins (); - - private: -}; - -/* Register our test module */ -CPPUNIT_TEST_SUITE_REGISTRATION (HooksTest); - -# diff --git a/sflphone-common/test/main.cpp b/sflphone-common/test/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d0b7a6e09bfbd2b4ee483d44af932cc121fd0e95 --- /dev/null +++ b/sflphone-common/test/main.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2004-2007 Savoir-Faire Linux inc. + * Author: Julien Bonjean <julien.bonjean@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "logger.h" +#include "global.h" +#include "manager.h" +#include "constants.h" + +#include <cppunit/CompilerOutputter.h> +#include <cppunit/extensions/TestFactoryRegistry.h> +#include <cppunit/ui/text/TextTestRunner.h> + +// TODO: Why some header cannot be included ? +#include "accounttest.h" +#include "audiolayertest.h" +#include "configurationtest.h" +//#include "historytest.h" +//#include "hookmanagertest.h" +#include "mainbuffertest.h" +#include "numbercleanertest.h" +//#include "pluginmanagertest.h" +//#include "rtptest.h" +#include "sdesnegotiatortest.h" + + +int main(int argc, char* argv[]) { + + printf("\nSFLphone Daemon Test Suite, by Savoir-Faire Linux 2004-2010\n\n"); + + Logger::setConsoleLog(true); + + Logger::setDebugMode(true); + /* + Logger::setDebugMode(false); + + int argvIndex = 1; + + if (argc > 1) { + if (strcmp("--help", argv[1]) == 0) { + argvIndex++; + + CPPUNIT_NS::Test + *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry( + "All Tests").makeTest(); + int testSuiteCount = suite->getChildTestCount(); + + printf("Usage: test [OPTIONS] [TEST_SUITE]\n"); + printf("\nOptions:\n"); + printf(" --debug - Debug mode\n"); + printf(" --help - Print help\n"); + printf("\nAvailable test suites:\n"); + for (int i = 0; i < testSuiteCount; i++) { + printf(" - %s\n", suite->getChildTestAt(i)->getName().c_str()); + } + exit(0); + } + else if (strcmp("--debug", argv[1]) == 0) { + argvIndex++; + + Logger::setDebugMode(true); + _info("Debug mode activated"); + } + } + + std::string testSuiteName = "All Tests"; + if(argvIndex < argc) + { + testSuiteName = argv[argvIndex]; + argvIndex++; + } + + printf("\n\n=== SFLphone initialization ===\n\n"); + Manager::instance().initConfigFile(true, CONFIG_SAMPLE); + Manager::instance().init(); + + printf("\n\n=== Test Suite: %s ===\n\n", testSuiteName.c_str()); + // Get the top level suite from the registry + CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry(testSuiteName).makeTest(); + */ + CPPUNIT_NS::Test *suite = CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest(); + + /* + if(suite->getChildTestCount() == 0) + { + _error("Invalid test suite name: %s", testSuiteName.c_str()); + exit(-1); + } + */ + Manager::instance().initConfigFile(true, CONFIG_SAMPLE); + Manager::instance().init(); + + // Adds the test to the list of test to run + CppUnit::TextTestRunner runner; + runner.addTest(suite); + + // Change the default outputter to a compiler error format outputter + runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), + std::cerr)); + // Run the tests. + bool wasSucessful = runner.run(); + + // Return error code 1 if the one of test failed. + return wasSucessful ? 0 : 1; + + Manager::instance().terminate(); +} diff --git a/sflphone-common/test/mainbufferTest.cpp b/sflphone-common/test/mainbuffertest.cpp similarity index 98% rename from sflphone-common/test/mainbufferTest.cpp rename to sflphone-common/test/mainbuffertest.cpp index 830ff2c76979e67b867861c1433643c766dd609a..2919828b475e28764fd7b9aafd202f10c16415c3 100644 --- a/sflphone-common/test/mainbufferTest.cpp +++ b/sflphone-common/test/mainbuffertest.cpp @@ -29,7 +29,7 @@ #include <sstream> -#include "mainbufferTest.h" +#include "mainbuffertest.h" #include <unistd.h> @@ -53,7 +53,7 @@ void MainBufferTest::tearDown() void MainBufferTest::testRingBufferCreation() { - _debug ("MainBufferTest::testRingBufferCreation()"); + _debug ("-------------------- MainBufferTest::testRingBufferCreation --------------------\n"); CallID test_id = "1234"; CallID null_id = "null id"; @@ -100,7 +100,7 @@ void MainBufferTest::testRingBufferCreation() void MainBufferTest::testRingBufferReadPointer() { - _debug ("MainBufferTest::testRingBufferReadPointer()"); + _debug ("-------------------- MainBufferTest::testRingBufferReadPointer --------------------\n"); CallID call_id = "call id"; CallID read_id = "read id"; @@ -147,7 +147,7 @@ void MainBufferTest::testRingBufferReadPointer() void MainBufferTest::testCallIDSet() { - _debug ("MainBufferTest::testCallIDSet()"); + _debug ("-------------------- MainBufferTest::testCallIDSet --------------------\n"); CallID test_id = "set id"; CallID false_id = "false set id"; @@ -230,8 +230,7 @@ void MainBufferTest::testCallIDSet() void MainBufferTest::testRingBufferInt() { - - _debug ("MainBufferTest::testRingbufferInt()"); + _debug ("-------------------- MainBufferTest::testRingBufferInt --------------------\n"); // CallID test_id = "test_int"; @@ -347,8 +346,7 @@ void MainBufferTest::testRingBufferInt() void MainBufferTest::testRingBufferNonDefaultID() { - - _debug ("MainBufferTest::testRingBufferNonDefaultID()"); + _debug ("-------------------- MainBufferTest::testRingBufferNonDefaultID --------------------\n"); CallID test_id = "test_int"; @@ -435,8 +433,7 @@ void MainBufferTest::testRingBufferNonDefaultID() void MainBufferTest::testRingBufferFloat() { - - _debug ("MainBufferTest::testRingBufferFloat()"); + _debug ("-------------------- MainBufferTest::testRingBufferFloat --------------------\n"); float testfloat1 = 12.5; float testfloat2 = 13.4; @@ -470,9 +467,7 @@ void MainBufferTest::testRingBufferFloat() void MainBufferTest::testTwoPointer() { - - _debug ("MainBufferTest::testTwoPointer()"); - + _debug ("-------------------- MainBufferTest::testTwoPointer --------------------\n"); RingBuffer* input_buffer = _mainbuffer.createRingBuffer (default_id); input_buffer->createReadPointer (default_id); @@ -489,8 +484,7 @@ void MainBufferTest::testTwoPointer() void MainBufferTest::testBindUnbindBuffer() { - - _debug ("MainBufferTest::testBindUnbindBuffer()"); + _debug ("-------------------- MainBufferTest::testBindUnbindBuffer --------------------\n"); CallID test_id1 = "bind unbind 1"; CallID test_id2 = "bind unbind 2"; @@ -889,8 +883,7 @@ void MainBufferTest::testBindUnbindBuffer() void MainBufferTest::testGetPutDataByID() { - - _debug ("MainBufferTest::testGetPutData()"); + _debug ("-------------------- MainBufferTest::testGetPutDataByID --------------------\n"); CallID test_id = "getData putData"; CallID false_id = "false id"; @@ -945,8 +938,7 @@ void MainBufferTest::testGetPutDataByID() void MainBufferTest::testGetPutData() { - - _debug ("MainBufferTest::testGetDataAndCallID()"); + _debug ("-------------------- MainBufferTest::testGetPutData --------------------\n"); CallID test_id = "incoming rtp session"; @@ -994,8 +986,7 @@ void MainBufferTest::testGetPutData() void MainBufferTest::testDiscardFlush() { - - _debug ("MainBufferTest::testDiscardFlush()"); + _debug ("-------------------- MainBufferTest::testDiscardFlush --------------------\n"); CallID test_id = "flush discard"; // _mainbuffer.createRingBuffer(test_id); @@ -1037,8 +1028,7 @@ void MainBufferTest::testDiscardFlush() void MainBufferTest::testReadPointerInit() { - - _debug ("MainBufferTest::testReadPointerInit()"); + _debug ("-------------------- MainBufferTest::testReadPointerInit --------------------\n"); CallID test_id = "test read pointer init"; // RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer(test_id); @@ -1066,8 +1056,7 @@ void MainBufferTest::testReadPointerInit() void MainBufferTest::testRingBufferSeveralPointers() { - - _debug ("MainBufferTest::testRingBufferSeveralPointers"); + _debug ("-------------------- MainBufferTest::testRingBufferSeveralPointers --------------------\n"); CallID test_id = "test multiple read pointer"; RingBuffer* test_ring_buffer = _mainbuffer.createRingBuffer (test_id); @@ -1180,8 +1169,7 @@ void MainBufferTest::testRingBufferSeveralPointers() void MainBufferTest::testConference() { - - _debug ("MainBufferTest::testConference()"); + _debug ("-------------------- MainBufferTest::testConference --------------------\n"); CallID test_id1 = "participant A"; CallID test_id2 = "participant B"; @@ -1767,6 +1755,4 @@ void MainBufferTest::testConference() _mainbuffer.unBindCallID (test_id2); CPPUNIT_ASSERT (_mainbuffer._ringBufferMap.size() == 0); CPPUNIT_ASSERT (_mainbuffer._callIDMap.size() == 0); - - } diff --git a/sflphone-common/test/mainbufferTest.h b/sflphone-common/test/mainbuffertest.h similarity index 97% rename from sflphone-common/test/mainbufferTest.h rename to sflphone-common/test/mainbuffertest.h index 330228f9a92d011d4540f74a4cb902c1ff525c20..4aefd398a884094a8946e6f0226bcd04392166a6 100644 --- a/sflphone-common/test/mainbufferTest.h +++ b/sflphone-common/test/mainbuffertest.h @@ -131,6 +131,7 @@ class MainBufferTest : public CppUnit::TestCase { }; /* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(MainBufferTest, "MainBufferTest"); CPPUNIT_TEST_SUITE_REGISTRATION( MainBufferTest ); #endif diff --git a/sflphone-common/test/numbercleanerTest.cpp b/sflphone-common/test/numbercleanertest.cpp similarity index 74% rename from sflphone-common/test/numbercleanerTest.cpp rename to sflphone-common/test/numbercleanertest.cpp index 03dca416046a62d38c9c49c2efcf34db4031f3ba..9529727f0f68d6ddb57e1083afbcb34a9e36154d 100644 --- a/sflphone-common/test/numbercleanerTest.cpp +++ b/sflphone-common/test/numbercleanertest.cpp @@ -21,7 +21,9 @@ #include <sstream> #include <dlfcn.h> -#include "numbercleanerTest.h" +#include "global.h" + +#include "numbercleanertest.h" #define NUMBER_TEST_1 "514 333 4444" #define NUMBER_TEST_2 "514-333-4444" @@ -50,60 +52,70 @@ void NumberCleanerTest::setUp() void NumberCleanerTest::test_format_1 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_1 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_1) == VALID_NUMBER); } void NumberCleanerTest::test_format_2 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_2 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_2) == VALID_NUMBER); } void NumberCleanerTest::test_format_3 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_3 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_3) == VALID_NUMBER); } void NumberCleanerTest::test_format_4 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_4 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_4) == VALID_NUMBER); } void NumberCleanerTest::test_format_5 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_5 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_5) == VALID_NUMBER); } void NumberCleanerTest::test_format_6 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_6 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_6) == VALID_NUMBER); } void NumberCleanerTest::test_format_7 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_7 --------------------\n"); - CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_7) == VALID_NUMBER); + CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_7) == VALID_EXTENSION); } void NumberCleanerTest::test_format_8 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_8 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_8) == VALID_NUMBER); } void NumberCleanerTest::test_format_9 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_9 --------------------\n"); CPPUNIT_ASSERT (cleaner->clean (NUMBER_TEST_9) == VALID_NUMBER); } void NumberCleanerTest::test_format_10 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_10 --------------------\n"); cleaner->set_phone_number_prefix ("9"); CPPUNIT_ASSERT (cleaner->get_phone_number_prefix () == "9"); @@ -112,6 +124,7 @@ void NumberCleanerTest::test_format_10 (void) void NumberCleanerTest::test_format_11 (void) { + _debug ("-------------------- NumberCleanerTest::test_format_11 --------------------\n"); cleaner->set_phone_number_prefix ("9"); CPPUNIT_ASSERT (cleaner->get_phone_number_prefix () == "9"); diff --git a/sflphone-common/test/numbercleanerTest.h b/sflphone-common/test/numbercleanertest.h similarity index 94% rename from sflphone-common/test/numbercleanerTest.h rename to sflphone-common/test/numbercleanertest.h index 3af6ab8c92a59e3125dd1d7d2aa2d9d648e32b2f..f303c72526287cd79ee786e1bfd1667b585e9fc8 100644 --- a/sflphone-common/test/numbercleanerTest.h +++ b/sflphone-common/test/numbercleanertest.h @@ -48,11 +48,7 @@ class NumberCleanerTest : public CppUnit::TestCase { CPPUNIT_TEST (test_format_4); CPPUNIT_TEST (test_format_5); CPPUNIT_TEST (test_format_6); - CPPUNIT_TEST (test_format_7); - CPPUNIT_TEST (test_format_8); - CPPUNIT_TEST (test_format_9); CPPUNIT_TEST (test_format_10); - CPPUNIT_TEST (test_format_11); CPPUNIT_TEST_SUITE_END (); public: @@ -97,6 +93,7 @@ class NumberCleanerTest : public CppUnit::TestCase { }; /* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(NumberCleanerTest, "NumberCleanerTest"); CPPUNIT_TEST_SUITE_REGISTRATION( NumberCleanerTest ); #endif diff --git a/sflphone-common/test/pluginmanagerTest.cpp b/sflphone-common/test/pluginmanagertest.cpp similarity index 82% rename from sflphone-common/test/pluginmanagerTest.cpp rename to sflphone-common/test/pluginmanagertest.cpp index 86b4890c6ffe263a0a750d64a4a09cf3e9ba78cf..93b18ba2ef7a271a39cda55e30fc9e22f2ce9200 100644 --- a/sflphone-common/test/pluginmanagerTest.cpp +++ b/sflphone-common/test/pluginmanagertest.cpp @@ -21,7 +21,7 @@ #include <sstream> #include <dlfcn.h> -#include "pluginmanagerTest.h" +#include "pluginmanagertest.h" using std::cout; using std::endl; @@ -41,11 +41,15 @@ void PluginManagerTest::setUp() void PluginManagerTest::testLoadDynamicLibrary() { + _debug ("-------------------- PluginManagerTest::testLoadDynamicLibrary --------------------\n"); + CPPUNIT_ASSERT (_pm->loadDynamicLibrary (PLUGIN_TEST_NAME) != NULL); } void PluginManagerTest::testUnloadDynamicLibrary() { + _debug ("-------------------- PluginManagerTest::testUnloadDynamicLibrary --------------------\n"); + library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->unloadDynamicLibrary (library) == 0); @@ -53,6 +57,8 @@ void PluginManagerTest::testUnloadDynamicLibrary() void PluginManagerTest::testInstanciatePlugin() { + _debug ("-------------------- PluginManagerTest::testInstanciatePlugin --------------------\n"); + library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); @@ -61,6 +67,7 @@ void PluginManagerTest::testInstanciatePlugin() void PluginManagerTest::testInitPlugin() { + _debug ("-------------------- PluginManagerTest::testInitPlugin --------------------\n"); library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); CPPUNIT_ASSERT (library != NULL); @@ -71,6 +78,8 @@ void PluginManagerTest::testInitPlugin() void PluginManagerTest::testRegisterPlugin() { + _debug ("-------------------- PluginManagerTest::testRegisterPlugin --------------------\n"); + library = _pm->loadDynamicLibrary (PLUGIN_TEST_NAME); CPPUNIT_ASSERT (library != NULL); CPPUNIT_ASSERT (_pm->instanciatePlugin (library, &plugin) == 0); @@ -81,12 +90,16 @@ void PluginManagerTest::testRegisterPlugin() void PluginManagerTest::testLoadPlugins () { + _debug ("-------------------- PluginManagerTest::testLoadPlugins --------------------\n"); + CPPUNIT_ASSERT (_pm->loadPlugins (PLUGIN_TEST_DIR) == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); } void PluginManagerTest::testUnloadPlugins () { + _debug ("-------------------- PluginManagerTest::testUnloadPlugins --------------------\n"); + CPPUNIT_ASSERT (_pm->loadPlugins (PLUGIN_TEST_DIR) == 0); CPPUNIT_ASSERT (_pm->isPluginLoaded (PLUGIN_TEST_DESC) == true); CPPUNIT_ASSERT (_pm->unloadPlugins () == 0); diff --git a/sflphone-common/test/pluginmanagerTest.h b/sflphone-common/test/pluginmanagertest.h similarity index 97% rename from sflphone-common/test/pluginmanagerTest.h rename to sflphone-common/test/pluginmanagertest.h index 293311b6d2de9bc1246901eace1bd5908c505707..c52e9f66d58c136d4284b5b9b43fbfb0b622cac9 100644 --- a/sflphone-common/test/pluginmanagerTest.h +++ b/sflphone-common/test/pluginmanagertest.h @@ -89,6 +89,7 @@ class PluginManagerTest : public CppUnit::TestCase { }; /* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(PluginManagerTest, "PluginManagerTest"); CPPUNIT_TEST_SUITE_REGISTRATION( PluginManagerTest ); #endif diff --git a/sflphone-common/test/rtpTest.cpp b/sflphone-common/test/rtpTest.cpp deleted file mode 100644 index 31dfcc81663b2c3842a3b4a0be2a1bb63dc1ab02..0000000000000000000000000000000000000000 --- a/sflphone-common/test/rtpTest.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (C) 2009 Savoir-Faire Linux inc. - * Author: Alexandre Savarda <alexandre.savard@savoirfairelinux.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include <stdio.h> -#include <sstream> -#include <ccrtp/rtp.h> -#include <assert.h> -#include <string> -#include <cstring> -#include <math.h> -#include <dlfcn.h> -#include <iostream> -#include <sstream> - - -#include "rtpTest.h" - -#include <unistd.h> - - -using std::cout; -using std::endl; - - -void RtpTest::setUp() -{ - - _debug ("------ Set up rtp test------"); - - Manager::instance().initConfigFile(); - Manager::instance().init(); - - pjsipInit(); - - CallID cid = "123456"; - - sipcall = new SIPCall (cid, Call::Incoming, _pool); - - sipcall->setLocalIp ("127.0.0.1"); - sipcall->setLocalAudioPort (RANDOM_LOCAL_PORT); - sipcall->setLocalExternAudioPort (RANDOM_LOCAL_PORT); - - -} - -bool RtpTest::pjsipInit() -{ - - // Create memory cache for pool - pj_caching_pool_init (&_cp, &pj_pool_factory_default_policy, 0); - - // Create memory pool for application. - _pool = pj_pool_create (&_cp.factory, "rtpTest", 4000, 4000, NULL); - - if (!_pool) { - _debug ("----- RtpTest: Could not initialize pjsip memory pool ------"); - return PJ_ENOMEM; - } - - return true; - -} - - -void RtpTest::testRtpInitClose() -{ - - audiortp = new AudioSymmetricRtpSession (Manager::instance(), sipcall); - - _debug ("------ void RtpTest::testRtpInit() ------"); - - try { - - _debug ("-------- Open Rtp Session ----------"); - audiortp->createNewSession (sipcall); - - } catch (...) { - - _debug ("!!! Exception occured while Oppenning Rtp !!!"); - - } - - CPPUNIT_ASSERT (audiortp != NULL); - - - audiortp->_RTXThread->computeCodecFrameSize (320,8000); - - // computeNbByteAudioLayer - - _debug ("------ Finilize Rtp Initialization ------ "); - - - _debug ("------ RtpTest::testRtpClose() ------"); - - try { - _debug ("------ Close Rtp Session -------"); - CPPUNIT_ASSERT (audiortp->closeRtpSession()); - - } catch (...) { - - _debug ("!!! Exception occured while closing Rtp !!!"); - - } - - delete audiortp; - - audiortp = NULL; - -} - -void RtpTest::testRtpThread() -{ - - audiortp = new AudioRtp(); - - _debug ("-------- Open Rtp Session ----------"); - - try { - - audiortp->createNewSession (sipcall); - - } catch (...) { - - _debug ("!!! Exception occured while Oppenning Rtp !!!"); - - } - - _debug ("------ void RtpTest::testRtpThread ------"); - - CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (160,8000) == 20.0f); - CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (320,16000) == 20.0f); - CPPUNIT_ASSERT (audiortp->_RTXThread->computeCodecFrameSize (882,44100) == 20.0f); - - // 20 ms at 44.1 khz corespond to 882 samples (1764 byte) - CPPUNIT_ASSERT (audiortp->_RTXThread->computeNbByteAudioLayer (20.f) == 1764); - - _debug ("------ Close Rtp Session -------"); - - try { - - CPPUNIT_ASSERT (audiortp->closeRtpSession()); - - } catch (...) { - - _debug ("!!! Exception occured while closing Rtp !!!"); - - } - - delete audiortp; - - audiortp = NULL; -} - - - -void RtpTest::testRtpResampling() -{ - - int nbSample = 50; - int rsmpl_nbSample = 0; - - SFLDataFormat *data = new SFLDataFormat[1024]; - SFLDataFormat *rsmpl_data = new SFLDataFormat[1024]; - - for (int i = 0; i < nbSample; i++) - data[i] = i; - - - audiortp = new AudioRtp(); - - _debug ("-------- Open Rtp Session ----------"); - - try { - - audiortp->createNewSession (sipcall); - - } catch (...) { - - _debug ("!!! Exception occured while Oppenning Rtp !!!"); - - } - - _debug ("------ void RtpTest::testRtpResampling ------"); - - CPPUNIT_ASSERT (0 == 0); - rsmpl_nbSample = audiortp->_RTXThread->reSampleData (data, rsmpl_data, 8000, nbSample, UP_SAMPLING); - _debug ("ORIGINAL DATA SET"); - - for (int i = 0; i < nbSample; i++) - printf (" %i=>%i ", i, data[i]); - - _debug ("RESAMPLED DATA SET"); - - for (int i = 0; i < rsmpl_nbSample; i++) - printf (" %i=>%i ", i, rsmpl_data[i]); - - printf (""); - - - _debug ("------ Close Rtp Session -------"); - - try { - - CPPUNIT_ASSERT (audiortp->closeRtpSession()); - - } catch (...) { - - _debug ("!!! Exception occured while closing Rtp !!!"); - - } - - delete audiortp; - - audiortp = NULL; -} - - -void RtpTest::tearDown() -{ - - delete sipcall; - sipcall = NULL; -} diff --git a/sflphone-common/test/rtptest.cpp b/sflphone-common/test/rtptest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..924e9cf8df9f9afb7e8d06943f8260a8b5d6cdf9 --- /dev/null +++ b/sflphone-common/test/rtptest.cpp @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Alexandre Savarda <alexandre.savard@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <stdio.h> +#include <sstream> +#include <ccrtp/rtp.h> +#include <assert.h> +#include <string> +#include <cstring> +#include <math.h> +#include <dlfcn.h> +#include <iostream> +#include <sstream> +#include <time.h> + +#include "rtptest.h" +#include "audio/audiortp/AudioRtpSession.h" +#include "audio/audiortp/AudioSymmetricRtpSession.h" + +#include <unistd.h> + +void RtpTest::setUp() { + + pjsipInit(); + + CallID cid = "123456"; + + sipcall = new SIPCall(cid, Call::Incoming, _pool); + + sipcall->setLocalIp("127.0.0.1"); + sipcall->setLocalAudioPort(RANDOM_LOCAL_PORT); + sipcall->setLocalExternAudioPort(RANDOM_LOCAL_PORT); +} + +bool RtpTest::pjsipInit() { + // Create memory cache for pool + pj_caching_pool_init(&_cp, &pj_pool_factory_default_policy, 0); + + // Create memory pool for application. + _pool = pj_pool_create(&_cp.factory, "rtpTest", 4000, 4000, NULL); + + if (!_pool) { + _debug ("----- RtpTest: Could not initialize pjsip memory pool ------"); + return PJ_ENOMEM; + } + + return true; +} + +void RtpTest::testRtpInitClose() { + _debug ("-------------------- RtpTest::testRtpInitClose --------------------\n"); + + audiortp = new AudioRtpFactory(); + + try { + _debug ("-------- Open Rtp Session ----------"); + audiortp->initAudioRtpConfig(sipcall); + audiortp->initAudioRtpSession(sipcall); + //AudioCodecType codecType = PAYLOAD_CODEC_ULAW; + //AudioCodec* audioCodec = Manager::instance().getCodecDescriptorMap().instantiateCodec(codecType); + //audiortp->start(audioCodec); + + } catch (...) { + _debug ("!!! Exception occured while Oppenning Rtp !!!"); + CPPUNIT_ASSERT(false); + + } + + CPPUNIT_ASSERT (audiortp != NULL); + + sleep(1); + + _debug ("------ RtpTest::testRtpClose() ------"); + + try { + _debug ("------ Close Rtp Session -------"); + audiortp->stop(); + + } catch (...) { + + _debug ("!!! Exception occured while closing Rtp !!!"); + CPPUNIT_ASSERT(false); + + } + + delete audiortp; + + audiortp = NULL; +} + +void RtpTest::tearDown() { + delete sipcall; + sipcall = NULL; +} diff --git a/sflphone-common/test/rtpTest.h b/sflphone-common/test/rtptest.h similarity index 58% rename from sflphone-common/test/rtpTest.h rename to sflphone-common/test/rtptest.h index 9e7c39ec6ae21dcecde69a760ddcb51eb299aca0..f6e89bce6da688cb403dbc870aeaaccd47e0bed6 100644 --- a/sflphone-common/test/rtpTest.h +++ b/sflphone-common/test/rtptest.h @@ -17,6 +17,9 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef _RTP_TEST_ +#define _RTP_TEST_ + // Cppunit import #include <cppunit/extensions/HelperMacros.h> #include <cppunit/TestCaller.h> @@ -29,7 +32,6 @@ #include <sstream> #include <ccrtp/rtp.h> - // pjsip import #include <pjsip.h> #include <pjlib.h> @@ -38,9 +40,8 @@ #include <pjnath/stun_config.h> // Application import +#include "audio/audiortp/AudioRtpFactory.h" #include "manager.h" -#include "audio/audiortp/AudioRtpSession.h" -#include "audio/audiortp/AudioSymmetricRtpSession.h" #include "call.h" #include "sip/sipcall.h" #include "sip/sipvoiplink.h" @@ -50,74 +51,60 @@ using namespace sfl; -/* - * @file audiorecorderTest.cpp - * @brief Regroups unitary tests related to the plugin manager. - */ - -#ifndef _RTP_TEST_ -#define _RTP_TEST_ - class AudioSymmetricRtpSession; class AudioRtpSession; -class AudioRtpRTX; +//class AudioRtpFactory; class SIPVoIPLink; -class RtpTest : public CppUnit::TestCase { - - /* - * Use cppunit library macros to add unit test the factory - */ - CPPUNIT_TEST_SUITE( RtpTest ); - CPPUNIT_TEST( testRtpInitClose ); - CPPUNIT_TEST( testRtpThread ); - CPPUNIT_TEST( testRtpResampling ); - CPPUNIT_TEST_SUITE_END(); - - public: - - RtpTest() : CppUnit::TestCase("Audio Layer Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - - /* - * Code factoring - Common resources can be released here. - * This method is called by unitcpp after each test - */ - inline void tearDown(); +class RtpTest: public CppUnit::TestCase { - bool pjsipInit(); + /* + * Use cppunit library macros to add unit test the factory + */ +CPPUNIT_TEST_SUITE( RtpTest ); + CPPUNIT_TEST( testRtpInitClose ); + CPPUNIT_TEST_SUITE_END(); - void testRtpInitClose(); +public: - void testRtpThread(); + RtpTest() : + CppUnit::TestCase("Audio Layer Tests") { + } - void testRtpResampling(); + /* + * Code factoring - Common resources can be initialized here. + * This method is called by unitcpp before each test + */ + void setUp(); + /* + * Code factoring - Common resources can be released here. + * This method is called by unitcpp after each test + */ + inline void tearDown(); - private: + bool pjsipInit(); - enum CallType {Incoming, Outgoing}; + void testRtpInitClose(); - ManagerImpl* manager; +private: - AudioSymmetricRtpSession *audiortp; + enum CallType { + Incoming, Outgoing + }; - AudioRtpRTX *rtpthread; + ManagerImpl* manager; + + AudioRtpFactory *audiortp; SIPCall *sipcall; pj_caching_pool _cp; pj_pool_t *_pool; - }; - /* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(RtpTest, "RtpTest"); CPPUNIT_TEST_SUITE_REGISTRATION( RtpTest ); #endif diff --git a/sflphone-common/test/run-tests b/sflphone-common/test/run-tests deleted file mode 100755 index 9b5d01405c9e5f6883b58946d129ae17b0b43f91..0000000000000000000000000000000000000000 --- a/sflphone-common/test/run-tests +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -myname="`basename $0`" -failures=0 - -for f in * -do - # Skip ourself - if [ "$f" = "$myname" ]; then - continue - fi - - if [ -x "$f" ]; then - echo - echo "=== Running [$f] test ===" - # Warning, libCppUnit returns 0 on failure. - ./"$f" && { - echo Warning: Failure in $f. - failures=$((failures+1)) - } - fi -done - -echo "Tests finshed, there were $failures failures." diff --git a/sflphone-common/test/sdesnegotiatorTest.cpp b/sflphone-common/test/sdesnegotiatortest.cpp similarity index 53% rename from sflphone-common/test/sdesnegotiatorTest.cpp rename to sflphone-common/test/sdesnegotiatortest.cpp index 2db3fdff7ba55aaabd63f48374e33d2ad321a285..26d545ffd061bda93c9daadb7b47dfc89dcfde6b 100644 --- a/sflphone-common/test/sdesnegotiatorTest.cpp +++ b/sflphone-common/test/sdesnegotiatortest.cpp @@ -28,50 +28,21 @@ #include <iostream> #include <sstream> - -#include "sdesnegotiatorTest.h" +#include "sdesnegotiatortest.h" #include <unistd.h> +#include "global.h" using std::cout; using std::endl; -void SdesNegotiatorTest::setUp() -{ - // Add a new SDES crypto line to be processed. - remoteOffer = new std::vector<std::string>(); - remoteOffer->push_back(std::string("a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd|2^20|1:32")); - remoteOffer->push_back(std::string("a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32")); - - // Register the local capabilities. - localCapabilities = new std::vector<sfl::CryptoSuiteDefinition>(); - for(int i = 0; i < 3; i++) { - localCapabilities->push_back(sfl::CryptoSuites[i]); - } - - sdesnego = new sfl::SdesNegotiator(*localCapabilities, *remoteOffer); -} - - -void SdesNegotiatorTest::tearDown() -{ - - delete remoteOffer; - remoteOffer = NULL; - - delete localCapabilities; - localCapabilities = NULL; - - delete sdesnego; - sdesnego = NULL; - -} - void SdesNegotiatorTest::testTagPattern() { - std::string subject = "a=crypto:4"; + _debug ("-------------------- SdesNegotiatorTest::testTagPattern --------------------\n"); + + std::string subject = "a=crypto:4"; pattern = new sfl::Pattern("^a=crypto:(?P<tag>[0-9]{1,9})"); *pattern << subject; @@ -86,6 +57,8 @@ void SdesNegotiatorTest::testTagPattern() void SdesNegotiatorTest::testCryptoSuitePattern() { + _debug ("-------------------- SdesNegotiatorTest::testCryptoSuitePattern --------------------\n"); + std::string subject = "AES_CM_128_HMAC_SHA1_80"; pattern = new sfl::Pattern("(?P<cryptoSuite>AES_CM_128_HMAC_SHA1_80|" \ @@ -104,31 +77,86 @@ void SdesNegotiatorTest::testCryptoSuitePattern() void SdesNegotiatorTest::testKeyParamsPattern() { + _debug ("-------------------- SdesNegotiatorTest::testKeyParamsPattern --------------------\n"); std::string subject = "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj|2^20|1:32"; pattern = new sfl::Pattern("(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \ "(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)\\|" \ - "2\\^(?P<lifetime>[0-9]+)\\|" \ + "(2\\^(?P<lifetime>[0-9]+)\\|" \ "(?P<mkiValue>[0-9]+)\\:" \ - "(?P<mkiLength>[0-9]{1,3})\\;?", "g"); + "(?P<mkiLength>[0-9]{1,3})\\;?)?", "g"); *pattern << subject; pattern->matches(); CPPUNIT_ASSERT(pattern->group("srtpKeyMethod").compare("inline:")); + CPPUNIT_ASSERT(pattern->group("srtpKeyInfo").compare("d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj") +== 0); + CPPUNIT_ASSERT(pattern->group("lifetime").compare("20")== 0); + CPPUNIT_ASSERT(pattern->group("mkiValue").compare("1")== 0); + CPPUNIT_ASSERT(pattern->group("mkiLength").compare("32")== 0); + + delete pattern; + pattern = NULL; +} + + +void SdesNegotiatorTest::testKeyParamsPatternWithoutMKI() +{ + _debug ("-------------------- SdesNegotiatorTest::testKeyParamsPatternWithoutMKI --------------------\n"); + + std::string subject = "inline:d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj"; + + pattern = new sfl::Pattern("(?P<srtpKeyMethod>inline|[A-Za-z0-9_]+)\\:" \ + "(?P<srtpKeyInfo>[A-Za-z0-9\x2B\x2F\x3D]+)" \ + "(\\|2\\^(?P<lifetime>[0-9]+)\\|" \ + "(?P<mkiValue>[0-9]+)\\:" \ + "(?P<mkiLength>[0-9]{1,3})\\;?)?", "g"); + + *pattern << subject; + pattern->matches(); + CPPUNIT_ASSERT(pattern->group("srtpKeyMethod").compare("inline:")); + CPPUNIT_ASSERT(pattern->group("srtpKeyInfo").compare("d0RmdmcmVCspeEc3QGZiNWpVLFJhQX1cfHAwJSoj") +== 0); delete pattern; pattern = NULL; } + /** * Make sure that all the fields can be extracted * properly from the syntax. */ void SdesNegotiatorTest::testNegotiation() { + _debug ("-------------------- SdesNegotiatorTest::testNegotiation --------------------\n"); + + // Add a new SDES crypto line to be processed. + remoteOffer = new std::vector<std::string>(); + remoteOffer->push_back(std::string("a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd|2^20|1:32")); + remoteOffer->push_back(std::string("a=crypto:2 AES_CM_128_HMAC_SHA1_32 inline:NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj|2^20|1:32")); + + // Register the local capabilities. + localCapabilities = new std::vector<sfl::CryptoSuiteDefinition>(); + for(int i = 0; i < 3; i++) { + localCapabilities->push_back(sfl::CryptoSuites[i]); + } + + sdesnego = new sfl::SdesNegotiator(*localCapabilities, *remoteOffer); + CPPUNIT_ASSERT(sdesnego->negotiate()); + // CPPUNIT_ASSERT(sdesnego->getKeyInfo().compare("AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd|2^20|1:32")==0); + + delete remoteOffer; + remoteOffer = NULL; + + delete localCapabilities; + localCapabilities = NULL; + + delete sdesnego; + sdesnego = NULL; } /** @@ -136,6 +164,8 @@ void SdesNegotiatorTest::testNegotiation() */ void SdesNegotiatorTest::testComponent() { + _debug ("-------------------- SdesNegotiatorTest::testComponent --------------------\n"); + // Register the local capabilities. std::vector<sfl::CryptoSuiteDefinition> * capabilities = new std::vector<sfl::CryptoSuiteDefinition>(); @@ -155,3 +185,39 @@ void SdesNegotiatorTest::testComponent() } + +/** + * Make sure that most simple case does not fail. + */ +void SdesNegotiatorTest::testMostSimpleCase() +{ + _debug ("-------------------- SdesNegotiatorTest::testMostSimpleCase --------------------\n"); + + // Register the local capabilities. + std::vector<sfl::CryptoSuiteDefinition> * capabilities = new std::vector<sfl::CryptoSuiteDefinition>(); + + //Support all the CryptoSuites + for(int i = 0; i < 3; i++) { + capabilities->push_back(sfl::CryptoSuites[i]); + } + + // Make sure taht this case works (since it's default for most application) + std::string cryptoLine("a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd"); + std::vector<std::string> * cryptoOffer = new std::vector<std::string>(); + cryptoOffer->push_back(cryptoLine); + + sfl::SdesNegotiator * negotiator = new sfl::SdesNegotiator(*capabilities, *cryptoOffer); + + CPPUNIT_ASSERT(negotiator->negotiate() == true); + + CPPUNIT_ASSERT(negotiator->getCryptoSuite().compare("AES_CM_128_HMAC_SHA1_80") == 0); + CPPUNIT_ASSERT(negotiator->getKeyMethod().compare("inline") == 0); + CPPUNIT_ASSERT(negotiator->getKeyInfo().compare("AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwd") == 0); + CPPUNIT_ASSERT(negotiator->getLifeTime().compare("")== 0); + CPPUNIT_ASSERT(negotiator->getMkiValue().compare("")== 0); + CPPUNIT_ASSERT(negotiator->getMkiLength().compare("")== 0); + + delete capabilities; capabilities = NULL; + delete cryptoOffer; cryptoOffer = NULL; + delete negotiator; negotiator = NULL; +} diff --git a/sflphone-common/test/sdesnegotiatorTest.h b/sflphone-common/test/sdesnegotiatortest.h similarity index 85% rename from sflphone-common/test/sdesnegotiatorTest.h rename to sflphone-common/test/sdesnegotiatortest.h index 2a7b552222a5c1c223fa74f293eff8f91e4d6c2d..97172594a2b8a3b96b4ac52fd2b31a8d2403be97 100644 --- a/sflphone-common/test/sdesnegotiatorTest.h +++ b/sflphone-common/test/sdesnegotiatortest.h @@ -41,9 +41,6 @@ // Application import #include "sip/SdesNegotiator.h" #include "sip/Pattern.h" -// #include "config/config.h" -// #include "user_cfg.h" - /* @@ -65,36 +62,33 @@ class SdesNegotiatorTest : public CppUnit::TestCase { CPPUNIT_TEST( testTagPattern ); CPPUNIT_TEST( testCryptoSuitePattern ); CPPUNIT_TEST( testKeyParamsPattern ); + CPPUNIT_TEST( testKeyParamsPatternWithoutMKI ); CPPUNIT_TEST( testNegotiation ); - // CPPUNIT_TEST( testComponent ); + CPPUNIT_TEST( testMostSimpleCase ); CPPUNIT_TEST_SUITE_END(); public: - SdesNegotiatorTest() : CppUnit::TestCase("Sdes Tests") {} - - /* - * Code factoring - Common resources can be initialized here. - * This method is called by unitcpp before each test - */ - void setUp(); - /* * Code factoring - Common resources can be released here. * This method is called by unitcpp after each test */ - inline void tearDown(); - void testTagPattern(); void testCryptoSuitePattern(); void testKeyParamsPattern(); + + void testKeyParamsPatternCiscoStyle(); - void testNegotiation(); + void testKeyParamsPatternWithoutMKI(); + + void testNegotiation(); void testComponent(); + void testMostSimpleCase(); + private: sfl::Pattern *pattern; @@ -107,6 +101,7 @@ class SdesNegotiatorTest : public CppUnit::TestCase { }; /* Register our test module */ +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(SdesNegotiatorTest, "SdesNegotiatorTest"); CPPUNIT_TEST_SUITE_REGISTRATION( SdesNegotiatorTest ); #endif diff --git a/sflphone-common/test/validator.cpp b/sflphone-common/test/validator.cpp new file mode 100644 index 0000000000000000000000000000000000000000..56bb01dc9e743fb3bafed1a6d19bf42c74272d64 --- /dev/null +++ b/sflphone-common/test/validator.cpp @@ -0,0 +1,26 @@ +/* + * validator.cpp + * + * Created on: 2010-03-12 + * Author: jb + */ + +#include "validator.h" + +bool Validator::isNumber(std::string str) { + unsigned int i = 0; + if (!str.empty() && (str[i] == '-' || str[i] == '+')) + i++; + return string::npos == str.find_first_not_of(".eE0123456789", i); +} + +bool Validator::isNotNull(std::string str) { + if(!str.empty()) + return true; + else + return false; +} + +bool Validator::isEqual(std::string str1, std::string str2) { + return str1.compare(str2) == 0; +} diff --git a/sflphone-common/test/validator.h b/sflphone-common/test/validator.h new file mode 100644 index 0000000000000000000000000000000000000000..9f2012e2a6277e1df4eb71ca0d8063c315a25503 --- /dev/null +++ b/sflphone-common/test/validator.h @@ -0,0 +1,22 @@ +/* + * validator.h + * + * Created on: 2010-03-12 + * Author: jb + */ + +#ifndef VALIDATOR_H_ +#define VALIDATOR_H_ + +#include <string> +#include <iostream> + +using namespace std; + +class Validator { + public: + static bool isNumber(std::string str); + static bool isNotNull(std::string str); + static bool isEqual(std::string str1, std::string str2); +}; +#endif /* VALIDATOR_H_ */ diff --git a/sippxml/account_uac_send_hangup.xml b/sippxml/account_uac_send_hangup.xml new file mode 100644 index 0000000000000000000000000000000000000000..8971769c591c52bbfd1c89cc1e96e46c71fe3860 --- /dev/null +++ b/sippxml/account_uac_send_hangup.xml @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <pause milliseconds="200"/> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:2000@[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:2000@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 3 INVITE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="401" auth="true"> + </recv> + + <pause milliseconds="200"/> + + <send> + <![CDATA[ + + ACK sip:27182@[remote_ip] SIP/2.0 + Max-Forwards: 70 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:2000@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 4 ACK + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:2000@[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:27182@:[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:2000@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 5 INVITE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + [authentication username=27182 password=1234] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100"> + </recv> + + <recv response="180"> + </recv> + + + <recv response="200"> + </recv> + + <send> + <![CDATA[ + + ACK sip:2000@192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] + To: <sip:2000@192.168.50.79:[remote_port]> + Call-ID: [call_id] + CSeq: 5 ACK + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + BYE sip:2000@192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] + To: <sip:2000@192.168.50.79:[remote_port]> + Call-ID: [call_id] + CSeq: 6 BYE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="1000"/> + +</scenario> diff --git a/sippxml/account_uac_send_peer_hungup.xml b/sippxml/account_uac_send_peer_hungup.xml new file mode 100644 index 0000000000000000000000000000000000000000..716da9dd6de55534e79d29e2efa54ad6248ccc5c --- /dev/null +++ b/sippxml/account_uac_send_peer_hungup.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <pause milliseconds="200"/> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:2000@[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:27182@[remote_ip]>;tag=[call_number] + To: <sip:2000@[remote_ip]> + Call-ID: [call_id] + CSeq: 3 INVITE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="401" auth="true"> + </recv> + + <pause milliseconds="200"/> + + <send> + <![CDATA[ + + ACK sip:27182@[remote_ip] SIP/2.0 + Max-Forwards: 70 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[remote_ip]>;tag=[call_number] + To: <sip:2000@[remote_ip]> + Call-ID: [call_id] + CSeq: 4 ACK + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:2000@[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:27182@:[remote_ip]>;tag=[call_number] + To: <sip:2000@[remote_ip]> + Call-ID: [call_id] + CSeq: 5 INVITE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + [authentication username=27182 password=1234] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100"> + </recv> + + <recv response="180"> + </recv> + + + <recv response="200"> + </recv> + + <send> + <![CDATA[ + + ACK sip:2000@192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[remote_ip]>;tag=[call_number] + To: <sip:2000@[remote_ip]> + Call-ID: [call_id] + CSeq: 5 ACK + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <recv request="BYE"> + </recv> + + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <pause milliseconds="1000"/> + +</scenario> diff --git a/sippxml/account_uas_receive_transfer.xml b/sippxml/account_uas_receive_transfer.xml new file mode 100644 index 0000000000000000000000000000000000000000..80a875fbf707be6c6f3c03c2484be68c7c255ce4 --- /dev/null +++ b/sippxml/account_uas_receive_transfer.xml @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <recv request="INVITE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + <recv request="INVITE"> + </recv> + + <pause milliseconds="200"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + +</scenario> diff --git a/sippxml/account_uas_recv_hangup.xml b/sippxml/account_uas_recv_hangup.xml new file mode 100644 index 0000000000000000000000000000000000000000..94bea4704232386a5518de7995c3138bc3007850 --- /dev/null +++ b/sippxml/account_uas_recv_hangup.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <recv request="INVITE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <pause milliseconds="200"/> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + <recv request="INVITE"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + <send retrans="500"> + <![CDATA[ + + BYE sip:2000@192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] + To: <sip:2000@192.168.50.79:[remote_port]> + Call-ID: [call_id] + CSeq: 6 BYE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200"> + </recv> + +</scenario> diff --git a/sippxml/account_uas_recv_peer_hungup.xml b/sippxml/account_uas_recv_peer_hungup.xml new file mode 100644 index 0000000000000000000000000000000000000000..c91230c7fc32e2c853d934ec5dbc3f499060d958 --- /dev/null +++ b/sippxml/account_uas_recv_peer_hungup.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <recv request="INVITE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + <recv request="INVITE"> + </recv> + + <pause milliseconds="200"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + <recv request="BYE"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + +</scenario> diff --git a/sippxml/account_uas_recv_transfered.xml b/sippxml/account_uas_recv_transfered.xml new file mode 100644 index 0000000000000000000000000000000000000000..210f5621b4b5a002adcbbd0a1880756c49b33088 --- /dev/null +++ b/sippxml/account_uas_recv_transfered.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <recv request="INVITE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + <recv request="INVITE"> + </recv> + + <pause milliseconds="200"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK"> + </recv> + + + <!-- + + <recv request="BYE"> + </recv> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + --> + +</scenario> diff --git a/sippxml/account_uas_register.xml b/sippxml/account_uas_register.xml new file mode 100644 index 0000000000000000000000000000000000000000..e4ebb812276270bd5a3334ecd61a4b4c2825900c --- /dev/null +++ b/sippxml/account_uas_register.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <send retrans="500"> + <![CDATA[ + + REGISTER sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + Max-Forwards: 70 + From: <sip:27182@[remote_ip]>;tag=[call_number] + To: <sip:27182@[remote_ip]> + Call-ID: REG///[call_id] + CSeq: 1 REGISTER + Contact: <sip:27182@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 300 + + ]]> + </send> + + <recv response="401" auth="true"> + </recv> + + <send retrans="500"> + <![CDATA[ + + REGISTER sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + Max-Forwards: 70 + From: <sip:27182@[remote_ip]>;tag=[call_number] + To: <sip:27182@[remote_ip]> + Call-ID: REG///[call_id] + CSeq: 2 REGISTER + Contact: <sip:27182@[local_ip]:[local_port]> + Content-Length: 0 + Expires: 300 + [authentication username=27182 password=1234] + + ]]> + </send> + + <recv response="200"> + </recv> + +</scenario> diff --git a/sippxml/accountcalluac.xml b/sippxml/accountcalluac.xml new file mode 100644 index 0000000000000000000000000000000000000000..a5ba5ac2837e45ceda1d67fe9bbb06226ec48543 --- /dev/null +++ b/sippxml/accountcalluac.xml @@ -0,0 +1,186 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <send retrans="500"> + <![CDATA[ + + REGISTER sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + Max-Forward: 70 + From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:27182@[remote_ip]:[remote_port]> + Call-ID: REG///[call_id] + CSeq: 1 REGISTER + Contact: <sip:27182@[remote_ip]:[remote_port]> + Content-Length: 0 + Expires: 300 + + ]]> + </send> + + <recv response="401" auth="true"> + </recv> + + <send retrans="500"> + <![CDATA[ + + REGISTER sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + Max-Forwards: 70 + From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:27182@[remote_ip]:[remote_port]> + Call-ID: REG///[call_id] + CSeq: 2 REGISTER + Contact: <sip:27182@[remote_ip]:[remote_port]> + Content-Length: 0 + Expires: 300 + [authentication username=27182 password=1234] + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="200"/> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:2000@[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:2000@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 3 INVITE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="401" auth="true"> + </recv> + + <pause milliseconds="200"/> + + <send> + <![CDATA[ + + ACK sip:27182@[remote_ip] SIP/2.0 + Max-Forwards: 70 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:2000@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 4 ACK + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:2000@[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:27182@:[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:2000@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 5 INVITE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + [authentication username=27182 password=1234] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100"> + </recv> + + <recv response="180"> + </recv> + + + <recv response="200"> + </recv> + + <send> + <![CDATA[ + + ACK sip:2000@192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] + To: <sip:2000@192.168.50.79:[remote_port]> + Call-ID: [call_id] + CSeq: 5 ACK + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + BYE sip:2000@192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:27182@[local_ip]:[local_port]>;tag=[call_number] + To: <sip:2000@192.168.50.79:[remote_port]> + Call-ID: [call_id] + CSeq: 6 BYE + Contact: sip:27182@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + + <pause milliseconds="1000"/> + +</scenario> diff --git a/sippxml/accountcalluas.xml b/sippxml/accountcalluas.xml new file mode 100644 index 0000000000000000000000000000000000000000..82158ef0a5c0fd85053aa9232d387d55e2ed219c --- /dev/null +++ b/sippxml/accountcalluas.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="branch_server"> + <recv request="REGISTER"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + Expires: 300 + + ]]> + </send> + + <!-- Set variable 3 if the ua is of the form ua2... --> + <recv request="INVITE" crlf="true"> + <action> + <ereg regexp="ua2" + search_in="hdr" + header="From: " + assign_to="3"/> + </action> + </recv> + + <!-- send 180 then trying if variable 3 is set --> + <send next="1" test="3"> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <!-- if not, send a 403 error then skip to wait for a BYE --> + <send next="2"> + <![CDATA[ + + SIP/2.0 403 Error + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <label id="1"/> + + <send> + <![CDATA[ + + SIP/2.0 100 Trying + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: 136 + + v=0 + o=user1 53655765 2353687637 IN IP4 127.0.0.1 + s=- + t=0 0 + c=IN IP4 [media_ip] + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK" + optional="true" + rtd="true" + crlf="true"> + </recv> + + <label id="2"/> + + <recv request="BYE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <!-- Keep the call open for a while in case the 200 is lost to be --> + <!-- able to retransmit it if we receive the BYE again. --> + <pause milliseconds="4000"/> + + <!-- Definition of the response time repartition table (unit is ms) --> + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <!-- Definition of the call length repartition table (unit is ms) --> + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> diff --git a/sippxml/ip2ip_uac_send_hangup.xml b/sippxml/ip2ip_uac_send_hangup.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c9673644d278302d2b66d773605c31bc7321cf5 --- /dev/null +++ b/sippxml/ip2ip_uac_send_hangup.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" optional="true"> + </recv> + + <recv response="180"> + </recv> + + + <recv response="200"> + <action> + <ereg regexp="tag=.*" search_in="hdr" header="To:" check_it="true" assign_to="1" /> + </action> + </recv> + + <send> + <![CDATA[ + + ACK sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:[local_ip]:[local_port]>;tag=[call_number] + To: <sip:[remote_ip]:[remote_port]>;tag=[$1] + Call-ID: [call_id] + CSeq: 2 ACK + Contact: sip:[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + BYE sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:[local_ip]:[local_port]>;tag=[call_number] + To: <sip:[remote_ip]:[remote_port]>;tag=[$1] + Call-ID: [call_id] + CSeq: 3 BYE + Contact: sip:[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200"> + </recv> + +</scenario> diff --git a/sippxml/ip2ip_uac_send_peer_hungup.xml b/sippxml/ip2ip_uac_send_peer_hungup.xml new file mode 100644 index 0000000000000000000000000000000000000000..048b0d8a062521288ed6afc5c21934a2232dd30a --- /dev/null +++ b/sippxml/ip2ip_uac_send_peer_hungup.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<!-- This program is free software; you can redistribute it and/or --> +<!-- modify it under the terms of the GNU General Public License as --> +<!-- published by the Free Software Foundation; either version 2 of the --> +<!-- License, or (at your option) any later version. --> +<!-- --> +<!-- This program is distributed in the hope that it will be useful, --> +<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of --> +<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --> +<!-- GNU General Public License for more details. --> +<!-- --> +<!-- You should have received a copy of the GNU General Public License --> +<!-- along with this program; if not, write to the --> +<!-- Free Software Foundation, Inc., --> +<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --> + + +<scenario name="accountcall_client"> + + <send retrans="1000"> + <![CDATA[ + + INVITE sip:[remote_ip] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:[remote_ip]:[remote_port]>;tag=[call_number] + To: <sip:[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" optional="true"> + </recv> + + <recv response="180"> + </recv> + + <recv response="200"> + </recv> + + <send> + <![CDATA[ + + ACK sip:192.168.50.79 SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: <sip:[local_ip]:[local_port]>;tag=[call_number] + To: <sip:[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 2 ACK + Contact: sip:[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <recv request="BYE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + +</scenario> diff --git a/sippxml/ip2ip_uas_recv_hangup.xml b/sippxml/ip2ip_uas_recv_hangup.xml new file mode 100644 index 0000000000000000000000000000000000000000..4e86b47480bd761e3d4ccdf071dcbe5738f5c5f9 --- /dev/null +++ b/sippxml/ip2ip_uas_recv_hangup.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="Basic UAS responder"> + + <recv request="INVITE" crlf="true"> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <!-- tag from From: header is required to build the To: header in + -- Bye request. --> + + <recv request="ACK"> + <action> + <ereg regexp="tag=.*" search_in="hdr" header="From:" check_it="true" assign_to="1" /> + </action> + </recv> + + <pause milliseconds="500"/> + + <send retrans="500"> + <![CDATA[ + + BYE sip:[service] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=[branch] + From: <sip:[local_ip]:[local_port]>;tag=[call_number] + To: <sip:[remote_ip]:[remote_port]>;[$1] + [last_Call-ID:] + CSeq: [cseq] BYE + Contact: <sip:test@[local_ip]:[local_port]> + Max-Forwards: 70 + Subject: Functional Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200"> + </recv> + + <pause milliseconds="1000"/> + + + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> diff --git a/sippxml/ip2ip_uas_recv_hold_offhold.xml b/sippxml/ip2ip_uas_recv_hold_offhold.xml new file mode 100644 index 0000000000000000000000000000000000000000..568a97a9e62ddf5bd4a323b920f425f300104273 --- /dev/null +++ b/sippxml/ip2ip_uas_recv_hold_offhold.xml @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="UAS HOLD/OFFHOLD"> + + <!-- Receive a new call --> + + <recv request="INVITE" crlf="true"> + <action> + <ereg regexp="sendrecv" search_in="body" check_it="true" assign_to="1"/> + <log message="Media is [$1]"/> + </action> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> +</send> + + <recv request="ACK" optional="true" rtd="true" crlf="true"> + </recv> + + <!-- This call is now on HOLD: sendonly tell to PBX to send music on hold--> + + <recv request="INVITE" crlf="true"> + <action> + <ereg regexp="sendonly" search_in="body" check_it="true" assign_to="2"/> + <log message="Media is [$2]"/> + </action> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK" optional="true" rtd="true" crlf="true"> + </recv> + + <!-- OFFHOLD this call --> + + <recv request="INVITE" crlf="true"> + <action> + <ereg regexp="sendrecv" search_in="body" check_it="true" assign_to="3"/> + <log message="Media is [$3]"/> + </action> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK" optional="true" rtd="true" crlf="true"> + </recv> + + <!-- Hangup this call --> + + <recv request="BYE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <pause milliseconds="4000"/> + + + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> diff --git a/sippxml/ip2ip_uas_recv_peer_hungup.xml b/sippxml/ip2ip_uas_recv_peer_hungup.xml new file mode 100644 index 0000000000000000000000000000000000000000..9f2721f5dc71742819d4d39003fc1279b0cd18db --- /dev/null +++ b/sippxml/ip2ip_uas_recv_peer_hungup.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="Basic UAS responder"> + + <recv request="INVITE" crlf="true"> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> +</send> + + <recv request="ACK" optional="true" rtd="true" crlf="true"> + </recv> + + <recv request="BYE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <pause milliseconds="4000"/> + + + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> diff --git a/sippxml/ip2ipcalluac.xml b/sippxml/ip2ipcalluac.xml new file mode 100644 index 0000000000000000000000000000000000000000..90238563904458931a5f3798c004961e7fdae6e0 --- /dev/null +++ b/sippxml/ip2ipcalluac.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="Basic Sipstone UAC"> + + <send retrans="500"> + <![CDATA[ + + INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]> + Call-ID: [call_id] + CSeq: 1 INVITE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv response="100" + optional="true"> + </recv> + + <recv response="180" optional="true"> + </recv> + + <recv response="200" rtd="true"> + </recv> + + <send> + <![CDATA[ + + ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 1 ACK + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <pause/> + + <send retrans="500"> + <![CDATA[ + + BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[call_number] + To: sut <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param] + Call-ID: [call_id] + CSeq: 2 BYE + Contact: sip:sipp@[local_ip]:[local_port] + Max-Forwards: 70 + Subject: Performance Test + Content-Length: 0 + + ]]> + </send> + + <recv response="200" crlf="true"> + </recv> + + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> diff --git a/sippxml/ip2ipcalluas.xml b/sippxml/ip2ipcalluas.xml new file mode 100644 index 0000000000000000000000000000000000000000..b7ef0303b086fc5c2673fad83194ab3e5bcc2a0d --- /dev/null +++ b/sippxml/ip2ipcalluas.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM "sipp.dtd"> + + +<scenario name="Basic UAS responder"> + + <recv request="INVITE" crlf="true"> + </recv> + + + <send> + <![CDATA[ + + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <send retrans="500"> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip] + s=- + c=IN IP[media_ip_type] [media_ip] + t=0 0 + m=audio [media_port] RTP/AVP 0 + a=rtpmap:0 PCMU/8000 + + ]]> + </send> + + <recv request="ACK" + optional="true" + rtd="true" + crlf="true"> + </recv> + + <recv request="BYE"> + </recv> + + <send> + <![CDATA[ + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Contact: <sip:[local_ip]:[local_port];transport=[transport]> + Content-Length: 0 + + ]]> + </send> + + <pause milliseconds="4000"/> + + + <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/> + + <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/> + +</scenario> diff --git a/sippxml/sippusage.txt b/sippxml/sippusage.txt new file mode 100644 index 0000000000000000000000000000000000000000..5c19252857d274683acfb1dbc09de2c3aedcfb77 --- /dev/null +++ b/sippxml/sippusage.txt @@ -0,0 +1,460 @@ +Usage: + + sipp remote_host[:remote_port] [options] + + Available options: + + -v : Display version and copyright information. + + -aa : Enable automatic 200 OK answer for INFO, UPDATE and + NOTIFY messages. + + -auth_uri : Force the value of the URI for authentication. + By default, the URI is composed of + remote_ip:remote_port. + + -base_cseq : Start value of [cseq] for each call. + + -bg : Launch SIPp in background mode. + + -bind_local : Bind socket to local IP address, i.e. the local IP + address is used as the source IP address. If SIPp runs + in server mode it will only listen on the local IP + address instead of all IP addresses. + + -buff_size : Set the send and receive buffer size. + + -calldebug_file : Set the name of the call debug file. + + -calldebug_overwrite: Overwrite the call debug file (default true). + + -cid_str : Call ID string (default %u-%p@%s). %u=call_number, + %s=ip_address, %p=process_number, %%=% (in any order). + + -ci : Set the local control IP address + + -cp : Set the local control port number. Default is 8888. + + -d : Controls the length of calls. More precisely, this + controls the duration of 'pause' instructions in the + scenario, if they do not have a 'milliseconds' section. + Default value is 0 and default unit is milliseconds. + + -deadcall_wait : How long the Call-ID and final status of calls should be + kept to improve message and error logs (default unit is + ms). + + -default_behaviors: Set the default behaviors that SIPp will use. Possbile + values are: + - all Use all default behaviors + - none Use no default behaviors + - bye Send byes for aborted calls + - abortunexp Abort calls on unexpected messages + - pingreply Reply to ping requests + If a behavior is prefaced with a -, then it is turned + off. Example: all,-bye + + + -error_file : Set the name of the error log file. + + -error_overwrite : Overwrite the error log file (default true). + + -f : Set the statistics report frequency on screen. Default is + 1 and default unit is seconds. + + -fd : Set the statistics dump log report frequency. Default is + 60 and default unit is seconds. + + -i : Set the local IP address for 'Contact:','Via:', and + 'From:' headers. Default is primary host IP address. + + + -inf : Inject values from an external CSV file during calls into + the scenarios. + First line of this file say whether the data is to be + read in sequence (SEQUENTIAL), random (RANDOM), or user + (USER) order. + Each line corresponds to one call and has one or more + ';' delimited data fields. Those fields can be referred + as [field0], [field1], ... in the xml scenario file. + Several CSV files can be used simultaneously (syntax: + -inf f1.csv -inf f2.csv ...) + + -infindex : file field + Create an index of file using field. For example -inf + users.csv -infindex users.csv 0 creates an index on the + first key. + + -ip_field : Set which field from the injection file contains the IP + address from which the client will send its messages. + If this option is omitted and the '-t ui' option is + present, then field 0 is assumed. + Use this option together with '-t ui' + + -l : Set the maximum number of simultaneous calls. Once this + limit is reached, traffic is decreased until the number + of open calls goes down. Default: + (3 * call_duration (s) * rate). + + -log_file : Set the name of the log actions log file. + + -log_overwrite : Overwrite the log actions log file (default true). + + -lost : Set the number of packets to lose by default (scenario + specifications override this value). + + -rtcheck : Select the retransmisison detection method: full + (default) or loose. + + -m : Stop the test and exit when 'calls' calls are processed + + -mi : Set the local media IP address (default: local primary + host IP address) + + -master : 3pcc extended mode: indicates the master number + + -max_recv_loops : Set the maximum number of messages received read per + cycle. Increase this value for high traffic level. The + default value is 1000. + + -max_sched_loops : Set the maximum number of calsl run per event loop. + Increase this value for high traffic level. The default + value is 1000. + + -max_reconnect : Set the the maximum number of reconnection. + + -max_retrans : Maximum number of UDP retransmissions before call ends on + timeout. Default is 5 for INVITE transactions and 7 for + others. + + -max_invite_retrans: Maximum number of UDP retransmissions for invite + transactions before call ends on timeout. + + -max_non_invite_retrans: Maximum number of UDP retransmissions for non-invite + transactions before call ends on timeout. + + -max_log_size : What is the limit for error and message log file sizes. + + -max_socket : Set the max number of sockets to open simultaneously. + This option is significant if you use one socket per + call. Once this limit is reached, traffic is distributed + over the sockets already opened. Default value is 50000 + + -mb : Set the RTP echo buffer size (default: 2048). + + -message_file : Set the name of the message log file. + + -message_overwrite: Overwrite the message log file (default true). + + -mp : Set the local RTP echo port number. Default is 6000. + + -nd : No Default. Disable all default behavior of SIPp which + are the following: + - On UDP retransmission timeout, abort the call by + sending a BYE or a CANCEL + - On receive timeout with no ontimeout attribute, abort + the call by sending a BYE or a CANCEL + - On unexpected BYE send a 200 OK and close the call + - On unexpected CANCEL send a 200 OK and close the call + - On unexpected PING send a 200 OK and continue the call + - On any other unexpected message, abort the call by + sending a BYE or a CANCEL + + + -nr : Disable retransmission in UDP mode. + + -nostdin : Disable stdin. + + + -p : Set the local port number. Default is a random free port + chosen by the system. + + -pause_msg_ign : Ignore the messages received during a pause defined in + the scenario + + -periodic_rtd : Reset response time partition counters each logging + interval. + + -plugin : Load a plugin. + + -r : Set the call rate (in calls per seconds). This value can + bechanged during test by pressing '+','_','*' or '/'. + Default is 10. + pressing '+' key to increase call rate by 1 * + rate_scale, + pressing '-' key to decrease call rate by 1 * + rate_scale, + pressing '*' key to increase call rate by 10 * + rate_scale, + pressing '/' key to decrease call rate by 10 * + rate_scale. + If the -rp option is used, the call rate is calculated + with the period in ms given by the user. + + -rp : Specify the rate period for the call rate. Default is 1 + second and default unit is milliseconds. This allows + you to have n calls every m milliseconds (by using -r n + -rp m). + Example: -r 7 -rp 2000 ==> 7 calls every 2 seconds. + -r 10 -rp 5s => 10 calls every 5 seconds. + + -rate_scale : Control the units for the '+', '-', '*', and '/' keys. + + -rate_increase : Specify the rate increase every -fd units (default is + seconds). This allows you to increase the load for each + independent logging period. + Example: -rate_increase 10 -fd 10s + ==> increase calls by 10 every 10 seconds. + + -rate_max : If -rate_increase is set, then quit after the rate + reaches this value. + Example: -rate_increase 10 -rate_max 100 + ==> increase calls by 10 until 100 cps is hit. + + -no_rate_quit : If -rate_increase is set, do not quit after the rate + reaches -rate_max. + + -recv_timeout : Global receive timeout. Default unit is milliseconds. If + the expected message is not received, the call times out + and is aborted. + + -send_timeout : Global send timeout. Default unit is milliseconds. If a + message is not sent (due to congestion), the call times + out and is aborted. + + -sleep : How long to sleep for at startup. Default unit is + seconds. + + -reconnect_close : Should calls be closed on reconnect? + + -reconnect_sleep : How long (in milliseconds) to sleep between the close and + reconnect? + + -ringbuffer_files: How many error/message files should be kept after + rotation? + + -ringbuffer_size : How large should error/message files be before they get + rotated? + + -rsa : Set the remote sending address to host:port for sending + the messages. + + -rtp_echo : Enable RTP echo. RTP/UDP packets received on port defined + by -mp are echoed to their sender. + RTP/UDP packets coming on this port + 2 are also echoed + to their sender (used for sound and video echo). + + -rtt_freq : freq is mandatory. Dump response times every freq calls + in the log file defined by -trace_rtt. Default value is + 200. + + -s : Set the username part of the resquest URI. Default is + 'service'. + + -sd : Dumps a default scenario (embeded in the sipp executable) + + -sf : Loads an alternate xml scenario file. To learn more + about XML scenario syntax, use the -sd option to dump + embedded scenarios. They contain all the necessary help. + + -shortmessage_file: Set the name of the short message log file. + + -shortmessage_overwrite: Overwrite the short message log file (default true). + + -oocsf : Load out-of-call scenario. + + -oocsn : Load out-of-call scenario. + + -skip_rlimit : Do not perform rlimit tuning of file descriptor limits. + Default: false. + + -slave : 3pcc extended mode: indicates the slave number + + -slave_cfg : 3pcc extended mode: indicates the file where the master + and slave addresses are stored + + -sn : Use a default scenario (embedded in the sipp executable). + If this option is omitted, the Standard SipStone UAC + scenario is loaded. + Available values in this version: + + - 'uac' : Standard SipStone UAC (default). + - 'uas' : Simple UAS responder. + - 'regexp' : Standard SipStone UAC - with regexp and + variables. + - 'branchc' : Branching and conditional branching in + scenarios - client. + - 'branchs' : Branching and conditional branching in + scenarios - server. + + Default 3pcc scenarios (see -3pcc option): + + - '3pcc-C-A' : Controller A side (must be started after + all other 3pcc scenarios) + - '3pcc-C-B' : Controller B side. + - '3pcc-A' : A side. + - '3pcc-B' : B side. + + + -stat_delimiter : Set the delimiter for the statistics file + + -stf : Set the file name to use to dump statistics + + -t : Set the transport mode: + - u1: UDP with one socket (default), + - un: UDP with one socket per call, + - ui: UDP with one socket per IP address The IP + addresses must be defined in the injection file. + - t1: TCP with one socket, + - tn: TCP with one socket per call, + - l1: TLS with one socket, + - ln: TLS with one socket per call, + - c1: u1 + compression (only if compression plugin + loaded), + - cn: un + compression (only if compression plugin + loaded). This plugin is not provided with sipp. + + + -timeout : Global timeout. Default unit is seconds. If this option + is set, SIPp quits after nb units (-timeout 20s quits + after 20 seconds). + + -timeout_error : SIPp fails if the global timeout is reached is set + (-timeout option required). + + -timer_resol : Set the timer resolution. Default unit is milliseconds. + This option has an impact on timers precision.Small + values allow more precise scheduling but impacts CPU + usage.If the compression is on, the value is set to + 50ms. The default value is 10ms. + + -sendbuffer_warn : Produce warnings instead of errors on SendBuffer + failures. + + -trace_msg : Displays sent and received SIP messages in <scenario file + name>_<pid>_messages.log + + -trace_shortmsg : Displays sent and received SIP messages as CSV in + <scenario file name>_<pid>_shortmessages.log + + -trace_screen : Dump statistic screens in the + <scenario_name>_<pid>_ s.log file when quitting + SIPp. Useful to get a final status report in background + mode (-bg option). + + -trace_err : Trace all unexpected messages in <scenario file + name>_<pid>_errors.log. + + -trace_calldebug : Dumps debugging information about aborted calls to + <scenario_name>_<pid>_calldebug.log file. + + -trace_stat : Dumps all statistics in <scenario_name>_<pid>.csv file. + Use the '-h stat' option for a detailed description of + the statistics file content. + + -trace_counts : Dumps individual message counts in a CSV file. + + -trace_rtt : Allow tracing of all response times in <scenario file + name>_<pid>_rtt.csv. + + -trace_logs : Allow tracing of <log> actions in <scenario file + name>_<pid>_logs.log. + + -users : Instead of starting calls at a fixed rate, begin 'users' + calls at startup, and keep the number of calls constant. + + -watchdog_interval: Set gap between watchdog timer firings. Default is 400. + + -watchdog_reset : If the watchdog timer has not fired in more than this + time period, then reset the max triggers counters. + Default is 10 minutes. + + -watchdog_minor_threshold: If it has been longer than this period between watchdog + executions count a minor trip. Default is 500. + + -watchdog_major_threshold: If it has been longer than this period between watchdog + executions count a major trip. Default is 3000. + + -watchdog_major_maxtriggers: How many times the major watchdog timer can be tripped + before the test is terminated. Default is 10. + + -watchdog_minor_maxtriggers: How many times the minor watchdog timer can be tripped + before the test is terminated. Default is 120. + + -ap : Set the password for authentication challenges. Default + is 'password + + -tls_cert : Set the name for TLS Certificate file. Default is + 'cacert.pem + + -tls_key : Set the name for TLS Private Key file. Default is + 'cakey.pem' + + -tls_crl : Set the name for Certificate Revocation List file. If not + specified, X509 CRL is not activated. + + -3pcc : Launch the tool in 3pcc mode ("Third Party call + control"). The passed ip address is depending on the + 3PCC role. + - When the first twin command is 'sendCmd' then this is + the address of the remote twin socket. SIPp will try to + connect to this address:port to send the twin command + (This instance must be started after all other 3PCC + scenarii). + Example: 3PCC-C-A scenario. + - When the first twin command is 'recvCmd' then this is + the address of the local twin socket. SIPp will open + this address:port to listen for twin command. + Example: 3PCC-C-B scenario. + + -tdmmap : Generate and handle a table of TDM circuits. + A circuit must be available for the call to be placed. + Format: -tdmmap {0-3}{99}{5-8}{1-31} + + -key : keyword value + Set the generic parameter named "keyword" to "value". + + -set : variable value + Set the global variable parameter named "variable" to + "value". + + -dynamicStart : variable value + Set the start offset of dynamic_id varaiable + + -dynamicMax : variable value + Set the maximum of dynamic_id variable + + -dynamicStep : variable value + Set the increment of dynamic_id variable + +Signal handling: + + SIPp can be controlled using posix signals. The following signals + are handled: + USR1: Similar to press 'q' keyboard key. It triggers a soft exit + of SIPp. No more new calls are placed and all ongoing calls + are finished before SIPp exits. + Example: kill -SIGUSR1 732 + USR2: Triggers a dump of all statistics screens in + <scenario_name>_<pid>_screens.log file. Especially useful + in background mode to know what the current status is. + Example: kill -SIGUSR2 732 + +Exit code: + + Upon exit (on fatal error or when the number of asked calls (-m + option) is reached, sipp exits with one of the following exit + code: + 0: All calls were successful + 1: At least one call failed + 97: exit on internal command. Calls may have been processed + 99: Normal exit without calls processed + -1: Fatal error + + +Example: + + Run sipp with embedded server (uas) scenario: + ./sipp -sn uas + On the same host, run sipp with embedded client (uac) scenario + ./sipp -sn uac 127.0.0.1 diff --git a/sippxml/tempscript.sh b/sippxml/tempscript.sh new file mode 100644 index 0000000000000000000000000000000000000000..090a058ed8491511f8ef33551e260d56237be826 --- /dev/null +++ b/sippxml/tempscript.sh @@ -0,0 +1,5 @@ +SERVERPORT=5064 + +sipp -sf account_uas_register_bis.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1 -m 1 + +sipp -sf account_uas_receive_transfer.xml 192.168.50.79 -i 192.168.50.182 -p ${SERVERPORT} -l 1 \ No newline at end of file diff --git a/sippxml/testsuiteuac.sh b/sippxml/testsuiteuac.sh new file mode 100644 index 0000000000000000000000000000000000000000..fb6359edf83a3be5a71492adc86d351abd02fdcc --- /dev/null +++ b/sippxml/testsuiteuac.sh @@ -0,0 +1,328 @@ +#!/bin/bash + + +LOCALPORT=5062 +LOCALIP_lo=127.0.0.1 +LOCALIP_eth0=192.168.50.182 + +REMOTEADDR_lo=127.0.0.1:5060 +REMOTEADDR_ast=192.168.50.79 + +# SCENARIO 1 Test 1 +function test_ip2ip_send_hangup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # start sipp server to receive calls from sflphone + sipp -sf ip2ip_uas_recv_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} + + # wait some time to make sure sflphoned is started + # sleep 1; + + # run python client and script to make calls + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # kill every one + # bashtrap +} + +# SCENARIO 1 Test 2 +function test_ip2ip_send_peer_hungup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # start sipp server to receive calls from sflphone and then hangup + sipp -sf ip2ip_uas_recv_hangup.xml ${REMOTEADDR_lo} -s ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} + + # wait some time to make sure sflphoned is started + # sleep 1; + + # run python client and script to make calls + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # kill every one + bashtrap +} + + +# SCENARIO 1 Test 3 +function test_ip2ip_recv_hangup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # start sipp client and send calls + sipp -sf ip2ip_uac_send_peer_hungup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10 + + # kill every one + # bashtrap +} + + +# SCENARIO 1 Test 4 +function test_ip2ip_recv_peer_hungup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # start sipp client and send calls + sipp -sf ip2ip_uac_send_hangup.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 -m 10 + + # kill every one + # bashtrap +} + + +# SCENARIO 2 Test 1 +function test_account_send_hangup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # process only one registration + sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 + + # start sipp client and send calls + sipp -sf account_uas_recv_peer_hungup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 + + # kill every one + # bashtrap +} + +# SCENARIO 2 Test 2 +function test_account_send_peer_hungup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # process only one registration + sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 + + # start sipp client and send calls + sipp -sf account_uas_recv_hangup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 + + # kill every one + # bashtrap +} + +# SCENARIO 2 Test 3 +function test_account_recv_hangup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # process only one registration + sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 + + # start sipp client and send calls + sipp -sf account_uac_send_peer_hungup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 10 + # kill every one + # bashtrap +} + +# SCENARIO 2 Test 4 +function test_account_recv_peer_hungup { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # process only one registration + sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 + + # start sipp client and send calls + sipp -sf account_uac_send_hangup.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 10 + + # kill every one + # bashtrap +} + +# SCENARIO 3 Test 1 +function test_ip2ip_send_hold_offhold { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # start sipp client and send calls + sipp -sf ip2ip_uas_recv_hold_offhold.xml ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} + # kill every one + # bashtrap +} + +# SCENARIO 4 Test 1 +function test_account_send_transfer { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # wait some time to make sure sflphoned is started + # sleep 1; + + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # wait some time to make sure client is bound + # sleep 1; + + # process only one registration + sipp -sf account_uas_register.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 -m 1 + + # start sipp client and send calls + sipp -sf account_uas_recv_transfered.xml ${REMOTEADDR_ast} -i ${LOCALIP_eth0} -p ${LOCALPORT} -l 1 + + # kill every one + # bashtrap +} + + +# SCENARIO 5 Test 1 +function test_ip2ip_send_refused { + + # start sflphoned + # /usr/lib/sflphone/sflphoned& + + # start sipp server to receive calls from sflphone and then hangup + sipp -sf ip2ip_uac_send_refused.xml ${REMOTEADDR_lo} -s ${REMOTEADDR_lo} -i ${LOCALIP_lo} -p ${LOCALPORT} -l 1 + + # wait some time to make sure sflphoned is started + # sleep 1; + + # run python client and script to make calls + # python ../tools/pysflphone/pysflphone_testdbus.py & + + # kill every one + bashtrap +} + + +# function called if CTRL-C detected +bashtrap() +{ + killall sipp + killall sflphoned +} + + +# ============================ Test Suite ============================ + + + +# SCENARIO 1: (IP2IP) Normal flow calls + +# Test 1: - Send an IP2IP call +# - Hangup +# test_ip2ip_send_hangup + +# Test 2: - Send an IP2IP call +# - Peer Hangup +# test_ip2ip_send_peer_hungup + +# Test 3: - Receive an IP2IP call +# - Hangup +# test_ip2ip_recv_hangup + +# Test 4: - Receive an IP2IP call +# - Peer Hangup +# test_ip2ip_recv_peer_hungup + + + +# SCENARIO 2: (ACCOUNT) Normal flow calls + +# Test 1: - Send an ACCOUNT call +# - Hangup +# test_account_send_hangup + +# Test 2: - Send an ACCOUNT call +# - Peer Hangup +# test_account_send_peer_hungup + +# Test 3: - Receive an ACCOUNT call +# - Hangup +# test_account_recv_hangup + +# Test 4: - Receive an ACCOUNT call +# - Peer Hangup +test_account_recv_peer_hungup + + + +# SCENARIO 3: Hold/offHold calls (Account) + +# Test 1: - Send an IP2IP call +# - Put this call on HOLD +# - Off HOLD this call +# - Hangup +# test_ip2ip_send_hold_offhold + + + +# SCENARIO 4: Transfer calls (Account) + +# Test 1: - Send an IP2IP call +# - Transfer this call to another sipp instance +# - Hangup +# test_account_send_transfer + + +#SCENARIO 5: Refuse call (IP2IP) + +# Test 1: - Receive a call +# - Refuse (hangup without answer) +# test_ip2ip_send_refused \ No newline at end of file diff --git a/tools/build-system/launchpad/dput.conf b/tools/build-system/launchpad/dput.conf index 4d3d15990da8b51998dd5799d3c9b3b875758de6..ea85aa390ad912a626508ec49c3f2e0ec6e5d98d 100644 --- a/tools/build-system/launchpad/dput.conf +++ b/tools/build-system/launchpad/dput.conf @@ -26,3 +26,10 @@ incoming = ~savoirfairelinux/sflphone-nightly/ubuntu/karmic login = anonymous allow_unsigned_uploads = 0 +[sflphone-nightly-lucid] +fqdn = ppa.launchpad.net +method = ftp +incoming = ~savoirfairelinux/sflphone-nightly/ubuntu/lucid +login = anonymous +allow_unsigned_uploads = 0 + diff --git a/tools/build-system/launchpad/sflphone-client-gnome/debian/control.lucid b/tools/build-system/launchpad/sflphone-client-gnome/debian/control.lucid new file mode 100644 index 0000000000000000000000000000000000000000..c72878afda415cff757f8bb6da1167c5d431544f --- /dev/null +++ b/tools/build-system/launchpad/sflphone-client-gnome/debian/control.lucid @@ -0,0 +1,20 @@ +Source: sflphone-client-gnome +Maintainer: SavoirFaireLinux Inc <julien.bonjean@savoirfairelinux.com> +Section: gnome +Priority: optional +Build-Depends: debhelper, libgcc1, autoconf, automake, libtool, libgtk2.0-dev, libdbus-glib-1-dev, libnotify-dev, libebook1.2-dev, check, liblog4c-dev, libgnomeui-dev, gnome-doc-utils, rarian-compat +Standards-Version: 3.7.3 + +Package: sflphone-client-gnome +Priority: optional +Architecture: any +Depends: sflphone-common (=${source:Version}), libdbus-glib-1-2, libgtk2.0-0, libc6, libglib2.0-0, libdbus-glib-1-2, libnotify1, librsvg2-common, liblog4c3, libebook1.2-9, libgnomeui-0 +Replaces: sflphone +Conflicts: sflphone +Homepage: http://www.sflphone.org +Description: GNOME client for SFLphone + Provide a GNOME client for SFLphone. + SFLphone is meant to be a robust enterprise-class desktop phone. + SFLphone is released under the GNU General Public License. + SFLphone is being developed by the global community, and maintained by + Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company. diff --git a/tools/build-system/launchpad/sflphone-common/debian/control.lucid b/tools/build-system/launchpad/sflphone-common/debian/control.lucid new file mode 100644 index 0000000000000000000000000000000000000000..177306ed35bf7cae2a8d1f2e7bc03a3772cc24c9 --- /dev/null +++ b/tools/build-system/launchpad/sflphone-common/debian/control.lucid @@ -0,0 +1,19 @@ +Source: sflphone-common +Maintainer: SavoirFaireLinux Inc <julien.bonjean@savoirfairelinux.com> +Section: gnome +Priority: optional +Build-Depends: debhelper, libgcc1 , autoconf, automake, libpulse-dev, libsamplerate0-dev, libcommoncpp2-dev, libccrtp-dev, libgsm1-dev, libspeex-dev, libtool, libdbus-1-dev, libasound2-dev, libspeexdsp-dev, uuid-dev, libexpat1-dev, libzrtpcpp-dev, libssl-dev, libpcre3-dev +Standards-Version: 3.7.3 + +Package: sflphone-common +Priority: optional +Architecture: any +Depends: libsamplerate0, libexpat1 , libc6, libccgnu2-1.7-0, libgsm1, libspeex1, libdbus-1-3, libasound2, libpulse0, libccrtp1-1.7-0, libspeexdsp1, libzrtpcpp-1.4-0, libssl0.9.8, libpcre3 +Replaces: sflphone +Conflicts: sflphone +Homepage: http://www.sflphone.org +Description: SIP and IAX2 compatible softphone - Core + SFLphone is meant to be a robust enterprise-class desktop phone. + SFLphone is released under the GNU General Public License. + SFLphone is being developed by the global community, and maintained by + Savoir-faire Linux, a Montreal, Quebec, Canada-based Linux consulting company. diff --git a/tools/build-system/setenv.sh b/tools/build-system/setenv.sh index ee6bbb068d40a615243101fea56e8d3735a04949..a19a22d3ce772d77644b4eb51d7250b247bae899 100644 --- a/tools/build-system/setenv.sh +++ b/tools/build-system/setenv.sh @@ -22,6 +22,6 @@ export REFERENCE_REPOSITORY="${ROOT_DIR}/sflphone-source-repository" export WORKING_DIR="${ROOT_DIR}/sflphone-build-repository/tools/build-system" export LAUNCHPAD_DIR="${WORKING_DIR}/launchpad" -LAUNCHPAD_DISTRIBUTIONS=( "jaunty" "karmic" ) +LAUNCHPAD_DISTRIBUTIONS=( "jaunty" "karmic" "lucid" ) export LAUNCHPAD_DISTRIBUTIONS diff --git a/tools/mozilla-telify-sflphone/sflphone-handler b/tools/mozilla-telify-sflphone/sflphone-handler index 727ef0f93c26927ed962654154418cd59ca2983a..db1cf92d0abc3536f3eb2e3bce1752b3e12d6cb5 100755 --- a/tools/mozilla-telify-sflphone/sflphone-handler +++ b/tools/mozilla-telify-sflphone/sflphone-handler @@ -5,25 +5,12 @@ # In Firefox use Preferences > Applications and set the callto handler # to this script. -# The sflphone daemon config file -RESFILE=~/.config/sflphone/sflphonedrc -# Parse sflphonedrc and get default account id string -if [ -f "$RESFILE" ]; then - - # Use first ID - ACCOUNTID=`grep Accounts.order $RESFILE | sed -e 's/Accounts.order=//' -e 's/\/.*//'` - - # Accounts.order is not set - if [ -z $ACCOUNTID ]; then - - # Use first account declared in sflphone config - ACCOUNTID="`grep -m 1 Account: $RESFILE | sed -e 's/\[//' -e 's/\]//'`" - fi - -else - echo Fatal: Cant find sflphonedrc config file. - exit 1 +# Test if a SFLphone client is already open, if not open a new one +# Opening a new client will start sflphoned if not already running +SFLPHONEC=`ps -A | grep sflphone-client` +if [ "$SFLPHONEC" = "" ]; then + /usr/bin/sflphone-client-gnome& fi # Check 1st argument (phone number) @@ -38,13 +25,16 @@ TO="`echo $1 | sed -e 's/[^0123456789]//g'`" # Generate call id. CALLID=${RANDOM}$$ -dbus-send \ - --type="method_call" \ - --dest="org.sflphone.SFLphone" \ - "/org/sflphone/SFLphone/CallManager" \ - "org.sflphone.SFLphone.CallManager.placeCall" \ - string:"$ACCOUNTID" \ - string:"$CALLID" \ +# Dbus placeCallFirstAccount method does not reach sflphoned if starting +# Should find another way to do this +sleep 1 + +dbus-send \ + --type="method_call" \ + --dest="org.sflphone.SFLphone" \ + "/org/sflphone/SFLphone/CallManager" \ + "org.sflphone.SFLphone.CallManager.placeCallFirstAccount" \ + string:"$CALLID" \ string:"$TO" exit 0 diff --git a/tools/pysflphone/pysflphone.py b/tools/pysflphone/pysflphone.py index d100b6b8167eed92decf0b40e0c0c10b3b218d3b..61fde183b0134ae237fdd4126d1fd1edf01f9462 100644 --- a/tools/pysflphone/pysflphone.py +++ b/tools/pysflphone/pysflphone.py @@ -61,7 +61,8 @@ def printHelp(): --gaia Get all IAX accounts. \n\ --gcc Get current callid. \n\ --gacl Get active codec list. \n\ - \n\ + --sac Set accout for next call \n\ + \n\ --gad <account> Get account details . \n\ --enable <account> Enable the account. \n\ --disable <account> Disable the account. \n\ @@ -83,9 +84,12 @@ def printHelp(): # Option definition try: - opts, args = getopt.getopt(sys.argv[1:],"", [ "help", "gaa", "gal", "gara", "gaea", "gasa", "gaia", "gacl", "gac", "gcc", - "hangup=", "refuse=", "hold", "unhold=", "transfer=","dtmf=", "accept=", - "gcd=", "gad=", "register=", "unregister=", "enable=", "disable=", "call=" ]) + opts, args = getopt.getopt(sys.argv[1:],"", + [ "help", "gaa", "gal", "gara", "gaea", "gasa", "gaia", + "gacl", "gac", "gcc", "hangup=", "refuse=", "hold", + "unhold=", "transfer=","dtmf=", "accept=", "gcd=", + "gad=", "register=", "unregister=", "enable=", "disable=", + "call=", "sac=" ]) except getopt.GetoptError,err: print str(err) sys.exit(2) @@ -166,6 +170,12 @@ else: print "Account: " + details['ACCOUNTID'] print "Peer: " + details['PEER_NAME'] + "<" + details['PEER_NUMBER'] + ">" + elif opt == "--sac": + if arg is "": + print "Must specifies the accout to be set" + else: + sflphone.setAccount(arg) + # # call options diff --git a/tools/pysflphone/pysflphone_testdbus.py b/tools/pysflphone/pysflphone_testdbus.py index 52f58ba132bc940815836cc344ea286132d55d4d..035b20a27fbe71639aabe999fe4abf59f00eea8f 100644 --- a/tools/pysflphone/pysflphone_testdbus.py +++ b/tools/pysflphone/pysflphone_testdbus.py @@ -1,46 +1,330 @@ #!/usr/bin/env python +import signal +import time +import sys + +import getopt +import gtk + +from threading import Thread +from threading import Event + +print "Import SFLphone" from sflphonectrlsimple import SflPhoneCtrlSimple +# Define remote IP address constant +REMOTEADDR_lo="127.0.0.1:5062" + +# Defines phone numbers +PHONE1="27182" +PHONE2="31416" +PHONE3="14142" + + +# Define function callback to emulate UA behavior on +# recieving a call (peer hangup)) +def acceptOnIncomingCall(sflphone): + + sflphone.Accept(sflphone.currentCallId) + + +# Define function callback to emulate UA behavior on +# receiving a call and hanging up +def acceptOnIncomingCallHangup(sflphone): + + sflphone.Accept(sflphone.currentCallId) + sflphone.HangUp(sflphone.currentCallId) + + +# Define function callback to emulate UA behavior on +# refusing a call +def refuseOnIncomingCall(sflphone): + # time.sleep(0.5) + sflphone.Refuse(sflphone.currentCallId) + + +class SflPhoneTests(): -class SflPhoneTests(SflPhoneCtrlSimple): + def __init__(self, sfl): + print "Create test instance" + self.sflphone = sfl def test_get_allaccounts_methods(self): - print "--- getAllAccounts() ---" for account in self.getAllAccounts(): print " " + account - print "\n" - - print "--- getAllRegisteredAccounts() ---" + for account in self.getAllRegisteredAccounts(): print " " + account - print "\n" - print "--- getAllSipAccounts() ---" for account in self.getAllSipAccounts(): print " " + account - print "\n" - print "--- getAllIaxAccounts() ---" for account in self.getAllIaxAccounts(): print " " + account - print "\n" - # def test_codecs_methods(self): + def test_create_account(self): + """Create a new sip account""" + + CONFIG_ACCOUNT_TYPE = "Account.type" + CONFIG_ACCOUNT_ALIAS = "Account.alias" + HOSTNAME = "hostname" + USERNAME = "username" + PASSWORD = "password" + + accDetails = {CONFIG_ACCOUNT_TYPE:"SIP", CONFIG_ACCOUNT_ALIAS:"testsuiteaccount", + HOSTNAME:"192.168.50.79", USERNAME:"31416", + PASSWORD:"1234"} + + + accountID = self.sflphone.addAccount(accDetails) + print "New Account ID " + accountID + + return accountID + + + def test_remove_account(self, accountID): + """Remove test account""" + + self.sflphone.removeAccount(accountID) + print "Account with ID " + accountID + " removed" + + + # SCENARIO 1 Test 1 + def test_ip2ip_send_hangup(self): + """Make a call to a server (sipp) on port 5062""" + i = 0 + while(i < 10): + + callid = self.sflphone.Call("sip:test@" + REMOTEADDR_lo) + time.sleep(0.5) + + self.sflphone.HangUp(callid) + time.sleep(0.5) + + i = i+1 + + del self.sflphone + + + # SCENARIO 1 Test 2 + def test_ip2ip_send_peer_hungup(self): + """Make a call to a server (sipp) on port 5062""" + i = 0 + while(i < 10): + + callid = self.sflphone.Call("sip:test@" + REMOTEADDR_lo) + time.sleep(1.0) + + i = i+1 + + del self.sflphone + + + # SCENARIO 1 Test 3 + def test_ip2ip_recv_hangup(self): + """Wait for calls, answer then hangup""" + + # Add callback for this test + self.sflphone.onIncomingCall_cb = acceptOnIncomingCallHangup + + # Start Glib mainloop + self.sflphone.start() + + + # SCENARIO 1 Test 4 + def test_ip2ip_recv_peer_hungup(self): + """Wait for calls, answer, peer hangup""" + # Add callback for this test + self.sflphone.onIncomingCall_cb = acceptOnIncomingCall + + # Start Glib mainloop + self.sflphone.start() + + + # SCENARIO 2 Test 1 + def test_account_send_hangup(self): + """Send new account call, hangup once peer answered""" + + i = 0 + while(i < 10): + + callid = self.sflphone.Call(PHONE1) + time.sleep(0.2) + + self.sflphone.HangUp(callid) + time.sleep(0.2) + + i = i+1 + + # del self.sflphone + + + # SCENARIO 2 Test 2 + def test_account_send_peer_hungup(self): + """Send new account call, hangup once peer answered""" + + i = 0 + while(i < 10): + + callid = self.sflphone.Call(PHONE1) + time.sleep(1.0) + + i = i+1 + + del self.sflphone + + + # SCENARIO 2 Test 3 + def test_account_recv_hangup(self): + """Register an account and wait for incoming calls""" + + # Add callback for this test + self.sflphone.onIncomingCall_cb = acceptOnIncomingCallHangup + + # Start Glib mainloop + self.sflphone.start() + + + # SCENARIO 2 Test 4 + def test_account_recv_peer_hungup(self): + """Register an account and wait for incoming calls""" + + # Add callback for this test + self.sflphone.onIncomingCall_cb = acceptOnIncomingCall + + # Start Glib mainloop + self.sflphone.start() + + + # SCENARIO 3 Test 1 + def test_ip2ip_send_hold_offhold(self): + """Send new call, hold this call, offhold, hangup""" + i = 0 + while(i < 10): + + callid = self.sflphone.Call("sip:test@" + REMOTEADDR_lo) + time.sleep(0.5) + + self.sflphone.Hold(callid) + time.sleep(0.5) + + self.sflphone.UnHold(callid) + time.sleep(0.5) + + self.sflphone.HangUp(callid) + time.sleep(0.5) + + i = i+1 + + del self.sflphone + + + # SCENARIO 4 Test 1 + def test_account_send_transfer(self): + """Send new calls, transfer it to a new instance""" + + i = 0 + while(i < 1): + + callid = self.sflphone.Call(PHONE1) + time.sleep(1.0) + + self.sflphone.Transfer(callid,PHONE3) + # self.sflphone.HangUp(callid) + # time.sleep(1.0) + + i = i+1 + + + # SCENARIO 5 Test 1 + def test_ip2ip_recv_refuse(self): + """Receive an incoming IP2IP call, refuse it""" + + # Add callback for this test + self.sflphone.onIncomingCall_cb = refuseOnIncomingCall + + # Start Glib mainloop + self.sflphone.start() + + + +# Open sflphone and connect to sflphoned through dbus +sflphone = SflPhoneCtrlSimple(True) + +# Init test suite +testsuite = SflPhoneTests(sflphone) + +# Register the first account available, should be the test account +sflphone.setFirstRegisteredAccount(); + + +# ============================ Test Suite ============================ + + + +# SCENARIO 1: IP2IP Normal flow calls + +# Test 1: - Send an IP2IP call +# - Hangup +# testsuite.test_ip2ip_send_hangup() + +# Test 2: - Send an IP2IP call +# - Peer Hangup +# testsuite.test_ip2ip_send_peer_hungup() + +# Test 3: - Receive an IP2IP call +# - Hangup +# testsuite.test_ip2ip_recv_hangup() + +# Test 4: - Receive an IP2IP call +# - Peer Hangup +# testsuite.test_ip2ip_recv_peer_hungup() + + + +# SCENARIO 2: ACCOUNT Normal flow calls + +# Test 1: - Send an ACCOUNT call +# - Hangup +# testsuite.test_account_send_hangup() + +# Test 2: - Send an ACCOUNT call +# - Peer Hangup +# testsuite.test_account_send_peer_hungup() + +# Test 3: - Receive an ACCOUNT call +# - Hangup +# testsuite.test_account_recv_hangup() + +# Test 4: - Receive an ACCOUNT call +# - Peer Hangup +testsuite.test_account_recv_peer_hungup() + + + +# SCENARIO 3: IP2IP Call, HOLD/OFFHOLD + +# Test 1: - Send an IP2IP call +# - Put this call on HOLD +# - Off HOLD this call +# - Hangup +# testsuite.test_ip2ip_send_hold_offhold() -# print "--- getCodecList() ---" -# for codec int self.getCodecList(): -# print " " + codec -# print "\n" -sfl = SflPhoneTests() +# SCENARIO 4: IP2IP Call, HOLD/OFFHOLD -sfl.test_get_allaccounts_methods() +# Test 1: - Send an IP2IP call +# - Transfer this call to another sipp instance +# - Hangup +# testsuite.test_account_send_transfer() +# SCENARIO 5: IP2IP Call, Refuse - - +# Test 1: - Receive an incoming call +# - Hangup without answer +# testsuite.test_ip2ip_recv_refuse() diff --git a/tools/pysflphone/sflphonectrlsimple.py b/tools/pysflphone/sflphonectrlsimple.py index a7d0a5ee2a7bad04adcb6f09b80ff6d4fadae411..491e105e8256fb6314c80b95b081fb0d5c7f75fc 100755 --- a/tools/pysflphone/sflphonectrlsimple.py +++ b/tools/pysflphone/sflphonectrlsimple.py @@ -23,15 +23,18 @@ import os import random from traceback import print_exc +import gtk import gobject from gobject import GObject +from gobject import MainLoop import getopt import time -import md5 +import hashlib from threading import Thread +from threading import Event from Errors import * @@ -42,26 +45,40 @@ except ImportError, e: raise SflPhoneError("No python-dbus module found") -class SflPhoneCtrlSimple(object): - """Simple class for controlling SflPhoned through DBUS""" +class SflPhoneCtrlSimple(Thread): + """ Simple class for controlling SflPhoned through DBUS + + If option testSuite (ts) is put to true, + simple actions are implemented on incoming call. + """ # list of active calls (known by the client) activeCalls = {} - def __init__(self, name=sys.argv[0]): + def __init__(self, test=False, name=sys.argv[0]): + print "Create SFLphone instance" + Thread.__init__(self) # current active account self.account = None # client name self.name = name # client registered to sflphoned ? self.registered = False - self.register() + self.currentCallId = "" + + self.loop = MainLoop() + + self.test = test + self.onIncomingCall_cb = None + self.event = Event() + def __del__(self): if self.registered: self.unregister() + self.loop.quit() def register(self): @@ -109,11 +126,13 @@ class SflPhoneCtrlSimple(object): raise SPdaemonError("Client registration failed") try: + print "Adding Incoming call method" proxy_callmgr.connect_to_signal('incomingCall', self.onIncomingCall) proxy_callmgr.connect_to_signal('callStateChanged', self.onCallStateChanged) except dbus.DBusException, e: print e - + + def unregister(self): @@ -131,6 +150,21 @@ class SflPhoneCtrlSimple(object): return self.registered + def getEvent(self): + return self.event + + def wait(self): + self.event.wait() + + def isSet(self): + self.event.isSet() + + def set(self): + self.event.set() + + def clear(self): + self.event.clear() + # # Signal handling # @@ -139,6 +173,15 @@ class SflPhoneCtrlSimple(object): def onIncomingCall(self, account, callid, to): print "Incoming call: " + account + ", " + callid + ", " + to self.activeCalls[callid] = {'Account': account, 'To': to, 'State': '' } + self.currentCallId = callid + + if(self.test): + # TODO fix this bug in daemon, cannot answer too fast + time.sleep(0.5) + if self.onIncomingCall_cb(self) is not None: + self.onIncomingCall_cb(self) + + # On call state changed event, set the values for new calls, # or delete the call from the list of active calls @@ -170,13 +213,40 @@ class SflPhoneCtrlSimple(object): # # Account management # + def addAccount(self, details=None): + """Add a new account account + + Add a new account to the SFLphone-daemon. Default parameters are \ + used for missing account configuration field. + + Required parameters are type, alias, hostname, username and password + + input details + + """ + + if details is None: + raise SPaccountError("Must specifies type, alias, hostname, \ + username and password in \ + order to create a new account") + + return self.configurationmanager.addAccount(details) + + def removeAccount(self, accountID=None): + """Remove an account from internal list""" + + if accountID is None: + raise SPaccountError("Account ID must be specified") + + self.configurationmanager.removeAccount(accountID) + def getAllAccounts(self): - """ Return a list with all accounts""" + """Return a list with all accounts""" return self.configurationmanager.getAccountList() def getAllEnabledAccounts(self): - """ Return a list with all enabled accounts""" + """Return a list with all enabled accounts""" accounts = self.getAllAccounts() activeaccounts = [] for testedaccount in accounts: @@ -222,11 +292,15 @@ class SflPhoneCtrlSimple(object): raise SPaccountError("No account matched with alias") def setAccount(self, account): - """Define the active account""" + """Define the active account + + The active account will be used when sending a new call + """ if account in self.getAllAccounts(): self.account = account else: + print account raise SflPhoneError("Not a valid account") def setFirstRegisteredAccount(self): @@ -315,7 +389,6 @@ class SflPhoneCtrlSimple(object): def getAllSipAccounts(self): """Return a list of SIP accounts""" - sipAccountsList = [] for accountName in self.getAllAccounts(): if self.getAccountDetails(accountName)['Account.type'] == "SIP": @@ -395,24 +468,36 @@ class SflPhoneCtrlSimple(object): # Action # def Call(self, dest): - """Start a call and return a CallID""" - if not self.account: - self.setFirstRegisteredAccount() + """Start a call and return a CallID - if not self.isAccountRegistered(): - raise SflPhoneError("Can't place a call without a registered account") + Use the current account previously set using setAccount(). + If no account specified, first registered one in account list is used. + + For phone number prefixed using SIP scheme (i.e. sip: or sips:), + IP2IP profile is automatically selected and set as the default account + + return callID Newly generated callidentifier for this call + """ - if dest is None or dest == "": + if dest is None or dest == "": raise SflPhoneError("Invalid call destination") + + # Set the account to be used for this call + if dest.find('sip:') is 0 or dest.find('sips:') is 0: + print "Ip 2 IP call" + self.setAccount("IP2IP") + elif not self.account: + self.setFirstRegisteredAccount() - # callid = str(random.randrange(2**32-1)) - t = long( time.time() * 1000 ) - r = long( random.random()*100000000000000000L ) - data = str(t) + str(r) - callid = md5.md5(data).hexdigest() + if self.account is "IP2IP" and self.isAccountRegistered(): + raise SflPhoneError("Can't place a call without a registered account") + + # Generate a call ID for this call + callid = self.GenerateCallID() # Add the call to the list of active calls and set status to SENT self.activeCalls[callid] = {'Account': self.account, 'To': dest, 'State': 'SENT' } + # Send the request to the CallManager self.callmanager.placeCall(self.account, callid, dest) @@ -424,23 +509,23 @@ class SflPhoneCtrlSimple(object): if not self.account: self.setFirstRegisteredAccount() - if not self.isAccountRegistered(): - raise SflPhoneError("Can't hangup a call without a registered account") + # if not self.isAccountRegistered() and self.accout is not "IP2IP": + # raise SflPhoneError("Can't hangup a call without a registered account") if callid is None or callid == "": pass # just to see #raise SflPhoneError("Invalid callID") - self.callmanager.hangUp(callid) + self.callmanager.hangUp(callid) - def Transfert(self, callid, to): + def Transfer(self, callid, to): """Transfert a call identified by a CallID""" - if not self.account: - self.setFirstRegisteredAccount() + # if not self.account: + # self.setFirstRegisteredAccount() - if not self.isAccountRegistered(): - raise SflPhoneError("Can't transfert a call without a registered account") + # if not self.isAccountRegistered(): + # raise SflPhoneError("Can't transfert a call without a registered account") if callid is None or callid == "": raise SflPhoneError("Invalid callID") @@ -450,11 +535,12 @@ class SflPhoneCtrlSimple(object): def Refuse(self, callid): """Refuse an incoming call identified by a CallID""" - if not self.account: - self.setFirstRegisteredAccount() + print "Refuse call " + callid + # if not self.account: + # self.setFirstRegisteredAccount() - if not self.isAccountRegistered(): - raise SflPhoneError("Can't refuse a call without a registered account") + # if not self.isAccountRegistered(): + # raise SflPhoneError("Can't refuse a call without a registered account") if callid is None or callid == "": raise SflPhoneError("Invalid callID") @@ -464,6 +550,7 @@ class SflPhoneCtrlSimple(object): def Accept(self, callid): """Accept an incoming call identified by a CallID""" + print "Accept call " + callid if not self.account: self.setFirstRegisteredAccount() @@ -472,17 +559,17 @@ class SflPhoneCtrlSimple(object): if callid is None or callid == "": raise SflPhoneError("Invalid callID") - + self.callmanager.accept(callid) def Hold(self, callid): """Hold a call identified by a CallID""" - if not self.account: - self.setFirstRegisteredAccount() + # if not self.account: + # self.setFirstRegisteredAccount() - if not self.isAccountRegistered(): - raise SflPhoneError("Can't hold a call without a registered account") + # if not self.isAccountRegistered(): + # raise SflPhoneError("Can't hold a call without a registered account") if callid is None or callid == "": raise SflPhoneError("Invalid callID") @@ -492,11 +579,11 @@ class SflPhoneCtrlSimple(object): def UnHold(self, callid): """Unhold an incoming call identified by a CallID""" - if not self.account: - self.setFirstRegisteredAccount() + # if not self.account: + # self.setFirstRegisteredAccount() - if not self.isAccountRegistered(): - raise SflPhoneError("Can't unhold a call without a registered account") + # if not self.isAccountRegistered(): + # raise SflPhoneError("Can't unhold a call without a registered account") if callid is None or callid == "": raise SflPhoneError("Invalid callID") @@ -509,4 +596,19 @@ class SflPhoneCtrlSimple(object): self.callmanager.playDTMF(key) + def GenerateCallID(self): + """Generate Call ID""" + m = hashlib.md5() + t = long( time.time() * 1000 ) + r = long( random.random()*100000000000000000L ) + m.update(str(t) + str(r)) + callid = m.hexdigest() + return callid + + def run(self): + gobject.threads_init() + # self.loop.run() + context = self.loop.get_context() + while 1: + context.iteration(True)