---
name: "eXosip2_conf"
section: "3"
platform: "linux"
package: "libexosip2-dev"
version: "4.1.0-2.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/eXosip2_conf"
---

# eXosip2\_conf(3)

eXosip2 configuration API

## NAME

eXosip2\_conf - eXosip2 configuration API

### Data Structures

struct **eXosip\_dns\_cache**\
 struct **eXosip\_tls\_credentials\_s**\
 struct **eXosip\_tls\_ctx\_s**\

### Macros

\#define **EXOSIP\_OPT\_UDP\_KEEP\_ALIVE**   (EXOSIP\_OPT\_BASE\_OPTION+1)\
 \#define **EXOSIP\_OPT\_UDP\_LEARN\_PORT**   (EXOSIP\_OPT\_BASE\_OPTION+2)\
 \#define **EXOSIP\_OPT\_USE\_RPORT**   (EXOSIP\_OPT\_BASE\_OPTION+7)\
 \#define **EXOSIP\_OPT\_SET\_IPV4\_FOR\_GATEWAY**   (EXOSIP\_OPT\_BASE\_OPTION+8)\
 \#define **EXOSIP\_OPT\_ADD\_DNS\_CACHE**   (EXOSIP\_OPT\_BASE\_OPTION+9)\
 \#define **EXOSIP\_OPT\_DELETE\_DNS\_CACHE**   (EXOSIP\_OPT\_BASE\_OPTION+10)\
 \#define **EXOSIP\_OPT\_SET\_IPV6\_FOR\_GATEWAY**   (EXOSIP\_OPT\_BASE\_OPTION+12)\
 \#define **EXOSIP\_OPT\_ADD\_ACCOUNT\_INFO**   (EXOSIP\_OPT\_BASE\_OPTION+13)\
 \#define **EXOSIP\_OPT\_DNS\_CAPABILITIES**   (EXOSIP\_OPT\_BASE\_OPTION+14)\
 \#define **EXOSIP\_OPT\_SET\_DSCP**   (EXOSIP\_OPT\_BASE\_OPTION+15)\
 \#define **EXOSIP\_OPT\_REGISTER\_WITH\_DATE**   (EXOSIP\_OPT\_BASE\_OPTION+16)\
 \#define **EXOSIP\_OPT\_SET\_HEADER\_USER\_AGENT**   (EXOSIP\_OPT\_BASE\_OPTION+17)\
 \#define **EXOSIP\_OPT\_ENABLE\_DNS\_CACHE**   (EXOSIP\_OPT\_BASE\_OPTION+18)\
 \#define **EXOSIP\_OPT\_ENABLE\_AUTOANSWERBYE**   (EXOSIP\_OPT\_BASE\_OPTION+19)\
 \#define **EXOSIP\_OPT\_ENABLE\_IPV6**   (EXOSIP\_OPT\_BASE\_OPTION+20)\
 \#define **EXOSIP\_OPT\_SET\_TLS\_VERIFY\_CERTIFICATE**   (EXOSIP\_OPT\_BASE\_OPTION+500)\
 \#define **EXOSIP\_OPT\_SET\_TLS\_CERTIFICATES\_INFO**   (EXOSIP\_OPT\_BASE\_OPTION+501)\
 \#define **EXOSIP\_OPT\_SET\_TLS\_CLIENT\_CERTIFICATE\_NAME**   (EXOSIP\_OPT\_BASE\_OPTION+502)\
 \#define **EXOSIP\_OPT\_SET\_TLS\_SERVER\_CERTIFICATE\_NAME**   (EXOSIP\_OPT\_BASE\_OPTION+503)\
 \#define **EXOSIP\_OPT\_SET\_TSC\_SERVER**   (EXOSIP\_OPT\_BASE\_OPTION+1001)\

### Enumerations

enum **eXosip\_tls\_ctx\_error** { **TLS\_OK** = 0, **TLS\_ERR\_NO\_RAND** = -1, **TLS\_ERR\_NO\_DH\_PARAM** = -2, **TLS\_ERR\_NO\_PW** = -3, **TLS\_ERR\_NO\_ROOT\_CA** = -4, **TLS\_ERR\_MISSING\_AUTH\_PART** = -5 }\

