eXosip2_conf(3)
π NAME π
eXosip2_conf(3) from libeXosip2 β it's the eXosip2 configuration API, bestie. Think of it as the control room where you set up options, transports, DNS cache stuff, TLS stuff, and all the little knobs that make eXosip behave. π
β¨ SYNOPSIS β¨
okay so here's the whole cast list. no skipping, no vibes-only summary, every single one is important π
π Data Structures π
struct eXosip_dns_cachestruct eXosip_statsstruct eXosip_tls_credentials_sstruct eXosip_tls_ctx_s
π§ Macros π§
these are literally the option keys, so keep them exactly as they are:
#define EXOSIP_OPT_UDP_KEEP_ALIVE (EXOSIP_OPT_BASE_OPTION + 1)
#define EXOSIP_OPT_AUTO_MASQUERADE_CONTACT (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_ENABLE_REUSE_TCP_PORT (EXOSIP_OPT_BASE_OPTION + 21)
#define EXOSIP_OPT_ENABLE_USE_EPHEMERAL_PORT (EXOSIP_OPT_BASE_OPTION + 22)
#define EXOSIP_OPT_SET_CALLBACK_WAKELOCK (EXOSIP_OPT_BASE_OPTION + 23)
#define EXOSIP_OPT_ENABLE_OUTBOUND (EXOSIP_OPT_BASE_OPTION + 24)
#define EXOSIP_OPT_SET_OC_LOCAL_ADDRESS (EXOSIP_OPT_BASE_OPTION + 25)
#define EXOSIP_OPT_SET_OC_PORT_RANGE (EXOSIP_OPT_BASE_OPTION + 26)
#define EXOSIP_OPT_REMOVE_PREROUTESET (EXOSIP_OPT_BASE_OPTION + 27)
#define EXOSIP_OPT_SET_SIP_INSTANCE (EXOSIP_OPT_BASE_OPTION + 28)
#define EXOSIP_OPT_SET_MAX_MESSAGE_TO_READ (EXOSIP_OPT_BASE_OPTION + 29)
#define EXOSIP_OPT_SET_MAX_READ_TIMEOUT (EXOSIP_OPT_BASE_OPTION + 30)
#define EXOSIP_OPT_SET_DEFAULT_CONTACT_DISPLAYNAME (EXOSIP_OPT_BASE_OPTION + 31)
#define EXOSIP_OPT_SET_SESSIONTIMERS_FORCE (EXOSIP_OPT_BASE_OPTION + 32)
#define EXOSIP_OPT_FORCE_CONNECTIONREUSE (EXOSIP_OPT_BASE_OPTION + 33)
#define EXOSIP_OPT_SET_CONTACT_DIALOG_EXTRA_PARAMS (EXOSIP_OPT_BASE_OPTION + 34)
#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)
#define EXOSIP_OPT_GET_STATISTICS (EXOSIP_OPT_BASE_OPTION + 2000)
π¦ 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 π
here's the function lineup, signatures kept exactly as they are:
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)
void eXosip_dnsutils_release (struct osip_naptr *naptr_record)
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_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 πΈ
okay this part is literally just a runway into the macro docs β no extra prose from the page here, just straight to the definitions. periodt π
π Macro Definition Documentation π
EXOSIP_OPT_UDP_KEEP_ALIVEβ#define EXOSIP_OPT_UDP_KEEP_ALIVE (EXOSIP_OPT_BASE_OPTION + 1)βint *: interval for keep alive packets (UDP, TCP, TLS, DTLS)EXOSIP_OPT_AUTO_MASQUERADE_CONTACTβ#define EXOSIP_OPT_AUTO_MASQUERADE_CONTACT (EXOSIP_OPT_BASE_OPTION + 2)βint *: specific re-usage of'rport'EXOSIP_OPT_USE_RPORTβ#define EXOSIP_OPT_USE_RPORT (EXOSIP_OPT_BASE_OPTION + 7)βint *: enable or disable rport in viaEXOSIP_OPT_SET_IPV4_FOR_GATEWAYβ#define EXOSIP_OPT_SET_IPV4_FOR_GATEWAY (EXOSIP_OPT_BASE_OPTION + 8)βchar *: usually, this is the proxy addressEXOSIP_OPT_ADD_DNS_CACHEβ#define EXOSIP_OPT_ADD_DNS_CACHE (EXOSIP_OPT_BASE_OPTION + 9)βstruct eXosip_dns_cache *: force some cache entry to avoid DNSEXOSIP_OPT_DELETE_DNS_CACHEβ#define EXOSIP_OPT_DELETE_DNS_CACHE (EXOSIP_OPT_BASE_OPTION + 10)βstruct eXosip_dns_cache *: force removal of some cache entry to avoid DNSEXOSIP_OPT_SET_IPV6_FOR_GATEWAYβ#define EXOSIP_OPT_SET_IPV6_FOR_GATEWAY (EXOSIP_OPT_BASE_OPTION + 12)βchar *: usually, this is the proxy addressEXOSIP_OPT_ADD_ACCOUNT_INFOβ#define EXOSIP_OPT_ADD_ACCOUNT_INFO (EXOSIP_OPT_BASE_OPTION + 13)βstruct eXosip_account_info *: internal stuffEXOSIP_OPT_DNS_CAPABILITIESβ#define EXOSIP_OPT_DNS_CAPABILITIES (EXOSIP_OPT_BASE_OPTION + 14)βint *: 0 to disable, 2 (default) to use NAPTR/SRV recordEXOSIP_OPT_SET_DSCPβ#define EXOSIP_OPT_SET_DSCP (EXOSIP_OPT_BASE_OPTION + 15)βint *: set a dscp value for SIP socketEXOSIP_OPT_REGISTER_WITH_DATEβ#define EXOSIP_OPT_REGISTER_WITH_DATE (EXOSIP_OPT_BASE_OPTION + 16)βint *: enable usage of Date header in REGISTEREXOSIP_OPT_SET_HEADER_USER_AGENTβ#define EXOSIP_OPT_SET_HEADER_USER_AGENT (EXOSIP_OPT_BASE_OPTION + 17)βchar *: set the User-Agent headerEXOSIP_OPT_ENABLE_DNS_CACHEβ#define EXOSIP_OPT_ENABLE_DNS_CACHE (EXOSIP_OPT_BASE_OPTION + 18)βint *: 0 to disable use of cacheEXOSIP_OPT_ENABLE_AUTOANSWERBYEβ#define EXOSIP_OPT_ENABLE_AUTOANSWERBYE (EXOSIP_OPT_BASE_OPTION + 19)βint *: 0 to disable automatic answer of BYEEXOSIP_OPT_ENABLE_IPV6β#define EXOSIP_OPT_ENABLE_IPV6 (EXOSIP_OPT_BASE_OPTION + 20)βint *: 0 to disable, 1 to use only IPv6, 2 to use choose the best -this is a per-eXosip_t parameter for using IPv6 DNS requestEXOSIP_OPT_ENABLE_REUSE_TCP_PORTβ#define EXOSIP_OPT_ENABLE_REUSE_TCP_PORT (EXOSIP_OPT_BASE_OPTION + 21)βint *: 0 to disable, 1 to enable reusing local tcp port for outgoing tcp connectionEXOSIP_OPT_ENABLE_USE_EPHEMERAL_PORTβ#define EXOSIP_OPT_ENABLE_USE_EPHEMERAL_PORT (EXOSIP_OPT_BASE_OPTION + 22)βint *: 0 to disable, 1 to enable usage of emphemeral tcp port in Contact headers instead of local listening port for TCP/TLSEXOSIP_OPT_SET_CALLBACK_WAKELOCKβ#define EXOSIP_OPT_SET_CALLBACK_WAKELOCK (EXOSIP_OPT_BASE_OPTION + 23)βCbSipWakeLock *: set a callback to be called upon start/end of transactionEXOSIP_OPT_ENABLE_OUTBOUNDβ#define EXOSIP_OPT_ENABLE_OUTBOUND (EXOSIP_OPT_BASE_OPTION + 24)βint *: 0 to disable, 1 to enable usage of ob parmeter (rfc 5626) in dialog's contact headersEXOSIP_OPT_SET_OC_LOCAL_ADDRESSβ#define EXOSIP_OPT_SET_OC_LOCAL_ADDRESS (EXOSIP_OPT_BASE_OPTION + 25)βchar *: set the ip address to bind for outbound connectionEXOSIP_OPT_SET_OC_PORT_RANGEβ#define EXOSIP_OPT_SET_OC_PORT_RANGE (EXOSIP_OPT_BASE_OPTION + 26)βint[2] *: set the port range (min, max) to bind for outbound connection (ifEXOSIP_OPT_SET_OC_LOCAL_ADDRESSis not used, this options apply to TCP/TLS only)EXOSIP_OPT_REMOVE_PREROUTESETβ#define EXOSIP_OPT_REMOVE_PREROUTESET (EXOSIP_OPT_BASE_OPTION + 27)βint *: 0: keep pre-route set in initial INVITE/SUBSCRIBE/REFER, 1 (default): remove pre-route setEXOSIP_OPT_SET_SIP_INSTANCEβ#define EXOSIP_OPT_SET_SIP_INSTANCE (EXOSIP_OPT_BASE_OPTION + 28)βchar *: define+sip.instanceparameter in Contact headers (example:urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6)EXOSIP_OPT_SET_MAX_MESSAGE_TO_READβ#define EXOSIP_OPT_SET_MAX_MESSAGE_TO_READ (EXOSIP_OPT_BASE_OPTION + 29)βint: set the number of message to read at once for each network processing (high load traffic use-case: DO NOT USE FOR COMMON USAGE)
π¨ bestie, that DO NOT USE FOR COMMON USAGE is not a vibe suggestion. high load traffic use-case only, fr fr.
EXOSIP_OPT_SET_MAX_READ_TIMEOUTβ#define EXOSIP_OPT_SET_MAX_READ_TIMEOUT (EXOSIP_OPT_BASE_OPTION + 30)βlong int: set the period in nano seconds during we read for sip message. (high load traffic use-case: DO NOT USE FOR COMMON USAGE)
π¨ same warning, same energy: high load traffic use-case, DO NOT USE FOR COMMON USAGE.
EXOSIP_OPT_SET_DEFAULT_CONTACT_DISPLAYNAMEβ#define EXOSIP_OPT_SET_DEFAULT_CONTACT_DISPLAYNAME (EXOSIP_OPT_BASE_OPTION + 31)βchar *: define a display name to be added in Contact headers (example:'john Doe')EXOSIP_OPT_SET_SESSIONTIMERS_FORCEβ#define EXOSIP_OPT_SET_SESSIONTIMERS_FORCE (EXOSIP_OPT_BASE_OPTION + 32)βint *: 0 (default): activate'session timers'if supported on both side, 1: if remote side (UAS) do not indicate support for'session timers', activate feature on UAC (local) sideEXOSIP_OPT_FORCE_CONNECTIONREUSEβ#define EXOSIP_OPT_FORCE_CONNECTIONREUSE (EXOSIP_OPT_BASE_OPTION + 33)βint *: 0 to disable, 1 to force reusing established connection for ACK and dialog messageEXOSIP_OPT_SET_CONTACT_DIALOG_EXTRA_PARAMSβ#define EXOSIP_OPT_SET_CONTACT_DIALOG_EXTRA_PARAMS (EXOSIP_OPT_BASE_OPTION + 34)βchar *: define extra parameters in Contact headers (example:'audio;video;xxx=yyy'parameter must not contains initial';')EXOSIP_OPT_SET_TLS_VERIFY_CERTIFICATEβ#define EXOSIP_OPT_SET_TLS_VERIFY_CERTIFICATE (EXOSIP_OPT_BASE_OPTION + 500)βint *: enable verification of certificate for TLS connectionEXOSIP_OPT_SET_TLS_CERTIFICATES_INFOβ#define EXOSIP_OPT_SET_TLS_CERTIFICATES_INFO (EXOSIP_OPT_BASE_OPTION + 501)βeXosip_tls_ctx_t *: client and/or server certificate/ca-root/key infoEXOSIP_OPT_SET_TLS_CLIENT_CERTIFICATE_NAMEβ#define EXOSIP_OPT_SET_TLS_CLIENT_CERTIFICATE_NAME (EXOSIP_OPT_BASE_OPTION + 502)βchar*: user can choose a specific certifcate present in Windows Certificate StoreEXOSIP_OPT_SET_TLS_SERVER_CERTIFICATE_NAMEβ#define EXOSIP_OPT_SET_TLS_SERVER_CERTIFICATE_NAME (EXOSIP_OPT_BASE_OPTION + 503)βchar*: user can choose a specific certifcate present in Windows Certificate StoreEXOSIP_OPT_SET_TSC_SERVERβ#define EXOSIP_OPT_SET_TSC_SERVER (EXOSIP_OPT_BASE_OPTION + 1001)β deprecated
π deprecated, bestie. not the main character anymore.
EXOSIP_OPT_GET_STATISTICSβ#define EXOSIP_OPT_GET_STATISTICS (EXOSIP_OPT_BASE_OPTION + 2000)βstruct eXosip_stats*: retreive numerous statistics about transactions, registrations, calls, publications and subscriptions...
π Enumeration Type Documentation π
π«Ά enum eXosip_tls_ctx_error
An enumeration which describes the error which can occur while setting the eXosip_tls_ctx
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 }
β Enumerator β
TLS_OKβ yippieh, everything is fine :)TLS_ERR_NO_RANDβ no absolute path to the random file was specifiedTLS_ERR_NO_DH_PARAMβ no absolute path to the diifie hellman file was specifiedTLS_ERR_NO_PWβ no password was specifiedTLS_ERR_NO_ROOT_CAβ no absolute path to the rootCA file was specifiedTLS_ERR_MISSING_AUTH_PARTβ something is missing: the private key or the certificate
β¨ Function Documentation β¨
okay bestie, this is the function buffet β every single one, with all the params and caveats intact. no skips, no summaries, we ate. π
π§Έ struct eXosip_t* eXosip_malloc (void)
Allocates an eXosip context. It's giving βnew instance energy.β
Returns: a new allocated eXosip_t instance. π«Ά
πΈ int eXosip_init (struct eXosip_t * excontext)
Initiate the eXtented oSIP library (yes, that spelling β we're keeping it, it's iconic). β¨
Parameters:
excontextβ theeXosip_tinstance.
π¦ void eXosip_quit (struct eXosip_t * excontext)
Release the resources used by the eXtented oSIP library. Cleanup era, no cap. π§Ή
Parameters:
excontextβ theeXosip_tinstance.
π int eXosip_lock (struct eXosip_t * excontext)
Lock the eXtented oSIP library. Grab that lock, bestie. π
Parameters:
excontextβ theeXosip_tinstance.
π int eXosip_unlock (struct eXosip_t * excontext)
UnLock the eXtented oSIP library. Release the lock, we're free. ποΈ
Parameters:
excontextβ theeXosip_tinstance.
β‘ int eXosip_execute (struct eXosip_t * excontext)
Process eXosip events. The manpage is very loud about this one: it's for non-threaded mode ONLY. Do not come for me if you ignore that. π
Parameters:
excontextβ theeXosip_tinstance.
π int eXosip_set_option (struct eXosip_t * excontext, int opt, const void * value)
Set eXosip options. Peep eXosip_option for the available options menu. π
Parameters:
excontextβ theeXosip_tinstance.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 an osip_naptr context. Heads up: DNS results might not yet be available, so don't expect instant answers. β³
If you provide a FQDN, a NAPTR query will be done on it. For example: 'antisip.com'.
If you wish to do a ENUM query, you need to specify both the domain to query and the AUS (ie, the number dialed). You'll use a '!' separator between them. For example, to query '+123456789' on 'e164.org', please use: 'e164.org!+123456789'.
Parameters:
excontextβ theeXosip_tinstance.domainβ domain name for NAPTR record OR ENUM query (such ase164.org!+123456789).protocolβ protocol to use ('SIP').transportβ transport to use ('UDP').keep_in_cacheβ keep result in cache if>0.
π void eXosip_dnsutils_release (struct osip_naptr * naptr_record)
For every eXosip_dnsutils_naptr query you make, you must call eXosip_dnsutils_release to release the memory. This is not optional, bestie. Clean up after yourself. π§Ό
Parameters:
naptr_recordβ the naptr structure to release.
π int eXosip_dnsutils_dns_process (struct osip_naptr * output_record, int force)
Continue to process asynchronous DNS request (if implemented). Yes, βif implementedβ β read it and weep. π
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. Spin that list. π
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. Socket era. π
Parameters:
excontextβ theeXosip_tinstance.transportβIPPROTO_UDPfor udp. (soon to come: TCP/TLS?)addrβ the address to bind (NULLfor all interface).portβ the listening port. (0for random port).familyβ the IP family (AF_INETorAF_INET6).secureβ0for UDP or TCP,1for TLS (with TCP).
π§Ή int eXosip_reset_transports (struct eXosip_t * excontext)
Reset transport sockets. Fresh start, reset the vibes. β¨
Parameters:
excontextβ theeXosip_tinstance.
πͺ int eXosip_set_socket (struct eXosip_t * excontext, int transport, int socket, int port)
Listen on a specified socket. Yes, another one β the manpage said it twice, so we say it twice. π
Parameters:
excontextβ theeXosip_tinstance.transportβIPPROTO_UDPfor 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. Make it cute, make it you. π
Parameters:
excontextβ theeXosip_tinstance.user_agentβ theUser-Agentheader to insert in messages.
β const char* eXosip_get_version (void)
Get the eXosip version as a string. Slay. π
π int eXosip_set_cbsip_message (struct eXosip_t * excontext, CbSipCallback cbsipCallback)
Set a callback to get sent and received SIP messages. Callback bestie, we love you. π«Ά
Parameters:
excontextβ theeXosip_tinstance.cbsipCallbackβ the callback to retreive messages.
πͺ 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 retrieved manually (fixed IP address) or with STUN. This address will only be used when the remote correspondant appears to be on an DIFFERENT LAN. Network drama, honestly. π
Parameters:
excontextβ theeXosip_tinstance.public_addressβ theipaddress.portβ the port for masquerading.
If set to NULL, then the local ip address will be guessed automatically (returns to default mode). Auto-pilot mode: on. β¨
π int eXosip_find_free_port (struct eXosip_t * excontext, int free_port, int transport)
This method is used to find out a free IPPROTO_UDP or IPPROTO_TCP port. Port hunting, but make it tech. π΅οΈββοΈ
Parameters:
excontextβ theeXosip_tinstance.free_portβ initial port for search.transportβIPPROTO_UDPorIPPROTO_TCPprotocol.
π Author π
Generated automatically by Doxygen for libeXosip2 from the source code.
π okay that's the whole function list, bestie! This page is from Version 5.3.0, dated Thu May 18 2023, and it lives at eXosip2_conf(3). Periodt. π«Άβ¨πΈ
π¦ where this page comes from
- epel 9: libeXosip2-devel 5.3.0-2.el9 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms