mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 05:38:14 +00:00
Merge branch 'dev_refactor_cpp' of git.linphone.org:linphone into dev_refactor_cpp_qrcode
This commit is contained in:
commit
6322f71e18
379 changed files with 27722 additions and 9008 deletions
|
|
@ -35,6 +35,7 @@ string(REGEX REPLACE "([a-zA-Z_]+)\\.po" "\\1" LINPHONE_ALL_LANGS_LIST "${LINPHO
|
|||
string(REPLACE ";" " " LINPHONE_ALL_LANGS "${LINPHONE_ALL_LANGS_LIST}")
|
||||
|
||||
include(CMakeDependentOption)
|
||||
include(cmake/Tools.cmake)
|
||||
|
||||
option(ENABLE_SHARED "Build shared library." YES)
|
||||
option(ENABLE_STATIC "Build static library." YES)
|
||||
|
|
@ -46,8 +47,7 @@ option(ENABLE_CXX_WRAPPER "Build the C++ wrapper for Liblinphone." YES)
|
|||
option(ENABLE_DAEMON "Enable the linphone daemon interface." YES)
|
||||
option(ENABLE_DATE "Use build date in internal version number." NO)
|
||||
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
|
||||
option(ENABLE_DOC "Enable documentation generation with Doxygen." YES)
|
||||
option(ENABLE_SPHINX_DOC "Enable sphinx documentation generation." NO)
|
||||
option(ENABLE_DOC "Enable API documentation generation." NO)
|
||||
option(ENABLE_JAVADOC "Add a target to generate documentation for Java API" NO)
|
||||
option(ENABLE_LDAP "Enable LDAP support." NO)
|
||||
option(ENABLE_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO)
|
||||
|
|
@ -173,8 +173,15 @@ if(ENABLE_LIME)
|
|||
endif()
|
||||
set(HAVE_LIME 1)
|
||||
endif()
|
||||
if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_SPHINX_DOC)
|
||||
if(ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRAPPER OR ENABLE_DOC)
|
||||
find_package(PythonInterp REQUIRED)
|
||||
check_python_module(pystache)
|
||||
check_python_module(six)
|
||||
if(ENABLE_DOC)
|
||||
check_python_module(sphinx)
|
||||
check_python_module(javasphinx)
|
||||
check_python_module(sphinx_csharp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
|
|
@ -182,6 +189,19 @@ if(UNIX AND NOT APPLE)
|
|||
check_include_files(libudev.h HAVE_LIBUDEV_H)
|
||||
endif()
|
||||
|
||||
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
find_library(LIBGCC NAMES gcc)
|
||||
find_library(LIBMINGWEX NAMES mingwex)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(Iconv QUIET)
|
||||
endif()
|
||||
if(ANDROID)
|
||||
find_package(CpuFeatures REQUIRED)
|
||||
find_package(Support REQUIRED)
|
||||
endif()
|
||||
|
||||
set(LINPHONE_LDFLAGS "${BELLESIP_LDFLAGS} ${MEDIASTREAMER2_LDFLAGS}")
|
||||
if(BELCARD_FOUND AND APPLE)
|
||||
set(LINPHONE_LDFLAGS "${LINPHONE_LDFLAGS} -stdlib=libc++")
|
||||
|
|
@ -249,6 +269,11 @@ if(ENABLE_DEBUG_LOGS)
|
|||
add_definitions("-DDEBUG_LOGS")
|
||||
endif()
|
||||
|
||||
# Enable stdint.h limit macros on C++ files. (Windows only.)
|
||||
if(MSVC)
|
||||
add_definitions("-D__STDC_LIMIT_MACROS")
|
||||
endif()
|
||||
|
||||
set(STRICT_OPTIONS_CPP )
|
||||
set(STRICT_OPTIONS_C )
|
||||
set(STRICT_OPTIONS_CXX )
|
||||
|
|
@ -278,7 +303,7 @@ else()
|
|||
)
|
||||
CHECK_CXX_COMPILER_FLAG("-Wsuggest-override" SUGGEST_OVERRIDE)
|
||||
if (SUGGEST_OVERRIDE)
|
||||
list(APPEND STRICT_OPTIONS_CXX "-Wsuggest-override" "-Werror=suggest-override")
|
||||
list(APPEND STRICT_OPTIONS_CXX "-Wsuggest-override" "-Wno-error=suggest-override" )
|
||||
endif ()
|
||||
list(APPEND STRICT_OPTIONS_C "-Wstrict-prototypes" "-Werror=strict-prototypes")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
|
|
@ -342,8 +367,8 @@ add_subdirectory(java)
|
|||
if(ENABLE_JAVA_WRAPPER)
|
||||
add_subdirectory(wrappers/java)
|
||||
endif()
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(coreapi)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(share)
|
||||
if(ENABLE_CONSOLE_UI)
|
||||
add_subdirectory(console)
|
||||
|
|
|
|||
45
README.md
45
README.md
|
|
@ -11,19 +11,22 @@ Building liblinphone
|
|||
|
||||
### Required dependencies
|
||||
|
||||
* *BcToolbox[2]*: portability layer
|
||||
* *BelleSIP[3]*: SIP stack
|
||||
* *Mediastreamer2[4]*: multimedia engine
|
||||
* *Belcard[5]*: VCard support
|
||||
* libxml2
|
||||
* zlib
|
||||
* libsqlite3: user data storage (disablable)
|
||||
* gettext and libintl: internationalization support (disablable)
|
||||
* **BcToolbox[2]:** portability layer
|
||||
* **BelleSIP[3]:** SIP stack
|
||||
* **Mediastreamer2[4]:** multimedia engine
|
||||
* **Belcard[5]:** VCard support
|
||||
* **libxml2**
|
||||
* **zlib**
|
||||
* **libsqlite3:** user data storage (disablable)
|
||||
* **gettext** and **libintl**: internationalization support (disablable)
|
||||
* **python interpreter** and **pystache**, **six** python module (needed for C++ wrapper and API documentaiton)
|
||||
* **doxygen** and **dot** (needed for C++ wrapper and API documentation)
|
||||
|
||||
|
||||
### Opitonal dependencies
|
||||
|
||||
* *Bzrtp[6]*: zrtp stack used for Linphone Instant Messaging Encryption
|
||||
* **Bzrtp[6]**: zrtp stack used for Linphone Instant Messaging Encryption.
|
||||
* For API documentatino generation: **sphinx**, **javasphinx**, **sphinx_csharp** python modules are needed.
|
||||
|
||||
|
||||
### Build instructions
|
||||
|
|
@ -36,17 +39,17 @@ Building liblinphone
|
|||
|
||||
### Supported build opitons
|
||||
|
||||
* `CMAKE_INSTALL_PREFIX=<string>` : install prefix
|
||||
* `CMAKE_PREFIX_PATH=<string>` : column-separated list of prefixes where to search for dependencies
|
||||
* `ENABLE_SHARED=NO` : do not build the shared library
|
||||
* `ENABLE_STATIC=NO` : do not build the static library
|
||||
* `ENABLE_STRICT=NO` : build without strict compilation flags (-Wall -Werror)
|
||||
* `ENABLE_DOC=NO` : do not generate the reference documentation of liblinphone
|
||||
* `ENABLE_UNIT_TESTS=NO` : do not build testing binaries
|
||||
* `ENABLE_VCARD=NO` : disable VCard support
|
||||
* `ENABLE_SQLITE_STORAGE=NO` : disable SQlite user data storage (message, history, contacts list)
|
||||
* `ENABLE_TOOLS=NO` : do not build tool binaries
|
||||
* `ENABLE_LIME=YES` : disable Linphone Instant Messaging Encryption
|
||||
* **`CMAKE_INSTALL_PREFIX=<string>`** : install prefix
|
||||
* **`CMAKE_PREFIX_PATH=<string>`** : column-separated list of prefixes where to search for dependencies
|
||||
* **`ENABLE_SHARED=NO`** : do not build the shared library
|
||||
* **`ENABLE_STATIC=NO`** : do not build the static library
|
||||
* **`ENABLE_STRICT=NO`** : build without strict compilation flags (-Wall -Werror)
|
||||
* **`ENABLE_DOC=YES`** : Make the reference documentation of liblinphone to generated
|
||||
* **`ENABLE_UNIT_TESTS=NO`** : do not build testing binaries
|
||||
* **`ENABLE_VCARD=NO`** : disable VCard support
|
||||
* **`ENABLE_SQLITE_STORAGE=NO`** : disable SQlite user data storage (message, history, contacts list)
|
||||
* **`ENABLE_TOOLS=NO`** : do not build tool binaries
|
||||
* **`ENABLE_LIME=YES`** : disable Linphone Instant Messaging Encryption
|
||||
|
||||
### Note for packagers
|
||||
|
||||
|
|
@ -89,4 +92,4 @@ Here is a short description of the content of the source tree.
|
|||
- [3] belle-sip: git://git.linphone.org/belle-sip.git *or* <https://www.linphone.org/releases/sources/belle-sip>
|
||||
- [4] mediastreamer2: git://git.linphone.org/mediastreamer2.git *or* <https://www.linphone.org/releases/sources/mediastreamer>
|
||||
- [5] belcard: git://git.linphone.org/belcard.git *or* <https://www.linphone.org/releases/sources/belcard>
|
||||
- [5] bzrtp: git://git.linphone.org/bzrtp.git *or* <https://www.linphone.org/releases/sources/bzrtp>
|
||||
- [6] bzrtp: git://git.linphone.org/bzrtp.git *or* <https://www.linphone.org/releases/sources/bzrtp>
|
||||
|
|
|
|||
33
cmake/Tools.cmake
Normal file
33
cmake/Tools.cmake
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
############################################################################
|
||||
# LinphoneUtils.cmake
|
||||
# Copyright (C) 2018 Belledonne Communications, Grenoble France
|
||||
#
|
||||
############################################################################
|
||||
#
|
||||
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
function(check_python_module module_name)
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import ${module_name}"
|
||||
RESULT_VARIABLE result
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET)
|
||||
if(result EQUAL 0)
|
||||
message(STATUS "'${module_name}' python module found")
|
||||
else()
|
||||
message(FATAL_ERROR "'${module_name}' python module not found")
|
||||
endif()
|
||||
endfunction()
|
||||
|
|
@ -53,7 +53,7 @@ if(WIN32)
|
|||
endif()
|
||||
|
||||
add_executable(linphonecsh ${LINPHONECSH_SOURCE_FILES})
|
||||
target_link_libraries(linphonecsh ${LINPHONE_LIBS_FOR_TOOLS} ${ORTP_LIBRARIES})
|
||||
target_link_libraries(linphonecsh ${LINPHONE_LIBS_FOR_TOOLS} ${BCTOOLBOX_CORE_LIBRARIES} ${ORTP_LIBRARIES})
|
||||
set_target_properties(linphonecsh PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}")
|
||||
|
||||
set(INSTALL_TARGETS linphonec linphonecsh)
|
||||
|
|
|
|||
|
|
@ -2150,7 +2150,7 @@ static int lpc_cmd_speak(LinphoneCore *lc, char *args){
|
|||
#ifndef _WIN32
|
||||
char voice[64];
|
||||
char *sentence;
|
||||
char cl[128];
|
||||
char cl[256];
|
||||
char wavfile[128]="/tmp/linphonec-espeak-XXXXXX";
|
||||
int status;
|
||||
FILE *file;
|
||||
|
|
|
|||
|
|
@ -20,19 +20,6 @@
|
|||
#
|
||||
############################################################################
|
||||
|
||||
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
find_library(LIBGCC NAMES gcc)
|
||||
find_library(LIBMINGWEX NAMES mingwex)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
find_package(Iconv QUIET)
|
||||
endif()
|
||||
if(ANDROID)
|
||||
find_package(CpuFeatures REQUIRED)
|
||||
find_package(Support REQUIRED)
|
||||
endif()
|
||||
|
||||
list(APPEND LINPHONE_PRIVATE_HEADER_FILES
|
||||
bellesip_sal/sal_impl.h
|
||||
carddav.h
|
||||
|
|
@ -64,7 +51,6 @@ set(LINPHONE_SOURCE_FILES_C
|
|||
carddav.c
|
||||
chat.c
|
||||
contactprovider.c
|
||||
content.c
|
||||
dial_plan.c
|
||||
dict.c
|
||||
ec-calibrator.c
|
||||
|
|
@ -137,54 +123,7 @@ else()
|
|||
list(APPEND LINPHONE_SOURCE_FILES_C linphone_tunnel_stubs.c)
|
||||
endif()
|
||||
|
||||
bc_git_version(liblinphone ${PROJECT_VERSION})
|
||||
|
||||
add_definitions(
|
||||
-DUSE_BELLESIP
|
||||
-DLIBLINPHONE_EXPORTS
|
||||
)
|
||||
|
||||
set(LIBS
|
||||
${BCTOOLBOX_CORE_LIBRARIES}
|
||||
${BELLESIP_LIBRARIES}
|
||||
${MEDIASTREAMER2_LIBRARIES}
|
||||
${ORTP_LIBRARIES}
|
||||
${XML2_LIBRARIES}
|
||||
${BELR_LIBRARIES}
|
||||
${LIBXSD_LIBRARIES}
|
||||
)
|
||||
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
list(APPEND LIBS "Ws2_32")
|
||||
endif()
|
||||
if(ENABLE_LIME)
|
||||
list(APPEND LIBS ${BZRTP_LIBRARIES})
|
||||
endif()
|
||||
if(ZLIB_FOUND)
|
||||
list(APPEND LIBS ${ZLIB_LIBRARIES})
|
||||
endif()
|
||||
if(SOCI_FOUND)
|
||||
list(APPEND LIBS ${SOCI_LIBRARIES})
|
||||
endif()
|
||||
if(SQLITE3_FOUND)
|
||||
list(APPEND LIBS ${SQLITE3_LIBRARIES})
|
||||
endif()
|
||||
if(ICONV_FOUND)
|
||||
list(APPEND LIBS ${ICONV_LIBRARIES})
|
||||
endif()
|
||||
if(ENABLE_TUNNEL)
|
||||
list(APPEND LIBS ${TUNNEL_LIBRARIES})
|
||||
endif()
|
||||
if(MSVC AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
list(APPEND LIBS ${LIBGCC} ${LIBMINGWEX})
|
||||
endif()
|
||||
if(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
list(APPEND LIBS shlwapi)
|
||||
endif()
|
||||
if(INTL_FOUND)
|
||||
list(APPEND LIBS ${INTL_LIBRARIES})
|
||||
endif()
|
||||
if(BELCARD_FOUND)
|
||||
list(APPEND LIBS ${BELCARD_LIBRARIES})
|
||||
list(APPEND LINPHONE_SOURCE_FILES_CXX vcard.cc)
|
||||
if(NOT MSVC)
|
||||
list(APPEND STRICT_OPTIONS_CXX "-std=c++11")
|
||||
|
|
@ -196,106 +135,37 @@ else()
|
|||
list(APPEND LINPHONE_SOURCE_FILES_C vcard_stubs.c)
|
||||
endif()
|
||||
|
||||
|
||||
bc_git_version(liblinphone ${PROJECT_VERSION})
|
||||
|
||||
add_definitions(
|
||||
-DUSE_BELLESIP
|
||||
-DLIBLINPHONE_EXPORTS
|
||||
-DBCTBX_LOG_DOMAIN="liblinphone"
|
||||
)
|
||||
|
||||
set_source_files_properties(${LINPHONE_SOURCE_FILES_C} PROPERTIES LANGUAGE CXX)
|
||||
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
|
||||
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
|
||||
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_OBJC STRICT_OPTIONS_CPP STRICT_OPTIONS_OBJC)
|
||||
|
||||
if(ENABLE_STATIC)
|
||||
add_library(linphone-static STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_PRIVATE_HEADER_FILES}
|
||||
${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}
|
||||
$<TARGET_OBJECTS:linphone-cxx-objects-static>
|
||||
)
|
||||
set_target_properties(linphone-static PROPERTIES OUTPUT_NAME linphone)
|
||||
add_dependencies(linphone-static liblinphone-git-version)
|
||||
target_include_directories(linphone-static PUBLIC ${LINPHONE_INCLUDE_DIRS})
|
||||
target_link_libraries(linphone-static INTERFACE ${LIBS})
|
||||
if(APPLE)
|
||||
target_link_libraries(linphone-static INTERFACE "-framework Foundation" "-framework AVFoundation")
|
||||
endif()
|
||||
install(TARGETS linphone-static EXPORT ${EXPORT_TARGETS_NAME}Targets
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
endif()
|
||||
if(ENABLE_SHARED)
|
||||
add_library(linphone SHARED "../share/cpim_grammar" ${LINPHONE_HEADER_FILES} ${LINPHONE_PRIVATE_HEADER_FILES}
|
||||
${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}
|
||||
$<TARGET_OBJECTS:linphone-cxx-objects>
|
||||
)
|
||||
if(IOS)
|
||||
if(IOS)
|
||||
set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET})
|
||||
else()
|
||||
set(MIN_OS ${CMAKE_OSX_DEPLOYMENT_TARGET})
|
||||
endif()
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/osx/")
|
||||
set_target_properties(linphone PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
MACOSX_FRAMEWORK_IDENTIFIER org.linphone.linphone
|
||||
MACOSX_FRAMEWORK_INFO_PLIST Info.plist.in
|
||||
PUBLIC_HEADER "${LINPHONE_HEADER_FILES}"
|
||||
RESOURCE "../share/cpim_grammar"
|
||||
)
|
||||
endif()
|
||||
if(BELCARD_FOUND)
|
||||
if(APPLE)
|
||||
set_target_properties(linphone PROPERTIES LINK_FLAGS "-stdlib=libc++")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(linphone PROPERTIES LINKER_LANGUAGE CXX)
|
||||
if(NOT ANDROID)
|
||||
# Do not version shared library on Android
|
||||
set_target_properties(linphone PROPERTIES SOVERSION ${LINPHONE_SO_VERSION})
|
||||
endif()
|
||||
add_dependencies(linphone liblinphone-git-version)
|
||||
target_include_directories(linphone PUBLIC ${LINPHONE_INCLUDE_DIRS})
|
||||
target_link_libraries(linphone PRIVATE ${LIBS})
|
||||
if(APPLE)
|
||||
target_link_libraries(linphone PRIVATE "-framework Foundation" "-framework AVFoundation")
|
||||
endif()
|
||||
if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set_target_properties(linphone PROPERTIES PREFIX "lib")
|
||||
elseif(ANDROID)
|
||||
target_link_libraries(linphone PUBLIC "log" ${SUPPORT_LIBRARIES} ${CPUFEATURES_LIBRARIES})
|
||||
if(ENABLE_JAVA_WRAPPER)
|
||||
add_dependencies(linphone linphonej)
|
||||
endif()
|
||||
endif()
|
||||
if(MSVC)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/linphone.pdb
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
install(TARGETS linphone EXPORT ${EXPORT_TARGETS_NAME}Targets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
FRAMEWORK DESTINATION Frameworks
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
if (ENABLE_STATIC)
|
||||
add_library(linphone-coreapi-static OBJECT
|
||||
${LINPHONE_PRIVATE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}
|
||||
)
|
||||
endif()
|
||||
if(ICONV_FOUND)
|
||||
if(APPLE)
|
||||
# Prevent conflict between the system iconv.h header and the one from macports.
|
||||
if(ENABLE_STATIC)
|
||||
target_compile_options(linphone-static PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h")
|
||||
endif()
|
||||
if(ENABLE_SHARED)
|
||||
target_compile_options(linphone PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h")
|
||||
endif()
|
||||
else()
|
||||
if(ENABLE_STATIC)
|
||||
target_include_directories(linphone-static PRIVATE ${ICONV_INCLUDE_DIRS})
|
||||
endif()
|
||||
if(ENABLE_SHARED)
|
||||
target_include_directories(linphone PRIVATE ${ICONV_INCLUDE_DIRS})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
target_include_directories(linphone-coreapi-static SYSTEM PRIVATE ${LINPHONE_INCLUDE_DIRS})
|
||||
add_dependencies(linphone-coreapi-static liblinphone-git-version)
|
||||
endif ()
|
||||
|
||||
if (ENABLE_SHARED)
|
||||
add_library(linphone-coreapi OBJECT
|
||||
${LINPHONE_PRIVATE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}
|
||||
)
|
||||
target_include_directories(linphone-coreapi SYSTEM PRIVATE ${LINPHONE_INCLUDE_DIRS})
|
||||
target_compile_options(linphone-coreapi PRIVATE "-fPIC")
|
||||
add_dependencies(linphone-coreapi liblinphone-git-version)
|
||||
endif ()
|
||||
|
||||
|
||||
add_subdirectory(help)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ liblinphone_la_SOURCES=\
|
|||
chat_file_transfer.c \
|
||||
conference.cc conference_private.h \
|
||||
contactprovider.c contact_providers_priv.h \
|
||||
content.c \
|
||||
dial_plan.c \
|
||||
dict.c \
|
||||
ec-calibrator.c \
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void TunnelManager::addServer(const char *ip, int port,unsigned int udpMirrorPor
|
|||
return;
|
||||
}
|
||||
addServer(ip,port);
|
||||
mUdpMirrorClients.push_back(UdpMirrorClient(ServerAddr(ip,udpMirrorPort),delay));
|
||||
mUdpMirrorClients.push_back(UdpMirrorClient(ServerAddr(ip, (int)udpMirrorPort), delay));
|
||||
}
|
||||
|
||||
void TunnelManager::addServer(const char *ip, int port) {
|
||||
|
|
@ -58,7 +58,7 @@ void TunnelManager::addServerPair(const char *ip1, int port1, const char *ip2, i
|
|||
return;
|
||||
}
|
||||
addServerPair(ip1, port1, ip2, port2);
|
||||
mUdpMirrorClients.push_back(UdpMirrorClient(ServerAddr(ip1, udpMirrorPort), delay));
|
||||
mUdpMirrorClients.push_back(UdpMirrorClient(ServerAddr(ip1, (int)udpMirrorPort), delay));
|
||||
}
|
||||
|
||||
void TunnelManager::addServerPair(const char *ip1, int port1, const char *ip2, int port2) {
|
||||
|
|
@ -159,7 +159,7 @@ void TunnelManager::startClient() {
|
|||
mTunnelClient = TunnelClient::create(TRUE);
|
||||
}
|
||||
|
||||
sal_set_tunnel(mCore->sal, mTunnelClient);
|
||||
mCore->sal->setTunnel(mTunnelClient);
|
||||
if (!mUseDualClient) {
|
||||
static_cast<TunnelClient*>(mTunnelClient)->setCallback(tunnelCallback,this);
|
||||
} else {
|
||||
|
|
@ -220,21 +220,21 @@ bool TunnelManager::isConnected() const {
|
|||
int TunnelManager::customSendto(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen){
|
||||
int size;
|
||||
DualSocket *ds = (DualSocket *)t->data;
|
||||
msgpullup(msg,-1);
|
||||
size=msgdsize(msg);
|
||||
ds->sendSocket->sendto(msg->b_rptr,size,to,tolen);
|
||||
msgpullup(msg, (size_t)-1);
|
||||
size = (int)msgdsize(msg);
|
||||
ds->sendSocket->sendto(msg->b_rptr, (size_t)size, to, tolen);
|
||||
return size;
|
||||
}
|
||||
|
||||
int TunnelManager::customRecvfrom(struct _RtpTransport *t, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen){
|
||||
DualSocket *ds = (DualSocket *)t->data;
|
||||
memset(&msg->recv_addr,0,sizeof(msg->recv_addr));
|
||||
int err=ds->recvSocket->recvfrom(msg->b_wptr,dblk_lim(msg->b_datap)-dblk_base(msg->b_datap),from,*fromlen);
|
||||
long err=ds->recvSocket->recvfrom(msg->b_wptr, (size_t)(dblk_lim(msg->b_datap) - dblk_base(msg->b_datap)), from, *fromlen);
|
||||
//to make ice happy
|
||||
inet_aton(((TunnelManager*)(ds->recvSocket)->getUserPointer())->mLocalAddr,&msg->recv_addr.addr.ipi_addr);
|
||||
msg->recv_addr.family = AF_INET;
|
||||
msg->recv_addr.port = htons((unsigned short)(ds->recvSocket)->getPort());
|
||||
if (err>0) return err;
|
||||
if (err>0) return (int)err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ TunnelManager::~TunnelManager(){
|
|||
mTunnelClient->stop();
|
||||
delete mTunnelClient;
|
||||
}
|
||||
sal_set_tunnel(mCore->sal,NULL);
|
||||
mCore->sal->setTunnel(NULL);
|
||||
linphone_core_remove_listener(mCore, mVTable);
|
||||
linphone_core_v_table_destroy(mVTable);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,14 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "linphone/core.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
|
||||
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
#include "dial-plan/dial-plan.h"
|
||||
|
||||
#if !_WIN32
|
||||
#include "regex.h"
|
||||
#endif
|
||||
|
||||
#include <bctoolbox/crypto.h>
|
||||
#include "bctoolbox/crypto.h"
|
||||
#include "bctoolbox/regex.h"
|
||||
|
||||
// TODO: From coreapi. Remove me later.
|
||||
#include "private.h"
|
||||
|
|
@ -112,25 +111,6 @@ static char* _get_identity(const LinphoneAccountCreator *creator) {
|
|||
return identity;
|
||||
}
|
||||
|
||||
static bool_t is_matching_regex(const char *entry, const char* regex) {
|
||||
#if _WIN32
|
||||
return TRUE;
|
||||
#else
|
||||
regex_t regex_pattern;
|
||||
char err_msg[256];
|
||||
int res;
|
||||
res = regcomp(®ex_pattern, regex, REG_EXTENDED | REG_NOSUB);
|
||||
if(res != 0) {
|
||||
regerror(res, ®ex_pattern, err_msg, sizeof(err_msg));
|
||||
ms_error("Could not compile regex '%s: %s", regex, err_msg);
|
||||
return FALSE;
|
||||
}
|
||||
res = regexec(®ex_pattern, entry, 0, NULL, 0);
|
||||
regfree(®ex_pattern);
|
||||
return (res != REG_NOMATCH);
|
||||
#endif
|
||||
}
|
||||
|
||||
LinphoneProxyConfig * linphone_account_creator_create_proxy_config(const LinphoneAccountCreator *creator) {
|
||||
LinphoneAuthInfo *info;
|
||||
LinphoneProxyConfig *cfg = linphone_core_create_proxy_config(creator->core);
|
||||
|
|
@ -288,8 +268,12 @@ void linphone_account_creator_cbs_set_update_account(LinphoneAccountCreatorCbs *
|
|||
static void _linphone_account_creator_destroy(LinphoneAccountCreator *creator) {
|
||||
/*this will drop all pending requests if any*/
|
||||
if (creator->xmlrpc_session) linphone_xml_rpc_session_release(creator->xmlrpc_session);
|
||||
if (creator->service != NULL && linphone_account_creator_service_get_destructor_cb(creator->service) != NULL)
|
||||
linphone_account_creator_service_get_destructor_cb(creator->service)(creator);
|
||||
if (creator->service != NULL ) {
|
||||
if (linphone_account_creator_service_get_destructor_cb(creator->service) != NULL)
|
||||
linphone_account_creator_service_get_destructor_cb(creator->service)(creator);
|
||||
linphone_account_creator_service_unref(creator->service);
|
||||
}
|
||||
|
||||
linphone_account_creator_cbs_unref(creator->cbs);
|
||||
linphone_proxy_config_unref(creator->proxy_cfg);
|
||||
linphone_account_creator_reset(creator);
|
||||
|
|
@ -309,6 +293,7 @@ LinphoneAccountCreator * _linphone_account_creator_new(LinphoneCore *core, const
|
|||
const char* domain = lp_config_get_string(core->config, "assistant", "domain", NULL);
|
||||
creator = belle_sip_object_new(LinphoneAccountCreator);
|
||||
creator->service = linphone_core_get_account_creator_service(core);
|
||||
linphone_account_creator_service_ref(creator->service);
|
||||
creator->cbs = linphone_account_creator_cbs_new();
|
||||
creator->core = core;
|
||||
creator->transport = LinphoneTransportTcp;
|
||||
|
|
@ -383,7 +368,7 @@ LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(Linph
|
|||
return LinphoneAccountCreatorUsernameStatusTooLong;
|
||||
} else if (use_phone_number && !linphone_proxy_config_is_phone_number(NULL, username)) {
|
||||
return LinphoneAccountCreatorUsernameStatusInvalid;
|
||||
} else if (regex && !is_matching_regex(username, regex)) {
|
||||
} else if (regex && !bctbx_is_matching_regex(username, regex)) {
|
||||
return LinphoneAccountCreatorUsernameStatusInvalidCharacters;
|
||||
} else if (validate_uri(username, NULL, NULL) != 0) {
|
||||
return LinphoneAccountCreatorUsernameStatusInvalid;
|
||||
|
|
@ -506,10 +491,10 @@ const char * linphone_account_creator_get_display_name(const LinphoneAccountCrea
|
|||
}
|
||||
|
||||
LinphoneAccountCreatorEmailStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email) {
|
||||
if (!email || !is_matching_regex(email, "^.+@.+\\..*$")) {
|
||||
if (!email || !bctbx_is_matching_regex(email, "^.+@.+\\..*$")) {
|
||||
return LinphoneAccountCreatorEmailStatusMalformed;
|
||||
}
|
||||
if (!is_matching_regex(email, "^.+@.+\\.[A-Za-z]{2}[A-Za-z]*$")) {
|
||||
if (!bctbx_is_matching_regex(email, "^.+@.+\\.[A-Za-z]{2}[A-Za-z]*$")) {
|
||||
return LinphoneAccountCreatorEmailStatusInvalidCharacters;
|
||||
}
|
||||
set_string(&creator->email, email, TRUE);
|
||||
|
|
|
|||
|
|
@ -452,8 +452,6 @@ LinphoneAuthInfo * linphone_core_create_auth_info(LinphoneCore *lc, const char *
|
|||
|
||||
void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info){
|
||||
LinphoneAuthInfo *ai;
|
||||
bctbx_list_t *elem;
|
||||
bctbx_list_t *l;
|
||||
int restarted_op_count=0;
|
||||
bool_t updating=FALSE;
|
||||
|
||||
|
|
@ -472,10 +470,10 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
lc->auth_info=bctbx_list_append(lc->auth_info,linphone_auth_info_clone(info));
|
||||
|
||||
/* retry pending authentication operations */
|
||||
for(l=elem=lc->sal->get_pending_auths();elem!=NULL;elem=elem->next){
|
||||
LinphonePrivate::SalOp *op= static_cast<LinphonePrivate::SalOp*>(elem->data);
|
||||
auto pendingAuths = lc->sal->getPendingAuths();
|
||||
for (const auto &op : pendingAuths) {
|
||||
LinphoneAuthInfo *ai;
|
||||
const SalAuthInfo *req_sai=op->get_auth_requested();
|
||||
const SalAuthInfo *req_sai=op->getAuthRequested();
|
||||
ai=(LinphoneAuthInfo*)_linphone_core_find_auth_info(lc,req_sai->realm,req_sai->username,req_sai->domain, FALSE);
|
||||
if (ai){
|
||||
SalAuthInfo sai;
|
||||
|
|
@ -495,7 +493,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
}
|
||||
/*proxy case*/
|
||||
for (proxy=(bctbx_list_t*)linphone_core_get_proxy_config_list(lc);proxy!=NULL;proxy=proxy->next) {
|
||||
if (proxy->data == op->get_user_pointer()) {
|
||||
if (proxy->data == op->getUserPointer()) {
|
||||
linphone_proxy_config_set_state((LinphoneProxyConfig*)(proxy->data),LinphoneRegistrationProgress,"Authentication...");
|
||||
break;
|
||||
}
|
||||
|
|
@ -504,7 +502,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
restarted_op_count++;
|
||||
}
|
||||
}
|
||||
if (l){
|
||||
if (!pendingAuths.empty()) {
|
||||
ms_message("linphone_core_add_auth_info(): restarted [%i] operation(s) after %s auth info for\n"
|
||||
"\tusername: [%s]\n"
|
||||
"\trealm [%s]\n"
|
||||
|
|
@ -515,7 +513,6 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
|
|||
info->realm ? info->realm : "",
|
||||
info->domain ? info->domain : "");
|
||||
}
|
||||
bctbx_list_free(l);
|
||||
write_auth_infos(lc);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -348,6 +348,29 @@ void sal_body_handler_set_subtype(SalBodyHandler *body_handler, const char *subt
|
|||
belle_sip_header_content_type_set_subtype(content_type, subtype);
|
||||
}
|
||||
|
||||
const belle_sip_list_t * sal_body_handler_get_content_type_parameters_names(const SalBodyHandler *body_handler) {
|
||||
belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type"));
|
||||
if (content_type != NULL) {
|
||||
return belle_sip_parameters_get_parameter_names(BELLE_SIP_PARAMETERS(content_type));
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char * sal_body_handler_get_content_type_parameter(const SalBodyHandler *body_handler, const char *name) {
|
||||
belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type"));
|
||||
if (content_type != NULL) {
|
||||
return belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type), name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void sal_body_handler_set_content_type_parameter(SalBodyHandler *body_handler, const char *paramName, const char *paramValue) {
|
||||
belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type"));
|
||||
if (content_type != NULL) {
|
||||
belle_sip_parameters_set_parameter(BELLE_SIP_PARAMETERS(content_type), paramName, paramValue);
|
||||
}
|
||||
}
|
||||
|
||||
const char * sal_body_handler_get_encoding(const SalBodyHandler *body_handler) {
|
||||
belle_sip_header_t *content_encoding = sal_body_handler_find_header(body_handler, "Content-Encoding");
|
||||
if (content_encoding != NULL) {
|
||||
|
|
@ -396,6 +419,11 @@ SalBodyHandler * sal_body_handler_get_part(const SalBodyHandler *body_handler, i
|
|||
return (SalBodyHandler *)belle_sip_list_nth_data(l, idx);
|
||||
}
|
||||
|
||||
const belle_sip_list_t * sal_body_handler_get_parts(const SalBodyHandler *body_handler) {
|
||||
if (!sal_body_handler_is_multipart(body_handler)) return NULL;
|
||||
return belle_sip_multipart_body_handler_get_parts(BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler));
|
||||
}
|
||||
|
||||
SalBodyHandler * sal_body_handler_find_part_by_header(const SalBodyHandler *body_handler, const char *header_name, const char *header_value) {
|
||||
const belle_sip_list_t *l = belle_sip_multipart_body_handler_get_parts(BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler));
|
||||
for (; l != NULL; l = l->next) {
|
||||
|
|
@ -418,3 +446,7 @@ const char * sal_body_handler_get_header(const SalBodyHandler *body_handler, con
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const belle_sip_list_t* sal_body_handler_get_headers(const SalBodyHandler *body_handler) {
|
||||
return belle_sip_body_handler_get_headers(BELLE_SIP_BODY_HANDLER(body_handler));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ static void sdp_parse_payload_types(belle_sdp_media_description_t *media_desc, S
|
|||
static void sdp_parse_media_crypto_parameters(belle_sdp_media_description_t *media_desc, SalStreamDescription *stream) {
|
||||
belle_sip_list_t *attribute_it;
|
||||
belle_sdp_attribute_t *attribute;
|
||||
char tmp[256], tmp2[256], parameters[256]={0};
|
||||
char tmp[257], tmp2[257], parameters[257]={0};
|
||||
int valid_count = 0;
|
||||
int nb;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,15 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
|
||||
#include "c-wrapper/internal/c-sal.h"
|
||||
#include "sal/call-op.h"
|
||||
#include "sal/message-op.h"
|
||||
#include "sal/refer-op.h"
|
||||
|
||||
#include "linphone/api/c-content.h"
|
||||
#include "linphone/core.h"
|
||||
#include "linphone/utils/utils.h"
|
||||
|
||||
#include "private.h"
|
||||
#include "mediastreamer2/mediastream.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
|
|
@ -41,6 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "call/call-p.h"
|
||||
#include "chat/chat-message/chat-message-p.h"
|
||||
#include "chat/chat-room/chat-room.h"
|
||||
#include "chat/chat-room/client-group-chat-room-p.h"
|
||||
#include "chat/chat-room/server-group-chat-room-p.h"
|
||||
#include "conference/participant.h"
|
||||
#include "conference/session/call-session-p.h"
|
||||
|
|
@ -56,19 +58,26 @@ using namespace LinphonePrivate;
|
|||
static void register_failure(SalOp *op);
|
||||
|
||||
static void call_received(SalCallOp *h) {
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(h->getSal()->getUserPointer());
|
||||
|
||||
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
|
||||
h->decline(SalReasonServiceUnavailable, nullptr);
|
||||
h->release();
|
||||
return;
|
||||
}
|
||||
|
||||
/* Look if this INVITE is for a call that has already been notified but broken because of network failure */
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(h->get_sal()->get_user_pointer());
|
||||
if (L_GET_PRIVATE_FROM_C_OBJECT(lc)->inviteReplacesABrokenCall(h))
|
||||
return;
|
||||
|
||||
LinphoneAddress *fromAddr = nullptr;
|
||||
const char *pAssertedId = sal_custom_header_find(h->get_recv_custom_header(), "P-Asserted-Identity");
|
||||
const char *pAssertedId = sal_custom_header_find(h->getRecvCustomHeaders(), "P-Asserted-Identity");
|
||||
/* In some situation, better to trust the network rather than the UAC */
|
||||
if (lp_config_get_int(linphone_core_get_config(lc), "sip", "call_logs_use_asserted_id_instead_of_from", 0)) {
|
||||
if (pAssertedId) {
|
||||
LinphoneAddress *pAssertedIdAddr = linphone_address_new(pAssertedId);
|
||||
if (pAssertedIdAddr) {
|
||||
ms_message("Using P-Asserted-Identity [%s] instead of from [%s] for op [%p]", pAssertedId, h->get_from(), h);
|
||||
ms_message("Using P-Asserted-Identity [%s] instead of from [%s] for op [%p]", pAssertedId, h->getFrom().c_str(), h);
|
||||
fromAddr = pAssertedIdAddr;
|
||||
} else
|
||||
ms_warning("Unsupported P-Asserted-Identity header for op [%p] ", h);
|
||||
|
|
@ -77,22 +86,23 @@ static void call_received(SalCallOp *h) {
|
|||
}
|
||||
|
||||
if (!fromAddr)
|
||||
fromAddr = linphone_address_new(h->get_from());
|
||||
LinphoneAddress *toAddr = linphone_address_new(h->get_to());
|
||||
fromAddr = linphone_address_new(h->getFrom().c_str());
|
||||
LinphoneAddress *toAddr = linphone_address_new(h->getTo().c_str());
|
||||
|
||||
if (_linphone_core_is_conference_creation(lc, toAddr)) {
|
||||
linphone_address_unref(toAddr);
|
||||
linphone_address_unref(fromAddr);
|
||||
if (sal_address_has_param(h->get_remote_contact_address(), "text")) {
|
||||
if (sal_address_has_param(h->getRemoteContactAddress(), "text")) {
|
||||
bool oneToOneChatRoom = false;
|
||||
const char *oneToOneChatRoomStr = sal_custom_header_find(h->get_recv_custom_header(), "One-To-One-Chat-Room");
|
||||
const char *oneToOneChatRoomStr = sal_custom_header_find(h->getRecvCustomHeaders(), "One-To-One-Chat-Room");
|
||||
if (oneToOneChatRoomStr && (strcmp(oneToOneChatRoomStr, "true") == 0))
|
||||
oneToOneChatRoom = true;
|
||||
if (oneToOneChatRoom) {
|
||||
IdentityAddress from(h->get_from());
|
||||
list<IdentityAddress> identAddresses = ServerGroupChatRoom::parseResourceLists(h->get_remote_body());
|
||||
IdentityAddress from(h->getFrom());
|
||||
list<IdentityAddress> identAddresses = ServerGroupChatRoom::parseResourceLists(h->getRemoteBody());
|
||||
if (identAddresses.size() != 1) {
|
||||
h->decline(SalReasonNotAcceptable, nullptr);
|
||||
h->release();
|
||||
return;
|
||||
}
|
||||
IdentityAddress confAddr = L_GET_PRIVATE_FROM_C_OBJECT(lc)->mainDb->findOneToOneConferenceChatRoomAddress(from, identAddresses.front());
|
||||
|
|
@ -106,17 +116,30 @@ static void call_received(SalCallOp *h) {
|
|||
}
|
||||
// TODO: handle media conference creation if the "text" feature tag is not present
|
||||
return;
|
||||
} else if (sal_address_has_param(h->get_remote_contact_address(), "text")) {
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(IdentityAddress(h->get_to()), IdentityAddress(h->get_to()))
|
||||
);
|
||||
if (chatRoom) {
|
||||
L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->confirmJoining(h);
|
||||
linphone_address_unref(toAddr);
|
||||
linphone_address_unref(fromAddr);
|
||||
} else if (sal_address_has_param(h->getRemoteContactAddress(), "text")) {
|
||||
linphone_address_unref(toAddr);
|
||||
linphone_address_unref(fromAddr);
|
||||
if (linphone_core_conference_server_enabled(lc)) {
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(IdentityAddress(h->getTo()), IdentityAddress(h->getTo()))
|
||||
);
|
||||
if (chatRoom) {
|
||||
L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->confirmJoining(h);
|
||||
} else {
|
||||
//invite is for an unknown chatroom
|
||||
h->decline(SalReasonNotFound, nullptr);
|
||||
h->release();
|
||||
}
|
||||
} else {
|
||||
//invite is for an unknown chatroom
|
||||
h->decline(SalReasonNotFound, nullptr);
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(IdentityAddress(h->getFrom()), IdentityAddress(h->getTo()))
|
||||
);
|
||||
if (!chatRoom) {
|
||||
chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom(
|
||||
h->getSubject(), h->getRemoteContact(), h->getRemoteBody(), false
|
||||
);
|
||||
}
|
||||
L_GET_PRIVATE(static_pointer_cast<ClientGroupChatRoom>(chatRoom))->confirmJoining(h);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
|
|
@ -136,7 +159,7 @@ static void call_received(SalCallOp *h) {
|
|||
memset(&sei, 0, sizeof(sei));
|
||||
sal_error_info_set(&sei, SalReasonRedirect, "SIP", 0, nullptr, nullptr);
|
||||
SalAddress *altAddr = sal_address_new(altContact);
|
||||
h->decline_with_error_info(&sei, altAddr);
|
||||
h->declineWithErrorInfo(&sei, altAddr);
|
||||
ms_free(altContact);
|
||||
sal_address_unref(altAddr);
|
||||
LinphoneErrorInfo *ei = linphone_error_info_new();
|
||||
|
|
@ -164,7 +187,7 @@ static void call_received(SalCallOp *h) {
|
|||
|
||||
/* Check if I'm the caller */
|
||||
LinphoneAddress *fromAddressToSearchIfMe = nullptr;
|
||||
if (h->get_privacy() == SalPrivacyNone)
|
||||
if (h->getPrivacy() == SalPrivacyNone)
|
||||
fromAddressToSearchIfMe = linphone_address_clone(fromAddr);
|
||||
else if (pAssertedId)
|
||||
fromAddressToSearchIfMe = linphone_address_new(pAssertedId);
|
||||
|
|
@ -192,16 +215,17 @@ static void call_received(SalCallOp *h) {
|
|||
}
|
||||
|
||||
static void call_rejected(SalCallOp *h){
|
||||
LinphoneCore *lc=(LinphoneCore *)h->get_sal()->get_user_pointer();
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(h->getSal()->getUserPointer());
|
||||
LinphoneErrorInfo *ei = linphone_error_info_new();
|
||||
linphone_error_info_from_sal_op(ei, h);
|
||||
linphone_core_report_early_failed_call(lc, LinphoneCallIncoming, linphone_address_new(h->get_from()), linphone_address_new(h->get_to()), ei);
|
||||
linphone_core_report_early_failed_call(lc, LinphoneCallIncoming, linphone_address_new(h->getFrom().c_str()), linphone_address_new(h->getTo().c_str()), ei);
|
||||
}
|
||||
|
||||
static void call_ringing(SalOp *h) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(h->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(h->getUserPointer());
|
||||
if (!session) return;
|
||||
L_GET_PRIVATE(session)->remoteRinging();
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->remoteRinging();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -210,83 +234,89 @@ static void call_ringing(SalOp *h) {
|
|||
* - when a request is accepted (pause, resume)
|
||||
*/
|
||||
static void call_accepted(SalOp *op) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("call_accepted: CallSession no longer exists");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->accepted();
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->accepted();
|
||||
}
|
||||
|
||||
/* this callback is called when an incoming re-INVITE/ SIP UPDATE modifies the session*/
|
||||
static void call_updating(SalOp *op, bool_t is_update) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("call_updating: CallSession no longer exists");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->updating(!!is_update);
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->updating(!!is_update);
|
||||
}
|
||||
|
||||
|
||||
static void call_ack_received(SalOp *op, SalCustomHeader *ack) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("call_ack_received(): no CallSession for which an ack is expected");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->ackReceived(reinterpret_cast<LinphoneHeaders *>(ack));
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->ackReceived(reinterpret_cast<LinphoneHeaders *>(ack));
|
||||
}
|
||||
|
||||
|
||||
static void call_ack_being_sent(SalOp *op, SalCustomHeader *ack) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("call_ack_being_sent(): no CallSession for which an ack is supposed to be sent");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->ackBeingSent(reinterpret_cast<LinphoneHeaders *>(ack));
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->ackBeingSent(reinterpret_cast<LinphoneHeaders *>(ack));
|
||||
}
|
||||
|
||||
static void call_terminated(SalOp *op, const char *from) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session)
|
||||
return;
|
||||
L_GET_PRIVATE(session)->terminated();
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->terminated();
|
||||
}
|
||||
|
||||
static void call_failure(SalOp *op) {
|
||||
shared_ptr<LinphonePrivate::CallSession> session;
|
||||
if (op->get_user_pointer())
|
||||
session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer())->getSharedFromThis();
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("Failure reported on already terminated CallSession");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->failure();
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->failure();
|
||||
}
|
||||
|
||||
static void call_released(SalOp *op) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
/* We can get here when the core manages call at Sal level without creating a Call object. Typicially,
|
||||
* when declining an incoming call with busy because maximum number of calls is reached. */
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->setState(LinphonePrivate::CallSession::State::Released, "Call released");
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->setState(LinphonePrivate::CallSession::State::Released, "Call released");
|
||||
}
|
||||
|
||||
static void call_cancel_done(SalOp *op) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("Cancel done reported on already terminated CallSession");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->cancelDone();
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->cancelDone();
|
||||
}
|
||||
|
||||
static void auth_failure(SalOp *op, SalAuthInfo* info) {
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->get_sal()->get_user_pointer());
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->getSal()->getUserPointer());
|
||||
LinphoneAuthInfo *ai = NULL;
|
||||
|
||||
if (info != NULL) {
|
||||
|
|
@ -305,7 +335,7 @@ static void auth_failure(SalOp *op, SalAuthInfo* info) {
|
|||
}
|
||||
|
||||
static void register_success(SalOp *op, bool_t registered){
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig *)op->get_user_pointer();
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig *)op->getUserPointer();
|
||||
if (!cfg){
|
||||
ms_message("Registration success for deleted proxy config, ignored");
|
||||
return;
|
||||
|
|
@ -315,8 +345,8 @@ static void register_success(SalOp *op, bool_t registered){
|
|||
}
|
||||
|
||||
static void register_failure(SalOp *op){
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)op->get_user_pointer();
|
||||
const SalErrorInfo *ei=op->get_error_info();
|
||||
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)op->getUserPointer();
|
||||
const SalErrorInfo *ei=op->getErrorInfo();
|
||||
const char *details=ei->full_string;
|
||||
|
||||
if (cfg==NULL){
|
||||
|
|
@ -341,48 +371,57 @@ static void register_failure(SalOp *op){
|
|||
}
|
||||
|
||||
static void vfu_request(SalOp *op) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session)
|
||||
return;
|
||||
LinphonePrivate::MediaSession *mediaSession = dynamic_cast<LinphonePrivate::MediaSession *>(session);
|
||||
if (!mediaSession) {
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
auto mediaSessionRef = dynamic_pointer_cast<LinphonePrivate::MediaSession>(sessionRef);
|
||||
if (!mediaSessionRef) {
|
||||
ms_warning("VFU request but no MediaSession!");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(mediaSession)->sendVfu();
|
||||
L_GET_PRIVATE(mediaSessionRef)->sendVfu();
|
||||
}
|
||||
|
||||
static void dtmf_received(SalOp *op, char dtmf) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session)
|
||||
return;
|
||||
LinphonePrivate::MediaSession *mediaSession = dynamic_cast<LinphonePrivate::MediaSession *>(session);
|
||||
if (!mediaSession) {
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
auto mediaSessionRef = dynamic_pointer_cast<LinphonePrivate::MediaSession>(sessionRef);
|
||||
if (!mediaSessionRef) {
|
||||
ms_warning("DTMF received but no MediaSession!");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(mediaSession)->dtmfReceived(dtmf);
|
||||
L_GET_PRIVATE(mediaSessionRef)->dtmfReceived(dtmf);
|
||||
}
|
||||
|
||||
static void call_refer_received(SalOp *op, const SalAddress *referTo) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
char *addrStr = sal_address_as_string_uri_only(referTo);
|
||||
Address referToAddr(addrStr);
|
||||
string method;
|
||||
if (referToAddr.isValid())
|
||||
method = referToAddr.getMethodParam();
|
||||
if (session && (method.empty() || (method == "INVITE"))) {
|
||||
L_GET_PRIVATE(session)->referred(referToAddr);
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->referred(referToAddr);
|
||||
} else {
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->get_sal()->get_user_pointer());
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->getSal()->getUserPointer());
|
||||
linphone_core_notify_refer_received(lc, addrStr);
|
||||
}
|
||||
bctbx_free(addrStr);
|
||||
}
|
||||
|
||||
static void message_received(SalOp *op, const SalMessage *msg){
|
||||
LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer();
|
||||
LinphoneCall *call=(LinphoneCall*)op->get_user_pointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->getSal()->getUserPointer();
|
||||
|
||||
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
|
||||
static_cast<SalMessageOp *>(op)->reply(SalReasonServiceUnavailable);
|
||||
return;
|
||||
}
|
||||
|
||||
LinphoneCall *call=(LinphoneCall*)op->getUserPointer();
|
||||
LinphoneReason reason = lc->chat_deny_code;
|
||||
if (reason == LinphoneReasonNone) {
|
||||
linphone_core_message_received(lc, op, msg);
|
||||
|
|
@ -408,27 +447,32 @@ static void convert_presence_to_xml_requested(SalOp *op, SalPresenceModel *prese
|
|||
}
|
||||
|
||||
static void notify_presence(SalOp *op, SalSubscribeStatus ss, SalPresenceModel *model, const char *msg){
|
||||
LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->getSal()->getUserPointer();
|
||||
linphone_notify_recv(lc,op,ss,model);
|
||||
}
|
||||
|
||||
static void subscribe_presence_received(SalPresenceOp *op, const char *from){
|
||||
LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->getSal()->getUserPointer();
|
||||
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
|
||||
op->decline(SalReasonServiceUnavailable);
|
||||
return;
|
||||
}
|
||||
linphone_subscription_new(lc,op,from);
|
||||
}
|
||||
|
||||
static void subscribe_presence_closed(SalPresenceOp *op, const char *from){
|
||||
LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->getSal()->getUserPointer();
|
||||
linphone_subscription_closed(lc,op);
|
||||
}
|
||||
|
||||
static void ping_reply(SalOp *op) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("Ping reply without CallSession attached...");
|
||||
return;
|
||||
}
|
||||
L_GET_PRIVATE(session)->pingReply();
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->pingReply();
|
||||
}
|
||||
|
||||
static bool_t fill_auth_info_with_client_certificate(LinphoneCore *lc, SalAuthInfo* sai) {
|
||||
|
|
@ -508,7 +552,7 @@ static bool_t fill_auth_info(LinphoneCore *lc, SalAuthInfo* sai) {
|
|||
}
|
||||
}
|
||||
static bool_t auth_requested(Sal* sal, SalAuthInfo* sai) {
|
||||
LinphoneCore *lc = (LinphoneCore *)sal->get_user_pointer();
|
||||
LinphoneCore *lc = (LinphoneCore *)sal->getUserPointer();
|
||||
if (fill_auth_info(lc,sai)) {
|
||||
return TRUE;
|
||||
} else {
|
||||
|
|
@ -526,11 +570,12 @@ static bool_t auth_requested(Sal* sal, SalAuthInfo* sai) {
|
|||
}
|
||||
|
||||
static void notify_refer(SalOp *op, SalReferStatus status) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session) {
|
||||
ms_warning("Receiving notify_refer for unknown CallSession");
|
||||
return;
|
||||
}
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
LinphonePrivate::CallSession::State cstate;
|
||||
switch (status) {
|
||||
case SalReferTrying:
|
||||
|
|
@ -544,9 +589,9 @@ static void notify_refer(SalOp *op, SalReferStatus status) {
|
|||
cstate = LinphonePrivate::CallSession::State::Error;
|
||||
break;
|
||||
}
|
||||
L_GET_PRIVATE(session)->setTransferState(cstate);
|
||||
L_GET_PRIVATE(sessionRef)->setTransferState(cstate);
|
||||
if (cstate == LinphonePrivate::CallSession::State::Connected)
|
||||
session->terminate(); // Automatically terminate the call as the transfer is complete
|
||||
sessionRef->terminate(); // Automatically terminate the call as the transfer is complete
|
||||
}
|
||||
|
||||
static LinphoneChatMessageState chatStatusSal2Linphone(SalMessageDeliveryStatus status){
|
||||
|
|
@ -562,7 +607,13 @@ static LinphoneChatMessageState chatStatusSal2Linphone(SalMessageDeliveryStatus
|
|||
}
|
||||
|
||||
static void message_delivery_update(SalOp *op, SalMessageDeliveryStatus status) {
|
||||
LinphonePrivate::ChatMessage *msg = reinterpret_cast<LinphonePrivate::ChatMessage *>(op->get_user_pointer());
|
||||
auto lc = reinterpret_cast<LinphoneCore *>(op->getSal()->getUserPointer());
|
||||
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
|
||||
return;
|
||||
}
|
||||
|
||||
LinphonePrivate::ChatMessage *msg = reinterpret_cast<LinphonePrivate::ChatMessage *>(op->getUserPointer());
|
||||
if (!msg)
|
||||
return; // Do not handle delivery status for isComposing messages.
|
||||
|
||||
|
|
@ -572,14 +623,15 @@ static void message_delivery_update(SalOp *op, SalMessageDeliveryStatus status)
|
|||
}
|
||||
|
||||
static void info_received(SalOp *op, SalBodyHandler *body_handler) {
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
|
||||
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->getUserPointer());
|
||||
if (!session)
|
||||
return;
|
||||
L_GET_PRIVATE(session)->infoReceived(body_handler);
|
||||
auto sessionRef = session->getSharedFromThis();
|
||||
L_GET_PRIVATE(sessionRef)->infoReceived(body_handler);
|
||||
}
|
||||
|
||||
static void subscribe_response(SalOp *op, SalSubscribeStatus status, int will_retry){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
|
||||
if (lev==NULL) return;
|
||||
|
||||
|
|
@ -596,15 +648,15 @@ static void subscribe_response(SalOp *op, SalSubscribeStatus status, int will_re
|
|||
}
|
||||
|
||||
static void notify(SalSubscribeOp *op, SalSubscribeStatus st, const char *eventname, SalBodyHandler *body_handler){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->getSal()->getUserPointer();
|
||||
bool_t out_of_dialog = (lev==NULL);
|
||||
if (out_of_dialog) {
|
||||
/*out of dialog notify */
|
||||
lev = linphone_event_new_with_out_of_dialog_op(lc,op,LinphoneSubscriptionOutgoing,eventname);
|
||||
}
|
||||
{
|
||||
LinphoneContent *ct=linphone_content_from_sal_body_handler(body_handler);
|
||||
LinphoneContent *ct = linphone_content_from_sal_body_handler(body_handler);
|
||||
if (ct) {
|
||||
linphone_core_notify_notify_received(lc,lev,eventname,ct);
|
||||
linphone_content_unref(ct);
|
||||
|
|
@ -619,27 +671,36 @@ static void notify(SalSubscribeOp *op, SalSubscribeStatus st, const char *eventn
|
|||
}
|
||||
|
||||
static void subscribe_received(SalSubscribeOp *op, const char *eventname, const SalBodyHandler *body_handler){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
LinphoneCore *lc=(LinphoneCore *)op->getSal()->getUserPointer();
|
||||
|
||||
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
|
||||
op->decline(SalReasonServiceUnavailable);
|
||||
return;
|
||||
}
|
||||
|
||||
if (lev==NULL) {
|
||||
lev=linphone_event_new_with_op(lc,op,LinphoneSubscriptionIncoming,eventname);
|
||||
linphone_event_set_state(lev,LinphoneSubscriptionIncomingReceived);
|
||||
}else{
|
||||
LinphoneContent *ct = linphone_content_from_sal_body_handler(body_handler);
|
||||
linphone_core_notify_subscribe_received(lc,lev,eventname,ct);
|
||||
if (ct)
|
||||
linphone_content_unref(ct);
|
||||
} else {
|
||||
/*subscribe refresh, unhandled*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void incoming_subscribe_closed(SalOp *op){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
|
||||
linphone_event_set_state(lev,LinphoneSubscriptionTerminated);
|
||||
}
|
||||
|
||||
static void on_publish_response(SalOp* op){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
const SalErrorInfo *ei=op->get_error_info();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
const SalErrorInfo *ei=op->getErrorInfo();
|
||||
|
||||
if (lev==NULL) return;
|
||||
if (ei->reason==SalReasonNone){
|
||||
|
|
@ -658,7 +719,7 @@ static void on_publish_response(SalOp* op){
|
|||
|
||||
|
||||
static void on_expire(SalOp *op){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
|
||||
if (lev==NULL) return;
|
||||
|
||||
|
|
@ -670,14 +731,14 @@ static void on_expire(SalOp *op){
|
|||
}
|
||||
|
||||
static void on_notify_response(SalOp *op){
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer();
|
||||
LinphoneEvent *lev=(LinphoneEvent*)op->getUserPointer();
|
||||
if (!lev)
|
||||
return;
|
||||
|
||||
if (lev->is_out_of_dialog_op) {
|
||||
switch (linphone_event_get_subscription_state(lev)) {
|
||||
case LinphoneSubscriptionIncomingReceived:
|
||||
if (op->get_error_info()->reason == SalReasonNone)
|
||||
if (op->getErrorInfo()->reason == SalReasonNone)
|
||||
linphone_event_set_state(lev, LinphoneSubscriptionTerminated);
|
||||
else
|
||||
linphone_event_set_state(lev, LinphoneSubscriptionError);
|
||||
|
|
@ -699,15 +760,21 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
|
|||
LinphonePrivate::Address addr(refer_uri);
|
||||
bctbx_free(refer_uri);
|
||||
if (addr.isValid()) {
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->get_sal()->get_user_pointer());
|
||||
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->getSal()->getUserPointer());
|
||||
|
||||
if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) {
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
|
||||
return;
|
||||
}
|
||||
|
||||
if (addr.hasUriParam("method") && (addr.getUriParamValue("method") == "BYE")) {
|
||||
if (linphone_core_conference_server_enabled(lc)) {
|
||||
// Removal of a participant at the server side
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))
|
||||
ChatRoomId(IdentityAddress(op->getTo()), IdentityAddress(op->getTo()))
|
||||
);
|
||||
if (chatRoom) {
|
||||
std::shared_ptr<Participant> participant = chatRoom->findParticipant(IdentityAddress(op->get_from()));
|
||||
std::shared_ptr<Participant> participant = chatRoom->findParticipant(IdentityAddress(op->getFrom()));
|
||||
if (!participant || !participant->isAdmin()) {
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
|
||||
return;
|
||||
|
|
@ -721,7 +788,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
|
|||
} else {
|
||||
// The server asks a participant to leave a chat room
|
||||
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to())))
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ChatRoomId(addr, IdentityAddress(op->getTo())))
|
||||
);
|
||||
if (cr) {
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->leave();
|
||||
|
|
@ -730,34 +797,51 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
|
|||
}
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
|
||||
}
|
||||
} else if (addr.hasParam("admin")) {
|
||||
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))
|
||||
));
|
||||
if (cr) {
|
||||
Address fromAddr(op->get_from());
|
||||
std::shared_ptr<Participant> participant = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->findParticipant(fromAddr);
|
||||
if (!participant || !participant->isAdmin()) {
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
|
||||
return;
|
||||
}
|
||||
participant = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->findParticipant(addr);
|
||||
if (participant) {
|
||||
bool value = Utils::stob(addr.getParamValue("admin"));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->setParticipantAdminStatus(participant, value);
|
||||
} else {
|
||||
if (linphone_core_conference_server_enabled(lc)) {
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(IdentityAddress(op->getTo()), IdentityAddress(op->getTo()))
|
||||
);
|
||||
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(chatRoom);
|
||||
if (cr) {
|
||||
Address fromAddr(op->getFrom());
|
||||
shared_ptr<Participant> participant = chatRoom->findParticipant(fromAddr);
|
||||
if (!participant || !participant->isAdmin()) {
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
|
||||
return;
|
||||
}
|
||||
if (addr.hasParam("admin")) {
|
||||
participant = chatRoom->findParticipant(addr);
|
||||
if (participant) {
|
||||
bool value = Utils::stob(addr.getParamValue("admin"));
|
||||
chatRoom->setParticipantAdminStatus(participant, value);
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonNone);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
participant = L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->findFilteredParticipant(addr);
|
||||
if (!participant) {
|
||||
list<IdentityAddress> identAddresses;
|
||||
identAddresses.push_back(addr);
|
||||
L_GET_PRIVATE(static_pointer_cast<ServerGroupChatRoom>(chatRoom))->checkCompatibleParticipants(
|
||||
IdentityAddress(op->getRemoteContact()),
|
||||
identAddresses
|
||||
);
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonNone);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(addr, IdentityAddress(op->getTo()))
|
||||
);
|
||||
if (!chatRoom)
|
||||
chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), Content(), false);
|
||||
chatRoom->join();
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonNone);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
shared_ptr<AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
ChatRoomId(addr, IdentityAddress(op->get_to()))
|
||||
);
|
||||
if (!chatRoom)
|
||||
chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), false);
|
||||
chatRoom->join();
|
||||
static_cast<SalReferOp *>(op)->reply(SalReasonNone);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ static char* generate_url_from_server_address_and_uid(const char *server_url) {
|
|||
char *result = NULL;
|
||||
if (server_url) {
|
||||
char *uuid = reinterpret_cast<char *>(ms_malloc(64));
|
||||
if (LinphonePrivate::Sal::generate_uuid(uuid, 64) == 0) {
|
||||
if (LinphonePrivate::Sal::generateUuid(uuid, 64) == 0) {
|
||||
char *url = reinterpret_cast<char *>(ms_malloc(300));
|
||||
snprintf(url, 300, "%s/linphone-%s.vcf", server_url, uuid);
|
||||
ms_debug("Generated url is %s", url);
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ const bctbx_list_t *linphone_core_get_chat_rooms (LinphoneCore *lc) {
|
|||
static LinphoneChatRoom *linphone_chat_room_new (LinphoneCore *core, const LinphoneAddress *addr) {
|
||||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(core)->getOrCreateBasicChatRoom(
|
||||
*L_GET_CPP_PTR_FROM_C_OBJECT(addr),
|
||||
linphone_core_realtime_text_enabled(core)
|
||||
!!linphone_core_realtime_text_enabled(core)
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -84,8 +84,8 @@ LinphoneChatRoom *linphone_core_get_chat_room (LinphoneCore *lc, const LinphoneA
|
|||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(*L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
|
||||
}
|
||||
|
||||
LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject) {
|
||||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject)));
|
||||
LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject, bool_t fallback) {
|
||||
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject), !!fallback));
|
||||
}
|
||||
|
||||
LinphoneChatRoom *_linphone_core_create_server_group_chat_room (LinphoneCore *lc, LinphonePrivate::SalCallOp *op) {
|
||||
|
|
@ -124,13 +124,13 @@ LinphoneChatRoom *linphone_core_find_one_to_one_chat_room (
|
|||
|
||||
int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op, const SalMessage *sal_msg) {
|
||||
LinphoneReason reason = LinphoneReasonNotAcceptable;
|
||||
const char *peerAddress;
|
||||
const char *localAddress;
|
||||
std::string peerAddress;
|
||||
std::string localAddress;
|
||||
if (linphone_core_conference_server_enabled(lc)) {
|
||||
localAddress = peerAddress = op->get_to();
|
||||
localAddress = peerAddress = op->getTo();
|
||||
} else {
|
||||
peerAddress = op->get_from();
|
||||
localAddress = op->get_to();
|
||||
peerAddress = op->getFrom();
|
||||
localAddress = op->getTo();
|
||||
}
|
||||
|
||||
shared_ptr<LinphonePrivate::AbstractChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
|
||||
|
|
|
|||
|
|
@ -685,9 +685,12 @@ void LocalConference::onCallTerminating (LinphoneCall *call) {
|
|||
ms_message("conference_check_uninit(): size=%i", getSize());
|
||||
if ((remote_count == 1) && !m_terminating)
|
||||
convertConferenceToCall();
|
||||
|
||||
if (remote_count == 0) {
|
||||
if (m_localParticipantStream)
|
||||
if (m_localParticipantStream){
|
||||
removeLocalEndpoint();
|
||||
linphone_core_soundcard_hint_check(m_core);
|
||||
}
|
||||
if (m_recordEndpoint) {
|
||||
ms_audio_conference_remove_member(m_conf, m_recordEndpoint);
|
||||
ms_audio_endpoint_destroy(m_recordEndpoint);
|
||||
|
|
|
|||
|
|
@ -1,243 +0,0 @@
|
|||
/*
|
||||
linphone
|
||||
Copyright (C) 2010-2014 Belledonne Communications SARL
|
||||
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone/core.h"
|
||||
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
|
||||
// TODO: From coreapi. Remove me later.
|
||||
#include "private.h"
|
||||
|
||||
static void linphone_content_set_sal_body_handler(LinphoneContent *content, SalBodyHandler *body_handler) {
|
||||
if (content->body_handler != NULL) {
|
||||
sal_body_handler_unref(content->body_handler);
|
||||
content->body_handler = NULL;
|
||||
}
|
||||
content->body_handler = sal_body_handler_ref(body_handler);
|
||||
}
|
||||
|
||||
static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) {
|
||||
LinphoneContent *content = belle_sip_object_new(LinphoneContent);
|
||||
belle_sip_object_ref(content);
|
||||
content->owned_fields = TRUE;
|
||||
content->cryptoContext = NULL; /* this field is managed externally by encryption/decryption functions so be careful to initialise it to NULL */
|
||||
if (body_handler == NULL) {
|
||||
linphone_content_set_sal_body_handler(content, sal_body_handler_new());
|
||||
} else {
|
||||
linphone_content_set_sal_body_handler(content, body_handler);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
static void linphone_content_destroy(LinphoneContent *content) {
|
||||
if (content->owned_fields == TRUE) {
|
||||
if (content->body_handler) sal_body_handler_unref(content->body_handler);
|
||||
if (content->name) belle_sip_free(content->name);
|
||||
if (content->key) belle_sip_free(content->key);
|
||||
/* note : crypto context is allocated/destroyed by the encryption function */
|
||||
}
|
||||
}
|
||||
|
||||
static void linphone_content_clone(LinphoneContent *obj, const LinphoneContent *ref) {
|
||||
obj->owned_fields = TRUE;
|
||||
linphone_content_set_sal_body_handler(obj, sal_body_handler_new());
|
||||
if ((linphone_content_get_type(ref) != NULL) || (linphone_content_get_subtype(ref) != NULL)) {
|
||||
linphone_content_set_type(obj, linphone_content_get_type(ref));
|
||||
linphone_content_set_subtype(obj, linphone_content_get_subtype(ref));
|
||||
}
|
||||
if (linphone_content_get_encoding(ref) != NULL) {
|
||||
linphone_content_set_encoding(obj, linphone_content_get_encoding(ref));
|
||||
}
|
||||
linphone_content_set_name(obj, linphone_content_get_name(ref));
|
||||
linphone_content_set_key(obj, linphone_content_get_key(ref), linphone_content_get_key_size(ref));
|
||||
if (linphone_content_get_buffer(ref) != NULL) {
|
||||
linphone_content_set_buffer(obj, linphone_content_get_buffer(ref), linphone_content_get_size(ref));
|
||||
} else {
|
||||
linphone_content_set_size(obj, linphone_content_get_size(ref));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneContent);
|
||||
|
||||
BELLE_SIP_INSTANCIATE_VPTR(LinphoneContent, belle_sip_object_t,
|
||||
(belle_sip_object_destroy_t)linphone_content_destroy,
|
||||
(belle_sip_object_clone_t)linphone_content_clone,
|
||||
NULL, // marshal
|
||||
TRUE
|
||||
);
|
||||
|
||||
|
||||
LinphoneContent * linphone_core_create_content(LinphoneCore *lc) {
|
||||
return linphone_content_new();
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_ref(LinphoneContent *content) {
|
||||
belle_sip_object_ref(content);
|
||||
return content;
|
||||
}
|
||||
|
||||
void linphone_content_unref(LinphoneContent *content) {
|
||||
belle_sip_object_unref(content);
|
||||
}
|
||||
|
||||
void *linphone_content_get_user_data(const LinphoneContent *content) {
|
||||
return content->user_data;
|
||||
}
|
||||
|
||||
void linphone_content_set_user_data(LinphoneContent *content, void *ud) {
|
||||
content->user_data = ud;
|
||||
}
|
||||
|
||||
const char * linphone_content_get_type(const LinphoneContent *content) {
|
||||
return sal_body_handler_get_type(content->body_handler);
|
||||
}
|
||||
|
||||
void linphone_content_set_type(LinphoneContent *content, const char *type) {
|
||||
sal_body_handler_set_type(content->body_handler, type);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_subtype(const LinphoneContent *content) {
|
||||
return sal_body_handler_get_subtype(content->body_handler);
|
||||
}
|
||||
|
||||
void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) {
|
||||
sal_body_handler_set_subtype(content->body_handler, subtype);
|
||||
}
|
||||
|
||||
uint8_t * linphone_content_get_buffer(const LinphoneContent *content) {
|
||||
return (uint8_t *)sal_body_handler_get_data(content->body_handler);
|
||||
}
|
||||
|
||||
void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) {
|
||||
void *data;
|
||||
sal_body_handler_set_size(content->body_handler, size);
|
||||
data = belle_sip_malloc(size + 1);
|
||||
memcpy(data, buffer, size);
|
||||
((char *)data)[size] = '\0';
|
||||
sal_body_handler_set_data(content->body_handler, data);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_string_buffer(const LinphoneContent *content) {
|
||||
return (const char *)linphone_content_get_buffer(content);
|
||||
}
|
||||
|
||||
void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) {
|
||||
sal_body_handler_set_size(content->body_handler, strlen(buffer));
|
||||
sal_body_handler_set_data(content->body_handler, belle_sip_strdup(buffer));
|
||||
}
|
||||
|
||||
size_t linphone_content_get_size(const LinphoneContent *content) {
|
||||
return sal_body_handler_get_size(content->body_handler);
|
||||
}
|
||||
|
||||
void linphone_content_set_size(LinphoneContent *content, size_t size) {
|
||||
sal_body_handler_set_size(content->body_handler, size);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_encoding(const LinphoneContent *content) {
|
||||
return sal_body_handler_get_encoding(content->body_handler);
|
||||
}
|
||||
|
||||
void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) {
|
||||
sal_body_handler_set_encoding(content->body_handler, encoding);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_name(const LinphoneContent *content) {
|
||||
return content->name;
|
||||
}
|
||||
|
||||
void linphone_content_set_name(LinphoneContent *content, const char *name) {
|
||||
if (content->name != NULL) {
|
||||
belle_sip_free(content->name);
|
||||
content->name = NULL;
|
||||
}
|
||||
if (name != NULL) {
|
||||
content->name = belle_sip_strdup(name);
|
||||
}
|
||||
}
|
||||
|
||||
size_t linphone_content_get_key_size(const LinphoneContent *content) {
|
||||
return content->keyLength;
|
||||
}
|
||||
|
||||
const char * linphone_content_get_key(const LinphoneContent *content) {
|
||||
return content->key;
|
||||
}
|
||||
|
||||
void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) {
|
||||
if (content->key != NULL) {
|
||||
belle_sip_free(content->key);
|
||||
content->key = NULL;
|
||||
}
|
||||
if (key != NULL) {
|
||||
content->key = reinterpret_cast<char *>(belle_sip_malloc(keyLength + 1));
|
||||
memcpy(content->key, key, keyLength);
|
||||
content->key[keyLength] = '\0';
|
||||
content->keyLength = keyLength;
|
||||
}
|
||||
}
|
||||
|
||||
/* crypto context is managed(allocated/freed) by the encryption function, so provide the address of field in the private structure */
|
||||
void ** linphone_content_get_cryptoContext_address(LinphoneContent *content) {
|
||||
return &(content->cryptoContext);
|
||||
}
|
||||
|
||||
bool_t linphone_content_is_multipart(const LinphoneContent *content) {
|
||||
return sal_body_handler_is_multipart(content->body_handler);
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) {
|
||||
SalBodyHandler *part_body_handler;
|
||||
if (!linphone_content_is_multipart(content)) return NULL;
|
||||
part_body_handler = sal_body_handler_get_part(content->body_handler, idx);
|
||||
return linphone_content_from_sal_body_handler(part_body_handler);
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) {
|
||||
SalBodyHandler *part_body_handler;
|
||||
if (!linphone_content_is_multipart(content)) return NULL;
|
||||
part_body_handler = sal_body_handler_find_part_by_header(content->body_handler, header_name, header_value);
|
||||
return linphone_content_from_sal_body_handler(part_body_handler);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) {
|
||||
return sal_body_handler_get_header(content->body_handler, header_name);
|
||||
}
|
||||
|
||||
|
||||
LinphoneContent * linphone_content_new(void) {
|
||||
return linphone_content_new_with_body_handler(NULL);
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_copy(const LinphoneContent *ref) {
|
||||
return (LinphoneContent *)belle_sip_object_ref(belle_sip_object_clone(BELLE_SIP_OBJECT(ref)));
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_handler) {
|
||||
if (body_handler) {
|
||||
return linphone_content_new_with_body_handler(body_handler);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) {
|
||||
if (content == NULL) return NULL;
|
||||
return content->body_handler;
|
||||
}
|
||||
|
|
@ -207,9 +207,9 @@ void linphone_error_info_from_sal_op(LinphoneErrorInfo *ei, const LinphonePrivat
|
|||
}else{
|
||||
const SalErrorInfo *sei;
|
||||
linphone_error_info_reset(ei);
|
||||
sei = op->get_error_info();
|
||||
sei = op->getErrorInfo();
|
||||
linphone_error_info_from_sal(ei, sei);
|
||||
sei = op->get_reason_error_info();
|
||||
sei = op->getReasonErrorInfo();
|
||||
linphone_error_info_from_sal_reason_ei(ei, sei);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ void linphone_event_cbs_set_notify_response(LinphoneEventCbs *cbs, LinphoneEvent
|
|||
static void linphone_event_release(LinphoneEvent *lev){
|
||||
if (lev->op) {
|
||||
/*this will stop the refresher*/
|
||||
lev->op->stop_refreshing();
|
||||
lev->op->stopRefreshing();
|
||||
}
|
||||
linphone_event_unref(lev);
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ static LinphoneEvent * linphone_event_new_base(LinphoneCore *lc, LinphoneSubscri
|
|||
lev->name=ms_strdup(name);
|
||||
if (strcmp(lev->name, "conference") == 0)
|
||||
lev->internal = TRUE;
|
||||
lev->op->set_user_pointer(lev);
|
||||
lev->op->setUserPointer(lev);
|
||||
return lev;
|
||||
}
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ LinphoneReason linphone_event_get_reason(const LinphoneEvent *lev){
|
|||
LinphoneEvent *linphone_core_create_subscribe(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires){
|
||||
LinphoneEvent *lev=linphone_event_new(lc, LinphoneSubscriptionOutgoing, event, expires);
|
||||
linphone_configure_op(lc,lev->op,resource,NULL,TRUE);
|
||||
lev->op->set_manual_refresher_mode(!lp_config_get_int(lc->config,"sip","refresh_generic_subscribe",1));
|
||||
lev->op->setManualRefresherMode(!lp_config_get_int(lc->config,"sip","refresh_generic_subscribe",1));
|
||||
return lev;
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ LinphoneEvent *linphone_core_create_notify(LinphoneCore *lc, const LinphoneAddre
|
|||
LinphoneEvent *lev=linphone_event_new(lc, LinphoneSubscriptionIncoming, event, -1);
|
||||
linphone_configure_op(lc,lev->op,resource,NULL,TRUE);
|
||||
lev->subscription_state = LinphoneSubscriptionIncomingReceived;
|
||||
lev->op->set_event(event);
|
||||
lev->op->setEvent(event);
|
||||
lev->is_out_of_dialog_op = TRUE;
|
||||
return lev;
|
||||
}
|
||||
|
|
@ -265,10 +265,10 @@ LinphoneStatus linphone_event_send_subscribe(LinphoneEvent *lev, const LinphoneC
|
|||
}
|
||||
|
||||
if (lev->send_custom_headers){
|
||||
lev->op->set_sent_custom_header(lev->send_custom_headers);
|
||||
lev->op->setSentCustomHeaders(lev->send_custom_headers);
|
||||
sal_custom_header_free(lev->send_custom_headers);
|
||||
lev->send_custom_headers=NULL;
|
||||
}else lev->op->set_sent_custom_header(NULL);
|
||||
}else lev->op->setSentCustomHeaders(NULL);
|
||||
|
||||
body_handler = sal_body_handler_from_content(body);
|
||||
auto subscribeOp = dynamic_cast<SalSubscribeOp *>(lev->op);
|
||||
|
|
@ -324,7 +324,7 @@ LinphoneStatus linphone_event_notify(LinphoneEvent *lev, const LinphoneContent *
|
|||
ms_error("linphone_event_notify(): cannot notify if not an incoming subscription.");
|
||||
return -1;
|
||||
}
|
||||
body_handler = sal_body_handler_from_content(body);
|
||||
body_handler = sal_body_handler_from_content(body, false);
|
||||
auto subscribeOp = dynamic_cast<SalSubscribeOp *>(lev->op);
|
||||
return subscribeOp->notify(body_handler);
|
||||
}
|
||||
|
|
@ -347,7 +347,7 @@ static LinphoneEvent *_linphone_core_create_publish(LinphoneCore *core, Linphone
|
|||
lev = linphone_event_new_with_op(lc, new SalPublishOp(lc->sal), LinphoneSubscriptionInvalidDir, event);
|
||||
lev->expires = expires;
|
||||
linphone_configure_op_with_proxy(lc,lev->op,resource,NULL, !!lp_config_get_int(lc->config,"sip","publish_msg_with_contact",0),cfg);
|
||||
lev->op->set_manual_refresher_mode(!lp_config_get_int(lc->config,"sip","refresh_generic_publish",1));
|
||||
lev->op->setManualRefresherMode(!lp_config_get_int(lc->config,"sip","refresh_generic_publish",1));
|
||||
return lev;
|
||||
}
|
||||
LinphoneEvent *linphone_core_create_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires){
|
||||
|
|
@ -374,10 +374,10 @@ static int _linphone_event_send_publish(LinphoneEvent *lev, const LinphoneConten
|
|||
return -1;
|
||||
}
|
||||
if (lev->send_custom_headers){
|
||||
lev->op->set_sent_custom_header(lev->send_custom_headers);
|
||||
lev->op->setSentCustomHeaders(lev->send_custom_headers);
|
||||
sal_custom_header_free(lev->send_custom_headers);
|
||||
lev->send_custom_headers=NULL;
|
||||
}else lev->op->set_sent_custom_header(NULL);
|
||||
}else lev->op->setSentCustomHeaders(NULL);
|
||||
body_handler = sal_body_handler_from_content(body);
|
||||
auto publishOp = dynamic_cast<SalPublishOp *>(lev->op);
|
||||
err=publishOp->publish(NULL,NULL,lev->name,lev->expires,body_handler);
|
||||
|
|
@ -413,7 +413,7 @@ LinphoneStatus linphone_event_refresh_publish(LinphoneEvent *lev) {
|
|||
return lev->op->refresh();
|
||||
}
|
||||
void linphone_event_pause_publish(LinphoneEvent *lev) {
|
||||
if (lev->op) lev->op->stop_refreshing();
|
||||
if (lev->op) lev->op->stopRefreshing();
|
||||
}
|
||||
void linphone_event_unpublish(LinphoneEvent *lev) {
|
||||
lev->terminating = TRUE; /* needed to get clear event*/
|
||||
|
|
@ -435,7 +435,7 @@ void linphone_event_add_custom_header(LinphoneEvent *ev, const char *name, const
|
|||
}
|
||||
|
||||
const char* linphone_event_get_custom_header(LinphoneEvent* ev, const char* name){
|
||||
const SalCustomHeader *ch=ev->op->get_recv_custom_header();
|
||||
const SalCustomHeader *ch=ev->op->getRecvCustomHeaders();
|
||||
return sal_custom_header_find(ch,name);
|
||||
}
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ void linphone_event_terminate(LinphoneEvent *lev){
|
|||
lev->terminating=TRUE;
|
||||
if (lev->dir==LinphoneSubscriptionIncoming){
|
||||
auto op = dynamic_cast<SalSubscribeOp *>(lev->op);
|
||||
op->close_notify();
|
||||
op->closeNotify();
|
||||
}else if (lev->dir==LinphoneSubscriptionOutgoing){
|
||||
auto op = dynamic_cast<SalSubscribeOp *>(lev->op);
|
||||
op->unsubscribe();
|
||||
|
|
@ -511,7 +511,7 @@ const char *linphone_event_get_name(const LinphoneEvent *lev){
|
|||
static const LinphoneAddress *_linphone_event_cache_to (const LinphoneEvent *lev) {
|
||||
if (lev->to_address)
|
||||
linphone_address_unref(lev->to_address);
|
||||
char *buf = sal_address_as_string(lev->op->get_to_address());
|
||||
char *buf = sal_address_as_string(lev->op->getToAddress());
|
||||
((LinphoneEvent *)lev)->to_address = linphone_address_new(buf);
|
||||
ms_free(buf);
|
||||
return lev->to_address;
|
||||
|
|
@ -520,7 +520,7 @@ static const LinphoneAddress *_linphone_event_cache_to (const LinphoneEvent *lev
|
|||
static const LinphoneAddress *_linphone_event_cache_from (const LinphoneEvent *lev) {
|
||||
if (lev->from_address)
|
||||
linphone_address_unref(lev->from_address);
|
||||
char *buf = sal_address_as_string(lev->op->get_from_address());
|
||||
char *buf = sal_address_as_string(lev->op->getFromAddress());
|
||||
((LinphoneEvent *)lev)->from_address = linphone_address_new(buf);
|
||||
ms_free(buf);
|
||||
return lev->from_address;
|
||||
|
|
@ -529,7 +529,7 @@ static const LinphoneAddress *_linphone_event_cache_from (const LinphoneEvent *l
|
|||
static const LinphoneAddress *_linphone_event_cache_remote_contact (const LinphoneEvent *lev) {
|
||||
if (lev->remote_contact_address)
|
||||
linphone_address_unref(lev->remote_contact_address);
|
||||
char *buf = sal_address_as_string(lev->op->get_remote_contact_address());
|
||||
char *buf = sal_address_as_string(lev->op->getRemoteContactAddress());
|
||||
((LinphoneEvent *)lev)->remote_contact_address = linphone_address_new(buf);
|
||||
ms_free(buf);
|
||||
return lev->remote_contact_address;
|
||||
|
|
|
|||
|
|
@ -439,3 +439,7 @@ void linphone_factory_set_log_collection_path(LinphoneFactory *factory, const ch
|
|||
void linphone_factory_enable_log_collection(LinphoneFactory *factory, LinphoneLogCollectionState state) {
|
||||
linphone_core_enable_log_collection(state);
|
||||
}
|
||||
|
||||
LinphoneTunnelConfig *linphone_factory_create_tunnel_config(LinphoneFactory *factory) {
|
||||
return linphone_tunnel_config_new();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ void linphone_friend_notify(LinphoneFriend *lf, LinphonePresenceModel *presence)
|
|||
}
|
||||
for(elem=lf->insubs; elem!=NULL; elem=bctbx_list_next(elem)){
|
||||
auto op = reinterpret_cast<SalPresenceOp *>(bctbx_list_get_data(elem));
|
||||
op->notify_presence((SalPresenceModel *)presence);
|
||||
op->notifyPresence((SalPresenceModel *)presence);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -531,7 +531,7 @@ void linphone_friend_invalidate_subscription(LinphoneFriend *lf){
|
|||
}
|
||||
|
||||
static void close_presence_notification(SalPresenceOp *op) {
|
||||
op->notify_presence_close();
|
||||
op->notifyPresenceClose();
|
||||
}
|
||||
|
||||
static void release_sal_op(SalOp *op) {
|
||||
|
|
@ -773,7 +773,7 @@ void linphone_friend_update_subscribes(LinphoneFriend *fr, bool_t only_when_regi
|
|||
linphone_friend_unsubscribe(fr);
|
||||
}else if (!can_subscribe && fr->outsub){
|
||||
fr->subscribe_active=FALSE;
|
||||
fr->outsub->stop_refreshing();
|
||||
fr->outsub->stopRefreshing();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1779,11 +1779,13 @@ const char * linphone_friend_phone_number_to_sip_uri(LinphoneFriend *lf, const c
|
|||
if(strcmp(normalized_number, phone_number) != 0) {
|
||||
char *old_uri = ms_strdup_printf("sip:%s@%s;user=phone", phone_number, linphone_proxy_config_get_domain(proxy_config));
|
||||
bctbx_iterator_t *it = bctbx_map_cchar_find_key(lf->friend_list->friends_map_uri, old_uri);
|
||||
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(lf->friend_list->friends_map_uri))){
|
||||
bctbx_iterator_t *end = bctbx_map_cchar_end(lf->friend_list->friends_map_uri);
|
||||
if (!bctbx_iterator_cchar_equals(it, end)){
|
||||
linphone_friend_unref((LinphoneFriend*)bctbx_pair_cchar_get_second(bctbx_iterator_cchar_get_pair(it)));
|
||||
bctbx_map_cchar_erase(lf->friend_list->friends_map_uri, it);
|
||||
}
|
||||
bctbx_iterator_cchar_delete(it);
|
||||
bctbx_iterator_cchar_delete(end);
|
||||
ms_free(old_uri);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
#include <bctoolbox/crypto.h>
|
||||
|
||||
#include "linphone/api/c-content.h"
|
||||
#include "linphone/core.h"
|
||||
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
|
|
@ -576,6 +577,7 @@ LinphoneFriendListStatus linphone_friend_list_import_friend(LinphoneFriendList *
|
|||
}
|
||||
iterator = bctbx_list_next(iterator);
|
||||
}
|
||||
bctbx_list_free(phone_numbers);
|
||||
|
||||
addresses = linphone_friend_get_addresses(lf);
|
||||
iterator = (bctbx_list_t *)addresses;
|
||||
|
|
@ -798,15 +800,19 @@ LinphoneFriend * linphone_friend_list_find_friend_by_uri(const LinphoneFriendLis
|
|||
return result;
|
||||
}
|
||||
|
||||
LinphoneFriend * linphone_friend_list_find_friend_by_ref_key(const LinphoneFriendList *list, const char *ref_key) {
|
||||
if(list) {
|
||||
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map, ref_key);
|
||||
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(list->friends_map))) {
|
||||
LinphoneFriend *linphone_friend_list_find_friend_by_ref_key (const LinphoneFriendList *list, const char *ref_key) {
|
||||
LinphoneFriend *result = NULL;
|
||||
if (list) {
|
||||
bctbx_iterator_t *it = bctbx_map_cchar_find_key(list->friends_map, ref_key);
|
||||
bctbx_iterator_t *end = bctbx_map_cchar_end(list->friends_map);
|
||||
if (!bctbx_iterator_cchar_equals(it, end)) {
|
||||
bctbx_pair_t *pair = bctbx_iterator_cchar_get_pair(it);
|
||||
return (LinphoneFriend *)bctbx_pair_cchar_get_second(pair);
|
||||
result = (LinphoneFriend *)bctbx_pair_cchar_get_second(pair);
|
||||
}
|
||||
bctbx_iterator_cchar_delete(end);
|
||||
bctbx_iterator_cchar_delete(it);
|
||||
}
|
||||
return NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
LinphoneFriend * linphone_friend_list_find_friend_by_inc_subscribe (
|
||||
|
|
@ -828,7 +834,7 @@ LinphoneFriend * linphone_friend_list_find_friend_by_out_subscribe (
|
|||
const bctbx_list_t *elem;
|
||||
for (elem = list->friends; elem != NULL; elem = bctbx_list_next(elem)) {
|
||||
LinphoneFriend *lf = (LinphoneFriend *)bctbx_list_get_data(elem);
|
||||
if (lf->outsub && ((lf->outsub == op) || lf->outsub->is_forked_of(op))) return lf;
|
||||
if (lf->outsub && ((lf->outsub == op) || lf->outsub->isForkedOf(op))) return lf;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -961,7 +967,7 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin
|
|||
const char *subtype = linphone_content_get_subtype(body);
|
||||
|
||||
if ((strcmp(type, "multipart") != 0) || (strcmp(subtype, "related") != 0)) {
|
||||
ms_warning("multipart presence notified but it is not 'multipart/related'");
|
||||
ms_warning("multipart presence notified but it is not 'multipart/related', instead is '%s/%s'", type, subtype);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,14 +38,12 @@ if (ENABLE_DOC OR ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRA
|
|||
)
|
||||
set(XML_DIR "${CMAKE_CURRENT_BINARY_DIR}/xml")
|
||||
set(LINPHONE_DOXYGEN_XML_DIR ${XML_DIR} PARENT_SCOPE)
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" "${XML_DIR}/index.xml"
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f html/* xml/*
|
||||
add_custom_command(OUTPUT "${XML_DIR}/index.xml"
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f xml/*
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
DEPENDS ${DOC_INPUT_FILES}
|
||||
)
|
||||
add_custom_target(linphone-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" "${XML_DIR}/index.xml")
|
||||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" "${XML_DIR}"
|
||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/linphone-${LINPHONE_VERSION}")
|
||||
add_custom_target(linphone-doc ALL DEPENDS "${XML_DIR}/index.xml")
|
||||
else()
|
||||
if (ENABLE_CXX_WRAPPER)
|
||||
message(FATAL_ERROR "The dot program is needed to generate the linphone documentation. You can get it from http://www.graphviz.org/.")
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ IGNORE_PREFIX =
|
|||
# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
|
||||
# The default value is: YES.
|
||||
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_HTML = NO
|
||||
|
||||
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
|
||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||
|
|
@ -1589,7 +1589,7 @@ EXTRA_SEARCH_MAPPINGS =
|
|||
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
|
||||
# The default value is: YES.
|
||||
|
||||
GENERATE_LATEX = YES
|
||||
GENERATE_LATEX = NO
|
||||
|
||||
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
|
||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||
|
|
@ -1825,7 +1825,7 @@ RTF_SOURCE_CODE = NO
|
|||
# classes and files.
|
||||
# The default value is: NO.
|
||||
|
||||
GENERATE_MAN = YES
|
||||
GENERATE_MAN = NO
|
||||
|
||||
# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
|
||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||
|
|
|
|||
|
|
@ -20,42 +20,40 @@
|
|||
#
|
||||
############################################################################
|
||||
|
||||
if (ENABLE_SPHINX_DOC)
|
||||
set(GENERATED_LANGUAGES c cpp csharp)
|
||||
set(DOCUMENTATION_DIRS )
|
||||
set(GENERATED_SPHINX_SOURCES )
|
||||
foreach(LANGUAGE_ ${GENERATED_LANGUAGES})
|
||||
set(DOCUMENTATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/source/${LANGUAGE_})
|
||||
list(APPEND DOCUMENTATION_DIRS ${DOCUMENTATION_DIR})
|
||||
list(APPEND GENERATED_SPHINX_SOURCES ${DOCUMENTATION_DIR}/index.rst)
|
||||
endforeach(LANGUAGE_)
|
||||
|
||||
set(PYTHON_SCRIPTS gendoc.py
|
||||
${linphone_SOURCE_DIR}/tools/abstractapi.py
|
||||
${linphone_SOURCE_DIR}/tools/genapixml.py
|
||||
${linphone_SOURCE_DIR}/tools/metadoc.py
|
||||
${linphone_SOURCE_DIR}/tools/metaname.py
|
||||
if (ENABLE_DOC)
|
||||
set(doc_source_dir ${CMAKE_CURRENT_BINARY_DIR}/source)
|
||||
set(doc_output_dir ${CMAKE_CURRENT_BINARY_DIR}/build)
|
||||
set(reference_doc_source_dir ${doc_source_dir}/reference)
|
||||
set(static_documentation_files
|
||||
guides/authentication.rst
|
||||
guides/buddy_list.rst
|
||||
guides/call_control.rst
|
||||
guides/call_logs.rst
|
||||
guides/call_misc.rst
|
||||
guides/chatroom.rst
|
||||
guides/conferencing.rst
|
||||
guides/event_api.rst
|
||||
guides/initializing.rst
|
||||
guides/ios_portability.rst
|
||||
guides/linphone_address.rst
|
||||
guides/media_parameters.rst
|
||||
guides/misc.rst
|
||||
guides/network_parameters.rst
|
||||
guides/proxies.rst
|
||||
index.rst
|
||||
logo.png
|
||||
samples/samples.rst
|
||||
)
|
||||
set(MUSTACHE_TEMPLATES class_page.mustache
|
||||
enums_page.mustache
|
||||
index_page.mustache
|
||||
)
|
||||
configure_file(conf.py.in source/conf.py)
|
||||
configure_file(source/index.rst source/index.rst COPYONLY)
|
||||
add_custom_command(OUTPUT ${GENERATED_SPHINX_SOURCES}
|
||||
COMMAND ${CMAKE_COMMAND} -E remove -f ${DOCUMENTATION_DIRS}
|
||||
COMMAND ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source'
|
||||
DEPENDS ${PYTHON_SCRIPTS}
|
||||
${MUSTACHE_TEMPLATES}
|
||||
${LINPHONE_DOXYGEN_XML_DIR}/index.xml
|
||||
linphone-doc
|
||||
)
|
||||
add_custom_command(OUTPUT build/html/index.html
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory build
|
||||
COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build'
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/source/conf.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/source/index.rst
|
||||
${GENERATED_SPHINX_SOURCES}
|
||||
)
|
||||
add_custom_target(sphinx-doc ALL DEPENDS build/html/index.html)
|
||||
configure_file(conf.py.in ${doc_source_dir}/conf.py)
|
||||
foreach(file ${static_documentation_files})
|
||||
configure_file(${file} ${doc_source_dir}/${file} COPYONLY)
|
||||
endforeach(file)
|
||||
foreach(source ${LINPHONE_C_EXAMPLES_SOURCE})
|
||||
configure_file(${source} ${doc_source_dir}/samples/ COPYONLY)
|
||||
endforeach(source)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${doc_source_dir}/_static ${reference_doc_source_dir})
|
||||
add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o '${reference_doc_source_dir}'
|
||||
COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html '${doc_source_dir}' '${doc_output_dir}'
|
||||
DEPENDS linphone-doc)
|
||||
install(DIRECTORY ${doc_output_dir}/html/ DESTINATION ${CMAKE_INSTALL_DOCDIR}/${LINPHONE_VERSION})
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
{{#hasNamespaceDeclarator}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{namespace}}}
|
||||
{{#isJava}}
|
||||
:noindex:
|
||||
{{/isJava}}
|
||||
{{/hasNamespaceDeclarator}}
|
||||
|
||||
{{#make_chapter}}{{{className}}} class{{/make_chapter}}
|
||||
|
||||
.. {{#write_declarator}}class{{/write_declarator}}:: {{{fullClassName}}}
|
||||
.. {{#write_declarator}}class{{/write_declarator}}:: {{{classDeclaration}}}
|
||||
|
||||
{{#briefDoc}}
|
||||
{{#lines}}
|
||||
|
|
@ -17,9 +24,24 @@
|
|||
{{{selector}}}
|
||||
|
||||
|
||||
{{#hasNamespaceDeclarator}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}}
|
||||
{{#isJava}}
|
||||
:noindex:
|
||||
{{/isJava}}
|
||||
{{/hasNamespaceDeclarator}}
|
||||
|
||||
|
||||
Summary
|
||||
=======
|
||||
|
||||
{{#hasEnums}}
|
||||
Enums
|
||||
-----
|
||||
|
||||
{{{enumsSummary}}}
|
||||
{{/hasEnums}}
|
||||
|
||||
{{#hasProperties}}
|
||||
Properties
|
||||
----------
|
||||
|
|
@ -41,18 +63,61 @@ Class methods
|
|||
{{{classMethodsSummary}}}
|
||||
{{/hasClassMethods}}
|
||||
|
||||
|
||||
Detailed descriptions
|
||||
=====================
|
||||
|
||||
{{#hasEnums}}
|
||||
Enums
|
||||
-----
|
||||
|
||||
{{#enums}}
|
||||
{{#make_subsection}}{{{name}}}{{/make_subsection}}
|
||||
.. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}}
|
||||
|
||||
{{#briefDesc}}
|
||||
{{#lines}}
|
||||
{{{line}}}
|
||||
{{/lines}}
|
||||
{{/briefDesc}}
|
||||
|
||||
{{{selector}}}
|
||||
|
||||
{{#enumerators}}
|
||||
{{#isNotJava}}
|
||||
.. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}}
|
||||
|
||||
{{/isNotJava}}
|
||||
{{#isJava}}
|
||||
**{{{name}}}**
|
||||
{{/isJava}}
|
||||
{{#briefDesc}}
|
||||
{{#lines}}
|
||||
{{{line}}}
|
||||
{{/lines}}
|
||||
{{/briefDesc}}
|
||||
|
||||
{{{selector}}}
|
||||
|
||||
{{/enumerators}}
|
||||
{{/enums}}
|
||||
{{/hasEnums}}
|
||||
|
||||
{{#hasProperties}}
|
||||
Properties
|
||||
----------
|
||||
|
||||
{{#properties}}
|
||||
|
||||
.. _{{{ref_label}}}:
|
||||
|
||||
{{{title}}}
|
||||
|
||||
{{#hasNamespaceDeclarator}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}}
|
||||
{{#isJava}}
|
||||
:noindex:
|
||||
{{/isJava}}
|
||||
{{/hasNamespaceDeclarator}}
|
||||
|
||||
{{#getter}}
|
||||
|
|
@ -100,6 +165,9 @@ Public methods
|
|||
|
||||
{{#hasNamespaceDeclarator}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}}
|
||||
{{#isJava}}
|
||||
:noindex:
|
||||
{{/isJava}}
|
||||
{{/hasNamespaceDeclarator}}
|
||||
|
||||
{{#methods}}
|
||||
|
|
@ -128,6 +196,9 @@ Class methods
|
|||
|
||||
{{#hasNamespaceDeclarator}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}}
|
||||
{{#isJava}}
|
||||
:noindex:
|
||||
{{/isJava}}
|
||||
{{/hasNamespaceDeclarator}}
|
||||
|
||||
{{#classMethods}}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['sphinx_csharp.csharp']
|
||||
extensions = ['sphinx_csharp.csharp', 'javasphinx']
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
|
@ -83,20 +83,33 @@ todo_include_todos = False
|
|||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
#html_theme = 'alabaster'
|
||||
html_theme = 'classic'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
# html_theme_options = {}
|
||||
html_theme_options = {
|
||||
'sidebarwidth': '360',
|
||||
'body_max_width': '100%',
|
||||
'collapsiblesidebar': 'true'
|
||||
}
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Path to the picture to use as logo.
|
||||
html_logo = 'logo.png'
|
||||
|
||||
# Enable html5
|
||||
html_experimental_html5_writer = True
|
||||
|
||||
# Side bar customization
|
||||
#html_sidebars = {
|
||||
# 'reference/*/*' : ['searchbox.html', 'globaltoc.html']
|
||||
#}
|
||||
|
||||
# -- Options for HTMLHelp output ------------------------------------------
|
||||
|
||||
|
|
|
|||
39
coreapi/help/doc/sphinx/enum_page.mustache
Normal file
39
coreapi/help/doc/sphinx/enum_page.mustache
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{{#namespace}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{namespace}}}
|
||||
{{#isJava}}
|
||||
:noindex:
|
||||
{{/isJava}}
|
||||
{{/namespace}}
|
||||
|
||||
{{#enum}}
|
||||
{{#make_chapter}}{{{name}}} enum{{/make_chapter}}
|
||||
|
||||
.. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}}
|
||||
|
||||
{{#briefDesc}}
|
||||
{{#lines}}
|
||||
{{{line}}}
|
||||
{{/lines}}
|
||||
{{/briefDesc}}
|
||||
|
||||
{{{selector}}}
|
||||
|
||||
{{#enumerators}}
|
||||
{{#isNotJava}}
|
||||
.. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}}
|
||||
|
||||
{{/isNotJava}}
|
||||
{{#isJava}}
|
||||
**{{{name}}}**
|
||||
{{/isJava}}
|
||||
{{#briefDesc}}
|
||||
{{#lines}}
|
||||
{{{line}}}
|
||||
{{/lines}}
|
||||
{{/briefDesc}}
|
||||
|
||||
{{{selector}}}
|
||||
|
||||
{{/enumerators}}
|
||||
|
||||
{{/enum}}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
{{#enums}}
|
||||
{{{sectionName}}}
|
||||
|
||||
.. {{#write_declarator}}enum{{/write_declarator}}:: {{{fullName}}}
|
||||
|
||||
{{#briefDesc}}
|
||||
{{#lines}}
|
||||
{{{line}}}
|
||||
{{/lines}}
|
||||
{{/briefDesc}}
|
||||
|
||||
{{{selector}}}
|
||||
|
||||
{{#hasNamespaceDeclarator}}
|
||||
.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{namespace}}}
|
||||
{{/hasNamespaceDeclarator}}
|
||||
|
||||
{{#enumerators}}
|
||||
.. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}}{{#value}} = {{{value}}}{{/value}}
|
||||
|
||||
{{#briefDesc}}
|
||||
{{#lines}}
|
||||
{{{line}}}
|
||||
{{/lines}}
|
||||
{{/briefDesc}}
|
||||
|
||||
{{{selector}}}
|
||||
|
||||
{{/enumerators}}
|
||||
{{/enums}}
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import logging
|
||||
import os
|
||||
import pystache
|
||||
|
|
@ -31,7 +32,18 @@ import metaname
|
|||
import metadoc
|
||||
|
||||
|
||||
def md5sum(file):
|
||||
hasher = hashlib.md5()
|
||||
with open(file, mode='rb') as f:
|
||||
hasher.update(f.read())
|
||||
return hasher.hexdigest()
|
||||
|
||||
|
||||
class RstTools:
|
||||
@staticmethod
|
||||
def make_part(text):
|
||||
return RstTools.make_section(text, char='#', overline=True)
|
||||
|
||||
@staticmethod
|
||||
def make_chapter(text):
|
||||
return RstTools.make_section(text, char='*', overline=True)
|
||||
|
|
@ -56,12 +68,27 @@ class RstTools:
|
|||
class Table:
|
||||
def __init__(self):
|
||||
self._rows = []
|
||||
self._widths = []
|
||||
self._heights = []
|
||||
|
||||
|
||||
@property
|
||||
def rows(self):
|
||||
return self._rows
|
||||
|
||||
class CSVTable(Table):
|
||||
def addrow(self, row):
|
||||
self._rows.append(', '.join([self._format_cell(cell) for cell in row]))
|
||||
|
||||
def __str__(self):
|
||||
return '.. csv-table::\n\t\n\t' + '\n\t'.join(self._rows)
|
||||
|
||||
def _format_cell(self, cell):
|
||||
return '"{0}"'.format(cell.replace('"', '""'))
|
||||
|
||||
|
||||
class GridTable(Table):
|
||||
def __init__(self):
|
||||
RstTools.Table.__init__(self)
|
||||
self._widths = []
|
||||
self._heights = []
|
||||
|
||||
def addrow(self, row):
|
||||
if len(self._widths) == 0:
|
||||
|
|
@ -125,78 +152,132 @@ class RstTools:
|
|||
|
||||
class LangInfo:
|
||||
def __init__(self, langCode):
|
||||
if langCode not in LangInfo._displayNames:
|
||||
raise ValueError("Invalid language code '{0}'".format(langCode))
|
||||
self.langCode = langCode
|
||||
self.displayName = LangInfo._lang_code_to_display_name(langCode)
|
||||
self.nameTranslator = metaname.Translator.get(langCode)
|
||||
self.langTranslator = abstractapi.Translator.get(langCode)
|
||||
self.docTranslator = metadoc.SphinxTranslator(langCode)
|
||||
|
||||
@staticmethod
|
||||
def _lang_code_to_display_name(langCode):
|
||||
if langCode == 'C':
|
||||
return 'C'
|
||||
elif langCode == 'Cpp':
|
||||
return 'C++'
|
||||
elif langCode == 'CSharp':
|
||||
return 'C#'
|
||||
else:
|
||||
raise ValueError("Invalid language code: '{0}'".format(langCode))
|
||||
|
||||
@property
|
||||
def displayName(self):
|
||||
return LangInfo._displayNames[self.langCode]
|
||||
|
||||
@property
|
||||
def directory(self):
|
||||
return self.langCode.lower()
|
||||
|
||||
_displayNames = {
|
||||
'C' : 'C',
|
||||
'Cpp' : 'C++',
|
||||
'Java' : 'Java',
|
||||
'CSharp': 'C#'
|
||||
}
|
||||
|
||||
|
||||
class SphinxPage(object):
|
||||
def __init__(self, lang, langs, filename):
|
||||
class SphinxPart(object):
|
||||
def __init__(self, lang, langs):
|
||||
object.__init__(self)
|
||||
self.lang = lang
|
||||
self.langs = langs
|
||||
self.filename = filename
|
||||
|
||||
@property
|
||||
def hasNamespaceDeclarator(self):
|
||||
return ('namespaceDeclarator' in dir(self.docTranslator))
|
||||
|
||||
|
||||
@property
|
||||
def language(self):
|
||||
return self.lang.displayName
|
||||
|
||||
|
||||
@property
|
||||
def docTranslator(self):
|
||||
return self.lang.docTranslator
|
||||
|
||||
|
||||
@property
|
||||
def hasNamespaceDeclarator(self):
|
||||
return ('namespaceDeclarator' in dir(self.docTranslator))
|
||||
|
||||
@property
|
||||
def isJava(self):
|
||||
return self.lang.langCode == 'Java'
|
||||
|
||||
@property
|
||||
def isNotJava(self):
|
||||
return not self.isJava
|
||||
|
||||
def make_part(self):
|
||||
return lambda text: RstTools.make_part(pystache.render(text, self))
|
||||
|
||||
def make_chapter(self):
|
||||
return lambda text: RstTools.make_chapter(pystache.render(text, self))
|
||||
|
||||
|
||||
def make_section(self):
|
||||
return lambda text: RstTools.make_section(pystache.render(text, self))
|
||||
|
||||
|
||||
def make_subsection(self):
|
||||
return lambda text: RstTools.make_subsection(pystache.render(text, self.properties))
|
||||
|
||||
return lambda text: RstTools.make_subsection(pystache.render(text, self))
|
||||
|
||||
def make_subsection(self):
|
||||
return lambda text: RstTools.make_subsubsection(pystache.render(text, self))
|
||||
|
||||
def write_declarator(self):
|
||||
return lambda text: self.docTranslator.get_declarator(text)
|
||||
|
||||
def write(self, directory):
|
||||
r = pystache.Renderer()
|
||||
filepath = os.path.join(directory, self.filename)
|
||||
with open(filepath, mode='w') as f:
|
||||
f.write(r.render(self))
|
||||
|
||||
def _get_translated_namespace(self, obj):
|
||||
namespace = obj.find_first_ancestor_by_type(abstractapi.Namespace)
|
||||
return namespace.name.translate(self.lang.nameTranslator, recursive=True)
|
||||
|
||||
|
||||
def _make_selector(self, obj):
|
||||
links = []
|
||||
ref = metadoc.Reference(None)
|
||||
ref.relatedObject = obj
|
||||
for lang in self.langs:
|
||||
if lang is self.lang:
|
||||
link = lang.displayName
|
||||
else:
|
||||
if lang.langCode == 'Java' and type(obj) is abstractapi.Enumerator:
|
||||
ref = metadoc.Reference.make_ref_from_object(None, obj.parent)
|
||||
else:
|
||||
ref = metadoc.Reference.make_ref_from_object(None, obj)
|
||||
link = ref.translate(lang.docTranslator, label=lang.displayName)
|
||||
|
||||
links.append(link)
|
||||
|
||||
return ' '.join(links)
|
||||
|
||||
|
||||
class EnumPart(SphinxPart):
|
||||
def __init__(self, enum, lang, langs, namespace=None):
|
||||
SphinxPart.__init__(self, lang, langs)
|
||||
self.name = enum.name.translate(self.lang.nameTranslator)
|
||||
self.fullName = enum.name.translate(self.lang.nameTranslator, recursive=True)
|
||||
self.briefDesc = enum.briefDescription.translate(self.docTranslator)
|
||||
self.enumerators = [self._translate_enumerator(enumerator) for enumerator in enum.enumerators]
|
||||
self.selector = self._make_selector(enum)
|
||||
self.sectionName = RstTools.make_section(self.name)
|
||||
self.declaration = 'public enum {0}'.format(self.name) if self.lang.langCode == 'Java' else self.name
|
||||
|
||||
ref = metadoc.ClassReference(None)
|
||||
ref.relatedObject = enum
|
||||
self.link = ref.translate(lang.docTranslator)
|
||||
|
||||
def _translate_enumerator(self, enumerator):
|
||||
return {
|
||||
'name' : enumerator.name.translate(self.lang.nameTranslator),
|
||||
'briefDesc' : enumerator.briefDescription.translate(self.docTranslator),
|
||||
'value' : enumerator.translate_value(self.lang.langTranslator),
|
||||
'selector' : self._make_selector(enumerator)
|
||||
}
|
||||
|
||||
|
||||
class SphinxPage(SphinxPart):
|
||||
def __init__(self, lang, langs, filename):
|
||||
SphinxPart.__init__(self, lang, langs)
|
||||
self.filename = filename
|
||||
|
||||
def write(self, directory):
|
||||
r = pystache.Renderer()
|
||||
filepath = os.path.join(directory, self.filename)
|
||||
tmpFilepath = filepath + '.tmp'
|
||||
with open(tmpFilepath, mode='w') as f:
|
||||
f.write(r.render(self))
|
||||
if os.path.exists(filepath) and md5sum(filepath) == md5sum(tmpFilepath):
|
||||
os.remove(tmpFilepath)
|
||||
else:
|
||||
os.rename(tmpFilepath, filepath)
|
||||
return filepath
|
||||
|
||||
def _get_translated_namespace(self, obj):
|
||||
namespace = obj.find_first_ancestor_by_type(abstractapi.Namespace)
|
||||
return namespace.name.translate(self.lang.nameTranslator, recursive=True)
|
||||
|
||||
@staticmethod
|
||||
def _classname_to_filename(classname):
|
||||
|
|
@ -204,60 +285,59 @@ class SphinxPage(object):
|
|||
|
||||
|
||||
class IndexPage(SphinxPage):
|
||||
def __init__(self, lang, langs):
|
||||
SphinxPage.__init__(self, lang, langs, 'index.rst')
|
||||
self.tocEntries = []
|
||||
|
||||
def add_class_entry(self, _class):
|
||||
self.tocEntries.append({'entryName': SphinxPage._classname_to_filename(_class.name)})
|
||||
def __init__(self, lang, filename):
|
||||
SphinxPage.__init__(self, lang, None, filename)
|
||||
self._entries = []
|
||||
self._sorted = True
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
return RstTools.make_chapter("{0} API".format(self.lang.displayName))
|
||||
|
||||
@property
|
||||
def dir(self):
|
||||
return self.lang.directory
|
||||
|
||||
@property
|
||||
def entries(self):
|
||||
if not self._sorted:
|
||||
self._entries.sort(key=lambda x: x['filename'])
|
||||
self._sorted = True
|
||||
return self._entries
|
||||
|
||||
def add_entry(self, filename):
|
||||
self.entries.append({'filename': filename})
|
||||
self._sorted = False
|
||||
|
||||
|
||||
class EnumsPage(SphinxPage):
|
||||
def __init__(self, lang, langs, enums):
|
||||
SphinxPage.__init__(self, lang, langs, 'enums.rst')
|
||||
self._translate_enums(enums)
|
||||
|
||||
def _translate_enums(self, enums):
|
||||
self.enums = []
|
||||
for enum in enums:
|
||||
translatedEnum = {
|
||||
'name' : enum.name.translate(self.lang.nameTranslator),
|
||||
'fullName' : enum.name.translate(self.lang.nameTranslator, recursive=True),
|
||||
'briefDesc' : enum.briefDescription.translate(self.docTranslator),
|
||||
'enumerators' : self._translate_enum_values(enum),
|
||||
'selector' : self._make_selector(enum)
|
||||
}
|
||||
translatedEnum['namespace'] = self._get_translated_namespace(enum) if self.lang.langCode == 'Cpp' else translatedEnum['fullName']
|
||||
translatedEnum['sectionName'] = RstTools.make_section(translatedEnum['name'])
|
||||
self.enums.append(translatedEnum)
|
||||
|
||||
def _translate_enum_values(self, enum):
|
||||
translatedEnumerators = []
|
||||
for enumerator in enum.enumerators:
|
||||
translatedValue = {
|
||||
'name' : enumerator.name.translate(self.lang.nameTranslator),
|
||||
'briefDesc' : enumerator.briefDescription.translate(self.docTranslator),
|
||||
'value' : enumerator.translate_value(self.lang.langTranslator),
|
||||
'selector' : self._make_selector(enumerator)
|
||||
}
|
||||
translatedEnumerators.append(translatedValue)
|
||||
|
||||
return translatedEnumerators
|
||||
class EnumPage(SphinxPage):
|
||||
def __init__(self, enum, lang, langs):
|
||||
filename = SphinxPage._classname_to_filename(enum.name)
|
||||
SphinxPage.__init__(self, lang, langs, filename)
|
||||
namespace = enum.find_first_ancestor_by_type(abstractapi.Namespace)
|
||||
self.namespace = namespace.name.translate(lang.nameTranslator) if lang.langCode != 'C' else None
|
||||
self.enum = EnumPart(enum, lang, langs, namespace=namespace)
|
||||
|
||||
|
||||
class ClassPage(SphinxPage):
|
||||
def __init__(self, _class, lang, langs):
|
||||
filename = SphinxPage._classname_to_filename(_class.name)
|
||||
SphinxPage.__init__(self, lang, langs, filename)
|
||||
self.namespace = self._get_translated_namespace(_class)
|
||||
namespace = _class.find_first_ancestor_by_type(abstractapi.Namespace)
|
||||
self.namespace = namespace.name.translate(self.lang.nameTranslator, recursive=True)
|
||||
self.className = _class.name.translate(self.lang.nameTranslator)
|
||||
self.fullClassName = _class.name.translate(self.lang.nameTranslator, recursive=True)
|
||||
self.briefDoc = _class.briefDescription.translate(self.docTranslator)
|
||||
self.detailedDoc = _class.detailedDescription.translate(self.docTranslator) if _class.detailedDescription is not None else None
|
||||
self.properties = self._translate_properties(_class.properties)
|
||||
self.enums = [EnumPart(enum, lang, langs) for enum in _class.enums]
|
||||
self.properties = self._translate_properties(_class.properties) if isinstance(_class, abstractapi.Class) else []
|
||||
self.methods = self._translate_methods(_class.instanceMethods)
|
||||
self.classMethods = self._translate_methods(_class.classMethods)
|
||||
self.selector = self._make_selector(_class)
|
||||
|
||||
@property
|
||||
def classDeclaration(self):
|
||||
return 'public interface {0}'.format(self.className) if self.lang.langCode == 'Java' else self.className
|
||||
|
||||
@property
|
||||
def hasMethods(self):
|
||||
|
|
@ -270,17 +350,22 @@ class ClassPage(SphinxPage):
|
|||
@property
|
||||
def hasProperties(self):
|
||||
return len(self.properties) > 0
|
||||
|
||||
@property
|
||||
def hasEnums(self):
|
||||
return len(self.enums) > 0
|
||||
|
||||
def _translate_properties(self, properties):
|
||||
translatedProperties = []
|
||||
for property_ in properties:
|
||||
propertyAttr = {
|
||||
'name' : property_.name.translate(self.lang.nameTranslator),
|
||||
'ref_label' : '{0}_{1}'.format(self.lang.langCode, property_.name.to_snake_case(fullName=True)),
|
||||
'getter' : self._translate_method(property_.getter) if property_.getter is not None else None,
|
||||
'setter' : self._translate_method(property_.setter) if property_.setter is not None else None
|
||||
}
|
||||
propertyAttr['title'] = RstTools.make_subsubsection(propertyAttr['name'])
|
||||
propertyAttr['ref_label'] = (self.lang.langCode + '_')
|
||||
propertyAttr['ref_label'] += (property_.getter.name.to_snake_case(fullName=True) if property_.getter is not None else property_.setter.name.to_snake_case(fullName=True))
|
||||
translatedProperties.append(propertyAttr)
|
||||
return translatedProperties
|
||||
|
||||
|
|
@ -291,73 +376,102 @@ class ClassPage(SphinxPage):
|
|||
return translatedMethods
|
||||
|
||||
def _translate_method(self, method):
|
||||
prototypeParams = {}
|
||||
if self.lang.langCode == 'Cpp':
|
||||
prototypeParams['showStdNs'] = True
|
||||
namespace = method.find_first_ancestor_by_type(abstractapi.Class,abstractapi.Interface)
|
||||
methAttr = {
|
||||
'prototype' : method.translate_as_prototype(self.lang.langTranslator, **prototypeParams),
|
||||
'prototype' : method.translate_as_prototype(self.lang.langTranslator, namespace=namespace),
|
||||
'briefDoc' : method.briefDescription.translate(self.docTranslator),
|
||||
'detailedDoc' : method.detailedDescription.translate(self.docTranslator),
|
||||
'selector' : self._make_selector(method)
|
||||
}
|
||||
reference = metadoc.FunctionReference(None)
|
||||
reference.relatedObject = method
|
||||
methAttr['link'] = reference.translate(self.lang.docTranslator)
|
||||
methAttr['link'] = reference.translate(self.lang.docTranslator, namespace=method.find_first_ancestor_by_type(abstractapi.Class, abstractapi.Interface))
|
||||
return methAttr
|
||||
|
||||
@property
|
||||
def enumsSummary(self):
|
||||
table = RstTools.CSVTable()
|
||||
for enum in self.enums:
|
||||
briefDoc = ' '.join([line['line'] for line in enum.briefDesc['lines']])
|
||||
table.addrow((enum.link, briefDoc))
|
||||
return table
|
||||
|
||||
@property
|
||||
def propertiesSummary(self):
|
||||
table = RstTools.Table()
|
||||
table = RstTools.CSVTable()
|
||||
for property_ in self.properties:
|
||||
reference = ':ref:`{0}`'.format(property_['ref_label'])
|
||||
briefDoc = property_['getter']['briefDoc'] if property_['getter'] is not None else property_['setter']['briefDoc']
|
||||
briefDoc = '\n'.join([line['line'] for line in briefDoc['lines']])
|
||||
briefDoc = ' '.join([line['line'] for line in briefDoc['lines']])
|
||||
table.addrow([reference, briefDoc])
|
||||
return table
|
||||
|
||||
@property
|
||||
def instanceMethodsSummary(self):
|
||||
table = RstTools.Table()
|
||||
table = RstTools.CSVTable()
|
||||
for method in self.methods:
|
||||
briefDoc = '\n'.join([line['line'] for line in method['briefDoc']['lines']])
|
||||
briefDoc = ' '.join([line['line'] for line in method['briefDoc']['lines']])
|
||||
table.addrow([method['link'], briefDoc])
|
||||
return table
|
||||
|
||||
@property
|
||||
def classMethodsSummary(self):
|
||||
table = RstTools.Table()
|
||||
table = RstTools.CSVTable()
|
||||
for method in self.classMethods:
|
||||
briefDoc = '\n'.join([line['line'] for line in method['briefDoc']['lines']])
|
||||
briefDoc = ' '.join([line['line'] for line in method['briefDoc']['lines']])
|
||||
table.addrow([method['link'], briefDoc])
|
||||
return table
|
||||
|
||||
|
||||
class OldFilesCleaner:
|
||||
def __init__(self, rootDirectory):
|
||||
self._filesToKeep = set()
|
||||
self.root = rootDirectory
|
||||
|
||||
def protect_file(self, directory):
|
||||
self._filesToKeep.add(directory)
|
||||
|
||||
def clean(self):
|
||||
self._clean(self.root)
|
||||
|
||||
def _clean(self, dir_):
|
||||
if os.path.isdir(dir_):
|
||||
for filename in os.listdir(dir_):
|
||||
self._clean(os.path.join(dir_, filename))
|
||||
elif dir_ not in self._filesToKeep:
|
||||
os.remove(dir_)
|
||||
|
||||
|
||||
class DocGenerator:
|
||||
def __init__(self, api):
|
||||
self.api = api
|
||||
self.languages = [
|
||||
LangInfo('C'),
|
||||
LangInfo('Cpp'),
|
||||
LangInfo('Java'),
|
||||
LangInfo('CSharp')
|
||||
]
|
||||
|
||||
def generate(self, outputdir):
|
||||
for lang in self.languages:
|
||||
subdirectory = lang.langCode.lower()
|
||||
directory = os.path.join(args.outputdir, subdirectory)
|
||||
directory = os.path.join(args.outputdir, lang.directory)
|
||||
cleaner = OldFilesCleaner(directory)
|
||||
indexPage = IndexPage(lang, 'index.rst')
|
||||
if not os.path.exists(directory):
|
||||
os.mkdir(directory)
|
||||
|
||||
enumsPage = EnumsPage(lang, self.languages, absApiParser.enums)
|
||||
enumsPage.write(directory)
|
||||
|
||||
indexPage = IndexPage(lang, self.languages)
|
||||
for _class in absApiParser.classes:
|
||||
page = ClassPage(_class, lang, self.languages)
|
||||
page.write(directory)
|
||||
indexPage.add_class_entry(_class)
|
||||
|
||||
indexPage.write(directory)
|
||||
for enum in self.api.namespace.enums:
|
||||
page = EnumPage(enum, lang, self.languages)
|
||||
filepath = page.write(directory)
|
||||
indexPage.add_entry(page.filename)
|
||||
cleaner.protect_file(filepath)
|
||||
for class_ in (self.api.namespace.classes + self.api.namespace.interfaces):
|
||||
page = ClassPage(class_, lang, self.languages)
|
||||
filepath = page.write(directory)
|
||||
indexPage.add_entry(page.filename)
|
||||
cleaner.protect_file(filepath)
|
||||
filepath = indexPage.write(directory)
|
||||
cleaner.protect_file(filepath)
|
||||
cleaner.clean()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
4
coreapi/help/doc/sphinx/guides/authentication.rst
Normal file
4
coreapi/help/doc/sphinx/guides/authentication.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Managing authentication: userid and passwords
|
||||
=============================================
|
||||
|
||||
|
||||
57
coreapi/help/doc/sphinx/guides/buddy_list.rst
Normal file
57
coreapi/help/doc/sphinx/guides/buddy_list.rst
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
Managing Buddies and buddy list and presence
|
||||
============================================
|
||||
Buddies and buddy list
|
||||
----------------------
|
||||
|
||||
Each buddy is represented by a :cpp:type:`LinphoneFriend` object created by function :cpp:func:`linphone_friend_new`.
|
||||
|
||||
Buddy configuration parameters like :cpp:func:`sip uri <linphone_friend_set_addr>` or :cpp:func:`status publication <linphone_friend_set_inc_subscribe_policy>` policy for
|
||||
this :cpp:type:`friend <LinphoneFriend>` are configurable for each buddy.
|
||||
|
||||
Here under a typical buddy creation:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LinphoneFriend* my_friend=linphone_friend_new_with_addr("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/
|
||||
linphone_friend_enable_subscribes(my_friend,TRUE); /*configure this friend to emit SUBSCRIBE message after being added to LinphoneCore*/
|
||||
linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* accept Incoming subscription request for this friend*/
|
||||
|
||||
:cpp:type:`Friends <LinphoneFriend>` status changes are reported by callback LinphoneCoreVTable.notify_presence_recv
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
static void notify_presence_recv_updated (struct _LinphoneCore *lc, LinphoneFriend *friend) {
|
||||
const LinphoneAddress* friend_address = linphone_friend_get_address(friend);
|
||||
printf("New state state [%s] for user id [%s] \n"
|
||||
,linphone_online_status_to_string(linphone_friend_get_status(friend))
|
||||
,linphone_address_as_string (friend_address));
|
||||
}
|
||||
|
||||
Once created a buddy can be added to the buddy list using function :cpp:func:`linphone_core_add_friend`. Added friends will be notified
|
||||
about :cpp:func:`local status changes <linphone_core_set_presence_info>`.
|
||||
|
||||
Any subsequente modifications to :cpp:type:`LinphoneFriend` must be first started by a call to function :cpp:func:`linphone_friend_edit` and validated by function :cpp:func:`linphone_friend_done`.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
linphone_friend_edit(my_friend); /* start editing friend */
|
||||
linphone_friend_enable_subscribes(my_friend,FALSE); /*disable subscription for this friend*/
|
||||
linphone_friend_done(my_friend); /*commit changes triggering an UNSUBSCRIBE message*/
|
||||
|
||||
|
||||
Publishing presence status
|
||||
--------------------------
|
||||
|
||||
Local presence status can be changed using function :cpp:func:`linphone_core_set_presence_model`. New status is propagated to all
|
||||
friends :cpp:func:`previously added <linphone_core_add_friend>` to :cpp:type:`LinphoneCore`.
|
||||
|
||||
|
||||
Handling incoming subscription request
|
||||
--------------------------------------
|
||||
|
||||
New incoming subscription requests are process according to :cpp:func:`the incoming subscription policy state <linphone_friend_set_inc_subscribe_policy>` for subscription
|
||||
initiated by :cpp:func:`members of the buddy list <linphone_core_add_friend>`.
|
||||
|
||||
For incoming request comming from an unknown buddy, the call back LinphoneCoreVTable.new_subscription_request is invoked.
|
||||
|
||||
A complete tutorial can be found at : \ref buddy_tutorials "Registration tutorial"
|
||||
9
coreapi/help/doc/sphinx/guides/call_control.rst
Normal file
9
coreapi/help/doc/sphinx/guides/call_control.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Placing and receiving calls
|
||||
===========================
|
||||
|
||||
The :cpp:type:`LinphoneCall` object represents an incoming or outgoing call managed by the :cpp:type:`LinphoneCore`.
|
||||
|
||||
Outgoing calls can be created using :cpp:func:`linphone_core_invite` or :cpp:func:`linphone_core_invite_address`, while incoming calls are notified to the application
|
||||
through the LinphoneCoreVTable::call_state_changed callback.
|
||||
|
||||
.. seealso:: :ref:`"Basic Call" <basic_call_code_sample>` source code.
|
||||
2
coreapi/help/doc/sphinx/guides/call_logs.rst
Normal file
2
coreapi/help/doc/sphinx/guides/call_logs.rst
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Managing call logs
|
||||
==================
|
||||
4
coreapi/help/doc/sphinx/guides/call_misc.rst
Normal file
4
coreapi/help/doc/sphinx/guides/call_misc.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Obtaining information about a running call: sound volumes, quality indicators
|
||||
=============================================================================
|
||||
|
||||
When a call is running, it is possible to retrieve in real time current measured volumes and quality indicator.
|
||||
28
coreapi/help/doc/sphinx/guides/chatroom.rst
Normal file
28
coreapi/help/doc/sphinx/guides/chatroom.rst
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Chat room and messaging
|
||||
=======================
|
||||
Exchanging text messages
|
||||
------------------------
|
||||
|
||||
Messages are sent using :cpp:type:`LinphoneChatRoom` object. First step is to create a :cpp:func:`chat room <linphone_core_get_chat_room>`
|
||||
from a peer sip uri.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LinphoneChatRoom* chat_room = linphone_core_get_chat_room(lc,"sip:joe@sip.linphone.org");
|
||||
|
||||
Once created, messages are sent using function :cpp:func:`linphone_chat_room_send_message`.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
linphone_chat_room_send_message(chat_room,"Hello world"); /*sending message*/
|
||||
|
||||
Incoming message are received from call back LinphoneCoreVTable.text_received
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
void text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) {
|
||||
printf(" Message [%s] received from [%s] \n",message,linphone_address_as_string (from));
|
||||
}
|
||||
|
||||
.. seealso:: A complete tutorial can be found at :ref:`"Chatroom and messaging" <chatroom_code_sample>` source code.
|
||||
|
||||
21
coreapi/help/doc/sphinx/guides/conferencing.rst
Normal file
21
coreapi/help/doc/sphinx/guides/conferencing.rst
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
Making an audio conference
|
||||
==========================
|
||||
|
||||
This API allows to create a conference entirely managed by the client. No server capabilities are required.
|
||||
|
||||
The way such conference is created is by doing the following:
|
||||
|
||||
#. The application shall makes "normal" calls to several destinations (using :cpp:func:`linphone_core_invite`), one after another.
|
||||
#. While initiating the second call, the first one is automatically paused.
|
||||
#. Then, once the second call is established, the application has the possibility to merge the two calls to form a conference where each participant
|
||||
(the local participant, the remote destination of the first call, the remote destination of the second call) can talk together.
|
||||
This must be done by adding the two calls to the conference using :cpp:func:`linphone_core_add_to_conference`.
|
||||
|
||||
Once merged into a conference the :cpp:type:`LinphoneCall` objects representing the calls that were established remain unchanged, except that
|
||||
they are tagged as part of the conference (see :cpp:func:`linphone_call_is_in_conference`). The calls in a conference are in the :cpp:enumerator:`LinphoneCallStreamsRunning` state.
|
||||
|
||||
Only a single conference can be created: the purpose of this feature is to allow the local user to create, take part and manage the conference.
|
||||
This API is not designed to create a conference server application.
|
||||
|
||||
Up to 10 calls can be merged into the conference, however depending on the CPU usage required for doing the encoding/decoding of the streams of each participants,
|
||||
the effective limit can be lower.
|
||||
4
coreapi/help/doc/sphinx/guides/event_api.rst
Normal file
4
coreapi/help/doc/sphinx/guides/event_api.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Managing generic subscriptions and publishes
|
||||
============================================
|
||||
|
||||
The :cpp:type:`LinphoneEvent` api allows application to control subscriptions, receive notifications and make publish to peers, in a generic manner.
|
||||
4
coreapi/help/doc/sphinx/guides/initializing.rst
Normal file
4
coreapi/help/doc/sphinx/guides/initializing.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Initializing liblinphone
|
||||
========================
|
||||
|
||||
|
||||
285
coreapi/help/doc/sphinx/guides/ios_portability.rst
Normal file
285
coreapi/help/doc/sphinx/guides/ios_portability.rst
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
iOS portability
|
||||
===============
|
||||
Multitasking
|
||||
------------
|
||||
|
||||
Liblinphone for IOS natively supports multitasking assuming application follows multitasking guides provided by Apple.
|
||||
|
||||
First step is to declare application as multitasked. It means adding background mode for both audio and voip to Info.plist file.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>voip</string>
|
||||
<string>audio</string>
|
||||
</array>
|
||||
|
||||
|
||||
SIP socket
|
||||
^^^^^^^^^^
|
||||
|
||||
Recommended mode is SIP over TCP, because UDP usually requires frequent keep alives for maintaining NAT association at the IP router level. This can
|
||||
be as frequent as one UDP packet every 15 seconds to maintain the NAT association accross NAT routers. Doing such drains the battery very fast, and
|
||||
furthermore the iOS keep-alive designed by Apple to handle this task can only be called with a minimum of 10 minutes interval.
|
||||
|
||||
For TCP, liblinphone automatically configures SIP socket for voip (I.E kCFStreamNetworkServiceType set to kCFStreamNetworkServiceTypeVoIP).
|
||||
|
||||
.. note::
|
||||
|
||||
Since IOS > 4.1 Apple disabled voip mode for UDP sockets.
|
||||
|
||||
|
||||
Entering background mode
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Before entering in background mode (through ``- (void)applicationDidEnterBackground:(UIApplication *)application``), the application must first refresh
|
||||
sip registration using function :cpp:func:`linphone_core_refresh_registers` and register a keep-alive handler for periodically refreshing the registration.
|
||||
The speudo code below shows how to register a keep alive handler:
|
||||
|
||||
.. code-block:: objective-c
|
||||
|
||||
//First refresh registration
|
||||
linphone_core_refresh_registers(theLinphoneCore);
|
||||
//wait for registration answer
|
||||
int i=0;
|
||||
while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) {
|
||||
linphone_core_iterate(theLinphoneCore);
|
||||
usleep(100000);
|
||||
}
|
||||
//register keepalive handler
|
||||
[[UIApplication sharedApplication] setKeepAliveTimeout:600/*minimal interval is 600 s*/
|
||||
handler:^{
|
||||
//refresh sip registration
|
||||
linphone_core_refresh_registers(theLinphoneCore);
|
||||
//make sure sip REGISTER is sent
|
||||
linphone_core_iterate(theLinphoneCore);
|
||||
}];
|
||||
|
||||
|
||||
Incoming call notification while in background mode
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Assuming application using liblinphone is well configured for multitasking, incoming calls arriving while liblinphone is in background mode will simply wakeup
|
||||
liblinphone thread but not resume GUI. To wakeup GUI, it is recommended to send a Local Notification to the user from the #LinphoneCoreCallStateChangedCb. Here
|
||||
under a speudo code for this operation:
|
||||
|
||||
.. code-block:: objective-c
|
||||
|
||||
if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
|
||||
// Create a new notification
|
||||
UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease];
|
||||
if (notif) {
|
||||
notif.repeatInterval = 0;
|
||||
notif.alertBody =@"New incoming call";
|
||||
notif.alertAction = @"Answer";
|
||||
notif.soundName = @"oldphone-mono-30s.caf";
|
||||
|
||||
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
|
||||
}
|
||||
|
||||
|
||||
Networking
|
||||
----------
|
||||
WWAN connection
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Liblinphone relies on iOS's standard BSD socket layer for sip/rtp networking. On IOS, WWAN connection is supposed to automatically bring up on any networking
|
||||
resquest issued by an application. At least on iPhone OS 3.x, BSD sockets do not implement this behavior. So it is recomended to add a special code to make sure
|
||||
the WWAN connection is properly setup. Pseudo code below describes a way to force WWAN connection by setting up a dummy TCP connection.
|
||||
|
||||
.. code-block:: objective-c
|
||||
|
||||
/*start a new thread to avoid blocking the main ui in case of peer host failure*/
|
||||
[NSThread detachNewThreadSelector:@selector(runNetworkConnection) toTarget:self withObject:nil];
|
||||
-(void) runNetworkConnection {
|
||||
CFWriteStreamRef writeStream;
|
||||
//create a dummy socket
|
||||
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"192.168.0.200", 15000, nil, &writeStream);
|
||||
CFWriteStreamOpen (writeStream);
|
||||
const char* buff="hello";
|
||||
//try to write on this socket
|
||||
CFWriteStreamWrite (writeStream,(const UInt8*)buff,strlen(buff));
|
||||
CFWriteStreamClose (writeStream);
|
||||
}
|
||||
|
||||
It is recommanded to perform this task each time the application is woken up, including keep alive handler.
|
||||
|
||||
|
||||
Managing IP connection state
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Liblinphone for IOS relies on the application to be informed of network connectivity changes. Network state changes when the IP connection moves from DOWN to UP,
|
||||
or from WIFI to WWAN. Applications using liblinphone must inform libliblinphone of this changes using function :cpp:func:`linphone_core_set_network_reachable`.
|
||||
Usually this method is called from the IOS NetworkReachability callback. Here under a sample code:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
//typical reachability callback
|
||||
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void * info) {
|
||||
if ((flags == 0) | (flags & (kSCNetworkReachabilityFlagsConnectionRequired |kSCNetworkReachabilityFlagsConnectionOnTraffic))) {
|
||||
//network state is off
|
||||
linphone_core_set_network_reachable(lc,false);
|
||||
((LinphoneManager*)info).connectivity = none;
|
||||
} else {
|
||||
Connectivity newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi;
|
||||
if (lLinphoneMgr.connectivity == none) {
|
||||
//notify new network state
|
||||
linphone_core_set_network_reachable(lc,true);
|
||||
} else if (lLinphoneMgr.connectivity != newConnectivity) {
|
||||
// connectivity has changed
|
||||
linphone_core_set_network_reachable(lc,false);
|
||||
linphone_core_set_network_reachable(lc,true);
|
||||
}
|
||||
//store new connectivity status
|
||||
lLinphoneMgr.connectivity=newConnectivity;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Sound cards
|
||||
-----------
|
||||
|
||||
Since IOS 5.0, liblinphone supports 2 sound cards. *AU: Audio Unit Receiver* based on IO units for voice calls plus *AQ: Audio Queue Device* dedicated to rings.
|
||||
Here under the recommended settings (I.E default one)
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
linphone_core_set_playback_device(lc, "AU: Audio Unit Receiver");
|
||||
linphone_core_set_ringer_device(lc, "AQ: Audio Queue Device");
|
||||
linphone_core_set_capture_device(lc, "AU: Audio Unit Receiver");
|
||||
|
||||
|
||||
GSM call interaction
|
||||
--------------------
|
||||
|
||||
To ensure gentle interaction with GSM calls, it is recommended to register an AudioSession delegate. This allows the application to be notified when its audio
|
||||
session is interrupted/resumed (presumably by a GSM call).
|
||||
|
||||
.. code-block:: objective-c
|
||||
|
||||
// declare a class handling the AVAudioSessionDelegate protocol
|
||||
@interface MyClass : NSObject <AVAudioSessionDelegate> { [...] }
|
||||
// implement 2 methods : here's an example implementation
|
||||
-(void) beginInterruption {
|
||||
LinphoneCall* c = linphone_core_get_current_call(theLinphoneCore);
|
||||
ms_message("Sound interruption detected!");
|
||||
if (c) {
|
||||
linphone_core_pause_call(theLinphoneCore, c);
|
||||
}
|
||||
}
|
||||
|
||||
-(void) endInterruption {
|
||||
ms_message("Sound interruption ended!");
|
||||
const MSList* c = linphone_core_get_calls(theLinphoneCore);
|
||||
|
||||
if (c) {
|
||||
ms_message("Auto resuming call");
|
||||
linphone_core_resume_call(theLinphoneCore, (LinphoneCall*) c->data);
|
||||
}
|
||||
}
|
||||
|
||||
.. seealso:: http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSessionDelegate_ProtocolReference/Reference/Reference.html
|
||||
|
||||
Declare an instance of your class as AudioSession's delegate :
|
||||
|
||||
.. code-block:: objective-c
|
||||
|
||||
[audioSession setDelegate:myClassInstance];
|
||||
|
||||
.. seealso:: http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html
|
||||
|
||||
|
||||
Video
|
||||
-----
|
||||
|
||||
Since 3.5 video support has been added to liblinphone for IOS. It requires the application to provide liblinphone with pointers to IOS's views hosting video
|
||||
display and video previous. These two UIView objects must be passed to the core using functions :cpp:func:`linphone_core_set_native_video_window_id` and
|
||||
:cpp:func:`linphone_core_set_native_preview_window_id`. Here under pseudo code:
|
||||
|
||||
.. code-block:: objective-c
|
||||
|
||||
UIView* display = [[UIView alloc] init];
|
||||
UIView* preview = [[UIView alloc] init];
|
||||
linphone_core_set_native_video_window_id(lc,(unsigned long)display);
|
||||
linphone_core_set_native_preview_window_id(lc,(unsigned long)preview);
|
||||
|
||||
Screen rotations are also handled by liblinphone. Two positions are currently supported, namely *UIInterfaceOrientationPortrait* and *UIInterfaceOrientationLandscapeRight*.
|
||||
Applications may invoke :cpp:func:`linphone_core_set_device_rotation` followed by :cpp:func:`linphone_core_update_call` to notify liblinphone of an orientation
|
||||
change. Here under a speudo code to handle orientation changes
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
-(void) configureOrientation:(UIInterfaceOrientation) oritentation {
|
||||
int oldLinphoneOrientation = linphone_core_get_device_rotation(lc);
|
||||
if (oritentation == UIInterfaceOrientationPortrait ) {
|
||||
linphone_core_set_native_video_window_id(lc,(unsigned long)display-portrait);
|
||||
linphone_core_set_native_preview_window_id(lc,(unsigned long)preview-portrait);
|
||||
linphone_core_set_device_rotation(lc, 0);
|
||||
|
||||
} else if (oritentation == UIInterfaceOrientationLandscapeRight ) {
|
||||
linphone_core_set_native_video_window_id(lc,(unsigned long)display-landscape);
|
||||
linphone_core_set_native_preview_window_id(lc,(unsigned long)preview-landscape);
|
||||
linphone_core_set_device_rotation(lc, 270);
|
||||
}
|
||||
|
||||
if ((oldLinphoneOrientation != linphone_core_get_device_rotation(lc))
|
||||
&& linphone_core_get_current_call(lc)) {
|
||||
//Orientation has changed, must call update call
|
||||
linphone_core_update_call(lc, linphone_core_get_current_call(lc), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DTMF feedbacks
|
||||
--------------
|
||||
|
||||
Liblinphone provides functions :cpp:func:`to play dtmf <linphone_core_play_dtmf()>` to the local user. Usually this is used to play a sound when the user
|
||||
presses a digit, inside or outside of any call. On IOS, libLinphone relies on AudioUnits for interfacing with the audio system. Unfortunately the Audio Unit
|
||||
initialization is a quite long operation that may trigger a bad user experience if performed each time a DTMF is played, the sound being delayed half a
|
||||
second after the press. To solve this issue and thus insure real-time precision, liblinphone introduces two functions for :cpp:func:`preloading <linphone_core_start_dtmf_stream>`
|
||||
and :cpp:func:`unloading <linphone_core_start_dtmf_stream>` the underlying audio graph responsible for playing DTMFs.
|
||||
|
||||
For an application using function :cpp:func:`linphone_core_play_dtmf`, it is recommanded to call :cpp:func:`linphone_core_start_dtmf_stream` when entering
|
||||
in foreground and #linphone_core_stop_dtmf_stream() upon entering background mode.
|
||||
|
||||
|
||||
Plugins
|
||||
-------
|
||||
|
||||
On iOS, plugins are built as static libraries so Liblinphone will not be able to load them at runtime dynamically. Instead, you should declare their prototypes:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
extern void libmsamr_init(MSFactory *factory);
|
||||
extern void libmsx264_init(MSFactory *factory);
|
||||
extern void libmsopenh264_init(MSFactory *factory);
|
||||
extern void libmssilk_init(MSFactory *factory);
|
||||
extern void libmsbcg729_init(MSFactory *factory);
|
||||
extern void libmswebrtc_init(MSFactory *factory);
|
||||
|
||||
|
||||
Then you should register them after the instantiation of :cpp:type:`LinphoneCore`:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
theLinphoneCore = linphone_core_new_with_config(/* options ... */);
|
||||
|
||||
// Load plugins if available in the linphone SDK - otherwise these calls will do nothing
|
||||
MSFactory *f = linphone_core_get_ms_factory(theLinphoneCore);
|
||||
libmssilk_init(f);
|
||||
libmsamr_init(f);
|
||||
libmsx264_init(f);
|
||||
libmsopenh264_init(f);
|
||||
libmsbcg729_init(f);
|
||||
libmswebrtc_init(f);
|
||||
linphone_core_reload_ms_plugins(theLinphoneCore, NULL);
|
||||
|
||||
|
||||
If the plugin has not been enabled at compilation time, a stubbed library will be generated with only libplugin_init method declared, doing nothing. You should
|
||||
see these trace in logs, if plugin is stubbed:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
I/lib/Could not find encoder for SILK
|
||||
I/lib/Could not find decoder for SILK
|
||||
4
coreapi/help/doc/sphinx/guides/linphone_address.rst
Normal file
4
coreapi/help/doc/sphinx/guides/linphone_address.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
SIP address parser API
|
||||
======================
|
||||
|
||||
This api is useful for manipulating SIP addresses ('from' or 'to' headers).
|
||||
11
coreapi/help/doc/sphinx/guides/media_parameters.rst
Normal file
11
coreapi/help/doc/sphinx/guides/media_parameters.rst
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
Controlling media parameters
|
||||
============================
|
||||
|
||||
Multicast
|
||||
---------
|
||||
|
||||
Call using rtp multicast addresses are supported for both audio and video with some limitations. Limitations are, no stun, no ice, no encryption.
|
||||
|
||||
* Incoming call with multicast address are automatically accepted. The called party switches in a media receive only mode.
|
||||
* Outgoing call willing to send media to a multicast address can activate multicast using :cpp:func:`linphone_core_enable_video_multicast`
|
||||
or :cpp:func:`linphone_core_enable_audio_multicast`. The calling party switches in a media listen send only mode.
|
||||
3
coreapi/help/doc/sphinx/guides/misc.rst
Normal file
3
coreapi/help/doc/sphinx/guides/misc.rst
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Miscenalleous: logs, version strings, config storage
|
||||
====================================================
|
||||
|
||||
2
coreapi/help/doc/sphinx/guides/network_parameters.rst
Normal file
2
coreapi/help/doc/sphinx/guides/network_parameters.rst
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Controlling network parameters (ports, mtu…)
|
||||
============================================
|
||||
76
coreapi/help/doc/sphinx/guides/proxies.rst
Normal file
76
coreapi/help/doc/sphinx/guides/proxies.rst
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
Managing proxies
|
||||
================
|
||||
|
||||
User registration is controled by :cpp:type:`LinphoneProxyConfig` settings.
|
||||
|
||||
Each :cpp:type:`LinphoneProxyConfig` object can be configured with registration informations like :cpp:func:`proxy address <linphone_proxy_config_set_server_addr>`,
|
||||
:cpp:func:`user id <linphone_proxy_config_set_identity>`, :cpp:func:`refresh period <linphone_proxy_config_expires>`, and so on.
|
||||
|
||||
A created proxy config using :cpp:func:`linphone_proxy_config_new`, once configured, must be added to :cpp:type:`LinphoneCore` using function :cpp:func:`linphone_core_add_proxy_config`.
|
||||
|
||||
It is recommended to set a default :cpp:type:`proxy config <LinphoneProxyConfig>` using function :cpp:func:`linphone_core_set_default_proxy`. Once done,
|
||||
if :cpp:type:`proxy config <LinphoneProxyConfig>` has been configured with attribute :cpp:func:`enable register <linphone_proxy_config_enable_register>`,
|
||||
next call to :cpp:func:`linphone_core_iterate` triggers SIP register.
|
||||
|
||||
Registration status is reported by LinphoneCoreRegistrationStateChangedCb.
|
||||
|
||||
This pseudo code demonstrates basic registration operations:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LinphoneProxyConfig* proxy_cfg;
|
||||
/*create proxy config*/
|
||||
proxy_cfg = linphone_proxy_config_new();
|
||||
/*parse identity*/
|
||||
LinphoneAddress *from = linphone_address_new("sip:toto@sip.titi.com");
|
||||
LinphoneAuthInfo *info;
|
||||
if (password!=NULL){
|
||||
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,"secret",NULL,NULL); /*create authentication structure from identity*/
|
||||
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
|
||||
}
|
||||
// configure proxy entries
|
||||
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
|
||||
const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
|
||||
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
|
||||
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
|
||||
linphone_address_destroy(from); /*release resource*/
|
||||
|
||||
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
|
||||
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
|
||||
|
||||
Registration sate call back:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
static void registration_state_changed(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message){
|
||||
printf("New registration state %s for user id [%s] at proxy [%s]\n"
|
||||
,linphone_registration_state_to_string(cstate)
|
||||
,linphone_proxy_config_get_identity(cfg)
|
||||
,linphone_proxy_config_get_addr(cfg));
|
||||
}
|
||||
|
||||
Authentication
|
||||
--------------
|
||||
|
||||
Most of the time, registration requires :doc:`authentication <authentication>` to succeed. :cpp:type:`LinphoneAuthInfo` info must be either added
|
||||
to :cpp:type:`LinphoneCore` using function :cpp:func:`linphone_core_add_auth_info` before :cpp:type:`LinphoneProxyConfig` is added to Linphone core, or on demand
|
||||
from call back #LinphoneCoreAuthInfoRequestedCb.
|
||||
|
||||
Unregistration
|
||||
--------------
|
||||
|
||||
Unregistration or any changes to :cpp:type:`LinphoneProxyConfig` must be first started by a call to function :cpp:func:`linphone_proxy_config_edit` and validated by
|
||||
function :cpp:func:`linphone_proxy_config_done`.
|
||||
|
||||
This pseudo code shows how to unregister a user associated to a #LinphoneProxyConfig:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
LinphoneProxyConfig* proxy_cfg;
|
||||
linphone_core_get_default_proxy(lc,&proxy_cfg); /* get default proxy config*/
|
||||
linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/
|
||||
linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/
|
||||
linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/
|
||||
|
||||
.. seealso:: A complete tutorial can be found at: :ref:`"Basic registration" <basic_registration_code_sample>` source code.
|
||||
|
||||
70
coreapi/help/doc/sphinx/index.rst
Normal file
70
coreapi/help/doc/sphinx/index.rst
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
.. Linphone API documentation master file, created by
|
||||
sphinx-quickstart on Mon Jun 19 11:58:21 2017.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Linphone API's documentation!
|
||||
========================================
|
||||
What is liblinphone
|
||||
-------------------
|
||||
|
||||
Liblinphone is a high level library for bringing SIP video call functionnality
|
||||
into an application. It aims at making easy the integration of the SIP
|
||||
video calls into any applications. All variants of linphone are directly based
|
||||
on it:
|
||||
|
||||
* linphone (gtk interface)
|
||||
* linphonec (console interface)
|
||||
* linphone for iOS
|
||||
* linphone for Android
|
||||
|
||||
Liblinphone is GPL (see COPYING file). Please understand the licencing details
|
||||
before using it!
|
||||
|
||||
For any use of this library beyond the rights granted to you by the
|
||||
GPL license, please contact Belledonne Communications
|
||||
(contact@belledonne-communications.com).
|
||||
|
||||
|
||||
Beginners' guides
|
||||
-----------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
guides/initializing
|
||||
guides/call_control
|
||||
guides/call_misc
|
||||
guides/media_parameters
|
||||
guides/proxies
|
||||
guides/network_parameters
|
||||
guides/authentication
|
||||
guides/buddy_list
|
||||
guides/chatroom
|
||||
guides/call_logs
|
||||
guides/linphone_address
|
||||
guides/conferencing
|
||||
guides/event_api
|
||||
guides/misc
|
||||
guides/ios_portability
|
||||
|
||||
|
||||
Code samples
|
||||
------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
samples/samples
|
||||
|
||||
|
||||
API's reference documentation
|
||||
-----------------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
reference/c/index
|
||||
reference/cpp/index
|
||||
reference/java/index
|
||||
reference/csharp/index
|
||||
|
|
@ -1,19 +1,8 @@
|
|||
{{#make_section}}{{{language}}} API{{/make_section}}
|
||||
|
||||
Index of classes
|
||||
----------------
|
||||
{{{title}}}
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
{{#tocEntries}}
|
||||
{{{entryName}}}
|
||||
{{/tocEntries}}
|
||||
|
||||
Index of enums
|
||||
--------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth 1
|
||||
|
||||
enums.rst
|
||||
{{#entries}}
|
||||
{{{filename}}}
|
||||
{{/entries}}
|
||||
|
|
|
|||
BIN
coreapi/help/doc/sphinx/logo.png
Normal file
BIN
coreapi/help/doc/sphinx/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
106
coreapi/help/doc/sphinx/samples/samples.rst
Normal file
106
coreapi/help/doc/sphinx/samples/samples.rst
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
.. _basic_call_code_sample:
|
||||
|
||||
Basic call
|
||||
==========
|
||||
|
||||
This program is a *very* simple usage example of liblinphone. It just takes a sip-uri as first argument and attempts to call it
|
||||
|
||||
.. literalinclude:: helloworld.c
|
||||
:language: c
|
||||
|
||||
|
||||
.. _basic_registration_code_sample:
|
||||
|
||||
Basic registration
|
||||
==================
|
||||
|
||||
This program is a *very* simple usage example of liblinphone, desmonstrating how to initiate a SIP registration from a sip uri identity
|
||||
passed from the command line. First argument must be like sip:jehan@sip.linphone.org , second must be *password* . Registration is cleared
|
||||
on *SIGINT*.
|
||||
|
||||
Example: ``registration sip:jehan@sip.linphone.org secret``
|
||||
|
||||
.. literalinclude:: registration.c
|
||||
:language: c
|
||||
|
||||
|
||||
.. _subscribe_notify_code_sample:
|
||||
|
||||
Generic subscribe/notify example
|
||||
================================
|
||||
|
||||
This program is a *very* simple usage example of liblinphone. It demonstrates how to listen to a SIP subscription.
|
||||
It then sends notify requests back periodically. First argument must be like sip:jehan@sip.linphone.org , second must be *password*.
|
||||
Registration is cleared on *SIGINT*.
|
||||
|
||||
Example: ``registration sip:jehan@sip.linphone.org secret``
|
||||
|
||||
.. literalinclude:: registration.c
|
||||
:language: c
|
||||
|
||||
|
||||
|
||||
.. _buddy_status_notification_code_sample:
|
||||
|
||||
Basic buddy status notification
|
||||
===============================
|
||||
|
||||
This program is a *very* simple usage example of liblinphone, demonstrating how to initiate SIP subscriptions and receive
|
||||
notifications from a sip uri identity passed from the command line. Argument must be like sip:jehan@sip.linphone.org .
|
||||
Subscription is cleared on *SIGINT* signal.
|
||||
|
||||
Example: ``budy_list sip:jehan@sip.linphone.org``
|
||||
|
||||
.. literalinclude:: buddy_status.c
|
||||
:language: c
|
||||
|
||||
|
||||
.. _chatroom_code_sample:
|
||||
|
||||
Chat room and messaging
|
||||
=======================
|
||||
|
||||
This program is a *very* simple usage example of liblinphone, desmonstrating how to send/receive SIP MESSAGE from a sip uri
|
||||
identity passed from the command line. Argument must be like sip:jehan@sip.linphone.org .
|
||||
|
||||
Example: ``chatroom sip:jehan@sip.linphone.org``
|
||||
|
||||
.. literalinclude:: chatroom.c
|
||||
:language: c
|
||||
|
||||
|
||||
.. _file_transfer_code_sample:
|
||||
|
||||
File transfer
|
||||
=============
|
||||
|
||||
.. literalinclude:: filetransfer.c
|
||||
:language: c
|
||||
|
||||
|
||||
|
||||
.. _RT text receiver_code_sample:
|
||||
|
||||
Real Time Text Receiver
|
||||
=======================
|
||||
|
||||
This program is able to receive chat message in real time on port 5060. Use realtimetext_sender to generate chat message
|
||||
|
||||
Example: ``./realtimetext_receiver``
|
||||
|
||||
.. literalinclude:: realtimetext_sender.c
|
||||
:language: c
|
||||
|
||||
|
||||
.. _RT_text_sender_code_sample:
|
||||
|
||||
Real Time Text Sender
|
||||
=====================
|
||||
|
||||
This program just send chat message in real time to dest uri. Use realtimetext_receiver to receive message.
|
||||
|
||||
Example: ``./realtimetext_sender sip:localhost:5060``
|
||||
|
||||
.. literalinclude:: realtimetext_sender.c
|
||||
:language: c
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
.. Linphone API documentation master file, created by
|
||||
sphinx-quickstart on Mon Jun 19 11:58:21 2017.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to Linphone API's documentation!
|
||||
========================================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Contents:
|
||||
|
||||
c/index.rst
|
||||
cpp/index.rst
|
||||
csharp/index.rst
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
|
|
@ -24,8 +24,18 @@ if (ENABLE_TOOLS)
|
|||
if (IOS)
|
||||
set(USE_BUNDLE MACOSX_BUNDLE)
|
||||
endif()
|
||||
file(GLOB EXECUTABLES_SOURCE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
|
||||
foreach(EXECUTABLE ${EXECUTABLES_SOURCE})
|
||||
set(LINPHONE_C_EXAMPLES_SOURCE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/buddy_status.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/chatroom.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/filetransfer.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/helloworld.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/notify.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/realtimetext_receiver.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/realtimetext_sender.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/registration.c
|
||||
PARENT_SCOPE
|
||||
)
|
||||
foreach(EXECUTABLE ${LINPHONE_C_EXAMPLES_SOURCE})
|
||||
string(REPLACE ".c" "" EXECUTABLE_NAME ${EXECUTABLE})
|
||||
bc_apply_compile_flags(${EXECUTABLE} STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
|
||||
add_executable(${EXECUTABLE_NAME} ${USE_BUNDLE} ${EXECUTABLE})
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "linphone/api/c-content.h"
|
||||
#include "linphone/core.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "linphone/api/c-content.h"
|
||||
|
||||
#include "lime.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
|
|
@ -315,7 +317,7 @@ static int lime_deriveKey(limeKey_t *key) {
|
|||
return LIME_UNABLE_TO_DERIVE_KEY;
|
||||
}
|
||||
|
||||
/* Derivation is made derived Key = HMAC_SHA256(Key, 0x0000001||"MessageKey"||0x00||SessionId||SessionIndex||0x00000100)*/
|
||||
/* Derivation is made derived Key = HMAC_SHA256(Key, 0x0000001||"MessageKey"||0x00||SessionId||SessionIndex||0x00000100)*/
|
||||
/* total data to be hashed is 55 bytes : 4 + 10 + 1 + 32 + 4 + 4 */
|
||||
inputData[0] = 0x00;
|
||||
inputData[1] = 0x00;
|
||||
|
|
@ -419,6 +421,8 @@ int lime_encryptFile(void **cryptoContext, unsigned char *key, size_t length, ch
|
|||
int lime_decryptFile(void **cryptoContext, unsigned char *key, size_t length, char *plain, char *cipher) {
|
||||
bctbx_aes_gcm_context_t *gcmContext;
|
||||
|
||||
if (key == NULL) return -1;
|
||||
|
||||
if (*cryptoContext == NULL) { /* first call to the function, allocate a crypto context and initialise it */
|
||||
/* key contains 192bits of key || 64 bits of Initialisation Vector, no additional data */
|
||||
gcmContext = bctbx_aes_gcm_context_new(key, 24, NULL, 0, key+24, 8, BCTBX_GCM_DECRYPT);
|
||||
|
|
@ -481,6 +485,9 @@ int lime_createMultipartMessage(void *cachedb, const char *contentType, uint8_t
|
|||
if (bzrtp_getSelfZID(cachedb, selfURI, selfZid, NULL) != 0) {
|
||||
return LIME_UNABLE_TO_ENCRYPT_MESSAGE;
|
||||
}
|
||||
if (message == NULL || contentType == NULL) {
|
||||
return LIME_UNABLE_TO_ENCRYPT_MESSAGE;
|
||||
}
|
||||
|
||||
/* encrypted message length is plaintext + 16 for tag */
|
||||
encryptedMessageLength = (uint32_t)strlen((char *)message) + 16;
|
||||
|
|
@ -787,8 +794,8 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
|
|||
LinphoneCore *lc = linphone_im_encryption_engine_get_core(engine);
|
||||
int errcode = -1;
|
||||
/* check if we have a xml/cipher message to be decrypted */
|
||||
if (linphone_chat_message_get_content_type(msg) &&
|
||||
(strcmp("xml/cipher", linphone_chat_message_get_content_type(msg)) == 0 ||
|
||||
if (linphone_chat_message_get_content_type(msg) &&
|
||||
(strcmp("xml/cipher", linphone_chat_message_get_content_type(msg)) == 0 ||
|
||||
strcmp("application/cipher.vnd.gsma.rcs-ft-http+xml", linphone_chat_message_get_content_type(msg)) == 0)) {
|
||||
errcode = 0;
|
||||
int retval;
|
||||
|
|
@ -798,6 +805,8 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
|
|||
char *peerUri = NULL;
|
||||
char *selfUri = NULL;
|
||||
|
||||
ms_debug("Content type is known (%s), try to decrypt it", linphone_chat_message_get_content_type(msg));
|
||||
|
||||
zrtp_cache_db = linphone_core_get_zrtp_cache_db(lc);
|
||||
if (zrtp_cache_db == NULL) {
|
||||
ms_warning("Unable to load content of ZRTP ZID cache to decrypt message");
|
||||
|
|
@ -807,7 +816,7 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
|
|||
peerUri = linphone_address_as_string_uri_only(linphone_chat_message_get_from_address(msg));
|
||||
selfUri = linphone_address_as_string_uri_only(linphone_chat_message_get_to_address(msg));
|
||||
retval = lime_decryptMultipartMessage(zrtp_cache_db, (uint8_t *)linphone_chat_message_get_text(msg), selfUri, peerUri, &decrypted_body, &decrypted_content_type,
|
||||
bctbx_time_string_to_sec(lp_config_get_string(lc->config, "sip", "lime_key_validity", "0")));
|
||||
bctbx_time_string_to_sec(lp_config_get_string(lc->config, "sip", "lime_key_validity", "0")));
|
||||
ms_free(peerUri);
|
||||
ms_free(selfUri);
|
||||
if (retval != 0) {
|
||||
|
|
@ -820,9 +829,11 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
|
|||
linphone_chat_message_set_text(msg, (char *)decrypted_body);
|
||||
ms_free(decrypted_body);
|
||||
if (decrypted_content_type != NULL) {
|
||||
ms_debug("Decrypted content type is ", decrypted_content_type);
|
||||
linphone_chat_message_set_content_type(msg, decrypted_content_type);
|
||||
ms_free(decrypted_content_type);
|
||||
} else {
|
||||
ms_debug("Decrypted content type is unknown, use plain/text or application/vnd.gsma.rcs-ft-http+xml");
|
||||
if (strcmp("application/cipher.vnd.gsma.rcs-ft-http+xml", linphone_chat_message_get_content_type(msg)) == 0) {
|
||||
linphone_chat_message_set_content_type(msg, "application/vnd.gsma.rcs-ft-http+xml");
|
||||
} else {
|
||||
|
|
@ -830,6 +841,8 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ms_message("Content type is unknown (%s), don't try to decrypt it", linphone_chat_message_get_content_type(msg));
|
||||
}
|
||||
return errcode;
|
||||
}
|
||||
|
|
@ -844,9 +857,9 @@ int lime_im_encryption_engine_process_outgoing_message_cb(LinphoneImEncryptionEn
|
|||
if (linphone_chat_message_get_content_type(msg)) {
|
||||
if (strcmp(linphone_chat_message_get_content_type(msg), "application/vnd.gsma.rcs-ft-http+xml") == 0) {
|
||||
/* It's a file transfer, content type shall be set to application/cipher.vnd.gsma.rcs-ft-http+xml
|
||||
TODO: As of january 2017, the content type is now included in the encrypted body, this
|
||||
application/cipher.vnd.gsma.rcs-ft-http+xml is kept for compatibility with previous versions,
|
||||
but may be dropped in the future to use xml/cipher instead. */
|
||||
TODO: As of january 2017, the content type is now included in the encrypted body, this
|
||||
application/cipher.vnd.gsma.rcs-ft-http+xml is kept for compatibility with previous versions,
|
||||
but may be dropped in the future to use xml/cipher instead. */
|
||||
new_content_type = "application/cipher.vnd.gsma.rcs-ft-http+xml";
|
||||
} else if (strcmp(linphone_chat_message_get_content_type(msg), "application/im-iscomposing+xml") == 0) {
|
||||
/* We don't encrypt composing messages */
|
||||
|
|
@ -893,49 +906,48 @@ int lime_im_encryption_engine_process_downloading_file_cb(LinphoneImEncryptionEn
|
|||
LinphoneContent *content = linphone_chat_message_get_file_transfer_information(msg);
|
||||
if (!content)
|
||||
return -1;
|
||||
if (!linphone_content_get_key(content)) {
|
||||
linphone_content_unref(content);
|
||||
|
||||
if (!linphone_content_get_key(content))
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!buffer || (size == 0)) {
|
||||
int result = lime_decryptFile(linphone_content_get_cryptoContext_address(content), NULL, 0, NULL, NULL);
|
||||
linphone_content_unref(content);
|
||||
return result;
|
||||
}
|
||||
if (!buffer || size == 0)
|
||||
return lime_decryptFile(linphone_content_get_cryptoContext_address(content), NULL, 0, NULL, NULL);
|
||||
|
||||
int result = lime_decryptFile(linphone_content_get_cryptoContext_address(content),
|
||||
(unsigned char *)linphone_content_get_key(content), size, (char *)decrypted_buffer, (char *)buffer);
|
||||
linphone_content_unref(content);
|
||||
return result;
|
||||
return lime_decryptFile(
|
||||
linphone_content_get_cryptoContext_address(content),
|
||||
(unsigned char *)linphone_content_get_key(content),
|
||||
size,
|
||||
(char *)decrypted_buffer,
|
||||
(char *)buffer
|
||||
);
|
||||
}
|
||||
|
||||
int lime_im_encryption_engine_process_uploading_file_cb(LinphoneImEncryptionEngine *engine, LinphoneChatMessage *msg, size_t offset, const uint8_t *buffer, size_t *size, uint8_t *encrypted_buffer) {
|
||||
LinphoneContent *content = linphone_chat_message_get_file_transfer_information(msg);
|
||||
|
||||
if (!content)
|
||||
return -1;
|
||||
if (!linphone_content_get_key(content)) {
|
||||
linphone_content_unref(content);
|
||||
|
||||
if (!linphone_content_get_key(content))
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!buffer || (*size == 0)) {
|
||||
int result = lime_encryptFile(linphone_content_get_cryptoContext_address(content), NULL, 0, NULL, NULL);
|
||||
linphone_content_unref(content);
|
||||
return result;
|
||||
}
|
||||
if (!buffer || *size == 0)
|
||||
return lime_encryptFile(linphone_content_get_cryptoContext_address(content), NULL, 0, NULL, NULL);
|
||||
|
||||
size_t file_size = linphone_content_get_size(content);
|
||||
size_t file_size = linphone_content_get_file_size(content);
|
||||
if (file_size == 0) {
|
||||
ms_warning("File size has not been set, encryption will fail if not done in one step (if file is larger than 16K)");
|
||||
} else if (offset + *size < file_size) {
|
||||
*size -= (*size % 16);
|
||||
}
|
||||
|
||||
int result = lime_encryptFile(linphone_content_get_cryptoContext_address(content),
|
||||
(unsigned char *)linphone_content_get_key(content), *size, (char *)buffer, (char *)encrypted_buffer);
|
||||
linphone_content_unref(content);
|
||||
return result;
|
||||
return lime_encryptFile(
|
||||
linphone_content_get_cryptoContext_address(content),
|
||||
(unsigned char *)linphone_content_get_key(content),
|
||||
*size,
|
||||
(char *)buffer,
|
||||
(char *)encrypted_buffer
|
||||
);
|
||||
}
|
||||
|
||||
bool_t lime_im_encryption_engine_is_file_encryption_enabled_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room) {
|
||||
|
|
@ -949,10 +961,8 @@ void lime_im_encryption_engine_generate_file_transfer_key_cb(LinphoneImEncryptio
|
|||
* file_transfer_information->key field of the msg */
|
||||
sal_get_random_bytes((unsigned char *)keyBuffer, FILE_TRANSFER_KEY_SIZE);
|
||||
LinphoneContent *content = linphone_chat_message_get_file_transfer_information(msg);
|
||||
if (!content)
|
||||
return;
|
||||
linphone_content_set_key(content, keyBuffer, FILE_TRANSFER_KEY_SIZE); /* key is duplicated in the content private structure */
|
||||
linphone_content_unref(content);
|
||||
if (content)
|
||||
linphone_content_set_key(content, keyBuffer, FILE_TRANSFER_KEY_SIZE); /* key is duplicated in the content private structure */
|
||||
}
|
||||
|
||||
#else /* HAVE_LIME */
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "linphone/core.h"
|
||||
#include "private.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
#include "c-wrapper/c-wrapper.h"
|
||||
|
||||
LinphoneTunnel* linphone_core_get_tunnel(const LinphoneCore *lc){
|
||||
return lc->tunnel;
|
||||
|
|
@ -42,13 +43,13 @@ struct _LinphoneTunnel {
|
|||
static void _linphone_tunnel_uninit(LinphoneTunnel *tunnel);
|
||||
|
||||
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneTunnel);
|
||||
BELLE_SIP_DECLARE_VPTR(LinphoneTunnel);
|
||||
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneTunnel);
|
||||
BELLE_SIP_INSTANCIATE_VPTR(LinphoneTunnel, belle_sip_object_t,
|
||||
_linphone_tunnel_uninit, // uninit
|
||||
NULL, // clone
|
||||
NULL, // marshal
|
||||
FALSE // unowned
|
||||
)
|
||||
);
|
||||
|
||||
extern "C" LinphoneTunnel* linphone_core_tunnel_new(LinphoneCore *lc){
|
||||
LinphoneTunnel* tunnel = belle_sip_object_new(LinphoneTunnel);
|
||||
|
|
@ -231,13 +232,13 @@ static void linphone_tunnel_add_server_intern(LinphoneTunnel *tunnel, LinphoneTu
|
|||
linphone_tunnel_config_get_port(tunnel_config),
|
||||
linphone_tunnel_config_get_host2(tunnel_config),
|
||||
linphone_tunnel_config_get_port2(tunnel_config),
|
||||
linphone_tunnel_config_get_remote_udp_mirror_port(tunnel_config),
|
||||
linphone_tunnel_config_get_delay(tunnel_config));
|
||||
(unsigned int)linphone_tunnel_config_get_remote_udp_mirror_port(tunnel_config),
|
||||
(unsigned int)linphone_tunnel_config_get_delay(tunnel_config));
|
||||
} else {
|
||||
bcTunnel(tunnel)->addServer(linphone_tunnel_config_get_host(tunnel_config),
|
||||
linphone_tunnel_config_get_port(tunnel_config),
|
||||
linphone_tunnel_config_get_remote_udp_mirror_port(tunnel_config),
|
||||
linphone_tunnel_config_get_delay(tunnel_config));
|
||||
(unsigned int)linphone_tunnel_config_get_remote_udp_mirror_port(tunnel_config),
|
||||
(unsigned int)linphone_tunnel_config_get_delay(tunnel_config));
|
||||
}
|
||||
} else if (linphone_tunnel_config_get_host2(tunnel_config) != NULL) {
|
||||
bcTunnel(tunnel)->addServerPair(linphone_tunnel_config_get_host(tunnel_config),
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -4689,10 +4689,10 @@ extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_setFileTransferFi
|
|||
ReleaseStringUTFChars(env, jpath, path);
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneChatMessageImpl_downloadFile(JNIEnv* env
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneChatMessageImpl_downloadFile(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
return (jint) linphone_chat_message_download_file((LinphoneChatMessage*)ptr);
|
||||
return linphone_chat_message_download_file((LinphoneChatMessage*)ptr);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneChatMessageImpl_isSecured(JNIEnv* env
|
||||
|
|
@ -4768,6 +4768,7 @@ static void file_transfer_progress_indication(LinphoneChatMessage *msg, const Li
|
|||
if (jmessage) {
|
||||
env->DeleteLocalRef(jmessage);
|
||||
}
|
||||
env->DeleteLocalRef(listener);
|
||||
}
|
||||
|
||||
static void file_transfer_recv(LinphoneChatMessage *msg, const LinphoneContent* content, const LinphoneBuffer *buffer) {
|
||||
|
|
@ -4797,6 +4798,7 @@ static void file_transfer_recv(LinphoneChatMessage *msg, const LinphoneContent*
|
|||
if (jmessage) {
|
||||
env->DeleteLocalRef(jmessage);
|
||||
}
|
||||
env->DeleteLocalRef(listener);
|
||||
}
|
||||
|
||||
static LinphoneBuffer* file_transfer_send(LinphoneChatMessage *msg, const LinphoneContent* content, size_t offset, size_t size) {
|
||||
|
|
@ -4827,6 +4829,7 @@ static LinphoneBuffer* file_transfer_send(LinphoneChatMessage *msg, const Linph
|
|||
|
||||
buffer = create_c_linphone_buffer_from_java_linphone_buffer(env, jbuffer);
|
||||
env->DeleteLocalRef(jbuffer);
|
||||
env->DeleteLocalRef(listener);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
@ -4909,7 +4912,7 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendChatMessage(JNIE
|
|||
,jlong chatroom_ptr
|
||||
,jobject message
|
||||
,jlong messagePtr) {
|
||||
|
||||
|
||||
linphone_chat_room_send_chat_message_2((LinphoneChatRoom*)chatroom_ptr, (LinphoneChatMessage*)messagePtr);
|
||||
}
|
||||
|
||||
|
|
@ -7693,7 +7696,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDnsServers(JNIEnv *e
|
|||
}
|
||||
}
|
||||
}
|
||||
linphone_core_set_dns_servers((LinphoneCore*)lc, l);
|
||||
linphone_core_set_dns_servers_app((LinphoneCore*)lc, l);
|
||||
bctbx_list_free_with_data(l, ms_free);
|
||||
}
|
||||
|
||||
|
|
@ -7755,19 +7758,45 @@ static void _next_video_frame_decoded_callback(LinphoneCall *call, void *user_da
|
|||
return;
|
||||
}
|
||||
|
||||
jobject listener = (jobject) user_data;
|
||||
jobject listener = (jobject) env->NewLocalRef((jobject)user_data);
|
||||
if (listener == NULL){
|
||||
ms_error("_next_video_frame_decoded_callback: listener has gone.");
|
||||
return;
|
||||
}
|
||||
jclass clazz = (jclass) env->GetObjectClass(listener);
|
||||
jmethodID method = env->GetMethodID(clazz, "onNextVideoFrameDecoded","(Lorg/linphone/core/LinphoneCall;)V");
|
||||
env->DeleteLocalRef(clazz);
|
||||
|
||||
jobject jcall = getCall(env, call);
|
||||
env->CallVoidMethod(listener, method, jcall);
|
||||
env->DeleteLocalRef(listener);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) {
|
||||
jobject listener = env->NewGlobalRef(jlistener);
|
||||
static void _on_tmmbr_received(LinphoneCall *call, int index, int bitrate){
|
||||
LinphoneCallCbs *cbs = linphone_call_get_current_callbacks(call);
|
||||
JNIEnv *env = ms_get_jni_env();
|
||||
jobject listener = (jobject) env->NewLocalRef((jobject)linphone_call_cbs_get_user_data(cbs));
|
||||
if (listener == NULL){
|
||||
ms_error("_on_tmmbr_received: listener has gone.");
|
||||
return;
|
||||
}
|
||||
jclass clazz = (jclass) env->GetObjectClass(listener);
|
||||
jmethodID method = env->GetMethodID(clazz, "tmmbrReceived","(Lorg/linphone/core/LinphoneCall;II)V");
|
||||
env->DeleteLocalRef(clazz);
|
||||
|
||||
jobject jcall = getCall(env, call);
|
||||
env->CallVoidMethod(listener, method, jcall,(jint)index, (jint)bitrate);
|
||||
env->DeleteLocalRef(listener);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCallImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) {
|
||||
LinphoneCall *call = (LinphoneCall *)ptr;
|
||||
linphone_call_set_next_video_frame_decoded_callback(call, _next_video_frame_decoded_callback, listener);
|
||||
LinphoneCallCbs *cbs = linphone_factory_create_call_cbs(linphone_factory_get());
|
||||
linphone_call_cbs_set_user_data(cbs, env->NewWeakGlobalRef(jlistener));
|
||||
linphone_call_cbs_set_tmmbr_received(cbs, _on_tmmbr_received);
|
||||
linphone_call_add_callbacks(call, cbs);
|
||||
|
||||
linphone_call_set_next_video_frame_decoded_callback(call, _next_video_frame_decoded_callback, env->NewWeakGlobalRef(jlistener));
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_setVideoWindowId(JNIEnv* env
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ static int _local_player_get_current_position(LinphonePlayer *obj) {
|
|||
|
||||
static void _local_player_destroy(LinphonePlayer *obj) {
|
||||
ms_media_player_free((MSMediaPlayer *)obj->impl);
|
||||
_linphone_player_destroy(obj);
|
||||
}
|
||||
|
||||
static void _local_player_close(LinphonePlayer *obj) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ LinphoneLogLevel _bctbx_log_level_to_linphone_log_level(BctbxLogLevel level) {
|
|||
if (response != tmap.cend()) {
|
||||
return response->first;
|
||||
} else {
|
||||
ms_fatal("%s(): invalid argurement [%d]", __FUNCTION__, level);
|
||||
ms_warning("%s(): invalid argurement [%d]", __FUNCTION__, level);
|
||||
return LinphoneLogLevelDebug;
|
||||
}
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ unsigned int _bctbx_log_mask_to_linphone_log_mask(unsigned int mask) {
|
|||
BctbxLogLevel _linphone_log_level_to_bctbx_log_level(LinphoneLogLevel level) {
|
||||
try {
|
||||
return _linphone_log_level_to_bctbx_log_level_map.at(level);
|
||||
} catch (const std::out_of_range &e) {
|
||||
} catch (const std::out_of_range &) {
|
||||
ms_fatal("%s(): invalid argument [%d]", __FUNCTION__, level);
|
||||
return BCTBX_LOG_LOGLEV_END;
|
||||
}
|
||||
|
|
@ -127,6 +127,7 @@ static void _log_handler_on_message_written_cb(void *info,const char *domain, Bc
|
|||
|
||||
static void _log_handler_destroy_cb(bctbx_log_handler_t *handler) {
|
||||
LinphoneLoggingService *service = (LinphoneLoggingService *)bctbx_log_handler_get_user_data(handler);
|
||||
bctbx_free(service->log_handler);
|
||||
service->log_handler = NULL;
|
||||
}
|
||||
|
||||
|
|
@ -158,11 +159,12 @@ LinphoneLoggingService *linphone_logging_service_ref(LinphoneLoggingService *ser
|
|||
}
|
||||
|
||||
void linphone_logging_service_unref(LinphoneLoggingService *service) {
|
||||
belle_sip_object_ref(service);
|
||||
belle_sip_object_unref(service);
|
||||
}
|
||||
|
||||
static void _linphone_logging_service_uninit(LinphoneLoggingService *log_service) {
|
||||
if (log_service->log_handler) bctbx_remove_log_handler(log_service->log_handler);
|
||||
if (log_service->log_handler)
|
||||
bctbx_remove_log_handler(log_service->log_handler);
|
||||
linphone_logging_service_cbs_unref(log_service->cbs);
|
||||
}
|
||||
|
||||
|
|
@ -179,10 +181,11 @@ LinphoneLoggingServiceCbs *linphone_logging_service_get_callbacks(const Linphone
|
|||
|
||||
static const char *_linphone_logging_service_log_domains[] = {
|
||||
"bctbx",
|
||||
"belle-sip",
|
||||
"ortp",
|
||||
"mediastreamer",
|
||||
"bzrtp",
|
||||
"linphone",
|
||||
BCTBX_LOG_DOMAIN, /* which is "liblinphone", set from CMakeList.txt*/
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -201,7 +204,7 @@ void linphone_logging_service_set_log_level_mask(LinphoneLoggingService *log_ser
|
|||
}
|
||||
|
||||
unsigned int linphone_logging_service_get_log_level_mask(const LinphoneLoggingService *log_service) {
|
||||
return _bctbx_log_mask_to_linphone_log_mask(bctbx_get_log_level_mask(ORTP_LOG_DOMAIN));
|
||||
return _bctbx_log_mask_to_linphone_log_mask(bctbx_get_log_level_mask(BCTBX_LOG_DOMAIN));
|
||||
}
|
||||
|
||||
void linphone_logging_service_set_log_file(const LinphoneLoggingService *service, const char *dir, const char *filename, size_t max_size) {
|
||||
|
|
@ -237,6 +240,11 @@ void linphone_logging_service_cbs_unref(LinphoneLoggingServiceCbs *cbs) {
|
|||
}
|
||||
|
||||
void linphone_logging_service_cbs_set_log_message_written(LinphoneLoggingServiceCbs *cbs, LinphoneLoggingServiceCbsLogMessageWrittenCb cb) {
|
||||
/* We need to set the legacy log handler to NULL here
|
||||
because LinphoneCore have a default log handler that dump
|
||||
all messages into the standard output. */
|
||||
/*this function is moved here to make sure default log handler is only removed when user defined logging cbs is set*/
|
||||
_linphone_core_set_log_handler(NULL);
|
||||
cbs->message_event_cb = cb;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,6 +222,10 @@ void lsd_player_set_gain(LsdPlayer *p, float gain){
|
|||
ms_filter_call_method(p->lsd->mixer,MS_AUDIO_MIXER_SET_INPUT_GAIN,&gainctl);
|
||||
}
|
||||
|
||||
static void lsd_player_configure_notify_func (void *userdata, MSFilter *, unsigned int, void *) {
|
||||
lsd_player_configure((LsdPlayer *)userdata);
|
||||
}
|
||||
|
||||
LinphoneSoundDaemon * linphone_sound_daemon_new(MSFactory* factory, const char *cardname, int rate, int nchannels){
|
||||
int i;
|
||||
MSConnectionPoint mp;
|
||||
|
|
@ -251,7 +255,7 @@ LinphoneSoundDaemon * linphone_sound_daemon_new(MSFactory* factory, const char *
|
|||
mp.pin=0;
|
||||
|
||||
lsd_player_init(factory, &lsd->branches[0],mp,MS_ITC_SOURCE_ID,lsd);
|
||||
ms_filter_add_notify_callback(lsd->branches[0].player,(MSFilterNotifyFunc)lsd_player_configure,&lsd->branches[0],FALSE);
|
||||
ms_filter_add_notify_callback(lsd->branches[0].player,lsd_player_configure_notify_func,&lsd->branches[0],FALSE);
|
||||
for(i=1;i<MAX_BRANCHES;++i){
|
||||
mp.pin=i;
|
||||
lsd_player_init(factory,&lsd->branches[i],mp,MS_FILE_PLAYER_ID,lsd);
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ const char * linphone_core_get_echo_canceller_filter_name(const LinphoneCore *lc
|
|||
* task_fun must return BELLE_SIP_STOP when job is finished.
|
||||
**/
|
||||
void linphone_core_queue_task(LinphoneCore *lc, belle_sip_source_func_t task_fun, void *data, const char *task_description){
|
||||
belle_sip_source_t *s=lc->sal->create_timer(task_fun,data, 20, task_description);
|
||||
belle_sip_source_t *s=lc->sal->createTimer(task_fun,data, 20, task_description);
|
||||
belle_sip_object_unref(s);
|
||||
}
|
||||
|
||||
|
|
@ -919,8 +919,11 @@ void linphone_core_report_call_log(LinphoneCore *lc, LinphoneCallLog *call_log){
|
|||
}
|
||||
linphone_address_unref(conference_factory_addr);
|
||||
}
|
||||
const char *username = linphone_address_get_username(call_log->to);
|
||||
if (username && (strstr(username, "chatroom-") == username))
|
||||
const char *usernameFrom = linphone_address_get_username(call_log->from);
|
||||
const char *usernameTo = linphone_address_get_username(call_log->to);
|
||||
if ((usernameFrom && (strstr(usernameFrom, "chatroom-") == usernameFrom))
|
||||
|| (usernameTo && (strstr(usernameTo, "chatroom-") == usernameTo))
|
||||
)
|
||||
return;
|
||||
// End of workaround
|
||||
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ static void initiate_incoming(MSFactory *factory, const SalStreamDescription *lo
|
|||
|
||||
if (remote_offer->haveZrtpHash == 1) {
|
||||
if (local_cap->zrtphash[0] != 0) { /* if ZRTP is available, set the zrtp hash even if it is not selected */
|
||||
strncpy((char *)(result->zrtphash), (char *)(local_cap->zrtphash), sizeof(local_cap->zrtphash));
|
||||
strncpy((char *)(result->zrtphash), (char *)(local_cap->zrtphash), sizeof(result->zrtphash));
|
||||
result->haveZrtpHash = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,10 +100,11 @@ void linphone_player_close(LinphonePlayer *obj){
|
|||
}
|
||||
|
||||
void linphone_player_destroy(LinphonePlayer *obj) {
|
||||
if(obj->destroy) obj->destroy(obj);
|
||||
_linphone_player_destroy(obj);
|
||||
}
|
||||
|
||||
void _linphone_player_destroy(LinphonePlayer *player) {
|
||||
if(player->destroy) player->destroy(player);
|
||||
linphone_player_cbs_unref(player->callbacks);
|
||||
}
|
||||
|
||||
|
|
@ -133,9 +134,13 @@ static bool_t call_player_check_state(LinphonePlayer *player, bool_t check_playe
|
|||
|
||||
static void on_eof(void *user_data, MSFilter *f, unsigned int event_id, void *arg){
|
||||
LinphonePlayer *player=(LinphonePlayer *)user_data;
|
||||
LinphonePlayerCbs *cbs = linphone_player_get_callbacks(player);
|
||||
LinphonePlayerCbsEofReachedCb cb = linphone_player_cbs_get_eof_reached(cbs);
|
||||
if (cb) cb(player);
|
||||
switch (event_id){
|
||||
case MS_PLAYER_EOF:
|
||||
LinphonePlayerCbs *cbs = linphone_player_get_callbacks(player);
|
||||
LinphonePlayerCbsEofReachedCb cb = linphone_player_cbs_get_eof_reached(cbs);
|
||||
if (cb) cb(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int call_player_open(LinphonePlayer* player, const char *filename){
|
||||
|
|
|
|||
|
|
@ -126,6 +126,10 @@ static void presence_note_uninit(LinphonePresenceNote *note) {
|
|||
}
|
||||
}
|
||||
|
||||
static void presence_note_unref(void *note) {
|
||||
linphone_presence_note_unref((LinphonePresenceNote *)note);
|
||||
}
|
||||
|
||||
static LinphonePresenceService * presence_service_new(const char *id, LinphonePresenceBasicStatus status) {
|
||||
LinphonePresenceService *service = belle_sip_object_new(LinphonePresenceService);
|
||||
if (id != NULL) {
|
||||
|
|
@ -143,10 +147,14 @@ static void presence_service_uninit(LinphonePresenceService *service) {
|
|||
if (service->contact != NULL) {
|
||||
ms_free(service->contact);
|
||||
}
|
||||
bctbx_list_for_each(service->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(service->notes, presence_note_unref);
|
||||
bctbx_list_free(service->notes);
|
||||
};
|
||||
|
||||
static void presence_service_unref(void *service) {
|
||||
linphone_presence_service_unref((LinphonePresenceService *)service);
|
||||
}
|
||||
|
||||
static void presence_service_set_timestamp(LinphonePresenceService *service, time_t timestamp) {
|
||||
service->timestamp = timestamp;
|
||||
}
|
||||
|
|
@ -161,6 +169,10 @@ static void presence_activity_uninit(LinphonePresenceActivity *activity) {
|
|||
}
|
||||
}
|
||||
|
||||
static void presence_activity_unref(void *activity) {
|
||||
linphone_presence_activity_unref((LinphonePresenceActivity *)activity);
|
||||
}
|
||||
|
||||
static time_t parse_timestamp(const char *timestamp) {
|
||||
struct tm ret;
|
||||
time_t seconds;
|
||||
|
|
@ -219,14 +231,18 @@ static void presence_person_uninit(LinphonePresencePerson *person) {
|
|||
if (person->id != NULL) {
|
||||
ms_free(person->id);
|
||||
}
|
||||
bctbx_list_for_each(person->activities, (MSIterateFunc)linphone_presence_activity_unref);
|
||||
bctbx_list_for_each(person->activities, presence_activity_unref);
|
||||
bctbx_list_free(person->activities);
|
||||
bctbx_list_for_each(person->activities_notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(person->activities_notes, presence_note_unref);
|
||||
bctbx_list_free(person->activities_notes);
|
||||
bctbx_list_for_each(person->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(person->notes, presence_note_unref);
|
||||
bctbx_list_free(person->notes);
|
||||
}
|
||||
|
||||
static void presence_person_unref(void *person) {
|
||||
linphone_presence_person_unref((LinphonePresencePerson *)person);
|
||||
}
|
||||
|
||||
static void presence_person_add_activities_note(LinphonePresencePerson *person, LinphonePresenceNote *note) {
|
||||
person->activities_notes = bctbx_list_append(person->activities_notes, note);
|
||||
}
|
||||
|
|
@ -256,11 +272,11 @@ static void presence_model_find_open_basic_status(LinphonePresenceService *servi
|
|||
static void presence_model_uninit(LinphonePresenceModel *model) {
|
||||
if (model->presentity)
|
||||
linphone_address_unref(model->presentity);
|
||||
bctbx_list_for_each(model->services, (MSIterateFunc)linphone_presence_service_unref);
|
||||
bctbx_list_for_each(model->services, presence_service_unref);
|
||||
bctbx_list_free(model->services);
|
||||
bctbx_list_for_each(model->persons, (MSIterateFunc)linphone_presence_person_unref);
|
||||
bctbx_list_for_each(model->persons, presence_person_unref);
|
||||
bctbx_list_free(model->persons);
|
||||
bctbx_list_for_each(model->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(model->notes, presence_note_unref);
|
||||
bctbx_list_free(model->notes);
|
||||
}
|
||||
|
||||
|
|
@ -357,6 +373,7 @@ LinphoneStatus linphone_presence_model_set_contact(LinphonePresenceModel *model,
|
|||
service = linphone_presence_service_new(NULL, LinphonePresenceBasicStatusClosed, NULL);
|
||||
if (service == NULL) return -1;
|
||||
linphone_presence_model_add_service(model, service);
|
||||
linphone_presence_service_unref(service);
|
||||
}
|
||||
return linphone_presence_service_set_contact(service, contact);
|
||||
}
|
||||
|
|
@ -445,10 +462,14 @@ LinphoneStatus linphone_presence_model_add_activity(LinphonePresenceModel *model
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void presence_person_clear_activities(void *person) {
|
||||
linphone_presence_person_clear_activities((LinphonePresencePerson *)person);
|
||||
}
|
||||
|
||||
LinphoneStatus linphone_presence_model_clear_activities(LinphonePresenceModel *model) {
|
||||
if (model == NULL) return -1;
|
||||
|
||||
bctbx_list_for_each(model->persons, (MSIterateFunc)linphone_presence_person_clear_activities);
|
||||
bctbx_list_for_each(model->persons, presence_person_clear_activities);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -579,16 +600,16 @@ LinphoneStatus linphone_presence_model_add_note(LinphonePresenceModel *model, co
|
|||
}
|
||||
|
||||
static void clear_presence_person_notes(LinphonePresencePerson *person) {
|
||||
bctbx_list_for_each(person->activities_notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(person->activities_notes, presence_note_unref);
|
||||
bctbx_list_free(person->activities_notes);
|
||||
person->activities_notes = NULL;
|
||||
bctbx_list_for_each(person->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(person->notes, presence_note_unref);
|
||||
bctbx_list_free(person->notes);
|
||||
person->notes = NULL;
|
||||
}
|
||||
|
||||
static void clear_presence_service_notes(LinphonePresenceService *service) {
|
||||
bctbx_list_for_each(service->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(service->notes, presence_note_unref);
|
||||
bctbx_list_free(service->notes);
|
||||
service->notes = NULL;
|
||||
}
|
||||
|
|
@ -599,7 +620,7 @@ LinphoneStatus linphone_presence_model_clear_notes(LinphonePresenceModel *model)
|
|||
|
||||
bctbx_list_for_each(model->persons, (MSIterateFunc)clear_presence_person_notes);
|
||||
bctbx_list_for_each(model->services, (MSIterateFunc)clear_presence_service_notes);
|
||||
bctbx_list_for_each(model->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(model->notes, presence_note_unref);
|
||||
bctbx_list_free(model->notes);
|
||||
model->notes = NULL;
|
||||
|
||||
|
|
@ -635,7 +656,7 @@ LinphoneStatus linphone_presence_model_add_service(LinphonePresenceModel *model,
|
|||
LinphoneStatus linphone_presence_model_clear_services(LinphonePresenceModel *model) {
|
||||
if (model == NULL) return -1;
|
||||
|
||||
bctbx_list_for_each(model->services, (MSIterateFunc)linphone_presence_service_unref);
|
||||
bctbx_list_for_each(model->services, presence_service_unref);
|
||||
bctbx_list_free(model->services);
|
||||
model->services = NULL;
|
||||
return 0;
|
||||
|
|
@ -661,7 +682,7 @@ LinphoneStatus linphone_presence_model_add_person(LinphonePresenceModel *model,
|
|||
LinphoneStatus linphone_presence_model_clear_persons(LinphonePresenceModel *model) {
|
||||
if (model == NULL) return -1;
|
||||
|
||||
bctbx_list_for_each(model->persons, (MSIterateFunc)linphone_presence_person_unref);
|
||||
bctbx_list_for_each(model->persons, presence_person_unref);
|
||||
bctbx_list_free(model->persons);
|
||||
model->persons = NULL;
|
||||
return 0;
|
||||
|
|
@ -797,7 +818,7 @@ LinphoneStatus linphone_presence_service_add_note(LinphonePresenceService *servi
|
|||
LinphoneStatus linphone_presence_service_clear_notes(LinphonePresenceService *service) {
|
||||
if (service == NULL) return -1;
|
||||
|
||||
bctbx_list_for_each(service->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(service->notes, presence_note_unref);
|
||||
bctbx_list_free(service->notes);
|
||||
service->notes = NULL;
|
||||
return 0;
|
||||
|
|
@ -858,7 +879,7 @@ LinphoneStatus linphone_presence_person_add_activity(LinphonePresencePerson *per
|
|||
|
||||
LinphoneStatus linphone_presence_person_clear_activities(LinphonePresencePerson *person) {
|
||||
if (person == NULL) return -1;
|
||||
bctbx_list_for_each(person->activities, (MSIterateFunc)linphone_presence_activity_unref);
|
||||
bctbx_list_for_each(person->activities, presence_activity_unref);
|
||||
bctbx_list_free(person->activities);
|
||||
person->activities = NULL;
|
||||
return 0;
|
||||
|
|
@ -883,7 +904,7 @@ LinphoneStatus linphone_presence_person_add_note(LinphonePresencePerson *person,
|
|||
|
||||
LinphoneStatus linphone_presence_person_clear_notes(LinphonePresencePerson *person) {
|
||||
if (person == NULL) return -1;
|
||||
bctbx_list_for_each(person->notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(person->notes, presence_note_unref);
|
||||
bctbx_list_free(person->notes);
|
||||
person->notes = NULL;
|
||||
return 0;
|
||||
|
|
@ -908,7 +929,7 @@ LinphoneStatus linphone_presence_person_add_activities_note(LinphonePresencePers
|
|||
|
||||
LinphoneStatus linphone_presence_person_clear_activities_notes(LinphonePresencePerson *person) {
|
||||
if (person == NULL) return -1;
|
||||
bctbx_list_for_each(person->activities_notes, (MSIterateFunc)linphone_presence_note_unref);
|
||||
bctbx_list_for_each(person->activities_notes, presence_note_unref);
|
||||
bctbx_list_free(person->activities_notes);
|
||||
person->activities_notes = NULL;
|
||||
return 0;
|
||||
|
|
@ -1437,7 +1458,7 @@ static int process_pidf_xml_presence_persons(xmlparsing_context_t *xml_ctx, Linp
|
|||
|
||||
if (err < 0) {
|
||||
/* Remove all the persons added since there was an error. */
|
||||
bctbx_list_for_each(model->persons, (MSIterateFunc)linphone_presence_person_unref);
|
||||
bctbx_list_for_each(model->persons, presence_person_unref);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
@ -1562,7 +1583,7 @@ void linphone_subscription_new(LinphoneCore *lc, SalSubscribeOp *op, const char
|
|||
linphone_friend_add_incoming_subscription(lf, op);
|
||||
lf->inc_subscribe_pending=TRUE;
|
||||
if (lp_config_get_int(lc->config,"sip","notify_pending_state",0)) {
|
||||
op->notify_pending_state();
|
||||
op->notifyPendingState();
|
||||
}
|
||||
op->accept();
|
||||
} else {
|
||||
|
|
@ -1935,7 +1956,7 @@ void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, Sa
|
|||
if (linphone_core_get_default_friend_list(lc) != NULL)
|
||||
lf=linphone_core_find_friend_by_out_subscribe(lc, op);
|
||||
if (lf==NULL && lp_config_get_int(lc->config,"sip","allow_out_of_subscribe_presence",0)){
|
||||
char *buf = sal_address_as_string_uri_only(op->get_from_address());
|
||||
char *buf = sal_address_as_string_uri_only(op->getFromAddress());
|
||||
LinphoneAddress *addr = linphone_address_new(buf);
|
||||
lf = linphone_core_find_friend(lc, addr);
|
||||
ms_free(buf);
|
||||
|
|
@ -1999,7 +2020,7 @@ void linphone_subscription_closed(LinphoneCore *lc, SalOp *op){
|
|||
linphone_friend_remove_incoming_subscription(lf, op);
|
||||
}else{
|
||||
/*case of an op that we already released because the friend was destroyed*/
|
||||
ms_message("Receiving unsuscribe for unknown in-subscribtion from %s", op->get_from());
|
||||
ms_message("Receiving unsuscribe for unknown in-subscribtion from %s", op->getFrom().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,6 @@
|
|||
#define STRING_SET(field, value) do{ if (field){bctbx_free(field);field=NULL;}; field=bctbx_strdup(value); }while(0)
|
||||
#define STRING_TRANSFER(field, newvalue) do{ if (field){bctbx_free(field);field=NULL;}; field=newvalue; }while(0)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define getPlatformHelpers(lc) static_cast<LinphonePrivate::PlatformHelpers*>(lc->platform_helper)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "private_types.h"
|
||||
#include "tester_utils.h"
|
||||
#include "conference/participant-imdn-state.h"
|
||||
#include "sal/op.h"
|
||||
#include "sal/event-op.h"
|
||||
|
||||
|
|
@ -48,6 +49,8 @@ void linphone_call_notify_stats_updated(LinphoneCall *call, const LinphoneCallSt
|
|||
void linphone_call_notify_info_message_received(LinphoneCall *call, const LinphoneInfoMessage *msg);
|
||||
void linphone_call_notify_ack_processing(LinphoneCall *call, LinphoneHeaders *msg, bool_t is_received);
|
||||
void linphone_call_notify_tmmbr_received(LinphoneCall *call, int stream_index, int tmmbr);
|
||||
void linphone_call_notify_snapshot_taken(LinphoneCall *call, const char *file_path);
|
||||
void linphone_call_notify_next_video_frame_decoded(LinphoneCall *call);
|
||||
|
||||
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg);
|
||||
LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, LinphonePrivate::SalCallOp *op);
|
||||
|
|
@ -238,7 +241,6 @@ LinphoneFriend * linphone_friend_new_from_config_file(struct _LinphoneCore *lc,
|
|||
void linphone_proxy_config_update(LinphoneProxyConfig *cfg);
|
||||
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri);
|
||||
const char *linphone_core_find_best_identity(LinphoneCore *lc, const LinphoneAddress *to);
|
||||
int linphone_core_get_local_ip_for(int type, const char *dest, char *result);
|
||||
LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const char *dest, char *result);
|
||||
|
||||
LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore *lc, int index);
|
||||
|
|
@ -288,6 +290,8 @@ void _linphone_chat_room_notify_participant_device_removed(LinphoneChatRoom *cr,
|
|||
void _linphone_chat_room_notify_participant_admin_status_changed(LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
void _linphone_chat_room_notify_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState);
|
||||
void _linphone_chat_room_notify_subject_changed(LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
void _linphone_chat_room_notify_conference_joined(LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
void _linphone_chat_room_notify_conference_left(LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
void _linphone_chat_room_notify_undecryptable_message_received(LinphoneChatRoom *cr, LinphoneChatMessage *msg);
|
||||
void _linphone_chat_room_notify_chat_message_received(LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
void _linphone_chat_room_notify_chat_message_sent(LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
|
|
@ -298,6 +302,7 @@ void _linphone_chat_room_notify_participant_registration_subscription_requested(
|
|||
void _linphone_chat_room_notify_participant_registration_unsubscription_requested(LinphoneChatRoom *cr, const LinphoneAddress *participantAddr);
|
||||
void _linphone_chat_room_notify_chat_message_should_be_stored(LinphoneChatRoom *cr, LinphoneChatMessage *msg);
|
||||
void _linphone_chat_room_clear_callbacks (LinphoneChatRoom *cr);
|
||||
const LinphoneParticipantImdnState *_linphone_participant_imdn_state_from_cpp_obj (const LinphonePrivate::ParticipantImdnState &state);
|
||||
|
||||
LinphoneToneDescription * linphone_tone_description_new(LinphoneReason reason, LinphoneToneID id, const char *audiofile);
|
||||
void linphone_tone_description_destroy(LinphoneToneDescription *obj);
|
||||
|
|
@ -382,7 +387,7 @@ void linphone_configure_op(LinphoneCore *lc, LinphonePrivate::SalOp *op, const L
|
|||
void linphone_configure_op_with_proxy(LinphoneCore *lc, LinphonePrivate::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact, LinphoneProxyConfig *proxy);
|
||||
LinphoneContent * linphone_content_new(void);
|
||||
LinphoneContent * linphone_content_copy(const LinphoneContent *ref);
|
||||
SalBodyHandler *sal_body_handler_from_content(const LinphoneContent *content);
|
||||
SalBodyHandler *sal_body_handler_from_content(const LinphoneContent *content, bool parseMultipart = true);
|
||||
SalReason linphone_reason_to_sal(LinphoneReason reason);
|
||||
LinphoneReason linphone_reason_from_sal(SalReason reason);
|
||||
void linphone_error_info_to_sal(const LinphoneErrorInfo* ei, SalErrorInfo* sei);
|
||||
|
|
@ -399,7 +404,7 @@ void linphone_event_set_state(LinphoneEvent *lev, LinphoneSubscriptionState stat
|
|||
void linphone_event_set_publish_state(LinphoneEvent *lev, LinphonePublishState state);
|
||||
void _linphone_event_notify_notify_response(const LinphoneEvent *lev);
|
||||
LinphoneSubscriptionState linphone_subscription_state_from_sal(SalSubscribeStatus ss);
|
||||
LinphoneContent *linphone_content_from_sal_body_handler(SalBodyHandler *ref);
|
||||
LinphoneContent *linphone_content_from_sal_body_handler(const SalBodyHandler *ref, bool parseMultipart = true);
|
||||
void linphone_core_invalidate_friend_subscriptions(LinphoneCore *lc);
|
||||
void linphone_core_register_offer_answer_providers(LinphoneCore *lc);
|
||||
|
||||
|
|
@ -501,6 +506,7 @@ void linphone_core_notify_configuring_status(LinphoneCore *lc, LinphoneConfiguri
|
|||
void linphone_core_notify_network_reachable(LinphoneCore *lc, bool_t reachable);
|
||||
|
||||
void linphone_core_notify_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char *notified_event, const LinphoneContent *body);
|
||||
void linphone_core_notify_subscribe_received(LinphoneCore *lc, LinphoneEvent *lev, const char *subscribe_event, const LinphoneContent *body);
|
||||
void linphone_core_notify_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state);
|
||||
void linphone_core_notify_publish_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphonePublishState state);
|
||||
void linphone_core_notify_log_collection_upload_state_changed(LinphoneCore *lc, LinphoneCoreLogCollectionUploadState state, const char *info);
|
||||
|
|
@ -558,6 +564,8 @@ LinphoneNatPolicy * linphone_config_create_nat_policy_from_section(const Linphon
|
|||
SalCustomHeader *linphone_info_message_get_headers (const LinphoneInfoMessage *im);
|
||||
void linphone_info_message_set_headers (LinphoneInfoMessage *im, const SalCustomHeader *headers);
|
||||
|
||||
void _linphone_core_set_log_handler(OrtpLogFunc logfunc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ struct _LinphoneProxyConfig
|
|||
char *refkey;
|
||||
char *sip_etag; /*publish context*/
|
||||
char *conference_factory_uri;
|
||||
|
||||
bool_t push_notification_allowed;
|
||||
};
|
||||
|
||||
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneProxyConfig);
|
||||
|
|
@ -450,17 +452,6 @@ struct _EchoTester {
|
|||
unsigned int rate;
|
||||
};
|
||||
|
||||
struct _LinphoneContent {
|
||||
belle_sip_object_t base;
|
||||
void *user_data;
|
||||
SalBodyHandler *body_handler;
|
||||
char *name; /**< used by RCS File transfer messages to store the original filename of the file to be downloaded from server */
|
||||
char *key; /**< used by RCS File transfer messages to store the key to encrypt file if needed */
|
||||
size_t keyLength; /**< Length of key in bytes */
|
||||
void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */
|
||||
bool_t owned_fields;
|
||||
};
|
||||
|
||||
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneContent);
|
||||
|
||||
struct _LinphoneBuffer {
|
||||
|
|
@ -824,6 +815,7 @@ namespace LinphonePrivate {
|
|||
char *update_check_current_version; \
|
||||
bctbx_list_t *chat_rooms; \
|
||||
bctbx_list_t *callsCache; \
|
||||
bool_t dns_set_by_app; \
|
||||
|
||||
#ifdef SQLITE_STORAGE_ENABLED
|
||||
#define LINPHONE_CORE_STRUCT_FIELDS \
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
|
|||
#include "linphone/core.h"
|
||||
#include "linphone/lpconfig.h"
|
||||
#include "linphone/sipsetup.h"
|
||||
|
||||
#include "mediastreamer2/mediastream.h"
|
||||
|
||||
#include "enum.h"
|
||||
|
|
@ -142,6 +143,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf
|
|||
cfg->avpf_rr_interval = lc ? !!lp_config_get_default_int(lc->config, "proxy", "avpf_rr_interval", 5) : 5;
|
||||
cfg->publish_expires= lc ? lp_config_get_default_int(lc->config, "proxy", "publish_expires", -1) : -1;
|
||||
cfg->publish = lc ? !!lp_config_get_default_int(lc->config, "proxy", "publish", FALSE) : FALSE;
|
||||
cfg->push_notification_allowed = lc ? !!lp_config_get_default_int(lc->config, "proxy", "push_notification_allowed", TRUE) : TRUE;
|
||||
cfg->refkey = refkey ? ms_strdup(refkey) : NULL;
|
||||
if (nat_policy_ref) {
|
||||
LinphoneNatPolicy *policy = linphone_config_create_nat_policy_from_section(lc->config,nat_policy_ref);
|
||||
|
|
@ -434,7 +436,7 @@ void linphone_proxy_config_enable_publish(LinphoneProxyConfig *cfg, bool_t val){
|
|||
}
|
||||
|
||||
void linphone_proxy_config_pause_register(LinphoneProxyConfig *cfg){
|
||||
if (cfg->op) cfg->op->stop_refreshing();
|
||||
if (cfg->op) cfg->op->stopRefreshing();
|
||||
}
|
||||
|
||||
void linphone_proxy_config_edit(LinphoneProxyConfig *cfg){
|
||||
|
|
@ -455,20 +457,16 @@ void linphone_proxy_config_apply(LinphoneProxyConfig *cfg,LinphoneCore *lc){
|
|||
|
||||
void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig * cfg){
|
||||
LinphoneAddress *contact_addr = NULL;
|
||||
{
|
||||
const SalAddress *sal_addr = cfg->op && cfg->state == LinphoneRegistrationOk
|
||||
? cfg->op->get_contact_address()
|
||||
: NULL;
|
||||
if (sal_addr) {
|
||||
char *buf = sal_address_as_string(sal_addr);
|
||||
contact_addr = buf ? linphone_address_new(buf) : NULL;
|
||||
ms_free(buf);
|
||||
}
|
||||
const SalAddress *sal_addr = cfg->op && cfg->state == LinphoneRegistrationOk ? cfg->op->getContactAddress() : NULL;
|
||||
if (sal_addr) {
|
||||
char *buf = sal_address_as_string(sal_addr);
|
||||
contact_addr = buf ? linphone_address_new(buf) : NULL;
|
||||
ms_free(buf);
|
||||
}
|
||||
|
||||
/*with udp, there is a risk of port reuse, so I prefer to not do anything for now*/
|
||||
if (contact_addr) {
|
||||
if (linphone_address_get_transport(contact_addr) != LinphoneTransportUdp) {
|
||||
if (linphone_address_get_transport(contact_addr) != LinphoneTransportUdp && lp_config_get_int(cfg->lc->config, "sip", "unregister_previous_contact", 0)) {
|
||||
if (cfg->pending_contact)
|
||||
linphone_address_unref(cfg->pending_contact);
|
||||
cfg->pending_contact=contact_addr;
|
||||
|
|
@ -540,10 +538,10 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){
|
|||
|
||||
guess_contact_for_register(cfg);
|
||||
if (cfg->contact_address)
|
||||
cfg->op->set_contact_address(L_GET_PRIVATE_FROM_C_OBJECT(cfg->contact_address)->getInternalAddress());
|
||||
cfg->op->set_user_pointer(cfg);
|
||||
cfg->op->setContactAddress(L_GET_PRIVATE_FROM_C_OBJECT(cfg->contact_address)->getInternalAddress());
|
||||
cfg->op->setUserPointer(cfg);
|
||||
|
||||
if (cfg->op->register_(
|
||||
if (cfg->op->sendRegister(
|
||||
proxy_string,
|
||||
cfg->reg_identity,
|
||||
cfg->expires,
|
||||
|
|
@ -570,7 +568,7 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *cfg){
|
|||
|
||||
void linphone_proxy_config_refresh_register(LinphoneProxyConfig *cfg){
|
||||
if (cfg->reg_sendregister && cfg->op && cfg->state!=LinphoneRegistrationProgress){
|
||||
if (cfg->op->register_refresh(cfg->expires) == 0) {
|
||||
if (cfg->op->refreshRegister(cfg->expires) == 0) {
|
||||
linphone_proxy_config_set_state(cfg,LinphoneRegistrationProgress, "Refresh registration");
|
||||
}
|
||||
}
|
||||
|
|
@ -852,7 +850,7 @@ LinphoneStatus linphone_proxy_config_done(LinphoneProxyConfig *cfg)
|
|||
if (res == LinphoneProxyConfigAddressDifferent) {
|
||||
_linphone_proxy_config_unregister(cfg);
|
||||
}
|
||||
cfg->op->set_user_pointer(NULL); /*we don't want to receive status for this un register*/
|
||||
cfg->op->setUserPointer(NULL); /*we don't want to receive status for this un register*/
|
||||
cfg->op->unref(); /*but we keep refresher to handle authentication if needed*/
|
||||
cfg->op=NULL;
|
||||
}
|
||||
|
|
@ -1047,7 +1045,7 @@ struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig
|
|||
const char *linphone_proxy_config_get_custom_header(LinphoneProxyConfig *cfg, const char *header_name){
|
||||
const SalCustomHeader *ch;
|
||||
if (!cfg->op) return NULL;
|
||||
ch = cfg->op->get_recv_custom_header();
|
||||
ch = cfg->op->getRecvCustomHeaders();
|
||||
return sal_custom_header_find(ch, header_name);
|
||||
}
|
||||
|
||||
|
|
@ -1189,6 +1187,7 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC
|
|||
lp_config_set_int(config,key,"dial_escape_plus",cfg->dial_escape_plus);
|
||||
lp_config_set_string(config,key,"dial_prefix",cfg->dial_prefix);
|
||||
lp_config_set_int(config,key,"privacy",(int)cfg->privacy);
|
||||
lp_config_set_int(config,key,"push_notification_allowed",(int)cfg->push_notification_allowed);
|
||||
if (cfg->refkey) lp_config_set_string(config,key,"refkey",cfg->refkey);
|
||||
lp_config_set_int(config, key, "publish_expires", cfg->publish_expires);
|
||||
|
||||
|
|
@ -1249,6 +1248,7 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc
|
|||
CONFIGURE_INT_VALUE(cfg,config,key,expires,"reg_expires", int)
|
||||
CONFIGURE_BOOL_VALUE(cfg,config,key,register,"reg_sendregister")
|
||||
CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"publish")
|
||||
linphone_proxy_config_set_push_notification_allowed(cfg, !!lp_config_get_int(config,key,"push_notification_allowed",linphone_proxy_config_is_push_notification_allowed(cfg)));
|
||||
linphone_proxy_config_set_avpf_mode(cfg,static_cast<LinphoneAVPFMode>(lp_config_get_int(config,key,"avpf",linphone_proxy_config_get_avpf_mode(cfg))));
|
||||
CONFIGURE_INT_VALUE(cfg,config,key,avpf_rr_interval,"avpf_rr_interval",uint8_t)
|
||||
CONFIGURE_INT_VALUE(cfg,config,key,dial_escape_plus,"dial_escape_plus",bool_t)
|
||||
|
|
@ -1416,7 +1416,7 @@ const LinphoneErrorInfo *linphone_proxy_config_get_error_info(const LinphoneProx
|
|||
}
|
||||
|
||||
const LinphoneAddress* linphone_proxy_config_get_service_route(const LinphoneProxyConfig* cfg) {
|
||||
return cfg->op?(const LinphoneAddress*) cfg->op->get_service_route():NULL;
|
||||
return cfg->op?(const LinphoneAddress*) cfg->op->getServiceRoute():NULL;
|
||||
}
|
||||
const char* linphone_proxy_config_get_transport(const LinphoneProxyConfig *cfg) {
|
||||
const char* addr=NULL;
|
||||
|
|
@ -1496,7 +1496,7 @@ const LinphoneAddress *linphone_proxy_config_get_contact (const LinphoneProxyCon
|
|||
// Warning : Do not remove, the op can change its contact_address
|
||||
if (!cfg->op)
|
||||
return NULL;
|
||||
const SalAddress *salAddr = cfg->op->get_contact_address();
|
||||
const SalAddress *salAddr = cfg->op->getContactAddress();
|
||||
if (!salAddr)
|
||||
return NULL;
|
||||
if (cfg->contact_address)
|
||||
|
|
@ -1538,7 +1538,7 @@ LinphoneNatPolicy * linphone_proxy_config_get_nat_policy(const LinphoneProxyConf
|
|||
|
||||
void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *cfg, LinphoneNatPolicy *policy) {
|
||||
if (policy != NULL) {
|
||||
policy = linphone_nat_policy_ref(policy); /* Prevent object destruction if the same policy is used */
|
||||
linphone_nat_policy_ref(policy); /* Prevent object destruction if the same policy is used */
|
||||
policy->lc = cfg->lc;
|
||||
}
|
||||
if (cfg->nat_policy != NULL) linphone_nat_policy_unref(cfg->nat_policy);
|
||||
|
|
@ -1578,3 +1578,11 @@ void linphone_proxy_config_set_conference_factory_uri(LinphoneProxyConfig *cfg,
|
|||
const char * linphone_proxy_config_get_conference_factory_uri(const LinphoneProxyConfig *cfg) {
|
||||
return cfg->conference_factory_uri;
|
||||
}
|
||||
|
||||
bool_t linphone_proxy_config_is_push_notification_allowed(const LinphoneProxyConfig *cfg) {
|
||||
return cfg->push_notification_allowed;
|
||||
}
|
||||
|
||||
void linphone_proxy_config_set_push_notification_allowed(LinphoneProxyConfig *cfg, bool_t is_allowed) {
|
||||
cfg->push_notification_allowed = is_allowed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "linphone/api/c-content.h"
|
||||
#include "linphone/core.h"
|
||||
|
||||
#include "private.h"
|
||||
#include "c-wrapper/internal/c-sal.h"
|
||||
#include "sal/sal.h"
|
||||
|
|
@ -378,7 +380,7 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
|
|||
sal_address_has_uri_param(salAddress, "maddr") ||
|
||||
linphone_address_get_port(request_uri) != 0) {
|
||||
ms_message("Publishing report with custom route %s", collector_uri);
|
||||
lev->op->set_route(collector_uri);
|
||||
lev->op->setRoute(collector_uri);
|
||||
}
|
||||
|
||||
if (linphone_event_send_publish(lev, content) != 0){
|
||||
|
|
@ -422,7 +424,7 @@ static const SalStreamDescription * get_media_stream_for_desc(const SalMediaDesc
|
|||
static void update_ip(LinphoneCall * call, int stats_type) {
|
||||
SalStreamType sal_stream_type = stats_type == LINPHONE_CALL_STATS_AUDIO ? SalAudio : stats_type == LINPHONE_CALL_STATS_VIDEO ? SalVideo : SalText;
|
||||
const SalStreamDescription * local_desc = get_media_stream_for_desc(_linphone_call_get_local_desc(call), sal_stream_type);
|
||||
const SalStreamDescription * remote_desc = get_media_stream_for_desc(L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp()->get_remote_media_description(), sal_stream_type);
|
||||
const SalStreamDescription * remote_desc = get_media_stream_for_desc(L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp()->getRemoteMediaDescription(), sal_stream_type);
|
||||
LinphoneCallLog *log = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getLog();
|
||||
|
||||
if (local_desc != NULL) {
|
||||
|
|
@ -442,7 +444,7 @@ static void update_ip(LinphoneCall * call, int stats_type) {
|
|||
if (strlen(remote_desc->rtp_addr) > 0) {
|
||||
STR_REASSIGN(log->reporting.reports[stats_type]->info.remote_addr.ip, ms_strdup(remote_desc->rtp_addr));
|
||||
} else {
|
||||
STR_REASSIGN(log->reporting.reports[stats_type]->info.remote_addr.ip, ms_strdup(L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp()->get_remote_media_description()->addr));
|
||||
STR_REASSIGN(log->reporting.reports[stats_type]->info.remote_addr.ip, ms_strdup(L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp()->getRemoteMediaDescription()->addr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -503,13 +505,12 @@ void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) {
|
|||
const LinphoneCallParams * current_params = linphone_call_get_current_params(call);
|
||||
LinphoneCallLog *log = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getLog();
|
||||
reporting_session_report_t * report = log->reporting.reports[stats_type];
|
||||
char * dialog_id;
|
||||
|
||||
// call->op might be already released if hanging up in state LinphoneCallOutgoingInit
|
||||
if (!media_report_enabled(call, stats_type) || !L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp())
|
||||
return;
|
||||
|
||||
dialog_id = L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp()->get_dialog_id();
|
||||
std::string dialogId = L_GET_PRIVATE_FROM_C_OBJECT(call)->getOp()->getDialogId();
|
||||
|
||||
STR_REASSIGN(report->info.call_id, ms_strdup(log->call_id));
|
||||
|
||||
|
|
@ -519,13 +520,13 @@ void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) {
|
|||
// RFC states: "LocalGroupID provides the identification for the purposes
|
||||
// of aggregation for the local endpoint.".
|
||||
STR_REASSIGN(report->info.local_addr.group, ms_strdup_printf("%s-%s-%s"
|
||||
, dialog_id ? dialog_id : ""
|
||||
, dialogId.c_str()
|
||||
, "local"
|
||||
, report->local_metrics.user_agent ? report->local_metrics.user_agent : ""
|
||||
)
|
||||
);
|
||||
STR_REASSIGN(report->info.remote_addr.group, ms_strdup_printf("%s-%s-%s"
|
||||
, dialog_id ? dialog_id : ""
|
||||
, dialogId.c_str()
|
||||
, "remote"
|
||||
, report->remote_metrics.user_agent ? report->remote_metrics.user_agent : ""
|
||||
)
|
||||
|
|
@ -580,7 +581,7 @@ void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) {
|
|||
}
|
||||
}
|
||||
|
||||
STR_REASSIGN(report->dialog_id, ms_strdup_printf("%s;%u", dialog_id ? dialog_id : "", report->info.local_addr.ssrc));
|
||||
STR_REASSIGN(report->dialog_id, ms_strdup_printf("%s;%u", dialogId.c_str(), report->info.local_addr.ssrc));
|
||||
|
||||
if (local_payload != NULL) {
|
||||
report->local_metrics.session_description.payload_type = local_payload->type;
|
||||
|
|
@ -595,8 +596,6 @@ void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) {
|
|||
report->remote_metrics.session_description.sample_rate = remote_payload->clock_rate;
|
||||
STR_REASSIGN(report->remote_metrics.session_description.fmtp, ms_strdup(remote_payload->recv_fmtp));
|
||||
}
|
||||
|
||||
ms_free(dialog_id);
|
||||
}
|
||||
|
||||
/* generate random float in interval ] 0.9 t ; 1.1 t [*/
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ extern "C" {
|
|||
LINPHONE_PUBLIC LinphoneVcardContext *linphone_core_get_vcard_context(const LinphoneCore *lc);
|
||||
LINPHONE_PUBLIC bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc);
|
||||
LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const char *dest, char *result);
|
||||
LINPHONE_PUBLIC int linphone_core_get_local_ip_for(int type, const char *dest, char *result);
|
||||
LINPHONE_PUBLIC void linphone_core_enable_forced_ice_relay(LinphoneCore *lc, bool_t enable);
|
||||
LINPHONE_PUBLIC void linphone_core_set_zrtp_not_available_simulation(LinphoneCore *lc, bool_t enabled);
|
||||
LINPHONE_PUBLIC belle_http_provider_t *linphone_core_get_http_provider(const LinphoneCore *lc);
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ bool_t linphone_vcard_generate_unique_id(LinphoneVcard *vCard) {
|
|||
if (linphone_vcard_get_uid(vCard)) {
|
||||
return FALSE;
|
||||
}
|
||||
if (LinphonePrivate::Sal::generate_uuid(uuid, sizeof(uuid)) == 0) {
|
||||
if (LinphonePrivate::Sal::generateUuid(uuid, sizeof(uuid)) == 0) {
|
||||
char vcard_uuid[sizeof(uuid)+4];
|
||||
snprintf(vcard_uuid, sizeof(vcard_uuid), "urn:%s", uuid);
|
||||
linphone_vcard_set_uid(vCard, vcard_uuid);
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ static void cleanup_dead_vtable_refs(LinphoneCore *lc){
|
|||
lc->vtable_notify_recursion--;
|
||||
|
||||
void linphone_core_notify_global_state_changed(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message) {
|
||||
L_GET_PRIVATE_FROM_C_OBJECT(lc)->notifyGlobalStateChanged(gstate);
|
||||
NOTIFY_IF_EXIST(global_state_changed,lc,gstate,message);
|
||||
cleanup_dead_vtable_refs(lc);
|
||||
}
|
||||
|
|
@ -243,7 +244,7 @@ void linphone_core_notify_configuring_status(LinphoneCore *lc, LinphoneConfiguri
|
|||
}
|
||||
|
||||
void linphone_core_notify_network_reachable(LinphoneCore *lc, bool_t reachable) {
|
||||
L_GET_PRIVATE_FROM_C_OBJECT(lc)->notifyNetworkReachable(!!lc->sip_network_reachable, lc->media_network_reachable);
|
||||
L_GET_PRIVATE_FROM_C_OBJECT(lc)->notifyNetworkReachable(!!lc->sip_network_reachable, !!lc->media_network_reachable);
|
||||
NOTIFY_IF_EXIST(network_reachable, lc,reachable);
|
||||
cleanup_dead_vtable_refs(lc);
|
||||
}
|
||||
|
|
@ -253,6 +254,11 @@ void linphone_core_notify_notify_received(LinphoneCore *lc, LinphoneEvent *lev,
|
|||
cleanup_dead_vtable_refs(lc);
|
||||
}
|
||||
|
||||
void linphone_core_notify_subscribe_received(LinphoneCore *lc, LinphoneEvent *lev, const char *subscribe_event, const LinphoneContent *body) {
|
||||
NOTIFY_IF_EXIST_INTERNAL(subscribe_received, linphone_event_is_internal(lev), lc, lev, subscribe_event, body);
|
||||
cleanup_dead_vtable_refs(lc);
|
||||
}
|
||||
|
||||
void linphone_core_notify_subscription_state_changed(LinphoneCore *lc, LinphoneEvent *lev, LinphoneSubscriptionState state) {
|
||||
NOTIFY_IF_EXIST_INTERNAL(subscription_state_changed,linphone_event_is_internal(lev), lc,lev,state);
|
||||
cleanup_dead_vtable_refs(lc);
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ set(DAEMON_SOURCE_FILES
|
|||
commands/msfilter-add-fmtp.h
|
||||
commands/netsim.cc
|
||||
commands/netsim.h
|
||||
commands/play.cc
|
||||
commands/play.h
|
||||
commands/play-wav.cc
|
||||
commands/play-wav.h
|
||||
commands/pop-event.cc
|
||||
|
|
|
|||
233
daemon/commands/play.cc
Normal file
233
daemon/commands/play.cc
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
/*
|
||||
play-wav.cc
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#include "play.h"
|
||||
#include "call.h"
|
||||
#include <utility>
|
||||
using namespace std;
|
||||
#define VOIDPTR_TO_INT(p) ((int)(intptr_t)(p))
|
||||
|
||||
void IncallPlayerStartCommand::onEof(LinphonePlayer *player){
|
||||
pair<int, Daemon *> *callPlayingData = (pair<int, Daemon *> *)linphone_player_get_user_data(player);
|
||||
Daemon *app = callPlayingData->second;
|
||||
int id = callPlayingData->first;
|
||||
app->callPlayingComplete(id);
|
||||
delete callPlayingData;
|
||||
linphone_player_set_user_data(player, NULL);
|
||||
}
|
||||
|
||||
|
||||
IncallPlayerStartCommand::IncallPlayerStartCommand() :
|
||||
DaemonCommand("incall-player-start", "incall-player-start <filename> [<call_id>]",
|
||||
"Play a WAV audio file or a MKV audio/video file. The played media stream will be sent through \n"
|
||||
"the RTP session of the given call.\n"
|
||||
"<filename> is the file to be played.\n") {
|
||||
addExample(new DaemonCommandExample("incall-player-start /usr/local/share/sounds/linphone/hello8000.wav 1",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-start /usr/local/share/sounds/linphone/hello8000.wav 1",
|
||||
"Status: Error\n"
|
||||
"Reason: No call with such id."));
|
||||
addExample(new DaemonCommandExample("incall-player-start /usr/local/share/sounds/linphone/hello8000.wav",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-start /usr/local/share/sounds/linphone/hello8000.wav",
|
||||
"Status: Error\n"
|
||||
"Reason: No active call."));
|
||||
}
|
||||
|
||||
void IncallPlayerStartCommand::exec(Daemon *app, const string& args) {
|
||||
LinphoneCall *call = NULL;
|
||||
int cid;
|
||||
const MSList *elem;
|
||||
istringstream ist(args);
|
||||
string filename;
|
||||
|
||||
ist >> filename;
|
||||
if (ist.eof() && (filename.length() == 0)) {
|
||||
app->sendResponse(Response("Missing filename parameter.", Response::Error));
|
||||
return;
|
||||
}
|
||||
if (ist.fail()) {
|
||||
app->sendResponse(Response("Incorrect filename parameter.", Response::Error));
|
||||
return;
|
||||
}
|
||||
|
||||
ist >> cid;
|
||||
if (ist.fail()) {
|
||||
elem = linphone_core_get_calls(app->getCore());
|
||||
if (elem != NULL && elem->next == NULL) {
|
||||
call = (LinphoneCall*)elem->data;
|
||||
}
|
||||
} else {
|
||||
call = app->findCall(cid);
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No call with such id."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No active call."));
|
||||
return;
|
||||
}
|
||||
LinphonePlayer *p = linphone_call_get_player(call);
|
||||
|
||||
LinphonePlayerCbs *cbs=linphone_player_get_callbacks(p);
|
||||
|
||||
pair<int, Daemon *> *callPlayingData = (pair<int, Daemon *> *)linphone_player_get_user_data(p);
|
||||
if(callPlayingData) callPlayingData = new pair<int, Daemon *>({
|
||||
VOIDPTR_TO_INT(linphone_call_get_user_data(call)),
|
||||
app
|
||||
});
|
||||
linphone_player_set_user_data(p, callPlayingData);
|
||||
linphone_player_cbs_set_eof_reached(cbs, onEof);
|
||||
linphone_player_open(p,filename.c_str());
|
||||
linphone_player_start(p);
|
||||
app->sendResponse(Response());
|
||||
}
|
||||
|
||||
|
||||
IncallPlayerStopCommand::IncallPlayerStopCommand() :
|
||||
DaemonCommand("incall-player-stop", "incall-player-stop [<call_id>]","Close the opened file.\n") {
|
||||
addExample(new DaemonCommandExample("incall-player-stop 1",
|
||||
"Status: Error\n"
|
||||
"Reason: No call with such id."));
|
||||
addExample(new DaemonCommandExample("incall-player-stop 1",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-stop",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-stop",
|
||||
"Status: Error\n"
|
||||
"Reason: No active call."));
|
||||
}
|
||||
|
||||
void IncallPlayerStopCommand::exec(Daemon *app, const string& args) {
|
||||
LinphoneCall *call = NULL;
|
||||
int cid;
|
||||
const MSList *elem;
|
||||
istringstream ist(args);
|
||||
ist >> cid;
|
||||
if (ist.fail()) {
|
||||
elem = linphone_core_get_calls(app->getCore());
|
||||
if (elem != NULL && elem->next == NULL) {
|
||||
call = (LinphoneCall*)elem->data;
|
||||
}
|
||||
} else {
|
||||
call = app->findCall(cid);
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No call with such id."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No active call."));
|
||||
return;
|
||||
}
|
||||
|
||||
LinphonePlayer *p = linphone_call_get_player(call);
|
||||
|
||||
linphone_player_close(p);
|
||||
app->sendResponse(Response());
|
||||
pair<int, Daemon *> *callPlayingData = (pair<int, Daemon *> *)linphone_player_get_user_data(p);
|
||||
if(callPlayingData) delete callPlayingData;
|
||||
}
|
||||
|
||||
IncallPlayerPauseCommand::IncallPlayerPauseCommand() :
|
||||
DaemonCommand("incall-player-pause", "incall-player-pause [<call_id>]",
|
||||
"Pause the playing of a file.\n") {
|
||||
addExample(new DaemonCommandExample("incall-player-pause 1",
|
||||
"Status: Error\n"
|
||||
"Reason: No call with such id."));
|
||||
addExample(new DaemonCommandExample("incall-player-pause 1",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-pause",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-pause",
|
||||
"Status: Error\n"
|
||||
"Reason: No active call."));
|
||||
}
|
||||
|
||||
void IncallPlayerPauseCommand::exec(Daemon *app, const string& args) {
|
||||
LinphoneCall *call = NULL;
|
||||
int cid;
|
||||
const MSList *elem;
|
||||
istringstream ist(args);
|
||||
ist >> cid;
|
||||
if (ist.fail()) {
|
||||
elem = linphone_core_get_calls(app->getCore());
|
||||
if (elem != NULL && elem->next == NULL) {
|
||||
call = (LinphoneCall*)elem->data;
|
||||
}
|
||||
} else {
|
||||
call = app->findCall(cid);
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No call with such id."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No active call."));
|
||||
return;
|
||||
}
|
||||
|
||||
LinphonePlayer *p = linphone_call_get_player(call);
|
||||
linphone_player_pause(p);
|
||||
app->sendResponse(Response());
|
||||
}
|
||||
|
||||
IncallPlayerResumeCommand::IncallPlayerResumeCommand() :
|
||||
DaemonCommand("incall-player-resume", "incall-player-resume [<call_id>]",
|
||||
"Unpause the playing of a file.\n") {
|
||||
addExample(new DaemonCommandExample("incall-player-resume 1",
|
||||
"Status: Error\n"
|
||||
"Reason: No call with such id."));
|
||||
addExample(new DaemonCommandExample("incall-player-resume 1",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-resume",
|
||||
"Status: Ok\n"));
|
||||
addExample(new DaemonCommandExample("incall-player-resume",
|
||||
"Status: Error\n"
|
||||
"Reason: No active call."));
|
||||
}
|
||||
|
||||
void IncallPlayerResumeCommand::exec(Daemon *app, const string& args) {
|
||||
LinphoneCall *call = NULL;
|
||||
int cid;
|
||||
const MSList *elem;
|
||||
istringstream ist(args);
|
||||
ist >> cid;
|
||||
if (ist.fail()) {
|
||||
elem = linphone_core_get_calls(app->getCore());
|
||||
if (elem != NULL && elem->next == NULL) {
|
||||
call = (LinphoneCall*)elem->data;
|
||||
}
|
||||
} else {
|
||||
call = app->findCall(cid);
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No call with such id."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (call == NULL) {
|
||||
app->sendResponse(Response("No active call."));
|
||||
return;
|
||||
}
|
||||
|
||||
LinphonePlayer *p = linphone_call_get_player(call);
|
||||
linphone_player_start(p);
|
||||
app->sendResponse(Response());
|
||||
}
|
||||
55
daemon/commands/play.h
Normal file
55
daemon/commands/play.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
play-wav.h
|
||||
Copyright (C) 2016 Belledonne Communications, Grenoble, France
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
#ifndef LINPHONE_DAEMON_COMMAND_PLAY_H_
|
||||
#define LINPHONE_DAEMON_COMMAND_PLAY_H_
|
||||
|
||||
#include "daemon.h"
|
||||
|
||||
class IncallPlayerStartCommand: public DaemonCommand {
|
||||
public:
|
||||
IncallPlayerStartCommand();
|
||||
|
||||
void exec (Daemon *app, const std::string& args) override;
|
||||
|
||||
private:
|
||||
static void onEof(LinphonePlayer *player);
|
||||
};
|
||||
|
||||
class IncallPlayerStopCommand: public DaemonCommand {
|
||||
public:
|
||||
IncallPlayerStopCommand();
|
||||
|
||||
void exec (Daemon *app, const std::string& args) override;
|
||||
};
|
||||
|
||||
class IncallPlayerPauseCommand: public DaemonCommand {
|
||||
public:
|
||||
IncallPlayerPauseCommand();
|
||||
|
||||
void exec (Daemon *app, const std::string& args) override;
|
||||
};
|
||||
|
||||
class IncallPlayerResumeCommand: public DaemonCommand {
|
||||
public:
|
||||
IncallPlayerResumeCommand();
|
||||
|
||||
void exec (Daemon *app, const std::string& args) override;
|
||||
};
|
||||
#endif // LINPHONE_DAEMON_COMMAND_PLAY_H_
|
||||
|
|
@ -95,10 +95,10 @@ void RegisterInfoCommand::exec(Daemon *app, const string& args) {
|
|||
int id;
|
||||
try {
|
||||
id = atoi(param.c_str());
|
||||
} catch (invalid_argument) {
|
||||
} catch (invalid_argument&) {
|
||||
app->sendResponse(Response("Invalid ID.", Response::Error));
|
||||
return;
|
||||
} catch (out_of_range) {
|
||||
} catch (out_of_range&) {
|
||||
app->sendResponse(Response("Out of range ID.", Response::Error));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include "commands/netsim.h"
|
||||
#include "commands/cn.h"
|
||||
#include "commands/version.h"
|
||||
#include "commands/play.h"
|
||||
|
||||
#include "private.h"
|
||||
using namespace std;
|
||||
|
|
@ -121,13 +122,18 @@ void *Daemon::iterateThread(void *arg) {
|
|||
}
|
||||
|
||||
EventResponse::EventResponse(Daemon *daemon, LinphoneCall *call, LinphoneCallState state) {
|
||||
LinphoneCallLog *callLog = linphone_call_get_call_log(call);
|
||||
const LinphoneAddress *fromAddr = linphone_call_log_get_from_address(callLog);
|
||||
char *fromStr = linphone_address_as_string(fromAddr);
|
||||
|
||||
ostringstream ostr;
|
||||
char *remote = linphone_call_get_remote_address_as_string(call);
|
||||
ostr << "Event-type: call-state-changed\nEvent: " << linphone_call_state_to_string(state) << "\n";
|
||||
ostr << "From: " << remote << "\n";
|
||||
ostr << "Event-type: call-state-changed" << "\n";
|
||||
ostr << "Event: " << linphone_call_state_to_string(state) << "\n";
|
||||
ostr << "From: " << fromStr << "\n";
|
||||
ostr << "Id: " << daemon->updateCallId(call) << "\n";
|
||||
setBody(ostr.str().c_str());
|
||||
ms_free(remote);
|
||||
|
||||
bctbx_free(fromStr);
|
||||
}
|
||||
|
||||
DtmfResponse::DtmfResponse(Daemon *daemon, LinphoneCall *call, int dtmf) {
|
||||
|
|
@ -214,6 +220,15 @@ AudioStreamStatsResponse::AudioStreamStatsResponse(Daemon* daemon, AudioStream*
|
|||
setBody(ostr.str().c_str());
|
||||
}
|
||||
|
||||
CallPlayingStatsResponse::CallPlayingStatsResponse(Daemon* daemon, int id) {
|
||||
ostringstream ostr;
|
||||
|
||||
ostr << "Event-type: call-playing-complete\n";
|
||||
ostr << "Id: " << id << "\n";
|
||||
|
||||
setBody(ostr.str().c_str());
|
||||
}
|
||||
|
||||
PayloadTypeResponse::PayloadTypeResponse(LinphoneCore *core, const PayloadType *payloadType, int index, const string &prefix, bool enabled_status) {
|
||||
ostringstream ostr;
|
||||
if (payloadType != NULL) {
|
||||
|
|
@ -486,6 +501,10 @@ void Daemon::initCommands() {
|
|||
mCommands.push_back(new ConfigSetCommand());
|
||||
mCommands.push_back(new NetsimCommand());
|
||||
mCommands.push_back(new CNCommand());
|
||||
mCommands.push_back(new IncallPlayerStartCommand());
|
||||
mCommands.push_back(new IncallPlayerStopCommand());
|
||||
mCommands.push_back(new IncallPlayerPauseCommand());
|
||||
mCommands.push_back(new IncallPlayerResumeCommand());
|
||||
mCommands.sort(compareCommands);
|
||||
}
|
||||
|
||||
|
|
@ -524,6 +543,10 @@ void Daemon::callStatsUpdated(LinphoneCall *call, const LinphoneCallStats *stats
|
|||
}
|
||||
}
|
||||
|
||||
void Daemon::callPlayingComplete(int id) {
|
||||
mEventQueue.push(new CallPlayingStatsResponse(this, id));
|
||||
}
|
||||
|
||||
void Daemon::dtmfReceived(LinphoneCall *call, int dtmf) {
|
||||
mEventQueue.push(new DtmfResponse(this, call, dtmf));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,6 +160,11 @@ public:
|
|||
const LinphoneCallStats *stats, bool event);
|
||||
};
|
||||
|
||||
class CallPlayingStatsResponse: public Response {
|
||||
public:
|
||||
CallPlayingStatsResponse(Daemon *daemon, int id);
|
||||
};
|
||||
|
||||
class DtmfResponse: public Response {
|
||||
public:
|
||||
DtmfResponse(Daemon *daemon, LinphoneCall *call, int dtmf);
|
||||
|
|
@ -230,7 +235,7 @@ public:
|
|||
void dumpCommandsHelpHtml();
|
||||
void enableStatsEvents(bool enabled);
|
||||
void enableLSD(bool enabled);
|
||||
|
||||
void callPlayingComplete(int id);
|
||||
void setAutoVideo( bool enabled ){ mAutoVideo = enabled; }
|
||||
inline bool autoVideo(){ return mAutoVideo; }
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ set(ROOT_HEADER_FILES
|
|||
chat.h
|
||||
conference.h
|
||||
contactprovider.h
|
||||
content.h
|
||||
core_utils.h
|
||||
core.h
|
||||
defs.h
|
||||
|
|
@ -85,10 +84,12 @@ set(C_API_HEADER_FILES
|
|||
c-chat-message.h
|
||||
c-chat-room-cbs.h
|
||||
c-chat-room.h
|
||||
c-content.h
|
||||
c-dial-plan.h
|
||||
c-event-log.h
|
||||
c-magic-search.h
|
||||
c-participant.h
|
||||
c-participant-imdn-state.h
|
||||
c-search-result.h
|
||||
c-types.h
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ linphone_include_HEADERS=\
|
|||
chat.h \
|
||||
conference.h \
|
||||
contactprovider.h \
|
||||
content.h \
|
||||
core.h \
|
||||
core_utils.h \
|
||||
defs.h \
|
||||
|
|
|
|||
|
|
@ -33,302 +33,302 @@ extern "C" {
|
|||
|
||||
/**
|
||||
* Callback to notify a response of server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] status The status of the LinphoneAccountCreator test existence operation that has just finished
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] status The status of the #LinphoneAccountCreator test existence operation that has just finished
|
||||
**/
|
||||
typedef void (*LinphoneAccountCreatorCbsStatusCb)(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp);
|
||||
|
||||
/************************** Start Account Creator data **************************/
|
||||
|
||||
/**
|
||||
* Create a LinphoneAccountCreator and set Linphone Request callbacks.
|
||||
* @param[in] core The LinphoneCore used for the XML-RPC communication
|
||||
* Create a #LinphoneAccountCreator and set Linphone Request callbacks.
|
||||
* @param[in] core The #LinphoneCore used for the XML-RPC communication
|
||||
* @param[in] xmlrpc_url The URL to the XML-RPC server. Must be NON NULL.
|
||||
* @return The new LinphoneAccountCreator object.
|
||||
* @return The new #LinphoneAccountCreator object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_new(LinphoneCore *core, const char *xmlrpc_url);
|
||||
|
||||
|
||||
/**
|
||||
* Reset the account creator entries like username, password, phone number...
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_reset(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to know the existence of account on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to create an account on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to know if an account is activated on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to activate an account on server.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to link an account to an alias.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to activate an alias.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to know if an alias is used.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to know if an account is linked.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to recover an account.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Send a request to update an account.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Acquire a reference to the LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object.
|
||||
* @return The same LinphoneAccountCreator object.
|
||||
* @param[in] creator #LinphoneAccountCreator object.
|
||||
* @return The same #LinphoneAccountCreator object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_ref(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Release reference to the LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object.
|
||||
* @param[in] creator #LinphoneAccountCreator object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_unref(LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with the LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object.
|
||||
* @param[in] creator #LinphoneAccountCreator object.
|
||||
* @return The user pointer associated with the LinphoneAccountCreator.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_account_creator_get_user_data(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to the LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object.
|
||||
* @param[in] creator #LinphoneAccountCreator object.
|
||||
* @param[in] ud The user pointer to associate with the LinphoneAccountCreator.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, void *ud);
|
||||
|
||||
/**
|
||||
* Set the username.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] username The username to set
|
||||
* @return LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username);
|
||||
|
||||
/**
|
||||
* Get the username.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The username of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The username of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_username(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the phone number normalized.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] phone_number The phone number to set
|
||||
* @param[in] country_code Country code to associate phone number with
|
||||
* @return LinphoneAccountCreatorPhoneNumberStatusOk if everything is OK, or specific(s) error(s) otherwise.
|
||||
* @return #LinphoneAccountCreatorPhoneNumberStatusOk if everything is OK, or specific(s) error(s) otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorPhoneNumberStatusMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code);
|
||||
|
||||
/**
|
||||
* Get the RFC 3966 normalized phone number.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The phone number of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The phone number of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_phone_number(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the password.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] password The password to set
|
||||
* @return LinphoneAccountCreatorPasswordStatusOk if everything is OK, or specific(s) error(s) otherwise.
|
||||
* @return #LinphoneAccountCreatorPasswordStatusOk if everything is OK, or specific(s) error(s) otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password);
|
||||
|
||||
/**
|
||||
* Get the password.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The password of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The password of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_password(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the ha1.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] ha1 The ha1 to set
|
||||
* @return LinphoneAccountCreatorPasswordStatusOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorPasswordStatusOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1);
|
||||
|
||||
/**
|
||||
* Get the ha1.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The ha1 of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The ha1 of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_ha1(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the activation code.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] activation_code The activation code to set
|
||||
* @return LinphoneAccountCreatorActivationCodeStatusOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorActivationCodeStatusOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorActivationCodeStatus linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code);
|
||||
|
||||
/**
|
||||
* Get the activation code.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The activation code of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The activation code of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_activation_code(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the language to use in email or SMS if supported.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] lang The language to use
|
||||
* @return LinphoneAccountCreatorLanguageStatusOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorLanguageStatusOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorLanguageStatus linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang);
|
||||
|
||||
/**
|
||||
* Get the language use in email of SMS.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The language of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The language of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_language(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the display name.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] display_name The display name to set
|
||||
* @return LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name);
|
||||
|
||||
/**
|
||||
* Get the display name.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The display name of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The display name of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_display_name(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the email.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] email The email to set
|
||||
* @return LinphoneAccountCreatorEmailStatusOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorEmailStatusOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorEmailStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email);
|
||||
|
||||
/**
|
||||
* Get the email.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The email of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The email of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_email(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the domain.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] domain The domain to set
|
||||
* @return LinphoneAccountCreatorDomainOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorDomainOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorDomainStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain);
|
||||
|
||||
/**
|
||||
* Get the domain.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The domain of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The domain of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_account_creator_get_domain(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set Transport
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] transport The transport to set
|
||||
* @return LinphoneAccountCreatorTransportOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorTransportOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorTransportStatus linphone_account_creator_set_transport(LinphoneAccountCreator *creator, LinphoneTransportType transport);
|
||||
|
||||
/**
|
||||
* get Transport
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The transport of LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The transport of #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneTransportType linphone_account_creator_get_transport(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Set the route.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @param[in] route The route to set
|
||||
* @return LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise.
|
||||
* @return #LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise.
|
||||
**/
|
||||
LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route);
|
||||
|
||||
/**
|
||||
* Get the route.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The route of the LinphoneAccountCreator
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The route of the #LinphoneAccountCreator
|
||||
**/
|
||||
LINPHONE_DEPRECATED LINPHONE_PUBLIC const char * linphone_account_creator_get_route(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Get the LinphoneAccountCreatorCbs object associated with a LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The LinphoneAccountCreatorCbs object associated with the LinphoneAccountCreator.
|
||||
* Get the #LinphoneAccountCreatorCbs object associated with a LinphoneAccountCreator.
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The #LinphoneAccountCreatorCbs object associated with the LinphoneAccountCreator.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_get_callbacks(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Get the LinphoneAccountCreatorService object associated with a LinphoneAccountCreator.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return The LinphoneAccountCreatorService object associated with the LinphoneAccountCreator.
|
||||
* Get the #LinphoneAccountCreatorService object associated with a LinphoneAccountCreator.
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return The #LinphoneAccountCreatorService object associated with the LinphoneAccountCreator.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_get_service(const LinphoneAccountCreator *creator);
|
||||
|
|
@ -338,168 +338,168 @@ LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_get_ser
|
|||
/************************** Start Account Creator Cbs **************************/
|
||||
|
||||
/**
|
||||
* Acquire a reference to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @return The same LinphoneAccountCreatorCbs object.
|
||||
* Acquire a reference to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The same #LinphoneAccountCreatorCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_cbs_ref(LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Release a reference to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Release a reference to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_unref(LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @return The user pointer associated with the LinphoneAccountCreatorCbs object.
|
||||
* Retrieve the user pointer associated with a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The user pointer associated with the #LinphoneAccountCreatorCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_account_creator_cbs_get_user_data(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] ud The user pointer to associate with the LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] ud The user pointer to associate with the #LinphoneAccountCreatorCbs object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, void *ud);
|
||||
|
||||
/**
|
||||
* Get the create account request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current create account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_create_account(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The create account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_create_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the is account exist request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current is account exist request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_exist(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The is account exist request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_exist(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the activate account request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current activate account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_account(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The activate account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the is account activated request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current is account activated request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_activated(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The is account activated request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_activated(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the link account request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current link account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_link_account(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The link account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_link_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the activate alias request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current link account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_alias(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The activate alias request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_alias(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the is alias used request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current is alias used request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_alias_used(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The is alias used request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_alias_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the is account linked request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current is account linked request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_linked(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The is account linked request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_linked(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the recover account request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current recover account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_recover_account(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The recover account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_recover_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
||||
/**
|
||||
* Get the update account request.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @return The current update account request.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_update_account(const LinphoneAccountCreatorCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs LinphoneAccountCreatorCbs object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cbs #LinphoneAccountCreatorCbs object.
|
||||
* @param[in] cb The update account request to be used.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb);
|
||||
|
|
@ -508,15 +508,15 @@ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_account(LinphoneAcc
|
|||
|
||||
/**
|
||||
* Create and configure a proxy config and a authentication info for an account creator
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return A LinphoneProxyConfig object if successful, NULL otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return A #LinphoneProxyConfig object if successful, NULL otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneProxyConfig * linphone_account_creator_create_proxy_config(const LinphoneAccountCreator *creator);
|
||||
|
||||
/**
|
||||
* Configure an account (create a proxy config and authentication info for it).
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @return A LinphoneProxyConfig object if successful, NULL otherwise
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
* @return A #LinphoneProxyConfig object if successful, NULL otherwise
|
||||
**/
|
||||
LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCreator *creator);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ extern "C" {
|
|||
|
||||
/**
|
||||
* Function to set custom server request.
|
||||
* @param[in] creator LinphoneAccountCreator object
|
||||
* @param[in] creator #LinphoneAccountCreator object
|
||||
*/
|
||||
typedef LinphoneAccountCreatorStatus (*LinphoneAccountCreatorRequestFunc)(LinphoneAccountCreator *creator);
|
||||
|
||||
|
|
@ -40,46 +40,46 @@ typedef LinphoneAccountCreatorStatus (*LinphoneAccountCreatorRequestFunc)(Linpho
|
|||
/************************** Start Account Creator Requests **************************/
|
||||
|
||||
/**
|
||||
* Create a new LinphoneAccountCreatorService object.
|
||||
* @return a new LinphoneAccountCreatorService object.
|
||||
* Create a new #LinphoneAccountCreatorService object.
|
||||
* @return a new #LinphoneAccountCreatorService object.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_service_new(void);
|
||||
|
||||
/**
|
||||
* Acquire a reference to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @return The same LinphoneAccountCreatorService object.
|
||||
* Acquire a reference to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The same #LinphoneAccountCreatorService object.
|
||||
* @donotwrap
|
||||
**/
|
||||
LinphoneAccountCreatorService * linphone_account_creator_service_ref(LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Release a reference to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Release a reference to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @donotwrap
|
||||
**/
|
||||
void linphone_account_creator_service_unref(LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @return The user pointer associated with the LinphoneAccountCreatorService object.
|
||||
* Retrieve the user pointer associated with a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The user pointer associated with the #LinphoneAccountCreatorService object.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_account_creator_service_get_user_data(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] ud The user pointer to associate with the LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] ud The user pointer to associate with the #LinphoneAccountCreatorService object.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_account_creator_service_set_user_data(LinphoneAccountCreatorService *service, void *ud);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The constructor of account creator requests.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -87,15 +87,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_constructor_cb(Linphon
|
|||
|
||||
/**
|
||||
* Get the constructor of account creator requests.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current constructor of create account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_constructor_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The destructor.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -103,7 +103,7 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_destructor_cb(Linphone
|
|||
|
||||
/**
|
||||
* Get the destructor of create account request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current destructor of create account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -111,15 +111,15 @@ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_servi
|
|||
|
||||
/**
|
||||
* Get the create account request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current create account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_create_account_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The create account request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -127,15 +127,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_create_account_cb(Linp
|
|||
|
||||
/**
|
||||
* Get the is account exist request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current is account exist request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_exist_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The is account exist request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -143,15 +143,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_exist_cb(Li
|
|||
|
||||
/**
|
||||
* Get the activate account request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current activate account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_account_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The activate account request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -159,15 +159,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_activate_account_cb(Li
|
|||
|
||||
/**
|
||||
* Get the is account activated request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current is account activated request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_activated_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The is account activated request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -175,15 +175,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_activated_c
|
|||
|
||||
/**
|
||||
* Get the link account request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current link account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_link_account_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The link account request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -191,15 +191,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_link_account_cb(Linpho
|
|||
|
||||
/**
|
||||
* Get the activate alias request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current link account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_alias_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The activate alias request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -207,15 +207,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_activate_alias_cb(Linp
|
|||
|
||||
/**
|
||||
* Get the is alias used request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current is alias used request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_alias_used_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The is alias used request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -223,15 +223,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_alias_used_cb(Linph
|
|||
|
||||
/**
|
||||
* Get the is account linked request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current is account linked request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_linked_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The is account linked request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -239,15 +239,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_linked_cb(L
|
|||
|
||||
/**
|
||||
* Get the recover account request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current recover account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_recover_account_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The recover account request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -255,15 +255,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_recover_account_cb(Lin
|
|||
|
||||
/**
|
||||
* Get the update account request.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @return The current update account request.
|
||||
* @donotwrap
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_update_account_cb(const LinphoneAccountCreatorService *service);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneAccountCreatorService object.
|
||||
* @param[in] service LinphoneAccountCreatorService object.
|
||||
* Assign a user pointer to a #LinphoneAccountCreatorService object.
|
||||
* @param[in] service #LinphoneAccountCreatorService object.
|
||||
* @param[in] cb The update account request to be used.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -34,23 +34,23 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Constructs a LinphoneAddress object by parsing the user supplied address,
|
||||
* Constructs a #LinphoneAddress object by parsing the user supplied address,
|
||||
* given as a string.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAddress *linphone_address_new (const char *address);
|
||||
|
||||
/**
|
||||
* Clones a LinphoneAddress object.
|
||||
* Clones a #LinphoneAddress object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAddress *linphone_address_clone (const LinphoneAddress *address);
|
||||
|
||||
/**
|
||||
* Increment reference count of LinphoneAddress object.
|
||||
* Increment reference count of #LinphoneAddress object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAddress *linphone_address_ref (LinphoneAddress *address);
|
||||
|
||||
/**
|
||||
* Decrement reference count of LinphoneAddress object. When dropped to zero, memory is freed.
|
||||
* Decrement reference count of #LinphoneAddress object. When dropped to zero, memory is freed.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_address_unref (LinphoneAddress *address);
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ LINPHONE_PUBLIC const char *linphone_address_get_password (const LinphoneAddress
|
|||
/**
|
||||
* Set the password encoded in the address.
|
||||
* It is used for basic authentication (not recommended).
|
||||
* @param address the LinphoneAddress
|
||||
* @param address the #LinphoneAddress
|
||||
* @param password the password to set.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_address_set_password (LinphoneAddress *address, const char *password);
|
||||
|
|
@ -170,26 +170,26 @@ LINPHONE_PUBLIC char *linphone_address_as_string (const LinphoneAddress *address
|
|||
LINPHONE_PUBLIC char *linphone_address_as_string_uri_only (const LinphoneAddress *address);
|
||||
|
||||
/**
|
||||
* Compare two LinphoneAddress ignoring tags and headers, basically just domain, username, and port.
|
||||
* @param[in] address1 LinphoneAddress object
|
||||
* @param[in] address2 LinphoneAddress object
|
||||
* @return Boolean value telling if the LinphoneAddress objects are equal.
|
||||
* Compare two #LinphoneAddress ignoring tags and headers, basically just domain, username, and port.
|
||||
* @param[in] address1 #LinphoneAddress object
|
||||
* @param[in] address2 #LinphoneAddress object
|
||||
* @return Boolean value telling if the #LinphoneAddress objects are equal.
|
||||
* @see linphone_address_equal()
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_address_weak_equal (const LinphoneAddress *address1, const LinphoneAddress *address2);
|
||||
|
||||
/**
|
||||
* Compare two LinphoneAddress taking the tags and headers into account.
|
||||
* @param[in] address1 LinphoneAddress object
|
||||
* @param[in] address2 LinphoneAddress object
|
||||
* @return Boolean value telling if the LinphoneAddress objects are equal.
|
||||
* Compare two #LinphoneAddress taking the tags and headers into account.
|
||||
* @param[in] address1 #LinphoneAddress object
|
||||
* @param[in] address2 #LinphoneAddress object
|
||||
* @return Boolean value telling if the #LinphoneAddress objects are equal.
|
||||
* @see linphone_address_weak_equal()
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_address_equal (const LinphoneAddress *address1, const LinphoneAddress *address2);
|
||||
|
||||
/**
|
||||
* Get the header encoded in the address.
|
||||
* @param address the address
|
||||
* Get the header encoded in the address.
|
||||
* @param header_name the header name
|
||||
**/
|
||||
LINPHONE_PUBLIC const char *linphone_address_get_header (const LinphoneAddress *address, const char *header_name);
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ LINPHONE_PUBLIC void linphone_address_set_header (LinphoneAddress *address, cons
|
|||
|
||||
/**
|
||||
* Tell whether a parameter is present in the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] param_name The name of the parameter
|
||||
* @return A boolean value telling whether the parameter is present in the address
|
||||
*/
|
||||
|
|
@ -212,7 +212,7 @@ LINPHONE_PUBLIC bool_t linphone_address_has_param (const LinphoneAddress *addres
|
|||
|
||||
/**
|
||||
* Get the value of a parameter of the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] param_name The name of the parameter
|
||||
* @return The value of the parameter
|
||||
*/
|
||||
|
|
@ -220,7 +220,7 @@ LINPHONE_PUBLIC const char *linphone_address_get_param (const LinphoneAddress *a
|
|||
|
||||
/**
|
||||
* Set the value of a parameter of the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] param_name The name of the parameter
|
||||
* @param[in] param_value The new value of the parameter
|
||||
*/
|
||||
|
|
@ -230,7 +230,7 @@ LINPHONE_PUBLIC void linphone_address_set_params (LinphoneAddress *address, cons
|
|||
|
||||
/**
|
||||
* Tell whether a parameter is present in the URI of the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] uri_param_name The name of the parameter
|
||||
* @return A boolean value telling whether the parameter is present in the URI of the address
|
||||
*/
|
||||
|
|
@ -238,7 +238,7 @@ LINPHONE_PUBLIC bool_t linphone_address_has_uri_param (const LinphoneAddress *ad
|
|||
|
||||
/**
|
||||
* Get the value of a parameter of the URI of the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] uri_param_name The name of the parameter
|
||||
* @return The value of the parameter
|
||||
*/
|
||||
|
|
@ -246,7 +246,7 @@ LINPHONE_PUBLIC const char *linphone_address_get_uri_param (const LinphoneAddres
|
|||
|
||||
/**
|
||||
* Set the value of a parameter of the URI of the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] uri_param_name The name of the parameter
|
||||
* @param[in] uri_param_value The new value of the parameter
|
||||
*/
|
||||
|
|
@ -256,13 +256,13 @@ LINPHONE_PUBLIC void linphone_address_set_uri_params (LinphoneAddress *address,
|
|||
|
||||
/**
|
||||
* Removes the value of a parameter of the URI of the address
|
||||
* @param[in] address LinphoneAddress object
|
||||
* @param[in] address #LinphoneAddress object
|
||||
* @param[in] uri_param_name The name of the parameter
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_address_remove_uri_param (LinphoneAddress *address, const char *uri_param_name);
|
||||
|
||||
/**
|
||||
* Destroys a LinphoneAddress object (actually calls linphone_address_unref()).
|
||||
* Destroys a #LinphoneAddress object (actually calls linphone_address_unref()).
|
||||
* @deprecated Use linphone_address_unref() instead
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -23,17 +23,19 @@
|
|||
#include "linphone/utils/general.h"
|
||||
|
||||
#include "linphone/api/c-address.h"
|
||||
#include "linphone/api/c-call.h"
|
||||
#include "linphone/api/c-call-cbs.h"
|
||||
#include "linphone/api/c-call-stats.h"
|
||||
#include "linphone/api/c-call.h"
|
||||
#include "linphone/api/c-callbacks.h"
|
||||
#include "linphone/api/c-chat-message.h"
|
||||
#include "linphone/api/c-chat-message-cbs.h"
|
||||
#include "linphone/api/c-chat-room.h"
|
||||
#include "linphone/api/c-chat-message.h"
|
||||
#include "linphone/api/c-chat-room-cbs.h"
|
||||
#include "linphone/api/c-chat-room.h"
|
||||
#include "linphone/api/c-content.h"
|
||||
#include "linphone/api/c-dial-plan.h"
|
||||
#include "linphone/api/c-event-log.h"
|
||||
#include "linphone/api/c-participant.h"
|
||||
#include "linphone/api/c-participant-imdn-state.h"
|
||||
#include "linphone/api/c-magic-search.h"
|
||||
#include "linphone/api/c-search-result.h"
|
||||
#include "linphone/api/c-types.h"
|
||||
|
|
|
|||
|
|
@ -35,126 +35,126 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Acquire a reference to the LinphoneCallCbs object.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @return The same LinphoneCallCbs object.
|
||||
* Acquire a reference to the #LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The same #LinphoneCallCbs object.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_cbs_ref (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Release reference to the LinphoneCallCbs object.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* Release reference to the #LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_unref (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with the LinphoneCallCbs object.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @return The user pointer associated with the LinphoneCallCbs object.
|
||||
* Retrieve the user pointer associated with the #LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The user pointer associated with the #LinphoneCallCbs object.
|
||||
*/
|
||||
LINPHONE_PUBLIC void *linphone_call_cbs_get_user_data (const LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to the LinphoneCallCbs object.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] ud The user pointer to associate with the LinphoneCallCbs object.
|
||||
* Assign a user pointer to the #LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] ud The user pointer to associate with the #LinphoneCallCbs object.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_user_data (LinphoneCallCbs *cbs, void *ud);
|
||||
|
||||
/**
|
||||
* Get the dtmf received callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current dtmf received callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsDtmfReceivedCb linphone_call_cbs_get_dtmf_received (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the dtmf received callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The dtmf received callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_dtmf_received (LinphoneCallCbs *cbs, LinphoneCallCbsDtmfReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the encryption changed callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current encryption changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsEncryptionChangedCb linphone_call_cbs_get_encryption_changed (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the encryption changed callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The encryption changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_encryption_changed (LinphoneCallCbs *cbs, LinphoneCallCbsEncryptionChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the info message received callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current info message received callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsInfoMessageReceivedCb linphone_call_cbs_get_info_message_received (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the info message received callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The info message received callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_info_message_received (LinphoneCallCbs *cbs, LinphoneCallCbsInfoMessageReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the state changed callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current state changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsStateChangedCb linphone_call_cbs_get_state_changed (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the state changed callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The state changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_state_changed (LinphoneCallCbs *cbs, LinphoneCallCbsStateChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the stats updated callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current stats updated callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsStatsUpdatedCb linphone_call_cbs_get_stats_updated (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the stats updated callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The stats updated callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_stats_updated (LinphoneCallCbs *cbs, LinphoneCallCbsStatsUpdatedCb cb);
|
||||
|
||||
/**
|
||||
* Get the transfer state changed callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current transfer state changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsTransferStateChangedCb linphone_call_cbs_get_transfer_state_changed (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the transfer state changed callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The transfer state changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_transfer_state_changed (LinphoneCallCbs *cbs, LinphoneCallCbsTransferStateChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the ACK processing callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @return The current ack processing callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsAckProcessingCb linphone_call_cbs_get_ack_processing (LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set ACK processing callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cbs #LinphoneCallCbs object.
|
||||
* @param[in] cb The ack processing callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_ack_processing (LinphoneCallCbs *cbs, LinphoneCallCbsAckProcessingCb cb);
|
||||
|
|
@ -173,6 +173,34 @@ LINPHONE_PUBLIC LinphoneCallCbsTmmbrReceivedCb linphone_call_cbs_get_tmmbr_recei
|
|||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_tmmbr_received(LinphoneCallCbs *cbs, LinphoneCallCbsTmmbrReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the snapshot taken callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @return The current snapshot taken callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsSnapshotTakenCb linphone_call_cbs_get_snapshot_taken(LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the snapshot taken callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cb The snapshot taken callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_snapshot_taken(LinphoneCallCbs *cbs, LinphoneCallCbsSnapshotTakenCb cb);
|
||||
|
||||
/**
|
||||
* Get the next video frame decoded callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @return The current next video frame decoded callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbsNextVideoFrameDecodedCb linphone_call_cbs_get_next_video_frame_decoded(LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the next video frame decoded callback.
|
||||
* @param[in] cbs LinphoneCallCbs object.
|
||||
* @param[in] cb The next video frame decoded callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_cbs_set_next_video_frame_decoded(LinphoneCallCbs *cbs, LinphoneCallCbsNextVideoFrameDecodedCb cb);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -46,29 +46,29 @@
|
|||
|
||||
/**
|
||||
* Increment refcount.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @ingroup misc
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneCallStats *linphone_call_stats_ref (LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Decrement refcount and possibly free the object.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @ingroup misc
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_stats_unref (LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Gets the user data in the LinphoneCallStats object
|
||||
* @param[in] stats the LinphoneCallStats
|
||||
* Gets the user data in the #LinphoneCallStats object
|
||||
* @param[in] stats the #LinphoneCallStats
|
||||
* @return the user data
|
||||
* @ingroup misc
|
||||
*/
|
||||
LINPHONE_PUBLIC void *linphone_call_stats_get_user_data (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Sets the user data in the LinphoneCallStats object
|
||||
* @param[in] stats the LinphoneCallStats object
|
||||
* Sets the user data in the #LinphoneCallStats object
|
||||
* @param[in] stats the #LinphoneCallStats object
|
||||
* @param[in] data the user data
|
||||
* @ingroup misc
|
||||
*/
|
||||
|
|
@ -76,7 +76,7 @@ LINPHONE_PUBLIC void linphone_call_stats_set_user_data (LinphoneCallStats *stats
|
|||
|
||||
/**
|
||||
* Get the type of the stream the stats refer to.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The type of the stream the stats refer to
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneStreamType linphone_call_stats_get_type (const LinphoneCallStats *stats);
|
||||
|
|
@ -107,14 +107,14 @@ LINPHONE_PUBLIC float linphone_call_stats_get_local_late_rate (const LinphoneCal
|
|||
|
||||
/**
|
||||
* Gets the local interarrival jitter
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The interarrival jitter at last emitted sender report
|
||||
**/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_sender_interarrival_jitter (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Gets the remote reported interarrival jitter
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The interarrival jitter at last received receiver report
|
||||
**/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_receiver_interarrival_jitter (const LinphoneCallStats *stats);
|
||||
|
|
@ -123,77 +123,77 @@ LINPHONE_PUBLIC const rtp_stats_t *linphone_call_stats_get_rtp_stats (const Linp
|
|||
|
||||
/**
|
||||
* Gets the cumulative number of late packets
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The cumulative number of late packets
|
||||
**/
|
||||
LINPHONE_PUBLIC uint64_t linphone_call_stats_get_late_packets_cumulative_number (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the bandwidth measurement of the received stream, expressed in kbit/s, including IP/UDP/RTP headers.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The bandwidth measurement of the received stream in kbit/s.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_download_bandwidth (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the bandwidth measurement of the sent stream, expressed in kbit/s, including IP/UDP/RTP headers.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The bandwidth measurement of the sent stream in kbit/s.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_upload_bandwidth (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the bandwidth measurement of the received RTCP, expressed in kbit/s, including IP/UDP/RTP headers.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The bandwidth measurement of the received RTCP in kbit/s.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_rtcp_download_bandwidth (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the bandwidth measurement of the sent RTCP, expressed in kbit/s, including IP/UDP/RTP headers.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The bandwidth measurement of the sent RTCP in kbit/s.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_rtcp_upload_bandwidth( const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the state of ICE processing.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The state of ICE processing.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneIceState linphone_call_stats_get_ice_state (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the state of uPnP processing.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The state of uPnP processing.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneUpnpState linphone_call_stats_get_upnp_state (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the IP address family of the remote peer.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The IP address family of the remote peer.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneAddressFamily linphone_call_stats_get_ip_family_of_remote (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the jitter buffer size in ms.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The jitter buffer size in ms.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_jitter_buffer_size_ms (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the round trip delay in s.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The round trip delay in s.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_round_trip_delay (const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Get the estimated bandwidth measurement of the received stream, expressed in kbit/s, including IP/UDP/RTP headers.
|
||||
* @param[in] stats LinphoneCallStats object
|
||||
* @param[in] stats #LinphoneCallStats object
|
||||
* @return The estimated bandwidth measurement of the received stream in kbit/s.
|
||||
*/
|
||||
LINPHONE_PUBLIC float linphone_call_stats_get_estimated_download_bandwidth(const LinphoneCallStats *stats);
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ LINPHONE_PUBLIC void linphone_call_set_user_data (LinphoneCall *call, void *ud);
|
|||
|
||||
/**
|
||||
* Get the core that has created the specified call.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @return The LinphoneCore object that has created the specified call.
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return The #LinphoneCore object that has created the specified call.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCore * linphone_call_get_core (const LinphoneCall *call);
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ LINPHONE_PUBLIC LinphoneCallState linphone_call_get_state (const LinphoneCall *c
|
|||
|
||||
/**
|
||||
* Tell whether a call has been asked to autoanswer
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return A boolean value telling whether the call has been asked to autoanswer
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_call_asked_to_autoanswer (LinphoneCall *call);
|
||||
|
|
@ -118,14 +118,14 @@ LINPHONE_PUBLIC LinphoneCallDir linphone_call_get_dir (const LinphoneCall *call)
|
|||
|
||||
/**
|
||||
* Gets the call log associated to this call.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @return The LinphoneCallLog associated with the specified LinphoneCall
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return The #LinphoneCallLog associated with the specified #LinphoneCall
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneCallLog *linphone_call_get_call_log (const LinphoneCall *call);
|
||||
|
||||
/**
|
||||
* Gets the refer-to uri (if the call was transfered).
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return The refer-to uri of the call (if it was transfered)
|
||||
**/
|
||||
LINPHONE_PUBLIC const char *linphone_call_get_refer_to (const LinphoneCall *call);
|
||||
|
|
@ -143,7 +143,7 @@ LINPHONE_PUBLIC bool_t linphone_call_has_transfer_pending (const LinphoneCall *c
|
|||
/**
|
||||
* Gets the transferer if this call was started automatically as a result of an incoming transfer request.
|
||||
* The call in which the transfer request was received is returned in this case.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return The transferer call if the specified call was started automatically as a result of an incoming transfer request, NULL otherwise
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneCall *linphone_call_get_transferer_call (const LinphoneCall *call);
|
||||
|
|
@ -192,7 +192,7 @@ LINPHONE_PUBLIC bool_t linphone_call_camera_enabled (const LinphoneCall *lc);
|
|||
/**
|
||||
* Take a photo of currently received video and write it into a jpeg file.
|
||||
* Note that the snapshot is asynchronous, an application shall not assume that the file is created when the function returns.
|
||||
* @param call a LinphoneCall
|
||||
* @param call a #LinphoneCall
|
||||
* @param file a path where to write the jpeg content.
|
||||
* @return 0 if successfull, -1 otherwise (typically if jpeg format is not supported).
|
||||
**/
|
||||
|
|
@ -201,7 +201,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_take_video_snapshot (LinphoneCall *
|
|||
/**
|
||||
* Take a photo of currently captured video and write it into a jpeg file.
|
||||
* Note that the snapshot is asynchronous, an application shall not assume that the file is created when the function returns.
|
||||
* @param call a LinphoneCall
|
||||
* @param call a #LinphoneCall
|
||||
* @param file a path where to write the jpeg content.
|
||||
* @return 0 if successfull, -1 otherwise (typically if jpeg format is not supported).
|
||||
**/
|
||||
|
|
@ -214,8 +214,8 @@ LINPHONE_PUBLIC LinphoneReason linphone_call_get_reason (const LinphoneCall *cal
|
|||
|
||||
/**
|
||||
* Returns full details about call errors or termination reasons.
|
||||
* @param call LinphoneCall object on which we want the information error
|
||||
* @return LinphoneErrorInfo object holding the reason error.
|
||||
* @param call #LinphoneCall object on which we want the information error
|
||||
* @return #LinphoneErrorInfo object holding the reason error.
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_call_get_error_info (const LinphoneCall *call);
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ LINPHONE_PUBLIC const char *linphone_call_get_remote_contact (LinphoneCall *call
|
|||
|
||||
/**
|
||||
* Returns the ZRTP authentication token to verify.
|
||||
* @param call the LinphoneCall
|
||||
* @param call the #LinphoneCall
|
||||
* @return the authentication token to verify.
|
||||
**/
|
||||
LINPHONE_PUBLIC const char *linphone_call_get_authentication_token (LinphoneCall *call);
|
||||
|
|
@ -240,7 +240,7 @@ LINPHONE_PUBLIC const char *linphone_call_get_authentication_token (LinphoneCall
|
|||
* Returns whether ZRTP authentication token is verified.
|
||||
* If not, it must be verified by users as described in ZRTP procedure.
|
||||
* Once done, the application must inform of the results with linphone_call_set_authentication_token_verified().
|
||||
* @param call the LinphoneCall
|
||||
* @param call the #LinphoneCall
|
||||
* @return TRUE if authentication token is verifed, false otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_call_get_authentication_token_verified (const LinphoneCall *call);
|
||||
|
|
@ -248,7 +248,7 @@ LINPHONE_PUBLIC bool_t linphone_call_get_authentication_token_verified (const Li
|
|||
/**
|
||||
* Set the result of ZRTP short code verification by user.
|
||||
* If remote party also does the same, it will update the ZRTP cache so that user's verification will not be required for the two users.
|
||||
* @param call the LinphoneCall
|
||||
* @param call the #LinphoneCall
|
||||
* @param verified whether the ZRTP SAS is verified.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_set_authentication_token_verified (LinphoneCall *call, bool_t verified);
|
||||
|
|
@ -291,7 +291,7 @@ LINPHONE_PUBLIC void linphone_call_zoom (LinphoneCall *call, float zoom_factor,
|
|||
* Send the specified dtmf.
|
||||
*
|
||||
* The dtmf is automatically played to the user.
|
||||
* @param call The LinphoneCall object
|
||||
* @param call The #LinphoneCall object
|
||||
* @param dtmf The dtmf name specified as a char, such as '0', '#' etc...
|
||||
* @return 0 if successful, -1 on error.
|
||||
**/
|
||||
|
|
@ -302,7 +302,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_send_dtmf (LinphoneCall *call, char
|
|||
*
|
||||
* The dtmfs are automatically sent to remote, separated by some needed customizable delay.
|
||||
* Sending is canceled if the call state changes to something not LinphoneCallStreamsRunning.
|
||||
* @param call The LinphoneCall object
|
||||
* @param call The #LinphoneCall object
|
||||
* @param dtmfs A dtmf sequence such as '123#123123'
|
||||
* @return -2 if there is already a DTMF sequence, -1 if call is not ready, 0 otherwise.
|
||||
**/
|
||||
|
|
@ -314,7 +314,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_send_dtmfs (LinphoneCall *call, con
|
|||
* Please note that some DTMF could be already sent,
|
||||
* depending on when this function call is delayed from #linphone_call_send_dtmfs. This
|
||||
* function will be automatically called if call state change to anything but LinphoneCallStreamsRunning.
|
||||
* @param call The LinphoneCall object
|
||||
* @param call The #LinphoneCall object
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_cancel_dtmfs (LinphoneCall *call);
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ LINPHONE_PUBLIC RtpTransport *linphone_call_get_meta_rtcp_transport (const Linph
|
|||
* Pauses the call. If a music file has been setup using linphone_core_set_play_file(),
|
||||
* this file will be played to the remote user.
|
||||
* The only way to resume a paused call is to call linphone_call_resume().
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return 0 on success, -1 on failure
|
||||
* @see linphone_call_resume()
|
||||
**/
|
||||
|
|
@ -384,7 +384,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_pause (LinphoneCall *call);
|
|||
/**
|
||||
* Resumes a call.
|
||||
* The call needs to have been paused previously with linphone_call_pause().
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return 0 on success, -1 on failure
|
||||
* @see linphone_call_pause()
|
||||
**/
|
||||
|
|
@ -392,21 +392,21 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_resume (LinphoneCall *call);
|
|||
|
||||
/**
|
||||
* Terminates a call.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return 0 on success, -1 on failure
|
||||
**/LINPHONE_PUBLIC LinphoneStatus linphone_call_terminate (LinphoneCall *call);
|
||||
|
||||
/**
|
||||
* Terminates a call.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] ei LinphoneErrorInfo
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @param[in] ei #LinphoneErrorInfo
|
||||
* @return 0 on success, -1 on failure
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_call_terminate_with_error_info (LinphoneCall *call, const LinphoneErrorInfo *ei);
|
||||
|
||||
/**
|
||||
* Redirect the specified call to the given redirect URI.
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @param[in] redirect_uri The URI to redirect the call to
|
||||
* @return 0 if successful, -1 on error.
|
||||
*/
|
||||
|
|
@ -414,16 +414,16 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_redirect (LinphoneCall *call, const
|
|||
|
||||
/**
|
||||
* Decline a pending incoming call, with a reason.
|
||||
* @param[in] call A LinphoneCall object that must be in the IncomingReceived state
|
||||
* @param[in] reason The reason for rejecting the call: LinphoneReasonDeclined or LinphoneReasonBusy
|
||||
* @param[in] call A #LinphoneCall object that must be in the IncomingReceived state
|
||||
* @param[in] reason The reason for rejecting the call: #LinphoneReasonDeclined or #LinphoneReasonBusy
|
||||
* @return 0 on success, -1 on failure
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_call_decline (LinphoneCall *call, LinphoneReason reason);
|
||||
|
||||
/**
|
||||
* Decline a pending incoming call, with a LinphoneErrorInfo object.
|
||||
* @param[in] call A LinphoneCall object that must be in the IncomingReceived state
|
||||
* @param[in] ei LinphoneErrorInfo containing more information on the call rejection.
|
||||
* Decline a pending incoming call, with a #LinphoneErrorInfo object.
|
||||
* @param[in] call A #LinphoneCall object that must be in the IncomingReceived state
|
||||
* @param[in] ei #LinphoneErrorInfo containing more information on the call rejection.
|
||||
* @return 0 on success, -1 on failure
|
||||
*/
|
||||
LINPHONE_PUBLIC int linphone_call_decline_with_error_info (LinphoneCall *call, const LinphoneErrorInfo *ei);
|
||||
|
|
@ -433,9 +433,9 @@ LINPHONE_PUBLIC int linphone_call_decline_with_error_info (LinphoneCall *call, c
|
|||
*
|
||||
* Basically the application is notified of incoming calls within the
|
||||
* call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive
|
||||
* a LinphoneCallIncoming event with the associated LinphoneCall object.
|
||||
* a #LinphoneCallIncoming event with the associated #LinphoneCall object.
|
||||
* The application can later accept the call using this method.
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @return 0 on success, -1 on failure
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_call_accept (LinphoneCall *call);
|
||||
|
|
@ -445,9 +445,9 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept (LinphoneCall *call);
|
|||
*
|
||||
* Basically the application is notified of incoming calls within the
|
||||
* call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive
|
||||
* a LinphoneCallIncoming event with the associated LinphoneCall object.
|
||||
* a #LinphoneCallIncoming event with the associated #LinphoneCall object.
|
||||
* The application can later accept the call using this method.
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @param[in] params The specific parameters for this call, for example whether video is accepted or not. Use NULL to use default parameters
|
||||
* @return 0 on success, -1 on failure
|
||||
**/
|
||||
|
|
@ -456,7 +456,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_with_params (LinphoneCall *c
|
|||
/**
|
||||
* Accept an early media session for an incoming call.
|
||||
* This is identical as calling linphone_call_accept_early_media_with_params() with NULL parameters.
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @return 0 if successful, -1 otherwise
|
||||
* @see linphone_call_accept_early_media_with_params()
|
||||
**/
|
||||
|
|
@ -467,7 +467,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_early_media (LinphoneCall *c
|
|||
* This means the call is not accepted but audio & video streams can be established if the remote party supports early media.
|
||||
* However, unlike after call acceptance, mic and camera input are not sent during early-media, though received audio & video are played normally.
|
||||
* The call can then later be fully accepted using linphone_call_accept() or linphone_call_accept_with_params().
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @param[in] params The call parameters to use (can be NULL)
|
||||
* @return 0 if successful, -1 otherwise
|
||||
**/
|
||||
|
|
@ -475,36 +475,35 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_early_media_with_params (Lin
|
|||
|
||||
/**
|
||||
* Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore.
|
||||
* In this version this is limited to the following use cases:
|
||||
* - setting up/down the video stream according to the video parameter of the LinphoneCallParams (see linphone_call_params_enable_video() ).
|
||||
* - changing the size of the transmitted video after calling linphone_core_set_preferred_video_size()
|
||||
* In case no changes are requested through the LinphoneCallParams argument, then this argument can be omitted and set to NULL.
|
||||
* WARNING: Updating a call in the LinphoneCallPaused state will still result in a paused call even if the media directions set in the
|
||||
* It triggers a SIP reINVITE in order to perform a new offer/answer of media capabilities.
|
||||
* Changing the size of the transmitted video after calling #linphone_core_set_preferred_video_size() can be used by passing NULL as params argument.
|
||||
* In case no changes are requested through the #LinphoneCallParams argument, then this argument can be omitted and set to NULL.
|
||||
* WARNING: Updating a call in the #LinphoneCallPaused state will still result in a paused call even if the media directions set in the
|
||||
* params are sendrecv. To resume a paused call, you need to call linphone_call_resume().
|
||||
*
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @param[in] params The new call parameters to use (may be NULL)
|
||||
* @return 0 if successful, -1 otherwise.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParams *params);
|
||||
|
||||
/**
|
||||
* When receiving a #LinphoneCallUpdatedByRemote state notification, prevent LinphoneCore from performing an automatic answer.
|
||||
* When receiving a #LinphoneCallUpdatedByRemote state notification, prevent #LinphoneCore from performing an automatic answer.
|
||||
*
|
||||
* When receiving a #LinphoneCallUpdatedByRemote state notification (ie an incoming reINVITE), the default behaviour of
|
||||
* LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default)
|
||||
* then the LinphoneCore automatically answers the reINIVTE with call parameters unchanged.
|
||||
* #LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default)
|
||||
* then the #LinphoneCore automatically answers the reINIVTE with call parameters unchanged.
|
||||
* However when for example when the remote party updated the call to propose a video stream, it can be useful
|
||||
* to prompt the user before answering. This can be achieved by calling linphone_core_defer_call_update() during
|
||||
* the call state notification, to deactivate the automatic answer that would just confirm the audio but reject the video.
|
||||
* Then, when the user responds to dialog prompt, it becomes possible to call linphone_call_accept_update() to answer
|
||||
* the reINVITE, with eventually video enabled in the LinphoneCallParams argument.
|
||||
* the reINVITE, with eventually video enabled in the #LinphoneCallParams argument.
|
||||
*
|
||||
* The #LinphoneCallUpdatedByRemote notification can also arrive when receiving an INVITE without SDP. In such case, an unchanged offer is made
|
||||
* in the 200Ok, and when the ACK containing the SDP answer is received, #LinphoneCallUpdatedByRemote is triggered to notify the application of possible
|
||||
* changes in the media session. However in such case defering the update has no meaning since we just generating an offer.
|
||||
*
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @return 0 if successful, -1 if the linphone_call_defer_update() was done outside a valid #LinphoneCallUpdatedByRemote notification
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_call_defer_update (LinphoneCall *call);
|
||||
|
|
@ -522,8 +521,8 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_defer_update (LinphoneCall *call);
|
|||
* If params is not NULL, then the update will be accepted according to the parameters passed.
|
||||
* Typical example is when a user accepts to start video, then params should indicate that video stream should be used
|
||||
* (see linphone_call_params_enable_video()).
|
||||
* @param[in] call A LinphoneCall object
|
||||
* @param[in] params A LinphoneCallParams object describing the call parameters to accept
|
||||
* @param[in] call A #LinphoneCall object
|
||||
* @param[in] params A #LinphoneCallParams object describing the call parameters to accept
|
||||
* @return 0 if successful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state)
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params);
|
||||
|
|
@ -707,8 +706,8 @@ LINPHONE_PUBLIC void linphone_call_stop_recording(LinphoneCall *call);
|
|||
|
||||
/**
|
||||
* Get a player associated with the call to play a local file and stream it to the remote peer.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @return A LinphonePlayer object
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return A #LinphonePlayer object
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphonePlayer * linphone_call_get_player(LinphoneCall *call);
|
||||
|
||||
|
|
@ -730,7 +729,7 @@ LINPHONE_PUBLIC bool_t linphone_call_media_in_progress(const LinphoneCall *call)
|
|||
LINPHONE_PUBLIC void linphone_call_ogl_render(const LinphoneCall *call);
|
||||
|
||||
/**
|
||||
* Send a LinphoneInfoMessage through an established call
|
||||
* Send a #LinphoneInfoMessage through an established call
|
||||
* @param call the call
|
||||
* @param info the info message
|
||||
**/
|
||||
|
|
@ -750,25 +749,25 @@ LINPHONE_PUBLIC LinphoneCallStats *linphone_call_get_video_stats(LinphoneCall *c
|
|||
LINPHONE_PUBLIC LinphoneCallStats *linphone_call_get_text_stats(LinphoneCall *call);
|
||||
|
||||
/**
|
||||
* Add a listener in order to be notified of LinphoneCall events. Once an event is received, registred LinphoneCallCbs are
|
||||
* Add a listener in order to be notified of #LinphoneCall events. Once an event is received, registred #LinphoneCallCbs are
|
||||
* invoked sequencially.
|
||||
* @param[in] call LinphoneCall object to monitor.
|
||||
* @param[in] cbs A LinphoneCallCbs object holding the callbacks you need. A reference is taken by the LinphoneCall until you invoke linphone_call_remove_callbacks().
|
||||
* @param[in] call #LinphoneCall object to monitor.
|
||||
* @param[in] cbs A #LinphoneCallCbs object holding the callbacks you need. A reference is taken by the #LinphoneCall until you invoke linphone_call_remove_callbacks().
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_add_callbacks(LinphoneCall *call, LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Remove a listener from a LinphoneCall
|
||||
* @param[in] call LinphoneCall object
|
||||
* @param[in] cbs LinphoneCallCbs object to remove.
|
||||
* Remove a listener from a #LinphoneCall
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @param[in] cbs #LinphoneCallCbs object to remove.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_call_remove_callbacks(LinphoneCall *call, LinphoneCallCbs *cbs);
|
||||
|
||||
/**
|
||||
* Gets the current LinphoneCallCbs.
|
||||
* This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneCallCbs that is calling the callback.
|
||||
* @param[in] call LinphoneCall object
|
||||
* @return The LinphoneCallCbs that has called the last callback
|
||||
* This is meant only to be called from a callback to be able to get the user_data associated with the #LinphoneCallCbs that is calling the callback.
|
||||
* @param[in] call #LinphoneCall object
|
||||
* @return The #LinphoneCallCbs that has called the last callback
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_get_current_callbacks(const LinphoneCall *call);
|
||||
|
||||
|
|
@ -778,16 +777,16 @@ LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_get_current_callbacks(const Linph
|
|||
* linphone_call_accept_with_params().
|
||||
* However, in some cases it might be desirable from a software design standpoint to modify local parameters outside of the application layer, typically
|
||||
* in the purpose of implementing a custom logic including special headers in INVITE or 200Ok requests, driven by a call_state_changed listener method.
|
||||
* This function accepts to assign a new LinphoneCallParams only in LinphoneCallOutgoingInit and LinphoneCallIncomingReceived states.
|
||||
* @param call the LinphoneCall object
|
||||
* This function accepts to assign a new #LinphoneCallParams only in #LinphoneCallOutgoingInit and #LinphoneCallIncomingReceived states.
|
||||
* @param call the #LinphoneCall object
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_set_params(LinphoneCall *call, const LinphoneCallParams *params);
|
||||
|
||||
/**
|
||||
* Returns local parameters associated with the call.
|
||||
* This is typically the parameters passed at call initiation to linphone_core_invite_address_with_params() or linphone_call_accept_with_params(), or some default
|
||||
* parameters if no LinphoneCallParams was explicitely passed during call initiation.
|
||||
* @param call the LinphoneCall object
|
||||
* parameters if no #LinphoneCallParams was explicitely passed during call initiation.
|
||||
* @param call the #LinphoneCall object
|
||||
* @return the call's local parameters.
|
||||
**/
|
||||
LINPHONE_PUBLIC const LinphoneCallParams * linphone_call_get_params(LinphoneCall *call);
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@
|
|||
|
||||
/**
|
||||
* Callback for being notified of received DTMFs.
|
||||
* @param call LinphoneCall object that received the dtmf
|
||||
* @param call #LinphoneCall object that received the dtmf
|
||||
* @param dtmf The ascii code of the dtmf
|
||||
*/
|
||||
typedef void (*LinphoneCallCbsDtmfReceivedCb)(LinphoneCall *call, int dtmf);
|
||||
|
||||
/**
|
||||
* Call encryption changed callback.
|
||||
* @param call LinphoneCall object whose encryption is changed.
|
||||
* @param call #LinphoneCall object whose encryption is changed.
|
||||
* @param on Whether encryption is activated.
|
||||
* @param authentication_token An authentication_token, currently set for ZRTP kind of encryption only.
|
||||
*/
|
||||
|
|
@ -52,14 +52,14 @@ typedef void (*LinphoneCallCbsEncryptionChangedCb)(LinphoneCall *call, bool_t on
|
|||
|
||||
/**
|
||||
* Callback for receiving info messages.
|
||||
* @param call LinphoneCall whose info message belongs to.
|
||||
* @param msg LinphoneInfoMessage object.
|
||||
* @param call #LinphoneCall whose info message belongs to.
|
||||
* @param msg #LinphoneInfoMessage object.
|
||||
*/
|
||||
typedef void (*LinphoneCallCbsInfoMessageReceivedCb)(LinphoneCall *call, const LinphoneInfoMessage *msg);
|
||||
|
||||
/**
|
||||
* Call state notification callback.
|
||||
* @param call LinphoneCall whose state is changed.
|
||||
* @param call #LinphoneCall whose state is changed.
|
||||
* @param cstate The new state of the call
|
||||
* @param message An informational message about the state.
|
||||
*/
|
||||
|
|
@ -67,21 +67,21 @@ typedef void (*LinphoneCallCbsStateChangedCb)(LinphoneCall *call, LinphoneCallSt
|
|||
|
||||
/**
|
||||
* Callback for receiving quality statistics for calls.
|
||||
* @param call LinphoneCall object whose statistics are notified
|
||||
* @param stats LinphoneCallStats object
|
||||
* @param call #LinphoneCall object whose statistics are notified
|
||||
* @param stats #LinphoneCallStats object
|
||||
*/
|
||||
typedef void (*LinphoneCallCbsStatsUpdatedCb)(LinphoneCall *call, const LinphoneCallStats *stats);
|
||||
|
||||
/**
|
||||
* Callback for notifying progresses of transfers.
|
||||
* @param call LinphoneCall that was transfered
|
||||
* @param call #LinphoneCall that was transfered
|
||||
* @param cstate The state of the call to transfer target at the far end.
|
||||
*/
|
||||
typedef void (*LinphoneCallCbsTransferStateChangedCb)(LinphoneCall *call, LinphoneCallState cstate);
|
||||
|
||||
/**
|
||||
* Callback for notifying the processing SIP ACK messages.
|
||||
* @param call LinphoneCall for which an ACK is being received or sent
|
||||
* @param call #LinphoneCall for which an ACK is being received or sent
|
||||
* @param ack the ACK message
|
||||
* @param is_received if TRUE this ACK is an incoming one, otherwise it is an ACK about to be sent.
|
||||
*/
|
||||
|
|
@ -95,6 +95,19 @@ typedef void (*LinphoneCallCbsAckProcessingCb)(LinphoneCall *call, LinphoneHeade
|
|||
*/
|
||||
typedef void (*LinphoneCallCbsTmmbrReceivedCb)(LinphoneCall *call, int stream_index, int tmmbr);
|
||||
|
||||
/**
|
||||
* Callback for notifying a snapshot taken.
|
||||
* @param call LinphoneCall for which the snapshot was taken
|
||||
* @param filepath the name of the saved file
|
||||
*/
|
||||
typedef void (*LinphoneCallCbsSnapshotTakenCb)(LinphoneCall *call, const char *filepath);
|
||||
|
||||
/**
|
||||
* Callback to notify a next video frame has been decoded
|
||||
* @param call LinphoneCall for which the next video frame has been decoded
|
||||
*/
|
||||
typedef void (*LinphoneCallCbsNextVideoFrameDecodedCb)(LinphoneCall *call);
|
||||
|
||||
/**
|
||||
* @}
|
||||
**/
|
||||
|
|
@ -108,9 +121,9 @@ typedef void (*LinphoneCallCbsTmmbrReceivedCb)(LinphoneCall *call, int stream_in
|
|||
/**
|
||||
* Call back used to notify message delivery status
|
||||
* @param msg #LinphoneChatMessage object
|
||||
* @param status LinphoneChatMessageState
|
||||
* @param status #LinphoneChatMessageState
|
||||
* @param ud application user data
|
||||
* @deprecated Use LinphoneChatMessageCbsMsgStateChangedCb instead.
|
||||
* @deprecated Use #LinphoneChatMessageCbsMsgStateChangedCb instead.
|
||||
* @donotwrap
|
||||
*/
|
||||
typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg, LinphoneChatMessageState state, void* ud);
|
||||
|
|
@ -118,10 +131,17 @@ typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg, Linp
|
|||
/**
|
||||
* Call back used to notify message delivery status
|
||||
* @param msg #LinphoneChatMessage object
|
||||
* @param status LinphoneChatMessageState
|
||||
* @param status #LinphoneChatMessageState
|
||||
*/
|
||||
typedef void (*LinphoneChatMessageCbsMsgStateChangedCb)(LinphoneChatMessage* msg, LinphoneChatMessageState state);
|
||||
|
||||
/**
|
||||
* Call back used to notify participant IMDN state
|
||||
* @param msg #LinphoneChatMessage object
|
||||
* @param state #LinphoneParticipantImdnState
|
||||
*/
|
||||
typedef void (*LinphoneChatMessageCbsParticipantImdnStateChangedCb)(LinphoneChatMessage* msg, const LinphoneParticipantImdnState *state);
|
||||
|
||||
/**
|
||||
* File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file.
|
||||
* @param message #LinphoneChatMessage message from which the body is received.
|
||||
|
|
@ -136,7 +156,7 @@ typedef void (*LinphoneChatMessageCbsFileTransferRecvCb)(LinphoneChatMessage *me
|
|||
* @param content #LinphoneContent outgoing content
|
||||
* @param offset the offset in the file from where to get the data to be sent
|
||||
* @param size the number of bytes expected by the framework
|
||||
* @return A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file.
|
||||
* @return A #LinphoneBuffer object holding the data written by the application. An empty buffer means end of file.
|
||||
*/
|
||||
typedef LinphoneBuffer * (*LinphoneChatMessageCbsFileTransferSendCb)(LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t size);
|
||||
|
||||
|
|
@ -235,6 +255,18 @@ typedef void (*LinphoneChatRoomCbsParticipantDeviceAddedCb) (LinphoneChatRoom *c
|
|||
*/
|
||||
typedef void (*LinphoneChatRoomCbsParticipantDeviceRemovedCb) (LinphoneChatRoom *cr, const LinphoneEventLog *event_log);
|
||||
|
||||
/**
|
||||
* Callback used to notify a chat room has been joined.
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
*/
|
||||
typedef void (*LinphoneChatRoomCbsConferenceJoinedCb) (LinphoneChatRoom *cr, const LinphoneEventLog *eventLog);
|
||||
|
||||
/**
|
||||
* Callback used to notify a chat room has been left.
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
*/
|
||||
typedef void (*LinphoneChatRoomCbsConferenceLeftCb) (LinphoneChatRoom *cr, const LinphoneEventLog *eventLog);
|
||||
|
||||
/**
|
||||
* Callback used when a group chat room is created server-side to generate the address of the chat room.
|
||||
* The function linphone_chat_room_set_conference_address() needs to be called by this callback.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
LinphoneChatMessageCbs *linphone_chat_message_cbs_new(void);
|
||||
LinphoneChatMessageCbs *linphone_chat_message_cbs_new (void);
|
||||
|
||||
/**
|
||||
* Acquire a reference to the chat room callbacks object.
|
||||
|
|
@ -65,59 +65,73 @@ LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data (LinphoneChatMessag
|
|||
|
||||
/**
|
||||
* Get the message state changed callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cbs #LinphoneChatMessageCbs object.
|
||||
* @return The current message state changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs);
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed (const LinphoneChatMessageCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the message state changed callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The message state changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb);
|
||||
/**
|
||||
* Set the message state changed callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The message state changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the file transfer receive callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @return The current file transfer receive callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs);
|
||||
/**
|
||||
* Get the file transfer receive callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @return The current file transfer receive callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv (const LinphoneChatMessageCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the file transfer receive callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The file transfer receive callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb);
|
||||
/**
|
||||
* Set the file transfer receive callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The file transfer receive callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get the file transfer send callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @return The current file transfer send callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs);
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send (const LinphoneChatMessageCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the file transfer send callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The file transfer send callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb);
|
||||
/**
|
||||
* Set the file transfer send callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The file transfer send callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb);
|
||||
|
||||
/**
|
||||
* Get the file transfer progress indication callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @return The current file transfer progress indication callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs);
|
||||
/**
|
||||
* Get the file transfer progress indication callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @return The current file transfer progress indication callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication (const LinphoneChatMessageCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the file transfer progress indication callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The file transfer progress indication callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb);
|
||||
/**
|
||||
* Set the file transfer progress indication callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The file transfer progress indication callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant IMDN state changed callback.
|
||||
* @param[in] cbs #LinphoneChatMessageCbs object.
|
||||
* @return The current participant IMDN state changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbsParticipantImdnStateChangedCb linphone_chat_message_cbs_get_participant_imdn_state_changed (const LinphoneChatMessageCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant IMDN state changed callback.
|
||||
* @param[in] cbs LinphoneChatMessageCbs object.
|
||||
* @param[in] cb The participant IMDN state changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cbs_set_participant_imdn_state_changed (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsParticipantImdnStateChangedCb cb);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,12 @@
|
|||
#ifndef _L_C_CHAT_MESSAGE_H_
|
||||
#define _L_C_CHAT_MESSAGE_H_
|
||||
|
||||
#include "linphone/api/c-types.h"
|
||||
#include "linphone/api/c-chat-message-cbs.h"
|
||||
#include "linphone/api/c-types.h"
|
||||
|
||||
#ifdef SQLITE_STORAGE_ENABLED
|
||||
#include <sqlite3.h>
|
||||
#endif
|
||||
#include <sqlite3.h>
|
||||
#endif // ifdef SQLITE_STORAGE_ENABLED
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ typedef enum _LinphoneChatMessageDir{
|
|||
// =============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
extern "C" {
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
/**
|
||||
|
|
@ -47,99 +47,101 @@ typedef enum _LinphoneChatMessageDir{
|
|||
|
||||
/**
|
||||
* Acquire a reference to the chat message.
|
||||
* @param[in] cr The chat message.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return The same chat message.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneChatMessage *linphone_chat_message_ref(LinphoneChatMessage *msg);
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessage *linphone_chat_message_ref (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Release reference to the chat message.
|
||||
* @param[in] cr The chat message.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_unref(LinphoneChatMessage *msg);
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_unref (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with the chat message.
|
||||
* @param[in] cr The chat message.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return The user pointer associated with the chat message.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_chat_message_get_user_data(const LinphoneChatMessage *msg);
|
||||
*/
|
||||
LINPHONE_PUBLIC void *linphone_chat_message_get_user_data (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to the chat message.
|
||||
* @param[in] cr The chat message.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] ud The user pointer to associate with the chat message.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_user_data(LinphoneChatMessage *msg, void *ud);
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_user_data (LinphoneChatMessage *msg, void *ud);
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_PUBLIC const char * linphone_chat_message_get_external_body_url(const LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_external_body_url (const LinphoneChatMessage *msg);
|
||||
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url(LinphoneChatMessage *msg, const char *external_body_url);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url (LinphoneChatMessage *msg, const char *external_body_url);
|
||||
|
||||
/**
|
||||
* Get the time the message was sent.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC time_t linphone_chat_message_get_time(const LinphoneChatMessage* msg);
|
||||
LINPHONE_PUBLIC time_t linphone_chat_message_get_time (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Returns TRUE if the message has been sent, returns FALSE if the message has been received.
|
||||
* @param message the message
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_outgoing(LinphoneChatMessage* msg);
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_outgoing (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get origin of the message
|
||||
* @param[in] message #LinphoneChatMessage obj
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return #LinphoneAddress
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_from_address(LinphoneChatMessage* msg);
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_message_get_from_address (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get destination of the message
|
||||
* @param[in] message #LinphoneChatMessage obj
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return #LinphoneAddress
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_to_address(LinphoneChatMessage* msg);
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_message_get_to_address (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get the content type of a chat message.
|
||||
* @param[in] message LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return The content type of the chat message
|
||||
*/
|
||||
LINPHONE_PUBLIC const char * linphone_chat_message_get_content_type(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_content_type (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Set the content type of a chat message.
|
||||
* This content type must match a content that is text representable, such as text/plain, text/html or image/svg+xml.
|
||||
* @param[in] message LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] content_type The new content type of the chat message
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_content_type(LinphoneChatMessage *msg, const char *content_type);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_content_type (LinphoneChatMessage *msg, const char *content_type);
|
||||
|
||||
/**
|
||||
* Get text part of this message
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return text or NULL if no text.
|
||||
* @deprecated use getTextContent() instead
|
||||
*/
|
||||
LINPHONE_PUBLIC const char* linphone_chat_message_get_text(LinphoneChatMessage* msg);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_text (LinphoneChatMessage* msg);
|
||||
|
||||
/**
|
||||
* Get the message identifier.
|
||||
* It is used to identify a message so that it can be notified as delivered and/or displayed.
|
||||
* @param[in] cm LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return The message identifier.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char* linphone_chat_message_get_message_id(const LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_message_id (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Linphone message has an app-specific field that can store a text. The application might want
|
||||
* to use it for keeping data over restarts, like thumbnail image path.
|
||||
* @param message #LinphoneChatMessage
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return the application-specific data or NULL if none has been stored.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char* linphone_chat_message_get_appdata(const LinphoneChatMessage* message);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_appdata (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Linphone message has an app-specific field that can store a text. The application might want
|
||||
|
|
@ -148,228 +150,244 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_appdata(const LinphoneChat
|
|||
* Invoking this function will attempt to update the message storage to reflect the changeif it is
|
||||
* enabled.
|
||||
*
|
||||
* @param message #LinphoneChatMessage
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param data the data to store into the message
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_appdata(LinphoneChatMessage* message, const char* data);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_appdata (LinphoneChatMessage *msg, const char *data);
|
||||
|
||||
/**
|
||||
* Returns the chatroom this message belongs to.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneChatRoom* linphone_chat_message_get_chat_room(const LinphoneChatMessage *msg);
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoom *linphone_chat_message_get_chat_room (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get the path to the file to read from or write to during the file transfer.
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object
|
||||
* @return The path to the file to use for the file transfer.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char * linphone_chat_message_get_file_transfer_filepath(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_file_transfer_filepath (LinphoneChatMessage *msg);
|
||||
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Get if a chat message is to be stored.
|
||||
* @param[in] message LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return Whether or not the message is to be stored
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_get_to_be_stored(const LinphoneChatMessage *message);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_get_to_be_stored (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Set if a chat message is to be stored.
|
||||
* This content type must match a content that is text representable, such as text/plain, text/html or image/svg+xml.
|
||||
* @param[in] message LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] to_be_stored Whether or not the chat message is to be stored
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_to_be_stored(LinphoneChatMessage *message, bool_t to_be_stored);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_to_be_stored (LinphoneChatMessage *msg, bool_t to_be_stored);
|
||||
|
||||
LINPHONE_PUBLIC unsigned int linphone_chat_message_store(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC unsigned int linphone_chat_message_store (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get the state of the message
|
||||
*@param message #LinphoneChatMessage obj
|
||||
*@return #LinphoneChatMessageState
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return #LinphoneChatMessageState
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageState linphone_chat_message_get_state(const LinphoneChatMessage* message);
|
||||
LINPHONE_PUBLIC LinphoneChatMessageState linphone_chat_message_get_state (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get if the message was encrypted when transfered
|
||||
* @param[in] message #LinphoneChatMessage obj
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return whether the message was encrypted when transfered or not
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_secured(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_secured (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Linphone message can carry external body as defined by rfc2017
|
||||
* @param message #LinphoneChatMessage
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return external body url or NULL if not present.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char* linphone_chat_message_get_external_body_url(const LinphoneChatMessage* message);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_external_body_url (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Linphone message can carry external body as defined by rfc2017
|
||||
*
|
||||
* @param message a LinphoneChatMessage
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param url ex: access-type=URL; URL="http://www.foo.com/file"
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url(LinphoneChatMessage* message,const char* url);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url (LinphoneChatMessage *msg,const char *url);
|
||||
|
||||
/**
|
||||
* Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer)
|
||||
*
|
||||
* @param message #LinphoneChatMessage
|
||||
* @return a pointer to the LinphoneContent structure or NULL if not present.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return a pointer to the #LinphoneContent structure or NULL if not present.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneContent* linphone_chat_message_get_file_transfer_information(LinphoneChatMessage* message);
|
||||
LINPHONE_PUBLIC LinphoneContent *linphone_chat_message_get_file_transfer_information (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Return whether or not a chat message is a file tranfer.
|
||||
* @param[in] message LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object
|
||||
* @return Whether or not the message is a file tranfer
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer(LinphoneChatMessage *message);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Return whether or not a chat message is a text.
|
||||
* @param[in] message LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return Whether or not the message is a text
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_text(LinphoneChatMessage *message);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_text (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Start the download of the file from remote server
|
||||
*
|
||||
* @param message #LinphoneChatMessage
|
||||
* @param status_cb LinphoneChatMessageStateChangeCb status callback invoked when file is downloaded or could not be downloaded
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param status_cb #LinphoneChatMessageStateChangeCb status callback invoked when file is downloaded or could not be downloaded
|
||||
* @param ud user data
|
||||
* @deprecated Use linphone_chat_message_download_file() instead.
|
||||
* @donotwrap
|
||||
*/
|
||||
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_message_start_file_download(LinphoneChatMessage* message, LinphoneChatMessageStateChangedCb status_cb, void* ud);
|
||||
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_message_start_file_download (
|
||||
LinphoneChatMessage *msg,
|
||||
LinphoneChatMessageStateChangedCb status_cb,
|
||||
void *ud
|
||||
);
|
||||
|
||||
/**
|
||||
* Start the download of the file referenced in a LinphoneChatMessage from remote server.
|
||||
* @param[in] message LinphoneChatMessage object.
|
||||
* Start the download of the file referenced in a #LinphoneChatMessage from remote server.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_chat_message_download_file(LinphoneChatMessage *message);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_download_file (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Cancel an ongoing file transfer attached to this message.(upload or download)
|
||||
* @param msg #LinphoneChatMessage
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cancel_file_transfer(LinphoneChatMessage* msg);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_cancel_file_transfer (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Send a chat message.
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_send (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Resend a chat message if it is in the 'not delivered' state for whatever reason.
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @deprecated Use linphone_chat_message_send instead.
|
||||
* @donotwrap
|
||||
*/
|
||||
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_message_resend(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_message_resend (LinphoneChatMessage *msg);
|
||||
|
||||
LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_message_get_peer_address (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Returns the origin address of a message if it was a outgoing message, or the destination address if it was an incoming message.
|
||||
*@param message #LinphoneChatMessage obj
|
||||
*@return #LinphoneAddress
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return #LinphoneAddress
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_message_get_local_address(LinphoneChatMessage* message);
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_message_get_local_address (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Add custom headers to the message.
|
||||
* @param message the message
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param header_name name of the header
|
||||
* @param header_value header value
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_add_custom_header(LinphoneChatMessage* message, const char *header_name, const char *header_value);
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_add_custom_header (
|
||||
LinphoneChatMessage *msg,
|
||||
const char *header_name,
|
||||
const char *header_value
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieve a custom header value given its name.
|
||||
* @param message the message
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param header_name header name searched
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_chat_message_get_custom_header(LinphoneChatMessage* message, const char *header_name);
|
||||
*/
|
||||
LINPHONE_PUBLIC const char * linphone_chat_message_get_custom_header (LinphoneChatMessage *msg, const char *header_name);
|
||||
|
||||
/**
|
||||
* Removes a custom header from the message.
|
||||
* @param msg the message
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param header_name name of the header to remove
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_remove_custom_header(LinphoneChatMessage *msg, const char *header_name);
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_remove_custom_header (LinphoneChatMessage *msg, const char *header_name);
|
||||
|
||||
/**
|
||||
* Returns TRUE if the message has been read, otherwise returns FALSE.
|
||||
* @param message the message
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_read(LinphoneChatMessage* message);
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_read (LinphoneChatMessage *msg);
|
||||
|
||||
LINPHONE_PUBLIC LinphoneReason linphone_chat_message_get_reason(LinphoneChatMessage* msg);
|
||||
LINPHONE_PUBLIC LinphoneReason linphone_chat_message_get_reason (LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Get full details about delivery error of a chat message.
|
||||
* @param msg a LinphoneChatMessage
|
||||
* @return a LinphoneErrorInfo describing the details.
|
||||
**/
|
||||
LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_chat_message_get_error_info(const LinphoneChatMessage *msg);
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return a #LinphoneErrorInfo describing the details.
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_chat_message_get_error_info (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Set the path to the file to read from or write to during the file transfer.
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] filepath The path to the file to use for the file transfer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_file_transfer_filepath(LinphoneChatMessage *msg, const char *filepath);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_set_file_transfer_filepath (LinphoneChatMessage *msg, const char *filepath);
|
||||
|
||||
/**
|
||||
* Fulfill a chat message char by char. Message linked to a Real Time Text Call send char in realtime following RFC 4103/T.140
|
||||
* To commit a message, use #linphone_chat_room_send_message
|
||||
* @param[in] msg LinphoneChatMessage
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] character T.140 char
|
||||
* @returns 0 if succeed.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_chat_message_put_char(LinphoneChatMessage *msg,uint32_t character);
|
||||
LINPHONE_PUBLIC LinphoneStatus linphone_chat_message_put_char (LinphoneChatMessage *msg, uint32_t character);
|
||||
|
||||
/**
|
||||
* Get the LinphoneChatMessageCbs object associated with the LinphoneChatMessage.
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @return The LinphoneChatMessageCbs object associated with the LinphoneChatMessage.
|
||||
* Get the #LinphoneChatMessageCbs object associated with the LinphoneChatMessage.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return The #LinphoneChatMessageCbs object associated with the LinphoneChatMessage.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_get_callbacks(const LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC LinphoneChatMessageCbs *linphone_chat_message_get_callbacks (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Adds a content to the ChatMessage
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] c_content LinphoneContent object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] c_content #LinphoneContent object
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_message_add_text_content(LinphoneChatMessage *msg, const char *c_content);
|
||||
LINPHONE_PUBLIC void linphone_chat_message_add_text_content (LinphoneChatMessage *msg, const char *c_content);
|
||||
|
||||
/**
|
||||
* Returns true if the chat message has a text content
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return true if it has one, false otherwise
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_has_text_content(const LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_has_text_content (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Gets the text content if available as a string
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @return the LinphoneContent buffer if available, null otherwise
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return the #LinphoneContent buffer if available, null otherwise
|
||||
*/
|
||||
LINPHONE_PUBLIC const char* linphone_chat_message_get_text_content(const LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC const char *linphone_chat_message_get_text_content (const LinphoneChatMessage *msg);
|
||||
|
||||
/**
|
||||
* Gets whether or not a file is currently being downloaded or uploaded
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @return true if download or upload is in progress, false otherwise
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer_in_progress(LinphoneChatMessage *msg);
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer_in_progress (LinphoneChatMessage *msg);
|
||||
|
||||
LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_in_state (const LinphoneChatMessage *msg, const LinphoneChatMessageState state);
|
||||
/**
|
||||
* Gets the list of participants for which the imdn state has reached the specified state and the time at which they did.
|
||||
* @param[in] msg #LinphoneChatMessage object.
|
||||
* @param[in] state The LinphoneChatMessageState the imdn have reached (only use LinphoneChatMessageStateDelivered,
|
||||
* LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)
|
||||
* @return \bctbx_list{LinphoneParticipantImdnState}
|
||||
*/
|
||||
LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_by_imdn_state (const LinphoneChatMessage *msg, LinphoneChatMessageState state);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
|||
|
|
@ -63,210 +63,238 @@ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_user_data (LinphoneChatRoomCbs *
|
|||
|
||||
/**
|
||||
* Get the is-composing received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current is-composing received callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsIsComposingReceivedCb linphone_chat_room_cbs_get_is_composing_received (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the is-composing received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The is-composing received callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_is_composing_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsIsComposingReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the message received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current message received callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsMessageReceivedCb linphone_chat_room_cbs_get_message_received (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the message received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The message received callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_message_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsMessageReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the chat message received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current chat message received callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsChatMessageReceivedCb linphone_chat_room_cbs_get_chat_message_received (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the chat message received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The chat message received callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_chat_message_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsChatMessageReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the chat message sent callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current chat message sent callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsChatMessageSentCb linphone_chat_room_cbs_get_chat_message_sent (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the chat message sent callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The chat message sent callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_chat_message_sent (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsChatMessageSentCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant added callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current participant added callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantAddedCb linphone_chat_room_cbs_get_participant_added (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant added callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The participant added callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_added (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantAddedCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant removed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current participant removed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantRemovedCb linphone_chat_room_cbs_get_participant_removed (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant removed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The participant removed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantRemovedCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant admin status changed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current participant admin status changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantAdminStatusChangedCb linphone_chat_room_cbs_get_participant_admin_status_changed (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant admin status changed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The participant admin status changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_admin_status_changed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantAdminStatusChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the state changed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current state changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsStateChangedCb linphone_chat_room_cbs_get_state_changed (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the state changed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The state changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_state_changed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsStateChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the subject changed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current subject changed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsSubjectChangedCb linphone_chat_room_cbs_get_subject_changed (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the subject changed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The subject changed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_subject_changed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsSubjectChangedCb cb);
|
||||
|
||||
/**
|
||||
* Get the undecryptable message received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current undecryptable message received callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsUndecryptableMessageReceivedCb linphone_chat_room_cbs_get_undecryptable_message_received (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the undecryptable message received callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The undecryptable message received callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_undecryptable_message_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsUndecryptableMessageReceivedCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant device added callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current participant device added callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceAddedCb linphone_chat_room_cbs_get_participant_device_added (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant device added callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The participant device added callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_added (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceAddedCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant device removed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @return The current participant device removed callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceRemovedCb linphone_chat_room_cbs_get_participant_device_removed (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant device removed callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The participant device removed callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceRemovedCb cb);
|
||||
|
||||
/**
|
||||
* Get the conference joined callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @return The current conference joined callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsConferenceJoinedCb linphone_chat_room_cbs_get_conference_joined (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the conference joined callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The conference joined callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_conference_joined (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsConferenceJoinedCb cb);
|
||||
|
||||
/**
|
||||
* Get the conference left callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @return The current conference left callback.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsConferenceLeftCb linphone_chat_room_cbs_get_conference_left (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the conference left callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object.
|
||||
* @param[in] cb The conference left callback to be used.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_conference_left (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsConferenceLeftCb cb);
|
||||
|
||||
/**
|
||||
* Get the conference address generation callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object
|
||||
* @return The current conference address generation callback
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsConferenceAddressGenerationCb linphone_chat_room_cbs_get_conference_address_generation (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the conference address generation callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object
|
||||
* @param[in] cb The conference address generation callback to be used
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_conference_address_generation (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsConferenceAddressGenerationCb cb);
|
||||
|
||||
/**
|
||||
* Get the participant device fetching callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object
|
||||
* @return The participant device fetching callback
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceFetchRequestedCb linphone_chat_room_cbs_get_participant_device_fetch_requested (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participant device fetching callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object
|
||||
* @param[in] cb The participant device fetching callback to be used
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_fetch_requested (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceFetchRequestedCb cb);
|
||||
|
||||
/**
|
||||
* Get the participants capabilities callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object
|
||||
* @return The participants capabilities getting callback
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb linphone_chat_room_cbs_get_participants_capabilities_checked (const LinphoneChatRoomCbs *cbs);
|
||||
|
||||
/**
|
||||
* Set the participants capabilities callback.
|
||||
* @param[in] cbs LinphoneChatRoomCbs object
|
||||
* @param[in] cbs #LinphoneChatRoomCbs object
|
||||
* @param[in] cb The participants capabilities callback to be used
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participants_capabilities_checked (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb cb);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_message_2(Linphon
|
|||
* @param initial_content #LinphoneContent initial content. #LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if LinphoneContent.data is NULL.
|
||||
* @return a new #LinphoneChatMessage
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent* initial_content);
|
||||
LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, LinphoneContent* initial_content);
|
||||
|
||||
/**
|
||||
* get peer address \link linphone_core_get_chat_room() associated to \endlink this #LinphoneChatRoom
|
||||
|
|
@ -118,11 +118,11 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_message(Linphon
|
|||
|
||||
/**
|
||||
* Send a message to peer member of this chat room.
|
||||
* @param[in] cr LinphoneChatRoom object
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* The state of the message sending will be notified via the callbacks defined in the LinphoneChatMessageCbs object that can be obtained
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
* @param[in] msg #LinphoneChatMessage object
|
||||
* The state of the message sending will be notified via the callbacks defined in the #LinphoneChatMessageCbs object that can be obtained
|
||||
* by calling linphone_chat_message_get_callbacks().
|
||||
* The LinphoneChatMessage reference is transfered to the function and thus doesn't need to be unref'd by the application.
|
||||
* The #LinphoneChatMessage reference is transfered to the function and thus doesn't need to be unref'd by the application.
|
||||
* @deprecated Use linphone_chat_message_send() instead.
|
||||
* @donotwrap
|
||||
*/
|
||||
|
|
@ -130,8 +130,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_chat_message(Li
|
|||
|
||||
/**
|
||||
* Used to receive a chat message when using async mechanism with IM encryption engine
|
||||
* @param[in] cr LinphoneChatRoom object
|
||||
* @param[in] msg LinphoneChatMessage object
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
* @param[in] msg #LinphoneChatMessage object
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_receive_chat_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg);
|
||||
|
||||
|
|
@ -278,16 +278,16 @@ LINPHONE_PUBLIC bool_t linphone_chat_room_lime_available(LinphoneChatRoom *cr);
|
|||
/**
|
||||
* get Curent Call associated to this chatroom if any
|
||||
* To commit a message, use #linphone_chat_room_send_message
|
||||
* @param[in] room LinphoneChatRomm
|
||||
* @returns LinphoneCall or NULL.
|
||||
* @param[in] room #LinphoneChatRomm
|
||||
* @returns #LinphoneCall or NULL.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneCall *linphone_chat_room_get_call(const LinphoneChatRoom *room);
|
||||
|
||||
/**
|
||||
* Add a listener in order to be notified of LinphoneChatRoom events. Once an event is received, registred LinphoneChatRoomCbs are
|
||||
* Add a listener in order to be notified of #LinphoneChatRoom events. Once an event is received, registred #LinphoneChatRoomCbs are
|
||||
* invoked sequencially.
|
||||
* @param[in] call LinphoneChatRoom object to monitor.
|
||||
* @param[in] cbs A LinphoneChatRoomCbs object holding the callbacks you need. A reference is taken by the LinphoneChatRoom until you invoke linphone_call_remove_callbacks().
|
||||
* @param[in] call #LinphoneChatRoom object to monitor.
|
||||
* @param[in] cbs A #LinphoneChatRoomCbs object holding the callbacks you need. A reference is taken by the #LinphoneChatRoom until you invoke linphone_call_remove_callbacks().
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_add_callbacks(LinphoneChatRoom *cr, LinphoneChatRoomCbs *cbs);
|
||||
|
||||
|
|
@ -308,14 +308,14 @@ LINPHONE_PUBLIC LinphoneChatRoomCbs *linphone_chat_room_get_current_callbacks(co
|
|||
|
||||
/**
|
||||
* Get the state of the chat room.
|
||||
* @param[in] cr LinphoneChatRoom object
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
* @return The state of the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Return whether or not the chat room has been left.
|
||||
* @param[in] cr LinphoneChatRoom object
|
||||
* @param[in] cr #LinphoneChatRoom object
|
||||
* @return whether or not the chat room has been left
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom *cr);
|
||||
|
|
@ -330,7 +330,7 @@ LINPHONE_PUBLIC time_t linphone_chat_room_get_last_update_time(const LinphoneCha
|
|||
/**
|
||||
* Add a participant to a chat room. This may fail if this type of chat room does not handle participants.
|
||||
* Use linphone_chat_room_can_handle_participants() to know if this chat room handles participants.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] addr The address of the participant to add to the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr);
|
||||
|
|
@ -338,21 +338,21 @@ LINPHONE_PUBLIC void linphone_chat_room_add_participant (LinphoneChatRoom *cr, c
|
|||
/**
|
||||
* Add several participants to a chat room at once. This may fail if this type of chat room does not handle participants.
|
||||
* Use linphone_chat_room_can_handle_participants() to know if this chat room handles participants.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] addresses \bctbx_list{LinphoneAddress}
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_add_participants (LinphoneChatRoom *cr, const bctbx_list_t *addresses);
|
||||
|
||||
/**
|
||||
* Tells whether a chat room is able to handle participants.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return A boolean value telling whether the chat room can handle participants or not
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_chat_room_can_handle_participants (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Find a participant of a chat room from its address.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] addr The address to search in the list of participants of the chat room
|
||||
* @return The participant if found, NULL otherwise.
|
||||
*/
|
||||
|
|
@ -360,14 +360,14 @@ LINPHONE_PUBLIC LinphoneParticipant *linphone_chat_room_find_participant (const
|
|||
|
||||
/**
|
||||
* Get the capabilities of a chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return The capabilities of the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatRoomCapabilitiesMask linphone_chat_room_get_capabilities (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Check if a chat room has given capabilities.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] mask A Capabilities mask
|
||||
* @return True if the mask matches, false otherwise
|
||||
*/
|
||||
|
|
@ -375,62 +375,62 @@ LINPHONE_PUBLIC bool_t linphone_chat_room_has_capability(const LinphoneChatRoom
|
|||
|
||||
/**
|
||||
* Get the conference address of the chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return The conference address of the chat room or NULL if this type of chat room is not conference based
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_room_get_conference_address (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Get the participant representing myself in the chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return The participant representing myself in the conference.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneParticipant *linphone_chat_room_get_me (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Get the number of participants in the chat room (that is without ourselves).
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return The number of participants in the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC int linphone_chat_room_get_nb_participants (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Get the list of participants of a chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return \bctbx_list{LinphoneParticipant}
|
||||
*/
|
||||
LINPHONE_PUBLIC bctbx_list_t * linphone_chat_room_get_participants (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Get the subject of a chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return The subject of the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC const char * linphone_chat_room_get_subject (const LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Leave a chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_leave (LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Remove a participant of a chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] participant The participant to remove from the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant);
|
||||
|
||||
/**
|
||||
* Remove several participants of a chat room at once.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] participants \bctbx_list{LinphoneParticipant}
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_remove_participants (LinphoneChatRoom *cr, const bctbx_list_t *participants);
|
||||
|
||||
/**
|
||||
* Change the admin status of a participant of a chat room (you need to be an admin yourself to do this).
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] participant The Participant for which to change the admin status
|
||||
* @param[in] isAdmin A boolean value telling whether the participant should now be an admin or not
|
||||
*/
|
||||
|
|
@ -438,30 +438,30 @@ LINPHONE_PUBLIC void linphone_chat_room_set_participant_admin_status (LinphoneCh
|
|||
|
||||
/**
|
||||
* Set the subject of a chat room.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] subject The new subject to set for the chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_set_subject (LinphoneChatRoom *cr, const char *subject);
|
||||
|
||||
/**
|
||||
* Gets the list of participants that are currently composing
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @return \bctbx_list{LinphoneAddress} list of addresses that are in the is_composing state
|
||||
*/
|
||||
LINPHONE_PUBLIC const bctbx_list_t * linphone_chat_room_get_composing_addresses(LinphoneChatRoom *cr);
|
||||
|
||||
/**
|
||||
* Set the conference address of a group chat room. This function needs to be called from the
|
||||
* LinphoneChatRoomCbsConferenceAddressGenerationCb callback and only there.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* #LinphoneChatRoomCbsConferenceAddressGenerationCb callback and only there.
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] confAddr The conference address to be used by the group chat room
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_chat_room_set_conference_address (LinphoneChatRoom *cr, const LinphoneAddress *confAddr);
|
||||
|
||||
/**
|
||||
* Set the participant device. This function needs to be called from the
|
||||
* LinphoneChatRoomCbsParticipantDeviceFetchRequestedCb callback and only there.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* #LinphoneChatRoomCbsParticipantDeviceFetchRequestedCb callback and only there.
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] partAddr The participant address
|
||||
* @param[in] partDevices \bctbx_list{LinphoneAddress} list of the participant devices to be used by the group chat room
|
||||
*/
|
||||
|
|
@ -478,8 +478,8 @@ LINPHONE_PUBLIC void linphone_chat_room_add_participant_device (LinphoneChatRoom
|
|||
|
||||
/**
|
||||
* Set the participant device. This function needs to be called from the
|
||||
* LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb callback and only there.
|
||||
* @param[in] cr A LinphoneChatRoom object
|
||||
* #LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb callback and only there.
|
||||
* @param[in] cr A #LinphoneChatRoom object
|
||||
* @param[in] deviceAddr The device address
|
||||
* @param[in] participantsCompatible \bctbx_list{LinphoneAddress}
|
||||
*/
|
||||
|
|
|
|||
247
include/linphone/api/c-content.h
Normal file
247
include/linphone/api/c-content.h
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
/*
|
||||
* c-content.h
|
||||
* Copyright (C) 2010-2018 Belledonne Communications SARL
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _L_C_CONTENT_H_
|
||||
#define _L_C_CONTENT_H_
|
||||
|
||||
#include "linphone/api/c-types.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
/**
|
||||
* @addtogroup misc
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Acquire a reference to the content.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The same #LinphoneContent object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneContent *linphone_content_ref (LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Release reference to the content.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_content_unref (LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with the content.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The user pointer associated with the content.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_content_get_user_data (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to the content.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] ud The user pointer to associate with the content.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_content_set_user_data (LinphoneContent *content, void *user_data);
|
||||
|
||||
/**
|
||||
* Get the mime type of the content data.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The mime type of the content data, for example "application".
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_type (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the mime type of the content data.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] type The mime type of the content data, for example "application".
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_type (LinphoneContent *content, const char *type);
|
||||
|
||||
/**
|
||||
* Get the mime subtype of the content data.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The mime subtype of the content data, for example "html".
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_subtype (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the mime subtype of the content data.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] subtype The mime subtype of the content data, for example "html".
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_subtype (LinphoneContent *content, const char *subtype);
|
||||
|
||||
/**
|
||||
* Adds a parameter to the ContentType header.
|
||||
* @param[in] content LinphoneContent object.
|
||||
* @param[in] name the name of the parameter to add.
|
||||
* @param[in] value the value of the parameter to add.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_add_content_type_parameter (
|
||||
LinphoneContent *content,
|
||||
const char *name,
|
||||
const char *value
|
||||
);
|
||||
|
||||
/**
|
||||
* Get the content data buffer, usually a string.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The content data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC const uint8_t *linphone_content_get_buffer (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the content data buffer, usually a string.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] buffer The content data buffer.
|
||||
* @param[in] size The size of the content data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_buffer (LinphoneContent *content, const uint8_t *buffer, size_t size);
|
||||
|
||||
/**
|
||||
* Get the string content data buffer.
|
||||
* @param[in] content #LinphoneContent object
|
||||
* @return The string content data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_string_buffer (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the string content data buffer.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] buffer The string content data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_string_buffer (LinphoneContent *content, const char *buffer);
|
||||
|
||||
/**
|
||||
* Get the content data buffer size, excluding null character despite null character is always set for convenience.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The content data buffer size.
|
||||
*/
|
||||
LINPHONE_PUBLIC size_t linphone_content_get_size (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Get the file size if content is either a FileContent or a FileTransferContent.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The represented file size.
|
||||
*/
|
||||
LINPHONE_PUBLIC size_t linphone_content_get_file_size(const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the content data size, excluding null character despite null character is always set for convenience.
|
||||
* @param[in] content #LinphoneContent object
|
||||
* @param[in] size The content data buffer size.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_size (LinphoneContent *content, size_t size);
|
||||
|
||||
/**
|
||||
* Get the encoding of the data buffer, for example "gzip".
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The encoding of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_encoding (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the encoding of the data buffer, for example "gzip".
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] encoding The encoding of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_encoding (LinphoneContent *content, const char *encoding);
|
||||
|
||||
/**
|
||||
* Get the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The name of the content.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_name (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] name The name of the content.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_name (LinphoneContent *content, const char *name);
|
||||
|
||||
/**
|
||||
* Tell whether a content is a multipart content.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return A boolean value telling whether the content is multipart or not.
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_content_is_multipart (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Get a part from a multipart content according to its index.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] idx The index of the part to get.
|
||||
* @return A #LinphoneContent object holding the part if found, NULL otherwise.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneContent *linphone_content_get_part (const LinphoneContent *content, int idx);
|
||||
|
||||
/**
|
||||
* Find a part from a multipart content looking for a part header with a specified value.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] header_name The name of the header to look for.
|
||||
* @param[in] header_value The value of the header to look for.
|
||||
* @return A #LinphoneContent object object the part if found, NULL otherwise.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneContent *linphone_content_find_part_by_header (
|
||||
const LinphoneContent *content,
|
||||
const char *header_name,
|
||||
const char *header_value
|
||||
);
|
||||
|
||||
/**
|
||||
* Get a custom header value of a content.
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] header_name The name of the header to get the value from.
|
||||
* @return The value of the header if found, NULL otherwise.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_custom_header (const LinphoneContent *content, const char *header_name);
|
||||
|
||||
/**
|
||||
* Get the key associated with a RCS file transfer message if encrypted
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The key to encrypt/decrypt the file associated to this content.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char *linphone_content_get_key (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Get the size of key associated with a RCS file transfer message if encrypted
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @return The key size in bytes
|
||||
*/
|
||||
LINPHONE_PUBLIC size_t linphone_content_get_key_size (const LinphoneContent *content);
|
||||
|
||||
/**
|
||||
* Set the key associated with a RCS file transfer message if encrypted
|
||||
* @param[in] content #LinphoneContent object.
|
||||
* @param[in] key The key to be used to encrypt/decrypt file associated to this content.
|
||||
* @param[in] key_length The lengh of the key.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_content_set_key (LinphoneContent *content, const char *key, const size_t key_length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
#endif // ifndef _L_C_CONTENT_H_
|
||||
|
|
@ -22,9 +22,11 @@
|
|||
|
||||
#include "linphone/api/c-types.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern "C" {
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
/**
|
||||
* @addtogroup misc
|
||||
|
|
@ -34,88 +36,88 @@ extern "C" {
|
|||
/**
|
||||
* Constructs a LinphoneMagicSearch object
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneMagicSearch *linphone_magic_search_new(LinphoneCore *lc);
|
||||
LINPHONE_PUBLIC LinphoneMagicSearch *linphone_magic_search_new (LinphoneCore *lc);
|
||||
|
||||
/**
|
||||
* Increment reference count of LinphoneMagicSearch object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneMagicSearch *linphone_magic_search_ref(LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC LinphoneMagicSearch *linphone_magic_search_ref (LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Decrement reference count of LinphoneMagicSearch object. When dropped to zero, memory is freed.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_unref(LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_unref (LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Set the minimum value used to calculate the weight in search
|
||||
* @param[in] weight minimum weight
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_min_weight(LinphoneMagicSearch *magicSearch, const unsigned int weight);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_min_weight (LinphoneMagicSearch *magic_search, unsigned int weight);
|
||||
|
||||
/**
|
||||
* @return the minimum value used to calculate the weight in search
|
||||
**/
|
||||
LINPHONE_PUBLIC unsigned int linphone_magic_search_get_min_weight(const LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC unsigned int linphone_magic_search_get_min_weight (const LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Set the maximum value used to calculate the weight in search
|
||||
* @param[in] weight maximum weight
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_max_weight(LinphoneMagicSearch *magicSearch, const unsigned int weight);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_max_weight (LinphoneMagicSearch *magic_search, unsigned int weight);
|
||||
|
||||
/**
|
||||
* @return the maximum value used to calculate the weight in search
|
||||
**/
|
||||
LINPHONE_PUBLIC unsigned int linphone_magic_search_get_max_weight(const LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC unsigned int linphone_magic_search_get_max_weight (const LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* @return the delimiter used to find matched filter word
|
||||
**/
|
||||
LINPHONE_PUBLIC const char *linphone_magic_search_get_delimiter(const LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC const char *linphone_magic_search_get_delimiter (const LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Set the delimiter used to find matched filter word
|
||||
* @param[in] delimiter delimiter (example "-_.,")
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_delimiter(LinphoneMagicSearch *magicSearch, const char *delimiter);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_delimiter (LinphoneMagicSearch *magic_search, const char *delimiter);
|
||||
|
||||
/**
|
||||
* @return if the delimiter search is used
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_magic_search_get_use_delimiter(LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC bool_t linphone_magic_search_get_use_delimiter (LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Enable or disable the delimiter in search
|
||||
* @param[in] enable
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_use_delimiter(LinphoneMagicSearch *magicSearch, bool_t enable);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_use_delimiter (LinphoneMagicSearch *magic_search, bool_t enable);
|
||||
|
||||
/**
|
||||
* @return the number of the maximum SearchResult which will be return
|
||||
**/
|
||||
LINPHONE_PUBLIC unsigned int linphone_magic_search_get_search_limit(const LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC unsigned int linphone_magic_search_get_search_limit (const LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Set the number of the maximum SearchResult which will be return
|
||||
* @param[in] limit
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_search_limit(LinphoneMagicSearch *magicSearch, const unsigned int limit);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_search_limit (LinphoneMagicSearch *magic_search, unsigned int limit);
|
||||
|
||||
/**
|
||||
* @return if the search is limited
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_magic_search_get_limited_search(const LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC bool_t linphone_magic_search_get_limited_search (const LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Enable or disable the limited search
|
||||
* @param[in] limited
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_limited_search(LinphoneMagicSearch *magicSearch, const bool_t limited);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_set_limited_search (LinphoneMagicSearch *magic_search, bool_t limited);
|
||||
|
||||
/**
|
||||
* Reset the cache to begin a new search
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_magic_search_reset_search_cache(LinphoneMagicSearch *magicSearch);
|
||||
LINPHONE_PUBLIC void linphone_magic_search_reset_search_cache (LinphoneMagicSearch *magic_search);
|
||||
|
||||
/**
|
||||
* Create a sorted list of SearchResult from SipUri, Contact name,
|
||||
|
|
@ -124,13 +126,17 @@ LINPHONE_PUBLIC void linphone_magic_search_reset_search_cache(LinphoneMagicSearc
|
|||
* During the first search, a cache is created and used for the next search
|
||||
* Use linphone_magic_search_reset_search_cache() to begin a new search
|
||||
* @param[in] filter word we search
|
||||
* @param[in] withDomain domain which we want to search only
|
||||
* @param[in] domain domain which we want to search only
|
||||
* - "" for searching in all contact
|
||||
* - "*" for searching in contact with sip SipUri
|
||||
* - "yourdomain" for searching in contact from "yourdomain" domain
|
||||
* @return sorted list of \bctbx_list{LinphoneSearchResult}
|
||||
**/
|
||||
LINPHONE_PUBLIC bctbx_list_t* linphone_magic_search_get_contact_list_from_filter(LinphoneMagicSearch *magicSearch, const char *filter, const char *withDomain);
|
||||
LINPHONE_PUBLIC bctbx_list_t* linphone_magic_search_get_contact_list_from_filter (
|
||||
LinphoneMagicSearch *magic_search,
|
||||
const char *filter,
|
||||
const char *domain
|
||||
);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
|||
91
include/linphone/api/c-participant-imdn-state.h
Normal file
91
include/linphone/api/c-participant-imdn-state.h
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* c-participant-imdn-state.h
|
||||
* Copyright (C) 2010-2018 Belledonne Communications SARL
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _L_C_PARTICIPANT_IMDN_STATE_H_
|
||||
#define _L_C_PARTICIPANT_IMDN_STATE_H_
|
||||
|
||||
#include "linphone/api/c-types.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
/**
|
||||
* @addtogroup misc
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Increment reference count of LinphoneParticipantImdnState object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneParticipantImdnState *linphone_participant_imdn_state_ref (LinphoneParticipantImdnState *state);
|
||||
|
||||
/**
|
||||
* Decrement reference count of LinphoneParticipantImdnState object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_participant_imdn_state_unref (LinphoneParticipantImdnState *state);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with a LinphoneParticipantImdnState.
|
||||
* @param[in] state A LinphoneParticipantImdnState object
|
||||
* @return The user pointer associated with the LinphoneParticipantImdnState.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_participant_imdn_state_get_user_data(const LinphoneParticipantImdnState *state);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to a LinphoneParticipantImdnState.
|
||||
* @param[in] state A LinphoneParticipantImdnState object
|
||||
* @param[in] ud The user pointer to associate with the LinphoneParticipantImdnState
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_participant_imdn_state_set_user_data(LinphoneParticipantImdnState *state, void *ud);
|
||||
|
||||
/**
|
||||
* Get the participant concerned by a LinphoneParticipantImdnState.
|
||||
* @param[in] state A LinphoneParticipantImdnState object
|
||||
* @return The participant concerned by the LinphoneParticipantImdnState
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneParticipant *linphone_participant_imdn_state_get_participant (
|
||||
const LinphoneParticipantImdnState *state
|
||||
);
|
||||
|
||||
/**
|
||||
* Get the chat message state the participant is in.
|
||||
* @param state A LinphoneParticipantImdnState object
|
||||
* @return The chat message state the participant is in
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneChatMessageState linphone_participant_imdn_state_get_state (const LinphoneParticipantImdnState *state);
|
||||
|
||||
/**
|
||||
* Get the timestamp at which a participant has reached the state described by a LinphoneParticipantImdnState.
|
||||
* @param[in] state A LinphoneParticipantImdnState object
|
||||
* @return The timestamp at which the participant has reached the state described in the LinphoneParticipantImdnState
|
||||
*/
|
||||
LINPHONE_PUBLIC time_t linphone_participant_imdn_state_get_state_change_time (const LinphoneParticipantImdnState *state);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
#endif // ifndef _L_C_PARTICIPANT_IMDN_STATE_H_
|
||||
|
|
@ -34,39 +34,39 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Increment reference count of LinphoneParticipant object.
|
||||
* Increment reference count of #LinphoneParticipant object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneParticipant *linphone_participant_ref (LinphoneParticipant *participant);
|
||||
|
||||
/**
|
||||
* Decrement reference count of LinphoneParticipant object.
|
||||
* Decrement reference count of #LinphoneParticipant object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_participant_unref (LinphoneParticipant *participant);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with the conference participant.
|
||||
* @param[in] participant A LinphoneParticipant object
|
||||
* @param[in] participant A #LinphoneParticipant object
|
||||
* @return The user pointer associated with the participant.
|
||||
**/
|
||||
LINPHONE_PUBLIC void * linphone_participant_get_user_data(const LinphoneParticipant *participant);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to the conference participant.
|
||||
* @param[in] participant A LinphoneParticipant object
|
||||
* @param[in] participant A #LinphoneParticipant object
|
||||
* @param[in] ud The user pointer to associate with the participant
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_participant_set_user_data(LinphoneParticipant *participant, void *ud);
|
||||
|
||||
/**
|
||||
* Get the address of a conference participant.
|
||||
* @param[in] participant A LinphoneParticipant object
|
||||
* @param[in] participant A #LinphoneParticipant object
|
||||
* @return The address of the participant
|
||||
*/
|
||||
LINPHONE_PUBLIC const LinphoneAddress * linphone_participant_get_address (const LinphoneParticipant *participant);
|
||||
|
||||
/**
|
||||
* Tells whether a conference participant is an administrator of the conference.
|
||||
* @param[in] participant A LinphoneParticipant object
|
||||
* @param[in] participant A #LinphoneParticipant object
|
||||
* @return A boolean value telling whether the participant is an administrator
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_participant_is_admin (const LinphoneParticipant *participant);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ LINPHONE_PUBLIC const LinphoneFriend* linphone_search_result_get_friend(const Li
|
|||
**/
|
||||
LINPHONE_PUBLIC const LinphoneAddress* linphone_search_result_get_address(const LinphoneSearchResult *searchResult);
|
||||
|
||||
/**
|
||||
* @return Phone Number associed
|
||||
**/
|
||||
LINPHONE_PUBLIC const char* linphone_search_result_get_phone_number(const LinphoneSearchResult *searchResult);
|
||||
|
||||
/**
|
||||
* @return the result weight
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@
|
|||
/**
|
||||
* Object that represents a SIP address.
|
||||
*
|
||||
* The LinphoneAddress is an opaque object to represents SIP addresses, ie
|
||||
* The #LinphoneAddress is an opaque object to represents SIP addresses, ie
|
||||
* the content of SIP's 'from' and 'to' headers.
|
||||
* A SIP address is made of display name, username, domain name, port, and various
|
||||
* uri headers (such as tags). It looks like 'Alice <sip:alice@example.net>'.
|
||||
* The LinphoneAddress has methods to extract and manipulate all parts of the address.
|
||||
* The #LinphoneAddress has methods to extract and manipulate all parts of the address.
|
||||
* When some part of the address (for example the username) is empty, the accessor methods
|
||||
* return NULL.
|
||||
* @ingroup linphone_address
|
||||
|
|
@ -77,20 +77,20 @@ typedef struct _LinphoneAddress LinphoneAddress;
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The LinphoneCall object represents a call issued or received by the LinphoneCore
|
||||
* The #LinphoneCall object represents a call issued or received by the #LinphoneCore
|
||||
* @ingroup call_control
|
||||
**/
|
||||
*/
|
||||
typedef struct _LinphoneCall LinphoneCall;
|
||||
|
||||
/** Callback prototype */
|
||||
typedef void (*LinphoneCallCbFunc) (LinphoneCall *call, void *ud);
|
||||
|
||||
/**
|
||||
* That class holds all the callbacks which are called by LinphoneCall objects.
|
||||
* That class holds all the callbacks which are called by #LinphoneCall objects.
|
||||
*
|
||||
* Use linphone_factory_create_call_cbs() to create an instance. Then, call the
|
||||
* callback setters on the events you need to monitor and pass the object to
|
||||
* a LinphoneCall instance through linphone_call_add_callbacks().
|
||||
* a #LinphoneCall instance through linphone_call_add_callbacks().
|
||||
* @ingroup call_control
|
||||
*/
|
||||
typedef struct _LinphoneCallCbs LinphoneCallCbs;
|
||||
|
|
@ -106,7 +106,7 @@ typedef struct _LinphoneCallCbs LinphoneCallCbs;
|
|||
typedef struct _LinphoneChatMessage LinphoneChatMessage;
|
||||
|
||||
/**
|
||||
* An object to handle the callbacks for the handling a LinphoneChatMessage objects.
|
||||
* An object to handle the callbacks for the handling a #LinphoneChatMessage objects.
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs;
|
||||
|
|
@ -119,13 +119,13 @@ typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs;
|
|||
typedef struct _LinphoneChatRoom LinphoneChatRoom;
|
||||
|
||||
/**
|
||||
* A mask of LinphoneChatRoomCapabilities
|
||||
* A mask of #LinphoneChatRoomCapabilities
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
typedef int LinphoneChatRoomCapabilitiesMask;
|
||||
|
||||
/**
|
||||
* An object to handle the callbacks for the handling a LinphoneChatRoom objects.
|
||||
* An object to handle the callbacks for the handling a #LinphoneChatRoom objects.
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
typedef struct _LinphoneChatRoomCbs LinphoneChatRoomCbs;
|
||||
|
|
@ -144,43 +144,76 @@ typedef struct _LinphoneEventLog LinphoneEventLog;
|
|||
// Misc.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The LinphoneContent object holds data that can be embedded in a signaling message.
|
||||
* @ingroup misc
|
||||
*/
|
||||
typedef struct _LinphoneContent LinphoneContent;
|
||||
|
||||
/**
|
||||
* Represents a dial plan
|
||||
* @ingroup misc
|
||||
**/
|
||||
*/
|
||||
typedef struct _LinphoneDialPlan LinphoneDialPlan;
|
||||
|
||||
/**
|
||||
* A LinphoneMagicSearch is used to do specifics searchs
|
||||
* A #LinphoneMagicSearch is used to do specifics searchs
|
||||
* @ingroup misc
|
||||
**/
|
||||
*/
|
||||
typedef struct _LinphoneMagicSearch LinphoneMagicSearch;
|
||||
|
||||
/**
|
||||
* The LinphoneParticipant object represents a participant of a conference.
|
||||
* @ingroup misc
|
||||
**/
|
||||
*/
|
||||
typedef struct _LinphoneParticipant LinphoneParticipant;
|
||||
|
||||
/**
|
||||
* The LinphoneParticipantImdnState object represents the state of chat message for a participant of a conference chat room.
|
||||
* @ingroup misc
|
||||
*/
|
||||
typedef struct _LinphoneParticipantImdnState LinphoneParticipantImdnState;
|
||||
|
||||
/**
|
||||
* The LinphoneSearchResult object represents a result of a search
|
||||
* @ingroup misc
|
||||
**/
|
||||
*/
|
||||
typedef struct _LinphoneSearchResult LinphoneSearchResult;
|
||||
|
||||
// =============================================================================
|
||||
// C Enums.
|
||||
// =============================================================================
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// How-to: Declare one enum
|
||||
//
|
||||
// 1. Declare a macro like this example in include/linphone/enums/chat-message-enums.h:
|
||||
//
|
||||
// #define L_ENUM_VALUES_CHAT_MESSAGE_DIRECTION(F) \ //
|
||||
// F(Incoming /**< Incoming message */) \ //
|
||||
// F(Outgoing /**< Outgoing message */)
|
||||
//
|
||||
// 2. And in this file, call L_DECLARE_C_ENUM with the enum name and values as params:
|
||||
//
|
||||
// L_DECLARE_C_ENUM(ChatMessageDirection, L_ENUM_VALUES_CHAT_MESSAGE_DIRECTION);
|
||||
//
|
||||
// 3. Do not forget to replace each single quote (with ') or other special char like
|
||||
// to an escaped sequence. Otherwise you get this error at compilation:
|
||||
//
|
||||
// [ 99%] Building CXX object wrappers/cpp/CMakeFiles/linphone++.dir/src/linphone++.cc.o
|
||||
// c++: error: WORK/desktop/Build/linphone/wrappers/cpp/src/linphone++.cc: No such file or directory
|
||||
// c++: fatal error: no input files
|
||||
// compilation terminated.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Call.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* LinphoneCallState enum represents the different state a call can reach into.
|
||||
* #LinphoneCallState enum represents the different state a call can reach into.
|
||||
* The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback.
|
||||
* @ingroup call_control
|
||||
**/
|
||||
*/
|
||||
L_DECLARE_C_ENUM(CallState, L_ENUM_VALUES_CALL_SESSION_STATE);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -188,25 +221,25 @@ L_DECLARE_C_ENUM(CallState, L_ENUM_VALUES_CALL_SESSION_STATE);
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* LinphoneChatMessageDirection is used to indicate if a message is outgoing or incoming.
|
||||
* #LinphoneChatMessageDirection is used to indicate if a message is outgoing or incoming.
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
L_DECLARE_C_ENUM(ChatMessageDirection, L_ENUM_VALUES_CHAT_MESSAGE_DIRECTION);
|
||||
|
||||
/**
|
||||
* LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.
|
||||
* #LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
*/
|
||||
L_DECLARE_C_ENUM(ChatMessageState, L_ENUM_VALUES_CHAT_MESSAGE_STATE);
|
||||
|
||||
/**
|
||||
* LinphoneChatRoomCapabilities is used to indicated the capabilities of a chat room.
|
||||
* #LinphoneChatRoomCapabilities is used to indicated the capabilities of a chat room.
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
L_DECLARE_C_ENUM_FIXED_VALUES(ChatRoomCapabilities, L_ENUM_VALUES_CHAT_ROOM_CAPABILITIES);
|
||||
|
||||
/**
|
||||
* LinphoneChatRoomState is used to indicate the current state of a chat room.
|
||||
* #LinphoneChatRoomState is used to indicate the current state of a chat room.
|
||||
* @ingroup chatroom
|
||||
*/
|
||||
L_DECLARE_C_ENUM(ChatRoomState, L_ENUM_VALUES_CHAT_ROOM_STATE);
|
||||
|
|
@ -216,7 +249,7 @@ L_DECLARE_C_ENUM(ChatRoomState, L_ENUM_VALUES_CHAT_ROOM_STATE);
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* LinphoneEventLogType is used to indicate the type of an event. Useful for cast.
|
||||
* #LinphoneEventLogType is used to indicate the type of an event. Useful for cast.
|
||||
* @ingroup events
|
||||
*/
|
||||
L_DECLARE_C_ENUM(EventLogType, L_ENUM_VALUES_EVENT_LOG_TYPE);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
*/
|
||||
|
||||
/**
|
||||
* Safely cast a belle_sip_object_t into LinphoneAuthInfo
|
||||
* Safely cast a belle_sip_object_t into #LinphoneAuthInfo
|
||||
*/
|
||||
#define LINPHONE_AUTH_INFO(obj) BELLE_SIP_CAST(obj, LinphoneAuthInfo)
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ extern "C" {
|
|||
* @param ha1 The ha1-encrypted password if password is not given in clear text.
|
||||
* @param realm The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter.
|
||||
* @param domain The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain.
|
||||
* @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The LinphoneCore makes a copy of LinphoneAuthInfo
|
||||
* @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The #LinphoneCore makes a copy of #LinphoneAuthInfo
|
||||
* passed through linphone_core_add_auth_info().
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_new(
|
||||
|
|
|
|||
|
|
@ -35,63 +35,63 @@ extern "C" {
|
|||
*/
|
||||
|
||||
/**
|
||||
* Create a new empty LinphoneBuffer object.
|
||||
* @return A new LinphoneBuffer object.
|
||||
* Create a new empty #LinphoneBuffer object.
|
||||
* @return A new #LinphoneBuffer object.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_new(void);
|
||||
|
||||
/**
|
||||
* Create a new LinphoneBuffer object from existing data.
|
||||
* Create a new #LinphoneBuffer object from existing data.
|
||||
* @param[in] data The initial data to store in the LinphoneBuffer.
|
||||
* @param[in] size The size of the initial data to stroe in the LinphoneBuffer.
|
||||
* @return A new LinphoneBuffer object.
|
||||
* @return A new #LinphoneBuffer object.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_new_from_data(const uint8_t *data, size_t size);
|
||||
|
||||
/**
|
||||
* Create a new LinphoneBuffer object from a string.
|
||||
* Create a new #LinphoneBuffer object from a string.
|
||||
* @param[in] data The initial string content of the LinphoneBuffer.
|
||||
* @return A new LinphoneBuffer object.
|
||||
* @return A new #LinphoneBuffer object.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_new_from_string(const char *data);
|
||||
|
||||
/**
|
||||
* Acquire a reference to the buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @return The same LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @return The same #LinphoneBuffer object.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_ref(LinphoneBuffer *buffer);
|
||||
|
||||
/**
|
||||
* Release reference to the buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_buffer_unref(LinphoneBuffer *buffer);
|
||||
|
||||
/**
|
||||
* Retrieve the user pointer associated with the buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @return The user pointer associated with the buffer.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_buffer_get_user_data(const LinphoneBuffer *buffer);
|
||||
|
||||
/**
|
||||
* Assign a user pointer to the buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @param[in] ud The user pointer to associate with the buffer.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_buffer_set_user_data(LinphoneBuffer *buffer, void *ud);
|
||||
|
||||
/**
|
||||
* Get the content of the data buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @return The content of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC const uint8_t * linphone_buffer_get_content(const LinphoneBuffer *buffer);
|
||||
|
||||
/**
|
||||
* Set the content of the data buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @param[in] content The content of the data buffer.
|
||||
* @param[in] size The size of the content of the data buffer.
|
||||
*/
|
||||
|
|
@ -99,36 +99,36 @@ LINPHONE_PUBLIC void linphone_buffer_set_content(LinphoneBuffer *buffer, const u
|
|||
|
||||
/**
|
||||
* Get the string content of the data buffer.
|
||||
* @param[in] buffer LinphoneBuffer object
|
||||
* @param[in] buffer #LinphoneBuffer object
|
||||
* @return The string content of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC const char * linphone_buffer_get_string_content(const LinphoneBuffer *buffer);
|
||||
|
||||
/**
|
||||
* Set the string content of the data buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @param[in] content The string content of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_buffer_set_string_content(LinphoneBuffer *buffer, const char *content);
|
||||
|
||||
/**
|
||||
* Get the size of the content of the data buffer.
|
||||
* @param[in] buffer LinphoneBuffer object.
|
||||
* @param[in] buffer #LinphoneBuffer object.
|
||||
* @return The size of the content of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC size_t linphone_buffer_get_size(const LinphoneBuffer *buffer);
|
||||
|
||||
/**
|
||||
* Set the size of the content of the data buffer.
|
||||
* @param[in] buffer LinphoneBuffer object
|
||||
* @param[in] buffer #LinphoneBuffer object
|
||||
* @param[in] size The size of the content of the data buffer.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_buffer_set_size(LinphoneBuffer *buffer, size_t size);
|
||||
|
||||
/**
|
||||
* Tell whether the LinphoneBuffer is empty.
|
||||
* @param[in] buffer LinphoneBuffer object
|
||||
* @return A boolean value telling whether the LinphoneBuffer is empty or not.
|
||||
* Tell whether the #LinphoneBuffer is empty.
|
||||
* @param[in] buffer #LinphoneBuffer object
|
||||
* @return A boolean value telling whether the #LinphoneBuffer is empty or not.
|
||||
*/
|
||||
LINPHONE_PUBLIC bool_t linphone_buffer_is_empty(const LinphoneBuffer *buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -38,35 +38,35 @@ extern "C" {
|
|||
|
||||
/**
|
||||
* Get the call ID used by the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The call ID used by the call as a string.
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_call_log_get_call_id(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Get the direction of the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The direction of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneCallDir linphone_call_log_get_dir(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Get the duration of the call since connected.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The duration of the call in seconds.
|
||||
**/
|
||||
LINPHONE_PUBLIC int linphone_call_log_get_duration(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Get the origin address (ie from) of the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The origin address (ie from) of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_from_address(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Get the RTP statistics computed locally regarding the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The RTP statistics that have been computed locally for the call.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -74,7 +74,7 @@ LINPHONE_PUBLIC const rtp_stats_t * linphone_call_log_get_local_stats(const Linp
|
|||
|
||||
/**
|
||||
* Get the overall quality indication of the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The overall quality indication of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC float linphone_call_log_get_quality(const LinphoneCallLog *cl);
|
||||
|
|
@ -85,7 +85,7 @@ LINPHONE_PUBLIC float linphone_call_log_get_quality(const LinphoneCallLog *cl);
|
|||
* The reference key can be for example an id to an external database.
|
||||
* It is stored in the config file, thus can survive to process exits/restarts.
|
||||
*
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The reference key string that has been associated to the call log, or NULL if none has been associated.
|
||||
**/
|
||||
LINPHONE_PUBLIC const char * linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
|
||||
|
|
@ -99,7 +99,7 @@ LINPHONE_PUBLIC const LinphoneAddress *linphone_call_log_get_local_address(const
|
|||
|
||||
/**
|
||||
* Get the remote address (that is from or to depending on call direction).
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The remote address of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_remote_address(const LinphoneCallLog *cl);
|
||||
|
|
@ -107,7 +107,7 @@ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_remote_address(con
|
|||
/**
|
||||
* Get the RTP statistics computed by the remote end and sent back via RTCP.
|
||||
* @note Not implemented yet.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The RTP statistics that have been computed by the remote end for the call.
|
||||
* @donotwrap
|
||||
**/
|
||||
|
|
@ -115,21 +115,21 @@ LINPHONE_PUBLIC const rtp_stats_t * linphone_call_log_get_remote_stats(const Lin
|
|||
|
||||
/**
|
||||
* Get the start date of the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The date of the beginning of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC time_t linphone_call_log_get_start_date(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Get the status of the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The status of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneCallStatus linphone_call_log_get_status(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Get the destination address (ie to) of the call.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The destination address (ie to) of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_to_address(const LinphoneCallLog *cl);
|
||||
|
|
@ -140,14 +140,14 @@ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_to_address(const L
|
|||
* The reference key can be for example an id to an external database.
|
||||
* It is stored in the config file, thus can survive to process exits/restarts.
|
||||
*
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @param[in] refkey The reference key string to associate to the call log.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey);
|
||||
|
||||
/**
|
||||
* Tell whether video was enabled at the end of the call or not.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return A boolean value telling whether video was enabled at the end of the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_call_log_video_enabled(const LinphoneCallLog *cl);
|
||||
|
|
@ -155,7 +155,7 @@ LINPHONE_PUBLIC bool_t linphone_call_log_video_enabled(const LinphoneCallLog *cl
|
|||
/**
|
||||
* Get a human readable string describing the call.
|
||||
* @note: the returned string must be freed by the application (use ms_free()).
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return A human readable string describing the call.
|
||||
**/
|
||||
LINPHONE_PUBLIC char * linphone_call_log_to_str(const LinphoneCallLog *cl);
|
||||
|
|
@ -181,28 +181,28 @@ LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_call_log_get_error_info(const
|
|||
|
||||
/**
|
||||
* Get the user data associated with the call log.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The user data associated with the call log.
|
||||
**/
|
||||
LINPHONE_PUBLIC void *linphone_call_log_get_user_data(const LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Assign a user data to the call log.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @param[in] ud The user data to associate with the call log.
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_log_set_user_data(LinphoneCallLog *cl, void *ud);
|
||||
|
||||
/**
|
||||
* Acquire a reference to the call log.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @return The same LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
* @return The same #LinphoneCallLog object
|
||||
**/
|
||||
LINPHONE_PUBLIC LinphoneCallLog * linphone_call_log_ref(LinphoneCallLog *cl);
|
||||
|
||||
/**
|
||||
* Release a reference to the call log.
|
||||
* @param[in] cl LinphoneCallLog object
|
||||
* @param[in] cl #LinphoneCallLog object
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_call_log_unref(LinphoneCallLog *cl);
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ LINPHONE_PUBLIC LinphoneCallLog *linphone_core_create_call_log(LinphoneCore *lc,
|
|||
|
||||
/**
|
||||
* Destroy a LinphoneCallLog.
|
||||
* @param cl LinphoneCallLog object
|
||||
* @param cl #LinphoneCallLog object
|
||||
* @deprecated Use linphone_call_log_unref() instead.
|
||||
* @donotwrap
|
||||
*/
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue