码迷,mamicode.com
首页 > 其他好文 > 详细

libeXosip2(3-1) -- eXosip2 INVITE and Call Management

时间:2014-08-29 20:00:48      阅读:607      评论:0      收藏:0      [点我收藏+]

标签:des   http   os   io   ar   for   cti   html   log   

eXosip2 INVITE and Call Management

SIP messages and call control API

Functions

int 
eXosip_call_set_reference (struct eXosip_t *excontext, int id, void *reference)

void * 
eXosip_call_get_reference (struct eXosip_t *excontext, int cid)

int 
eXosip_call_build_initial_invite (struct eXosip_t *excontext, osip_message_t **invite, const char *to, const char *from, const char *route, const char *subject)

int 
eXosip_call_send_initial_invite (struct eXosip_t *excontext, osip_message_t *invite)

int 
eXosip_call_build_request (struct eXosip_t *excontext, int did, const char *method, osip_message_t **request)

int 
eXosip_call_build_ack (struct eXosip_t *excontext, int did, osip_message_t **ack)

int 
eXosip_call_send_ack (struct eXosip_t *excontext, int did, osip_message_t *ack)

int 
eXosip_call_build_refer (struct eXosip_t *excontext, int did, const char *refer_to, osip_message_t **request)

int 
eXosip_call_build_info (struct eXosip_t *excontext, int did, osip_message_t **request)

int 
eXosip_call_build_options (struct eXosip_t *excontext, int did, osip_message_t **request)

int 
eXosip_call_build_update (struct eXosip_t *excontext, int did, osip_message_t **request)

int 
eXosip_call_build_notify (struct eXosip_t *excontext, int did, int subscription_status, osip_message_t **request)

int 
eXosip_call_send_request (struct eXosip_t *excontext, int did, osip_message_t *request)

int 
eXosip_call_build_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t **answer)

int 
eXosip_call_send_answer (struct eXosip_t *excontext, int tid, int status, osip_message_t *answer)

int 
eXosip_call_terminate (struct eXosip_t *excontext, int cid, int did)

int 
eXosip_call_build_prack (struct eXosip_t *excontext, int tid, osip_message_t **prack)

int 
eXosip_call_send_prack (struct eXosip_t *excontext, int tid, osip_message_t *prack)

int 
eXosip_call_get_referto (struct eXosip_t *excontext, int did, char *refer_to, size_t refer_to_len)

int 
eXosip_call_find_by_replaces (struct eXosip_t *excontext, char *replaces)

Detailed Description

Function Documentation

int eXosip_call_set_reference
(
struct eXosip_t * excontext,

int id,

void * reference

)

Set a new application context for an existing call

Parameters

excontext

eXosip_t instance.

id
call-id or dialog-id of call

reference
New application context.

void* eXosip_call_get_reference
(
struct eXosip_t * excontext,

int cid

)

Get the application context pointer for an existing call.

Parameters

excontext

eXosip_t instance.

cid
id of the call.

Returns
Application context reference

int eXosip_call_build_initial_invite
(
struct eXosip_t * excontext,

osip_message_t ** invite,

const char * to,

const char * from,

const char * route,

const char * subject

)

Build a default INVITE message for a new call.

Parameters

excontext
eXosip_t instance.

invite
Pointer for the SIP element to hold.

to
SIP url for callee.

from
SIP url for caller.

route
Route header for INVITE. (optional)

subject
Subject for the call.

int eXosip_call_send_initial_invite
(
struct eXosip_t * excontext,

osip_message_t * invite

)

Initiate a call.

Parameters

excontext
eXosip_t instance.

invite
SIP INVITE message to send.

int eXosip_call_build_request
(
struct eXosip_t * excontext,

int did,

const char * method,

osip_message_t ** request

)

Build a default request within a call. (INVITE, OPTIONS, INFO, REFER)

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

method
request type to build.

request
The sip request to build.

