liblinphone  3.6.1
Typedefs | Functions
Tunnel

Typedefs

typedef struct
_LinphoneTunnelConfig 
LinphoneTunnelConfig
 

Functions

MS2_PUBLIC LinphoneTunnelConfiglinphone_tunnel_config_new ()
 
MS2_PUBLIC void linphone_tunnel_config_set_host (LinphoneTunnelConfig *tunnel, const char *host)
 
MS2_PUBLIC const char * linphone_tunnel_config_get_host (const LinphoneTunnelConfig *tunnel)
 
MS2_PUBLIC void linphone_tunnel_config_set_port (LinphoneTunnelConfig *tunnel, int port)
 
MS2_PUBLIC int linphone_tunnel_config_get_port (const LinphoneTunnelConfig *tunnel)
 
MS2_PUBLIC void linphone_tunnel_config_set_remote_udp_mirror_port (LinphoneTunnelConfig *tunnel, int remote_udp_mirror_port)
 
MS2_PUBLIC int linphone_tunnel_config_get_remote_udp_mirror_port (const LinphoneTunnelConfig *tunnel)
 
MS2_PUBLIC void linphone_tunnel_config_set_delay (LinphoneTunnelConfig *tunnel, int delay)
 
MS2_PUBLIC int linphone_tunnel_config_get_delay (const LinphoneTunnelConfig *tunnel)
 
MS2_PUBLIC void linphone_tunnel_config_destroy (LinphoneTunnelConfig *tunnel)
 
MS2_PUBLIC void linphone_tunnel_add_server (LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config)
 
MS2_PUBLIC void linphone_tunnel_remove_server (LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config)
 
MS2_PUBLIC const MSList * linphone_tunnel_get_servers (LinphoneTunnel *tunnel)
 
MS2_PUBLIC void linphone_tunnel_clean_servers (LinphoneTunnel *tunnel)
 
MS2_PUBLIC void linphone_tunnel_enable (LinphoneTunnel *tunnel, bool_t enabled)
 
MS2_PUBLIC bool_t linphone_tunnel_enabled (LinphoneTunnel *tunnel)
 
bool_t linphone_tunnel_connected (LinphoneTunnel *tunnel)
 
MS2_PUBLIC void linphone_tunnel_reconnect (LinphoneTunnel *tunnel)
 
MS2_PUBLIC void linphone_tunnel_auto_detect (LinphoneTunnel *tunnel)
 
MS2_PUBLIC void linphone_tunnel_set_http_proxy (LinphoneTunnel *tunnel, const char *host, int port, const char *username, const char *passwd)
 
MS2_PUBLIC void linphone_tunnel_get_http_proxy (LinphoneTunnel *tunnel, const char **host, int *port, const char **username, const char **passwd)
 

Detailed Description

Typedef Documentation

typedef struct _LinphoneTunnelConfig LinphoneTunnelConfig

This set of methods enhance LinphoneCore functionalities in order to provide an easy to use API to

  • provision tunnel servers ip addresses and ports. This functionality is an option not implemented under GPL.
  • start/stop the tunneling service
  • perform auto-detection whether tunneling is required, based on a test of sending/receiving a flow of UDP packets.

It takes in charge automatically the SIP registration procedure when connecting or disconnecting to a tunnel server. No other action on LinphoneCore is required to enable full operation in tunnel mode.

Function Documentation

MS2_PUBLIC LinphoneTunnelConfig* linphone_tunnel_config_new ( )

Create a new tunnel configuration

MS2_PUBLIC void linphone_tunnel_config_set_host ( LinphoneTunnelConfig tunnel,
const char *  host 
)

Set address of server.

Parameters
tunnelconfiguration object
hosttunnel server ip address
MS2_PUBLIC const char* linphone_tunnel_config_get_host ( const LinphoneTunnelConfig tunnel)

Get address of server.

Parameters
tunnelconfiguration object
MS2_PUBLIC void linphone_tunnel_config_set_port ( LinphoneTunnelConfig tunnel,
int  port 
)

Set tls port of server.

Parameters
tunnelconfiguration object
porttunnel server tls port, recommended value is 443
MS2_PUBLIC int linphone_tunnel_config_get_port ( const LinphoneTunnelConfig tunnel)

Get tls port of server.

Parameters
tunnelconfiguration object
MS2_PUBLIC void linphone_tunnel_config_set_remote_udp_mirror_port ( LinphoneTunnelConfig tunnel,
int  remote_udp_mirror_port 
)

Set the remote port on the tunnel server side used to test udp reachability.

