eXosip2 configuration API

General purpose 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_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)

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_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

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 
)

read

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 ressource 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

)

read

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.

Parameters

ipv6_enable
This paramter 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.

libeXosip2(2-1) -- eXosip2 configuration API的更多相关文章

  1. libeXosip2(2-3) -- eXosip2 event API

    eXosip2 event API General purpose API. Data Structures struct   eXosip_event Enumerations enum   eXo ...

  2. libeXosip2(2-2) -- eXosip2 network API

    eXosip2 network API General purpose API. Functions int  eXosip_transport_set (osip_message_t *msg, c ...

  3. ASP.NET Web.config文件的配置(Configuration API)

    本次我们讨论主要聚焦在以下Web.config配置文件的设置值的读取. 1.<connectionString />连接字符串的读取. 2.<appSettings />应用程 ...

  4. libeXosip2(2) -- General purpose API.

    General purpose API. general purpose API in libeXosip2-4.0.0. More... Modules eXosip2 configuration ...

  5. libeXosip2(1) -- Modules

    Modules Here is a list of all modules: [detail level 12] The eXtented eXosip stack LibeXosip2 Versio ...

  6. libeXosip2(3) -- SIP messages and call control API

    SIP messages and call control API The SIP messages and call control API. More... Modules eXosip2 INV ...

  7. Hadoop源码之Configuration

    本文hadoop版本为最新版本2.6.Configuration做为Hadoop的一个基础功能承担着重要的责任,为Yarn.HSFS.MapReduce.NFS.调度器等提供参数的配置.配置文件的分布 ...

  8. asp.net core 系列 10 配置configuration (上)

    一.  ASP.NET Core 中的配置概述 ASP.NET Core 中的应用配置是基于键值对,由configuration 程序提供. configuration  将从各种配置源提供程序操作键 ...

  9. asp.net core 系列之Configuration

    在ASP.NET Core中的App configuration 是通过configuration providers基于key-value对建立的.Configuration providers读取 ...

随机推荐

  1. 2014.7.8模拟赛【笨笨当粉刷匠】|bzoj1296 [SCOI]粉刷匠

    笨笨太好玩了,农田荒芜了,彩奖用光了,笨笨只好到处找工作,笨笨找到了一份粉刷匠的工作.笨笨有n条木板需要被粉刷.每条木板被分成m个格子,每个格子要被刷成红色或蓝色.笨笨每次粉刷,只能选择一条木板上一段 ...

  2. linux下 tags相关

    在vim中配置好了YouCompleteMe插件,发现把光标移动到函数名下再按ctrl+],并不能跳转到该函数的定义处.解决办法: 1.先查看有没有安装ctags,运行ctags –version查看 ...

  3. hdu5014:number sequence对称思想

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5014 题目大意:给定数组 a[]={0,1,2......n} 求一个数组b[] 元素也为0.... ...

  4. 第29讲 UI组件之 ListView与 BaseAdapter,SimpleAdapter

    第29讲 UI组件之 ListView与 BaseAdapter,SimpleAdapter 1.BaseAdapter BaseAdapter是Android应用程序中经常用到的基础数据适配器,它的 ...

  5. Html中版权符号的字体选择问题(如何让版权符号更美观)

    一.发现问题 ©是html的中版权的符号,但是字体选择的不对会带来一些问题.如果是宋体,这个符号显示的就是很奇怪的一个符号. 二.解决问题 复制代码 代码如下: <span style=&quo ...

  6. JavaScript闭包函数的写法

    <script type="text/javascript"> //通过js内置的函数构造器创建函数 var func=new Function('a','b','re ...

  7. QiniuUpload- 一个方便用七牛做图床然后插入markdown的小工具

    最近一段时间有用markdown做笔记,其他都好,但是markdown插入图片挺麻烦的,特别是想截图之后直接插入的时候.需要首先把图片保存了,然后还要上传到一个地方生成链接才能插入.如果有个工具可以直 ...

  8. asp.net服务器向客户端弹出对话框,但不使页面边白板

    1: using System; 2: using System.Collections.Generic; 3: using System.Linq; 4: using System.Web; 5: ...

  9. win7_64位主机装虚机Linux系统(VMware Workstation10+CentOS6.5)详细步骤图文讲解

    第一步:创建新的虚拟机 第二步:选择“典型”安装 第三步:选择映像文件安装—浏览选择iso文件 第四步:选择稍后安装操作系统 第五步:系统选择Linux,版本选择centOS64位 第六步:虚拟机名称 ...

  10. OC基础 点语法的使用

    OC基础 点语法的使用 1.创建一个Student类继承于NSObject,Student.h文件 #import <Foundation/Foundation.h> @interface ...