liblinphone 3.6.1

- Main Page
- Related Pages
- Modules
- Data Structures

Typedefs | Functions
Tunnel

## Typedefs
typedef struct _LinphoneTunnelConfig | LinphoneTunnelConfig

## Functions
LinphoneTunnelConfig * | linphone_tunnel_config_new ()
void | linphone_tunnel_config_set_host (LinphoneTunnelConfig *tunnel, const char *host)
const char * | linphone_tunnel_config_get_host (const LinphoneTunnelConfig *tunnel)
void | linphone_tunnel_config_set_port (LinphoneTunnelConfig *tunnel, int port)
int | linphone_tunnel_config_get_port (const LinphoneTunnelConfig *tunnel)
void | linphone_tunnel_config_set_remote_udp_mirror_port (LinphoneTunnelConfig *tunnel, int remote_udp_mirror_port)
int | linphone_tunnel_config_get_remote_udp_mirror_port (const LinphoneTunnelConfig *tunnel)
void | linphone_tunnel_config_set_delay (LinphoneTunnelConfig *tunnel, int delay)
int | linphone_tunnel_config_get_delay (const LinphoneTunnelConfig *tunnel)
void | linphone_tunnel_config_destroy (LinphoneTunnelConfig *tunnel)
void | linphone_tunnel_add_server (LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config)
void | linphone_tunnel_remove_server (LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config)
const MSList * | linphone_tunnel_get_servers (LinphoneTunnel *tunnel)
void | linphone_tunnel_clean_servers (LinphoneTunnel *tunnel)
void | linphone_tunnel_enable (LinphoneTunnel *tunnel, bool_t enabled)
bool_t | linphone_tunnel_enabled (LinphoneTunnel *tunnel)
bool_t | linphone_tunnel_connected (LinphoneTunnel *tunnel)
void | linphone_tunnel_reconnect (LinphoneTunnel *tunnel)
void | linphone_tunnel_auto_detect (LinphoneTunnel *tunnel)
void | linphone_tunnel_set_http_proxy (LinphoneTunnel *tunnel, const char *host, int port, const char *username, const char *passwd)
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

LinphoneTunnelConfig* linphone_tunnel_config_new | ( |  | ) |

Create a new tunnel configuration

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

Set address of server.

Parameters:

  tunnel | configuration object
  host | tunnel server ip address

const char* linphone_tunnel_config_get_host | ( | const LinphoneTunnelConfig * | tunnel | ) |

Get address of server.

Parameters:

  tunnel | configuration object

void linphone_tunnel_config_set_port | ( | LinphoneTunnelConfig * | tunnel,
|  | int | port
| ) |  |

Set tls port of server.

Parameters:

  tunnel | configuration object
  port | tunnel server tls port, recommended value is 443

int linphone_tunnel_config_get_port | ( | const LinphoneTunnelConfig * | tunnel | ) |

Get tls port of server.

Parameters:

  tunnel | configuration object

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:

  tunnel | configuration object
  remote_udp_mirror_port | remote port on the tunnel server side used to test udp reachability, set to -1 to disable the feature

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:

  tunnel | configuration object

void linphone_tunnel_config_set_delay | ( | LinphoneTunnelConfig * | tunnel,
|  | int | delay
| ) |  |

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

Parameters:

  tunnel | configuration object
  delay | udp packet round trip delay in ms considered as acceptable. recommended value is 1000 ms.

int linphone_tunnel_config_get_delay | ( | const LinphoneTunnelConfig * | tunnel | ) |

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

Parameters:

  tunnel | configuration object

void linphone_tunnel_config_destroy | ( | LinphoneTunnelConfig * | tunnel | ) |

Destroy a tunnel configuration

Parameters:

  tunnel | configuration object

void linphone_tunnel_add_server | ( | LinphoneTunnel * | tunnel,
|  | LinphoneTunnelConfig * | tunnel_config
| ) |  |

Add tunnel server configuration

Parameters:

  tunnel | object
  tunnel_config | object

void linphone_tunnel_remove_server | ( | LinphoneTunnel * | tunnel,
|  | LinphoneTunnelConfig * | tunnel_config
| ) |  |

Remove tunnel server configuration

Parameters:

  tunnel | object
  tunnel_config | object

const MSList* linphone_tunnel_get_servers | ( | LinphoneTunnel * | tunnel | ) |

Parameters:

  tunnel | object returns a string of space separated list of host:port of tunnel server addresses

void linphone_tunnel_clean_servers | ( | LinphoneTunnel * | tunnel | ) |

Parameters:

  tunnel | object Removes all tunnel server address previously entered with addServer()

void linphone_tunnel_enable | ( | LinphoneTunnel * | tunnel,
|  | bool_t | enabled
| ) |  |

Sets whether tunneling of SIP and RTP is required.

Parameters:

  tunnel | object
  enabled | If 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.

bool_t linphone_tunnel_enabled | ( | LinphoneTunnel * | tunnel | ) |

Parameters:

  tunnel | object Returns a boolean indicating whether tunneled operation is enabled.

bool_t linphone_tunnel_connected | ( | LinphoneTunnel * | tunnel | ) |

Parameters:

  tunnel | object Returns a boolean indicating whether tunnel is connected successfully.

void linphone_tunnel_reconnect | ( | LinphoneTunnel * | tunnel | ) |

Parameters:

  tunnel | object 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.

void linphone_tunnel_auto_detect | ( | LinphoneTunnel * | tunnel | ) |

Start tunnel need detection.

Parameters:

  tunnel | object 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

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:

  tunnel | LinphoneTunnel object
  host | Http proxy host.
  port | http proxy port.
  username | optional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use NULL if not needed.
  password | optional http proxy password. Use NULL if not needed.

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:

  tunnel | LinphoneTunnel object
  host | Http proxy host.
  port | http proxy port.
  username | optional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use NULL if not needed.
  password | optional http proxy password. Use NULL if not needed.