Parameters
tunnelconfiguration object
remote_udp_mirror_portremote port on the tunnel server side used to test udp reachability, set to -1 to disable the feature
MS2_PUBLIC int linphone_tunnel_config_get_remote_udp_mirror_port ( const LinphoneTunnelConfig tunnel)

Get the remote port on the tunnel server side used to test udp reachability.

Parameters
tunnelconfiguration object
MS2_PUBLIC void linphone_tunnel_config_set_delay ( LinphoneTunnelConfig tunnel,
int  delay 
)

Set the udp packet round trip delay in ms for a tunnel configuration.

Parameters
tunnelconfiguration object
delayudp packet round trip delay in ms considered as acceptable. recommended value is 1000 ms.
MS2_PUBLIC int linphone_tunnel_config_get_delay ( const LinphoneTunnelConfig tunnel)

Get the udp packet round trip delay in ms for a tunnel configuration.

Parameters
tunnelconfiguration object
MS2_PUBLIC void linphone_tunnel_config_destroy ( LinphoneTunnelConfig tunnel)

Destroy a tunnel configuration

Parameters
tunnelconfiguration object
MS2_PUBLIC void linphone_tunnel_add_server ( LinphoneTunnel *  tunnel,
LinphoneTunnelConfig tunnel_config 
)

Add tunnel server configuration

Parameters
tunnelobject
tunnel_configobject
MS2_PUBLIC void linphone_tunnel_remove_server ( LinphoneTunnel *  tunnel,
LinphoneTunnelConfig tunnel_config 
)

Remove tunnel server configuration

Parameters
tunnelobject
tunnel_configobject
MS2_PUBLIC const MSList* linphone_tunnel_get_servers ( LinphoneTunnel *  tunnel)
Parameters
tunnelobject returns a string of space separated list of host:port of tunnel server addresses
MS2_PUBLIC void linphone_tunnel_clean_servers ( LinphoneTunnel *  tunnel)
Parameters
tunnelobject Removes all tunnel server address previously entered with addServer()
MS2_PUBLIC void linphone_tunnel_enable ( LinphoneTunnel *  tunnel,
bool_t  enabled 
)

Sets whether tunneling of SIP and RTP is required.

Parameters
tunnelobject
enabledIf true enter in tunneled mode, if false exits from tunneled mode. The TunnelManager takes care of refreshing SIP registration when switching on or off the tunneled mode.
MS2_PUBLIC bool_t linphone_tunnel_enabled ( LinphoneTunnel *  tunnel)
Parameters
tunnelobject Returns a boolean indicating whether tunneled operation is enabled.
bool_t linphone_tunnel_connected ( LinphoneTunnel *  tunnel)
Parameters
tunnelobject Returns a boolean indicating whether tunnel is connected successfully.
MS2_PUBLIC void linphone_tunnel_reconnect ( LinphoneTunnel *  tunnel)
Parameters
tunnelobject Forces reconnection to the tunnel server. This method is useful when the device switches from wifi to Edge/3G or vice versa. In most cases the tunnel client socket won't be notified promptly that its connection is now zombie, so it is recommended to call this method that will cause the lost connection to be closed and new connection to be issued.
MS2_PUBLIC void linphone_tunnel_auto_detect ( LinphoneTunnel *  tunnel)

Start tunnel need detection.

Parameters
tunnelobject In auto detect mode, the tunnel manager try to establish a real time rtp cummunication with the tunnel server on specified port.
In case of success, the tunnel is automatically turned off. Otherwise, if no udp commmunication is feasible, tunnel mode is turned on.
Call this method each time to run the auto detection algorithm
MS2_PUBLIC void linphone_tunnel_set_http_proxy ( LinphoneTunnel *  tunnel,
const char *  host,
int  port,
const char *  username,
const char *  passwd 
)

Set an optional http proxy to go through when connecting to tunnel server.

Parameters
tunnelLinphoneTunnel object
hostHttp proxy host.
porthttp proxy port.
usernameoptional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use NULL if not needed.
passwordoptional http proxy password. Use NULL if not needed.
MS2_PUBLIC void linphone_tunnel_get_http_proxy ( LinphoneTunnel *  tunnel,
const char **  host,
int *  port,
const char **  username,
const char **  passwd 
)

Retrieve optional http proxy configuration previously set with linphone_tunnel_set_http_proxy().

Parameters
tunnelLinphoneTunnel object
hostHttp proxy host.
porthttp proxy port.
usernameoptional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use NULL if not needed.
passwordoptional http proxy password. Use NULL if not needed.