Commit 35d65d36 authored by Yann Diorcet's avatar Yann Diorcet

Merge branch 'master' of git.linphone.org:linphone into upnp

Conflicts:
	coreapi/linphone_tunnel.cc
	mediastreamer2
parents a1645810 d55c0fbf
......@@ -33,13 +33,12 @@ AM_INIT_AUTOMAKE
AC_SUBST([LIBTOOL_DEPS])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_SUBST([docdir], [${datadir}/doc])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_C_INLINE
AM_PROG_CC_STDC
AC_HEADER_STDC
AM_PROG_CC_C_O
AC_CHECK_PROGS(MD5SUM,[md5sum md5])
......
......@@ -895,22 +895,22 @@ linphonec_prompt_for_auth_final(LinphoneCore *lc)
void
print_usage (int exit_status)
{
fprintf (stdout, "\n\
usage: linphonec [-c file] [-s sipaddr] [-a] [-V] [-d level ] [-l logfile]\n\
linphonec -v\n\
\n\
-b file specify path of readonly factory configuration file.\n\
-c file specify path of configuration file.\n\
-d level be verbose. 0 is no output. 6 is all output\n\
-l logfile specify the log file for your SIP phone\n\
-s sipaddress specify the sip call to do at startup\n\
-a enable auto answering for incoming calls\n\
-V enable video features globally (disabled by default)\n\
-C enable video capture only (disabled by default)\n\
-D enable video display only (disabled by default)\n\
-S show general state messages (disabled by default)\n\
--wid windowid force embedding of video window into provided windowid (disabled by default)\n\
-v or --version display version and exits.\n");
fprintf (stdout, "\n"
"usage: linphonec [-c file] [-s sipaddr] [-a] [-V] [-d level ] [-l logfile]\n"
"linphonec -v\n"
"\n"
" -b file specify path of readonly factory configuration file.\n"
" -c file specify path of configuration file.\n"
" -d level be verbose. 0 is no output. 6 is all output\n"
" -l logfile specify the log file for your SIP phone\n"
" -s sipaddress specify the sip call to do at startup\n"
" -a enable auto answering for incoming calls\n"
" -V enable video features globally (disabled by default)\n"
" -C enable video capture only (disabled by default)\n"
" -D enable video display only (disabled by default)\n"
" -S show general state messages (disabled by default)\n"
" --wid windowid force embedding of video window into provided windowid (disabled by default)\n"
" -v or --version display version and exits.\n");
exit(exit_status);
}
......
......@@ -57,6 +57,7 @@ if BUILD_WIZARD
liblinphone_la_SOURCES+=sipwizard.c
endif
liblinphone_la_SOURCES+=linphone_tunnel_config.c
if BUILD_TUNNEL
liblinphone_la_SOURCES+=linphone_tunnel.cc TunnelManager.cc TunnelManager.hh
else
......
......@@ -107,6 +107,10 @@ void TunnelManager::addServer(const char *ip, int port,unsigned int udpMirrorPor
}
void TunnelManager::addServer(const char *ip, int port) {
if (ip == NULL) {
ip = "";
ms_warning("Adding tunnel server with empty ip, it will not work!");
}
mServerAddrs.push_back(ServerAddr(ip,port));
if (mTunnelClient) mTunnelClient->addServer(ip,port);
}
......
......@@ -131,7 +131,7 @@ void linphone_auth_info_write_config(LpConfig *config, LinphoneAuthInfo *obj, in
sprintf(key,"auth_info_%i",pos);
lp_config_clean_section(config,key);
if (obj==NULL){
if (obj==NULL || lp_config_get_int(config, "sip", "store_auth_info", 1) == 0){
return;
}
if (obj->username!=NULL){
......
......@@ -356,7 +356,7 @@ static void call_accepted(SalOp *op){
linphone_call_set_state(call,LinphoneCallConnected,"Connected");
if (call->referer) linphone_core_notify_refer_state(lc,call->referer,call);
}
if (md && !sal_media_description_empty(md)){
if (md && !sal_media_description_empty(md) && !linphone_core_incompatible_security(lc,md)){
if (sal_media_description_has_dir(md,SalStreamSendOnly) ||
sal_media_description_has_dir(md,SalStreamInactive)){
if (lc->vtable.display_status){
......@@ -405,7 +405,7 @@ static void call_accepted(SalOp *op){
}else{
/*send a bye*/
ms_error("Incompatible SDP offer received in 200Ok, need to abort the call");
linphone_core_abort_call(lc,call,_("Incompatible, check codecs..."));
linphone_core_abort_call(lc,call,_("Incompatible, check codecs or security settings..."));
}
}
......
......@@ -20,19 +20,19 @@ package org.linphone.core.tutorials;
import org.linphone.core.LinphoneAddress;
import org.linphone.core.LinphoneCall;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCallStats;
import org.linphone.core.LinphoneChatMessage;
import org.linphone.core.LinphoneChatRoom;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
import org.linphone.core.LinphoneCore.GlobalState;
import org.linphone.core.LinphoneCore.RegistrationState;
import org.linphone.core.LinphoneCoreException;
import org.linphone.core.LinphoneCoreFactory;
import org.linphone.core.LinphoneCoreListener;
import org.linphone.core.LinphoneFriend;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCore.GlobalState;
import org.linphone.core.LinphoneCore.RegistrationState;
/**
......@@ -50,7 +50,7 @@ import org.linphone.core.LinphoneCore.RegistrationState;
* @author Guillaume Beraudo
*
*/
public class TutorialChatRoom implements LinphoneCoreListener {
public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessage.StateListener {
private boolean running;
private TutorialNotifier TutorialNotifier;
......@@ -83,7 +83,7 @@ public class TutorialChatRoom implements LinphoneCoreListener {
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) {
write("Message ["+message+"] received from ["+from.asString()+"]");
//Deprecated
}
......@@ -118,7 +118,8 @@ public class TutorialChatRoom implements LinphoneCoreListener {
LinphoneChatRoom chatRoom = lc.createChatRoom(destinationSipAddress);
// Send message
chatRoom.sendMessage("Hello world");
LinphoneChatMessage chatMessage = chatRoom.createLinphoneChatMessage("Hello world");
chatRoom.sendMessage(chatMessage, this);
// main loop for receiving notifications and doing background linphonecore work
running = true;
......@@ -153,8 +154,13 @@ public class TutorialChatRoom implements LinphoneCoreListener {
@Override
public void messageReceived(LinphoneCore lc, LinphoneChatRoom cr,
LinphoneChatMessage message) {
// TODO Auto-generated method stub
write("Message [" + message.getMessage() + "] received from [" + message.getFrom().asString() + "]");
}
@Override
public void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg,
org.linphone.core.LinphoneChatMessage.State state) {
write("Sent message [" + msg.getMessage() + "] new state is " + state.toString());
}
......
......@@ -29,58 +29,199 @@
#include "private.h"
#include "lpconfig.h"
LinphoneTunnel* linphone_core_get_tunnel(LinphoneCore *lc){
return lc->tunnel;
}
struct _LinphoneTunnel {
belledonnecomm::TunnelManager *manager;
MSList *config_list;
};
extern "C" LinphoneTunnel* linphone_core_tunnel_new(LinphoneCore *lc){
LinphoneTunnel* tunnel = ms_new0(LinphoneTunnel, 1);
tunnel->manager = new belledonnecomm::TunnelManager(lc);
return tunnel;
}
static inline belledonnecomm::TunnelManager *bcTunnel(LinphoneTunnel *tunnel){
return (belledonnecomm::TunnelManager *)tunnel;
return tunnel->manager;
}
static inline _LpConfig *config(LinphoneTunnel *tunnel){
return ((belledonnecomm::TunnelManager *)tunnel)->getLinphoneCore()->config;
return tunnel->manager->getLinphoneCore()->config;
}
extern "C" LinphoneTunnel* linphone_core_tunnel_new(LinphoneCore *lc){
LinphoneTunnel* tunnel= (LinphoneTunnel*) new belledonnecomm::TunnelManager(lc);
return tunnel;
void linphone_tunnel_destroy(LinphoneTunnel *tunnel){
delete tunnel->manager;
ms_free(tunnel);
}
void linphone_tunnel_destroy(LinphoneTunnel *tunnel){
delete bcTunnel(tunnel);
static char *linphone_tunnel_config_to_string(const LinphoneTunnelConfig *tunnel_config) {
char *str = NULL;
if(linphone_tunnel_config_get_remote_udp_mirror_port(tunnel_config) != -1) {
str = ms_strdup_printf("%s:%d:%d:%d",
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));
} else {
str = ms_strdup_printf("%s:%d",
linphone_tunnel_config_get_host(tunnel_config),
linphone_tunnel_config_get_port(tunnel_config));
}
return str;
}
static LinphoneTunnelConfig *linphone_tunnel_config_from_string(const char *str) {
LinphoneTunnelConfig *tunnel_config = NULL;
char * dstr = ms_strdup(str);
const char *host = NULL;
int port = -1;
int remote_udp_mirror_port = -1;
int delay = -1;
int pos = 0;
char *pch;
pch = strtok(dstr, ":");
while(pch != NULL) {
switch(pos) {
case 0:
host = pch;
break;
case 1:
port = atoi(pch);
break;
case 2:
remote_udp_mirror_port = atoi(pch);
break;
case 3:
delay = atoi(pch);
break;
default:
// Abort
pos = 0;
break;
}
++pos;
pch = strtok(NULL, ":");
}
if(pos >= 2) {
tunnel_config = linphone_tunnel_config_new();
linphone_tunnel_config_set_host(tunnel_config, host);
linphone_tunnel_config_set_port(tunnel_config, port);
}
if(pos >= 3) {
linphone_tunnel_config_set_remote_udp_mirror_port(tunnel_config, remote_udp_mirror_port);
}
if(pos == 4) {
linphone_tunnel_config_set_delay(tunnel_config, delay);
}
ms_free(dstr);
return tunnel_config;
}
static void add_server_to_config(LinphoneTunnel *tunnel, const char *host, int port){
const char *orig=lp_config_get_string(config(tunnel),"tunnel","server_addresses", NULL);
static void linphone_tunnel_save_config(LinphoneTunnel *tunnel) {
MSList *elem = tunnel->config_list;
char *tmp = NULL, *old_tmp = NULL, *tc_str = NULL;
while(elem != NULL) {
LinphoneTunnelConfig *tunnel_config = (LinphoneTunnelConfig *)elem->data;
tc_str = linphone_tunnel_config_to_string(tunnel_config);
if(tmp != NULL) {
old_tmp = tmp;
tmp = ms_strdup_printf("%s %s", old_tmp, tc_str);
ms_free(old_tmp);
ms_free(tc_str);
} else {
tmp = tc_str;
}
elem = elem->next;
}
lp_config_set_string(config(tunnel), "tunnel", "server_addresses", tmp);
if(tmp != NULL) {
ms_free(tmp);
}
}
static void linphone_tunnel_add_server_intern(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config) {
if(linphone_tunnel_config_get_remote_udp_mirror_port(tunnel_config) == -1) {
bcTunnel(tunnel)->addServer(linphone_tunnel_config_get_host(tunnel_config),
linphone_tunnel_config_get_port(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));
}
tunnel->config_list = ms_list_append(tunnel->config_list, tunnel_config);
}
static void linphone_tunnel_load_config(LinphoneTunnel *tunnel){
const char * confaddress = lp_config_get_string(config(tunnel), "tunnel", "server_addresses", NULL);
char *tmp;
if (orig){
tmp=ms_strdup_printf("%s %s:%i",orig,host,port);
}else tmp=ms_strdup_printf("%s:%i",host, port);
lp_config_set_string(config(tunnel),"tunnel","server_addresses",tmp);
ms_free(tmp);
const char *it;
LinphoneTunnelConfig *tunnel_config;
int adv;
if(confaddress != NULL) {
tmp = ms_strdup(confaddress);
it = confaddress;
while(confaddress[0] != '\0') {
int ret = sscanf(it,"%s%n", tmp, &adv);
if (ret >= 1){
it += adv;
tunnel_config = linphone_tunnel_config_from_string(tmp);
if(tunnel_config != NULL) {
linphone_tunnel_add_server_intern(tunnel, tunnel_config);
} else {
ms_error("Tunnel server address incorrectly specified from config file: %s", tmp);
}
} else break;
}
ms_free(tmp);
}
}
static void linphone_tunnel_refresh_config(LinphoneTunnel *tunnel) {
MSList *old_list = tunnel->config_list;
tunnel->config_list = NULL;
bcTunnel(tunnel)->cleanServers();
while(old_list != NULL) {
LinphoneTunnelConfig *tunnel_config = (LinphoneTunnelConfig *)old_list->data;
linphone_tunnel_add_server_intern(tunnel, tunnel_config);
old_list = old_list->next;
}
}
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, const char *host, int port){
bcTunnel(tunnel)->addServer(host, port);
add_server_to_config(tunnel,host,port);
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config) {
linphone_tunnel_add_server_intern(tunnel, tunnel_config);
linphone_tunnel_save_config(tunnel);
}
void linphone_tunnel_add_server_and_mirror(LinphoneTunnel *tunnel, const char *host, int port, int remote_udp_mirror, int delay){
bcTunnel(tunnel)->addServer(host, port, remote_udp_mirror, delay);
/*FIXME, udp-mirror feature not saved in config*/
add_server_to_config(tunnel,host,port);
void linphone_tunnel_remove_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config) {
MSList *elem = ms_list_find(tunnel->config_list, tunnel_config);
if(elem != NULL) {
tunnel->config_list = ms_list_remove(tunnel->config_list, tunnel_config);
linphone_tunnel_config_destroy(tunnel_config);
linphone_tunnel_refresh_config(tunnel);
linphone_tunnel_save_config(tunnel);
}
}
char *linphone_tunnel_get_servers(LinphoneTunnel *tunnel){
const char *tmp=lp_config_get_string(config(tunnel),"tunnel","server_addresses",NULL);
if (tmp) return ms_strdup(tmp);
return NULL;
const MSList *linphone_tunnel_get_servers(LinphoneTunnel *tunnel){
return tunnel->config_list;
}
void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel){
bcTunnel(tunnel)->cleanServers();
lp_config_set_string(config(tunnel),"tunnel","server_addresses",NULL);
/* Free the list */
ms_list_for_each(tunnel->config_list, (void (*)(void *))linphone_tunnel_config_destroy);
tunnel->config_list = ms_list_free(tunnel->config_list);
linphone_tunnel_save_config(tunnel);
}
void linphone_tunnel_enable(LinphoneTunnel *tunnel, bool_t enabled){
......@@ -169,28 +310,6 @@ void linphone_tunnel_auto_detect(LinphoneTunnel *tunnel){
bcTunnel(tunnel)->autoDetect();
}
static void tunnel_add_servers_from_config(LinphoneTunnel *tunnel, const char* confaddress){
char *tmp=(char*)ms_malloc0(strlen(confaddress)+1);
const char *it=confaddress;
int adv;
do{
int ret=sscanf(it,"%s%n",tmp,&adv);
if (ret>=1){
it+=adv;
char *port=strchr(tmp,':');
if (!port){
ms_error("Tunnel server addresses incorrectly specified from config file: %s",it);
break;
}else{
*port='\0';
port++;
bcTunnel(tunnel)->addServer(tmp, atoi(port));
}
}else break;
}while(1);
ms_free(tmp);
}
static void my_ortp_logv(OrtpLogLevel level, const char *fmt, va_list args){
ortp_logv(level,fmt,args);
}
......@@ -201,10 +320,8 @@ static void my_ortp_logv(OrtpLogLevel level, const char *fmt, va_list args){
*/
void linphone_tunnel_configure(LinphoneTunnel *tunnel){
bool_t enabled=(bool_t)lp_config_get_int(config(tunnel),"tunnel","enabled",FALSE);
const char* addresses=lp_config_get_string(config(tunnel),"tunnel","server_addresses", NULL);
linphone_tunnel_enable_logs_with_handler(tunnel,TRUE,my_ortp_logv);
if (addresses)
tunnel_add_servers_from_config(tunnel,addresses);
linphone_tunnel_load_config(tunnel);
linphone_tunnel_enable(tunnel, enabled);
}
......@@ -23,8 +23,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef LINPHONETUNNELMANAGER_H
#define LINPHONETUNNELMANAGER_H
#ifndef LINPHONETUNNEL_H
#define LINPHONETUNNEL_H
#include "linphonecore.h"
......@@ -48,34 +48,108 @@ extern "C"
{
#endif
typedef struct _LinphoneTunnelConfig LinphoneTunnelConfig;
/**
* Add a tunnel server. At least one should be provided to be able to connect.
* When several addresses are provided, the tunnel client may try each of them until it gets connected.
* @param tunnel object
* @param host server ip address
* @param port tunnel server tls port, recommended value is 443
* Create a new tunnel configuration
*/
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, const char *host, int port);
LinphoneTunnelConfig *linphone_tunnel_config_new();
/**
*Add tunnel server with auto detection capabilities
* Set address of server.
*
* @param tunnel object
* @param tunnel configuration object
* @param host tunnel server ip address
*/
void linphone_tunnel_config_set_host(LinphoneTunnelConfig *tunnel, const char *host);
/**
* Get address of server.
*
* @param tunnel configuration object
*/
const char *linphone_tunnel_config_get_host(const LinphoneTunnelConfig *tunnel);
/**
* Set tls port of server.
*
* @param tunnel configuration object
* @param port tunnel server tls port, recommended value is 443
* @param remote_udp_mirror_port remote port on the tunnel server side used to test udp reachability
*/
void linphone_tunnel_config_set_port(LinphoneTunnelConfig *tunnel, int port);
/**
* Get tls port of server.
*
* @param tunnel configuration object
*/
int linphone_tunnel_config_get_port(const LinphoneTunnelConfig *tunnel);
/**
* Set the remote port on the tunnel server side used to test udp reachability.
*
* @param tunnel configuration object
* @param remote_udp_mirror_port remote port on the tunnel server side used to test udp reachability, set to -1 to disable the feature
*/
void linphone_tunnel_config_set_remote_udp_mirror_port(LinphoneTunnelConfig *tunnel, int remote_udp_mirror_port);
/**
* Get the remote port on the tunnel server side used to test udp reachability.
*
* @param tunnel configuration object
*/
int linphone_tunnel_config_get_remote_udp_mirror_port(const LinphoneTunnelConfig *tunnel);
/**
* Set the udp packet round trip delay in ms for a tunnel configuration.
*
* @param tunnel configuration object
* @param delay udp packet round trip delay in ms considered as acceptable. recommended value is 1000 ms.
*/
void linphone_tunnel_add_server_and_mirror(LinphoneTunnel *tunnel, const char *host, int port, int remote_udp_mirror_port, int delay);
void linphone_tunnel_config_set_delay(LinphoneTunnelConfig *tunnel, int delay);
/**
* Get the udp packet round trip delay in ms for a tunnel configuration.
*
* @param tunnel configuration object
*/
int linphone_tunnel_config_get_delay(const LinphoneTunnelConfig *tunnel);
/**
* Destroy a tunnel configuration
*
* @param tunnel configuration object
*/
void linphone_tunnel_config_destroy(LinphoneTunnelConfig *tunnel);
/**
* Add tunnel server configuration
*
* @param tunnel object
* @param tunnel_config object
*/
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config);
/**
* Remove tunnel server configuration
*
* @param tunnel object
* @param tunnel_config object
*/
void linphone_tunnel_remove_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config);
/**
* @param tunnel object
* returns a string of space separated list of host:port of tunnel server addresses
* */
char *linphone_tunnel_get_servers(LinphoneTunnel *tunnel);
const MSList *linphone_tunnel_get_servers(LinphoneTunnel *tunnel);
/**
* @param tunnel object
* Removes all tunnel server address previously entered with addServer()
**/
void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel);
/**
* Sets whether tunneling of SIP and RTP is required.
* @param tunnel object
......@@ -84,11 +158,13 @@ void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel);
*
**/
void linphone_tunnel_enable(LinphoneTunnel *tunnel, bool_t enabled);
/**
* @param tunnel object
* Returns a boolean indicating whether tunneled operation is enabled.
**/
bool_t linphone_tunnel_enabled(LinphoneTunnel *tunnel);
/**
* @param tunnel object
* Forces reconnection to the tunnel server.
......@@ -97,6 +173,7 @@ bool_t linphone_tunnel_enabled(LinphoneTunnel *tunnel);
* the lost connection to be closed and new connection to be issued.
**/
void linphone_tunnel_reconnect(LinphoneTunnel *tunnel);
/**
* Start tunnel need detection.
* @param tunnel object
......@@ -129,8 +206,6 @@ void linphone_tunnel_get_http_proxy(LinphoneTunnel*tunnel,const char **host, int
void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel*tunnel, const char* username,const char* passwd);
void linphone_tunnel_enable_logs(LinphoneTunnel *tunnel, bool_t enabled);
/**
* @}
**/
......@@ -140,5 +215,5 @@ void linphone_tunnel_enable_logs(LinphoneTunnel *tunnel, bool_t enabled);
#endif
#endif
#endif //LINPHONETUNNEL_H
/***************************************************************************
* linphone_tunnel_config.c
*
* Copyright 2012 Belledonne Communications
****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphone_tunnel.h"
struct _LinphoneTunnelConfig {
char *host;
int port;
int remote_udp_mirror_port;
int delay;
};
LinphoneTunnelConfig *linphone_tunnel_config_new() {
LinphoneTunnelConfig *ltc = ms_new0(LinphoneTunnelConfig,1);
ltc->remote_udp_mirror_port = 12345;
ltc->delay = 1000;
return ltc;
}
void linphone_tunnel_config_set_host(LinphoneTunnelConfig *tunnel, const char *host) {
if(tunnel->host != NULL) {
ms_free(tunnel->host);
tunnel->host = NULL;
}
if(host != NULL && strlen(host)) {
tunnel->host = ms_strdup(host);
}
}
const char *linphone_tunnel_config_get_host(const LinphoneTunnelConfig *tunnel) {
return tunnel->host;
}
void linphone_tunnel_config_set_port(LinphoneTunnelConfig *tunnel, int port) {
tunnel->port = port;
}
int linphone_tunnel_config_get_port(const LinphoneTunnelConfig *tunnel) {
return tunnel->port;
}
void linphone_tunnel_config_set_remote_udp_mirror_port(LinphoneTunnelConfig *tunnel, int remote_udp_mirror_port) {
tunnel->remote_udp_mirror_port = remote_udp_mirror_port;
}
int linphone_tunnel_config_get_remote_udp_mirror_port(const LinphoneTunnelConfig *tunnel) {
return tunnel->remote_udp_mirror_port;
}
void linphone_tunnel_config_set_delay(LinphoneTunnelConfig *tunnel, int delay) {
tunnel->delay = delay;
}
int linphone_tunnel_config_get_delay(const LinphoneTunnelConfig *tunnel) {
return tunnel->delay;
}
void linphone_tunnel_config_destroy(LinphoneTunnelConfig *tunnel) {
if(tunnel->host != NULL) {
ms_free(tunnel->host);
}
ms_free(tunnel);
}
......@@ -38,14 +38,15 @@ LinphoneTunnel* linphone_core_get_tunnel(LinphoneCore *lc){
void linphone_tunnel_destroy(LinphoneTunnel *tunnel){
}
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, const char *host, int port){
void linphone_tunnel_add_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config){
}
void linphone_tunnel_add_server_and_mirror(LinphoneTunnel *tunnel, const char *host, int port, int remote_udp_mirror, int delay){
void linphone_tunnel_remove_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config){
}
char *linphone_tunnel_get_servers(LinphoneTunnel *tunnel){
return NULL;
const MSList *linphone_tunnel_get_servers(LinphoneTunnel *tunnel){
return NULL;
}
void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel){
......@@ -55,9 +56,10 @@ void linphone_tunnel_enable(LinphoneTunnel *tunnel, bool_t enabled){
}
bool_t linphone_tunnel_enabled(LinphoneTunnel *tunnel){
return FALSE;