|
| bool_t | linphone_core_tunnel_available (void) |
| | True if tunnel extension was compiled. More...
|
| |
| LinphoneTunnel * | linphone_core_get_tunnel (const LinphoneCore *core) |
| | Gets tunnel instance if available. More...
|
| |
| LinphoneTunnelConfig * | linphone_tunnel_config_new (void) |
| | Create a new tunnel configuration. More...
|
| |
| LinphoneTunnel * | linphone_tunnel_ref (LinphoneTunnel *tunnel) |
| | Take a reference on a LinphoneTunnel. More...
|
| |
| void | linphone_tunnel_unref (LinphoneTunnel *tunnel) |
| | Release a reference on a LinphoneTunnel. More...
|
| |
| void | linphone_tunnel_config_set_host (LinphoneTunnelConfig *tunnel_config, const char *host) |
| | Set the IP address or hostname of the tunnel server. More...
|
| |
| const char * | linphone_tunnel_config_get_host (const LinphoneTunnelConfig *tunnel_config) |
| | Get the IP address or hostname of the tunnel server. More...
|
| |
| void | linphone_tunnel_config_set_port (LinphoneTunnelConfig *tunnel_config, int port) |
| | Set tls port of server. More...
|
| |
| int | linphone_tunnel_config_get_port (const LinphoneTunnelConfig *tunnel_config) |
| | Get the TLS port of the tunnel server. More...
|
| |
| void | linphone_tunnel_config_set_host2 (LinphoneTunnelConfig *tunnel_config, const char *host) |
| | Set the IP address or hostname of the second tunnel server when using dual tunnel client. More...
|
| |
| const char * | linphone_tunnel_config_get_host2 (const LinphoneTunnelConfig *tunnel_config) |
| | Get the IP address or hostname of the second tunnel server when using dual tunnel client. More...
|
| |
| void | linphone_tunnel_config_set_port2 (LinphoneTunnelConfig *tunnel_config, int port) |
| | Set tls port of the second server when using dual tunnel client. More...
|
| |
| int | linphone_tunnel_config_get_port2 (const LinphoneTunnelConfig *tunnel_config) |
| | Get the TLS port of the second tunnel server when using dual tunnel client. More...
|
| |
| void | linphone_tunnel_config_set_remote_udp_mirror_port (LinphoneTunnelConfig *tunnel_config, int remote_udp_mirror_port) |
| | Set the remote port on the tunnel server side used to test UDP reachability. More...
|
| |
| int | linphone_tunnel_config_get_remote_udp_mirror_port (const LinphoneTunnelConfig *tunnel_config) |
| | Get the remote port on the tunnel server side used to test UDP reachability. More...
|
| |
| void | linphone_tunnel_config_set_delay (LinphoneTunnelConfig *tunnel_config, int delay) |
| | Set the UDP packet round trip delay in ms for a tunnel configuration. More...
|
| |
| int | linphone_tunnel_config_get_delay (const LinphoneTunnelConfig *tunnel_config) |
| | Get the UDP packet round trip delay in ms for a tunnel configuration. More...
|
| |
| LinphoneTunnelConfig * | linphone_tunnel_config_ref (LinphoneTunnelConfig *tunnel_config) |
| | Increment the refcount of LinphoneTunnelConfig object. More...
|
| |
| void | linphone_tunnel_config_unref (LinphoneTunnelConfig *tunnel_config) |
| | Decrement the refcount of LinphoneTunnelConfig object. More...
|
| |
| void | linphone_tunnel_config_set_user_data (LinphoneTunnelConfig *tunnel_config, void *user_data) |
| | Store a user data in the tunnel config object. More...
|
| |
| void * | linphone_tunnel_config_get_user_data (LinphoneTunnelConfig *tunnel_config) |
| | Retrieve user data from the tunnel config. More...
|
| |
| void | linphone_tunnel_add_server (LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config) |
| | Add a tunnel server configuration. More...
|
| |
| void | linphone_tunnel_remove_server (LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config) |
| | Remove a tunnel server configuration. More...
|
| |
| const bctbx_list_t * | linphone_tunnel_get_servers (const LinphoneTunnel *tunnel) |
| | Get added servers. More...
|
| |
| void | linphone_tunnel_clean_servers (LinphoneTunnel *tunnel) |
| | Remove all tunnel server addresses previously entered with linphone_tunnel_add_server() More...
|
| |
| void | linphone_tunnel_set_mode (LinphoneTunnel *tunnel, LinphoneTunnelMode mode) |
| | Set the tunnel mode. More...
|
| |
| LinphoneTunnelMode | linphone_tunnel_get_mode (const LinphoneTunnel *tunnel) |
| | Get the tunnel mode. More...
|
| |
| void | linphone_tunnel_enable_dual_mode (LinphoneTunnel *tunnel, bool_t dual_mode_enabled) |
| | Sets whether or not to use the dual tunnel client mode. More...
|
| |
| bool_t | linphone_tunnel_dual_mode_enabled (const LinphoneTunnel *tunnel) |
| | Get the dual tunnel client mode. More...
|
| |
| bool_t | linphone_tunnel_get_activated (const LinphoneTunnel *tunnel) |
| | Returns whether the tunnel is activated. More...
|
| |
| bool_t | linphone_tunnel_connected (const LinphoneTunnel *tunnel) |
| | Check whether the tunnel is connected. More...
|
| |
| void | linphone_tunnel_reconnect (LinphoneTunnel *tunnel) |
| | Force reconnection to the tunnel server. More...
|
| |
| void | linphone_tunnel_enable_sip (LinphoneTunnel *tunnel, bool_t enable) |
| | Set whether SIP packets must be directly sent to a UA or pass through the tunnel. More...
|
| |
| bool_t | linphone_tunnel_sip_enabled (const LinphoneTunnel *tunnel) |
| | Check whether tunnel is set to transport SIP packets. More...
|
| |
| 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. More...
|
| |
| 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(). More...
|
| |
| void | linphone_tunnel_set_http_proxy_auth_info (LinphoneTunnel *tunnel, const char *username, const char *passwd) |
| | Set authentication info for the http proxy. More...
|
| |
| void | linphone_tunnel_set_username (LinphoneTunnel *tunnel, const char *username) |
| | Set the username. More...
|
| |
| const char * | linphone_tunnel_get_username (LinphoneTunnel *tunnel) |
| | Get the username. More...
|
| |
| void | linphone_tunnel_set_domain (LinphoneTunnel *tunnel, const char *domain) |
| | Set the domain. More...
|
| |
| const char * | linphone_tunnel_get_domain (LinphoneTunnel *tunnel) |
| | Get the domain. More...
|
| |
|
void | linphone_tunnel_simulate_udp_loss (LinphoneTunnel *tunnel, bool_t enabled) |
| |
Linphone tunnel aims is to bypass IP traffic blocking due to aggressive firewalls which typically only authorize TCP traffic with destination port 443.
Its principle is tunneling all SIP and/or RTP traffic through a single secure https connection up to a detunnelizer server.
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. Availability can be check at runtime using function linphone_core_tunnel_available()
- 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.
Provision is done using object LinphoneTunnelConfig created by function linphone_tunnel_config_new(). Functions linphone_tunnel_config_set_host() and linphone_tunnel_config_set_port() allow to point to tunnel server IP/port. Once set, use function linphone_tunnel_add_server() to provision a tunnel server.
Finally tunnel mode configuration is achieved by function linphone_tunnel_set_mode().
Tunnel connection status can be checked using function linphone_tunnel_connected().
Bellow pseudo code that can be use to configure, enable, check state and disable tunnel functionality:
1 LinphoneTunnel *tunnel = linphone_core_get_tunnel(linphone_core);
2 LinphoneTunnelConfig *config=linphone_tunnel_config_new(); //instantiate tunnel configuration
3 linphone_tunnel_config_set_host(config, "tunnel.linphone.org"); //set tunnel server host address
4 linphone_tunnel_config_set_port(config, 443); //set tunnel server port
5 linphone_tunnel_add_server(tunnel, config); //provision tunnel config
6 linphone_tunnel_set_mode(tunnel, LinphoneTunnelModeEnable); //activate the tunnel unconditional
8 while (!linphone_tunnel_connected(tunnel)) { //wait for tunnel to be ready
9 linphone_core_iterate(linphone_core); //schedule core main loop
10 ms_sleep(100); //wait 100ms
13 LinphoneCall *call = linphone_core_invite(linphone_core,"sip:foo@example.org"); //place an outgoing call
14 linphone_call_ref(call); //acquire a reference on the call to avoid deletion after completion
16 linphone_core_terminate_call(linphone_core,call);
18 while (linphone_call_get_state(call) != LinphoneCallReleased) { //wait for call to be in release state
19 linphone_core_iterate(linphone_core); //schedule core main loop
20 ms_sleep(100); //wait 100ms
23 linphone_tunnel_set_mode(tunnel, LinphoneTunnelModeDisable); //deactivate tunnel
24 linphone_call_unref(call); //release reference on the call