### Functions

struct eXosip\_t \* **eXosip\_malloc** (void)\
 int **eXosip\_init** (struct eXosip\_t \*excontext)\
 void **eXosip\_quit** (struct eXosip\_t \*excontext)\
 int **eXosip\_lock** (struct eXosip\_t \*excontext)\
 int **eXosip\_unlock** (struct eXosip\_t \*excontext)\
 int **eXosip\_execute** (struct eXosip\_t \*excontext)\
 int **eXosip\_set\_option** (struct eXosip\_t \*excontext, int opt, const void \*value)\
 struct osip\_naptr \* **eXosip\_dnsutils\_naptr** (struct eXosip\_t \*excontext, const char \*domain, const char \*protocol, const char \*transport, int keep\_in\_cache)\
 int **eXosip\_dnsutils\_dns\_process** (struct osip\_naptr \*output\_record, int force)\
 int **eXosip\_dnsutils\_rotate\_srv** (struct osip\_srv\_record \*output\_record)\
 int **eXosip\_listen\_addr** (struct eXosip\_t \*excontext, int transport, const char \*addr, int port, int family, int secure)\
 int **eXosip\_reset\_transports** (struct eXosip\_t \*excontext)\
 int **eXosip\_set\_socket** (struct eXosip\_t \*excontext, int transport, int socket, int port)\
 void **eXosip\_set\_user\_agent** (struct eXosip\_t \*excontext, const char \*user\_agent)\
 const char \* **eXosip\_get\_version** (void)\
 int **eXosip\_set\_cbsip\_message** (struct eXosip\_t \*excontext, CbSipCallback cbsipCallback)\
 void **eXosip\_enable\_ipv6** (int ipv6\_enable)\
 void **eXosip\_masquerade\_contact** (struct eXosip\_t \*excontext, const char \*public\_address, int port)\
 int **eXosip\_find\_free\_port** (struct eXosip\_t \*excontext, int free\_port, int transport)\

## Detailed Description

## Macro Definition Documentation

### #define EXOSIP\_OPT\_UDP\_KEEP\_ALIVE (EXOSIP\_OPT\_BASE\_OPTION+1)

int \*: interval for keep alive packets (UDP, TCP, TLS, DTLS)

### #define EXOSIP\_OPT\_UDP\_LEARN\_PORT (EXOSIP\_OPT\_BASE\_OPTION+2)

int \*: specific re-usage of 'rport'

### #define EXOSIP\_OPT\_USE\_RPORT (EXOSIP\_OPT\_BASE\_OPTION+7)

int \*: enable or disable rport in via

### #define EXOSIP\_OPT\_SET\_IPV4\_FOR\_GATEWAY (EXOSIP\_OPT\_BASE\_OPTION+8)

char \*: usually, this is the proxy address

### #define EXOSIP\_OPT\_ADD\_DNS\_CACHE (EXOSIP\_OPT\_BASE\_OPTION+9)

struct **eXosip\_dns\_cache** \*: force some cache entry to avoid DNS

### #define EXOSIP\_OPT\_DELETE\_DNS\_CACHE (EXOSIP\_OPT\_BASE\_OPTION+10)

struct **eXosip\_dns\_cache** \*: force removal of some cache entry to avoid DNS

### #define EXOSIP\_OPT\_SET\_IPV6\_FOR\_GATEWAY (EXOSIP\_OPT\_BASE\_OPTION+12)

char \*: usually, this is the proxy address

### #define EXOSIP\_OPT\_ADD\_ACCOUNT\_INFO (EXOSIP\_OPT\_BASE\_OPTION+13)

struct eXosip\_account\_info \*: internal stuff

### #define EXOSIP\_OPT\_DNS\_CAPABILITIES (EXOSIP\_OPT\_BASE\_OPTION+14)

int \*: 0 to disable, 2 to use NAPTR/SRV record

### #define EXOSIP\_OPT\_SET\_DSCP (EXOSIP\_OPT\_BASE\_OPTION+15)