int eXosip_call_build_ack
(
struct eXosip_t * excontext,

int did,

osip_message_t ** ack

)

Build a default ACK for a 200ok received.

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

ack
The sip request to build.

int eXosip_call_send_ack
(
struct eXosip_t * excontext,

int did,

osip_message_t * ack

)

Send the ACK for the 200ok received..

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

ack
SIP ACK message to send.

int eXosip_call_build_refer
(
struct eXosip_t * excontext,

int did,

const char * refer_to,

osip_message_t ** request

)

Build a default REFER for a call transfer.

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

refer_to
url for call transfer (Refer-To header).

request
The sip request to build.

int eXosip_call_build_info
(
struct eXosip_t * excontext,

int did,

osip_message_t ** request

)

Build a default INFO within a call.

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

request
The sip request to build.

int eXosip_call_build_options
(
struct eXosip_t * excontext,

int did,

osip_message_t ** request

)

Build a default OPTIONS within a call.

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

request
The sip request to build.

int eXosip_call_build_update
(
struct eXosip_t * excontext,

int did,

osip_message_t ** request

)

Build a default UPDATE within a call.

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

request
The sip request to build.

int eXosip_call_build_notify
(
struct eXosip_t * excontext,

int did,

int subscription_status,

osip_message_t ** request

)

Build a default NOTIFY within a call.

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

subscription_status
Subscription status of the request.

request
The sip request to build.

int eXosip_call_send_request
(
struct eXosip_t * excontext,

int did,

osip_message_t * request

)

send the request within call. (INVITE, OPTIONS, INFO, REFER, UPDATE)

Parameters

excontext
eXosip_t instance.

did
dialog id of call.

request
The sip request to send.

int eXosip_call_build_answer
(
struct eXosip_t * excontext,

int tid,

int status,

osip_message_t ** answer

)

Build default Answer for request.

Parameters

excontext
eXosip_t instance.

tid
id of transaction to answer.

status
Status code to use.

answer
The sip answer to build.

int eXosip_call_send_answer
(
struct eXosip_t * excontext,

int tid,

int status,

osip_message_t * answer

)

Send Answer for invite.

Parameters

excontext
eXosip_t instance.

tid
id of transaction to answer.

status
response status if answer is NULL. (not allowed for 2XX)

answer
The sip answer to send.

int eXosip_call_terminate
(
struct eXosip_t * excontext,

int cid,

int did

)

Terminate a call. send CANCEL, BYE or 603 Decline.

Parameters

excontext
eXosip_t instance.

cid
call id of call.

did
dialog id of call.

int eXosip_call_build_prack
(
struct eXosip_t * excontext,

int tid,

osip_message_t ** prack

)

Build a PRACK for invite.

Parameters

excontext
eXosip_t instance.

tid
id of the invite transaction.

prack
The sip prack to build.

int eXosip_call_send_prack
(
struct eXosip_t * excontext,

int tid,

osip_message_t * prack

)

Send a PRACK for invite.

Parameters

excontext
eXosip_t instance.

tid
id of the invite transaction.

prack
The sip prack to send.

int eXosip_call_get_referto
(
struct eXosip_t * excontext,

int did,

char * refer_to,

size_t refer_to_len

)

Get Refer-To header with Replace parameter from dialog.

Parameters

excontext
eXosip_t instance.

did
id of the dialog.

refer_to
buffer to be filled with refer-to info.

refer_to_len
size of refer_to buffer.

int eXosip_call_find_by_replaces
(
struct eXosip_t * excontext,

char * replaces

)

Return did (or cid) for the replace header.

Parameters

excontext
eXosip_t instance.

replaces
buffer to be filled with refer-to info.

libeXosip2(3-1) -- eXosip2 INVITE and Call Management

标签:des   http   os   io   ar   for   cti   html   log   

原文地址:http://www.cnblogs.com/elisha-blogs/p/3945555.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!