int \*: set a dscp value for SIP socket

### #define EXOSIP\_OPT\_REGISTER\_WITH\_DATE (EXOSIP\_OPT\_BASE\_OPTION+16)

int \*: enable usage of Date header in REGISTER

### #define EXOSIP\_OPT\_SET\_HEADER\_USER\_AGENT (EXOSIP\_OPT\_BASE\_OPTION+17)

char \*: set the User-Agent header

### #define EXOSIP\_OPT\_ENABLE\_DNS\_CACHE (EXOSIP\_OPT\_BASE\_OPTION+18)

int \*: 0 to disable use of cache

### #define EXOSIP\_OPT\_ENABLE\_AUTOANSWERBYE (EXOSIP\_OPT\_BASE\_OPTION+19)

int \*: 0 to disable automatic answer of BYE

### #define EXOSIP\_OPT\_ENABLE\_IPV6 (EXOSIP\_OPT\_BASE\_OPTION+20)

int \*: 0 to disable -this is a per-eXosip\_t parameter for using IPv6 DNS request

### #define EXOSIP\_OPT\_SET\_TLS\_VERIFY\_CERTIFICATE (EXOSIP\_OPT\_BASE\_OPTION+500)

int \*: enable verification of certificate for TLS connection

### #define EXOSIP\_OPT\_SET\_TLS\_CERTIFICATES\_INFO (EXOSIP\_OPT\_BASE\_OPTION+501)

eXosip\_tls\_ctx\_t \*: client and/or server certificate/ca-root/key info

### #define EXOSIP\_OPT\_SET\_TLS\_CLIENT\_CERTIFICATE\_NAME (EXOSIP\_OPT\_BASE\_OPTION+502)

char\*: user can choose a specific certifcate present in Windows Certificate Store

### #define EXOSIP\_OPT\_SET\_TLS\_SERVER\_CERTIFICATE\_NAME (EXOSIP\_OPT\_BASE\_OPTION+503)

char\*: user can choose a specific certifcate present in Windows Certificate Store

### #define EXOSIP\_OPT\_SET\_TSC\_SERVER (EXOSIP\_OPT\_BASE\_OPTION+1001)

void\*: set the tsc tunnel handle

## Enumeration Type Documentation

### enum eXosip\_tls\_ctx\_error

An enumeration which describes the error which can occur while setting the eXosip\_tls\_ctx

**Enumerator**

- *TLS\_OK*

  *yippieh, everything is fine :)*

- *TLS\_ERR\_NO\_RAND*

  *no absolute path to the random file was specified*

- *TLS\_ERR\_NO\_DH\_PARAM*

  *no absolute path to the diifie hellman file was specified*

- *TLS\_ERR\_NO\_PW*

  *no password was specified*

- *TLS\_ERR\_NO\_ROOT\_CA*

  *no absolute path to the rootCA file was specified*

- *TLS\_ERR\_MISSING\_AUTH\_PART*

  *something is missing: the private key or the certificate*

## Function Documentation

### struct eXosip\_t\* eXosip\_malloc (void)

*Allocate an eXosip context.*

**Returns:**

*a new allocated eXosip\_t instance.*

### int eXosip\_init (struct eXosip\_t \* excontext)

*Initiate the eXtented oSIP library.*

**Parameters:**

*excontext eXosip\_t instance.*

### void eXosip\_quit (struct eXosip\_t \* excontext)

*Release resource used by the eXtented oSIP library.*

**Parameters:**

*excontext eXosip\_t instance.*

### int eXosip\_lock (struct eXosip\_t \* excontext)

*Lock the eXtented oSIP library.*

**Parameters:**

*excontext eXosip\_t instance.*

### int eXosip\_unlock (struct eXosip\_t \* excontext)

*UnLock the eXtented oSIP library.*

**Parameters:**

*excontext eXosip\_t instance.*

### int eXosip\_execute (struct eXosip\_t \* excontext)

*Process (non-threaded mode ONLY) eXosip events.*

**Parameters:**

*excontext eXosip\_t instance.*

### int eXosip\_set\_option (struct eXosip\_t \* excontext, int opt, const void \* value)

*Set eXosip options. See eXosip\_option for available options.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *opt option to configure.* \
 *value value for options.*

### struct osip\_naptr\* eXosip\_dnsutils\_naptr (struct eXosip\_t \* excontext, const char \* domain, const char \* protocol, const char \* transport, int keep\_in\_cache)

*Start and return osip\_naptr context. Note that DNS results might not yet be available.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *domain domain name for NAPTR record* \
 *protocol protocol to use ('SIP')* \
 *transport transport to use ('UDP')* \
 *keep\_in\_cache keep result in cache if \>0*

### int eXosip\_dnsutils\_dns\_process (struct osip\_naptr \* output\_record, int force)

*Continue to process asynchronous DNS request (if implemented).*

**Parameters:**

*output\_record result structure.* \
 *force force waiting for final answer if \>0*

### int eXosip\_dnsutils\_rotate\_srv (struct osip\_srv\_record \* output\_record)

*Rotate first SRV entry to last SRV entry.*

**Parameters:**

*output\_record result structure.*

### int eXosip\_listen\_addr (struct eXosip\_t \* excontext, int transport, const char \* addr, int port, int family, int secure)

*Listen on a specified socket.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *transport IPPROTO\_UDP for udp. (soon to come: TCP/TLS?)* \
 *addr the address to bind (NULL for all interface)* \
 *port the listening port. (0 for random port)* \
 *family the IP family (AF\_INET or AF\_INET6).* \
 *secure 0 for UDP or TCP, 1 for TLS (with TCP).*

### int eXosip\_reset\_transports (struct eXosip\_t \* excontext)

*Reset transport sockets.*

**Parameters:**

*excontext eXosip\_t instance.*

### int eXosip\_set\_socket (struct eXosip\_t \* excontext, int transport, int socket, int port)

*Listen on a specified socket.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *transport IPPROTO\_UDP for udp. (soon to come: TCP/TLS?)* \
 *socket socket to use for listening to UDP sip messages.* \
 *port the listening port for masquerading.*

### void eXosip\_set\_user\_agent (struct eXosip\_t \* excontext, const char \* user\_agent)

*Set the SIP User-Agent: header string.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *user\_agent the User-Agent header to insert in messages.*

### const char\* eXosip\_get\_version (void)

*Get the eXosip version as a sring*

### int eXosip\_set\_cbsip\_message (struct eXosip\_t \* excontext, CbSipCallback cbsipCallback)

*Set a callback to get sent and received SIP messages.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *cbsipCallback the callback to retreive messages.*

### void eXosip\_enable\_ipv6 (int ipv6\_enable)

*Use IPv6 instead of IPv4. (global setting)*

*DEPRECATED: you MUST use EXOSIP\_OPT\_ENABLE\_IPV6 to configure each eXosip\_t independently.*

**THIS CODE DOES NOTHING, REPLACE WITH**

*eXosip\_set\_option(excontext, EXOSIP\_OPT\_ENABLE\_IPV6, &val);*

**Parameters:**

*ipv6\_enable This parameter should be set to 1 to enable IPv6 mode.*

### void eXosip\_masquerade\_contact (struct eXosip\_t \* excontext, const char \* public\_address, int port)

*This method is used to replace contact address with the public address of your NAT. The ip address should be retreived manually (fixed IP address) or with STUN. This address will only be used when the remote correspondant appears to be on an DIFFERENT LAN.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *public\_address the ip address.* \
 *port the port for masquerading.*

*If set to NULL, then the local ip address will be guessed automatically (returns to default mode).*

### int eXosip\_find\_free\_port (struct eXosip\_t \* excontext, int free\_port, int transport)

*This method is used to find out an free IPPROTO\_UDP or IPPROTO\_TCP port.*

**Parameters:**

*excontext eXosip\_t instance.* \
 *free\_port initial port for search.* \
 *transport IPPROTO\_UDP or IPPROTO\_TCP protocol.*

## Author

*Generated automatically by Doxygen for libeXosip2 from the source code.*
