libamsip  5.2.1
Functions
amsip event interface

Functions

void am_log (int level, const char *chfr,...)
 
void am_trace (const char *fi, int li, int level, const char *chfr,...)
 
int am_event_get (eXosip_event_t *evt)
 
int am_event_wait (eXosip_event_t *evt, int tv_s, int tv_ms)
 
void am_event_release (eXosip_event_t *evt)
 
int am_message_get_header (osip_message_t *msg, char *header, am_header_t *value)
 
int am_message_get_bodyinfo (osip_message_t *msg, int attachemnt_index, am_bodyinfo_t *bodyinfo)
 
int am_message_release_bodyinfo (am_bodyinfo_t *bodyinfo)
 
int am_message_get_messageinfo (osip_message_t *msg, am_messageinfo_t *value)
 
int am_message_add_header_to_uri (const char *uri, const char *header_name, const char *header_value, char *dest_uri, int dest_size)
 
int am_message_get_audio_rtpdirection (osip_message_t *msg)
 
int am_message_get_video_rtpdirection (osip_message_t *msg)
 
int am_message_set_body (osip_message_t *msg, const char *ctt, const char *body, int body_size)
 
int am_message_set_header (osip_message_t *sip, const char *hname, const char *hvalue)
 
int am_helper_get_nameaddr_info (const char *nameaddr, am_nameaddress_t *value)
 

Detailed Description

Function Documentation

◆ am_log()

void am_log ( int  level,
const char *  chfr,
  ... 
)

Log facility for amsip. DEPRECATED METHOD: use am_trace instead

Parameters
levelLevel for debug data.
chfrFormat for data.

◆ am_trace()

void am_trace ( const char *  fi,
int  li,
int  level,
const char *  chfr,
  ... 
)

Log facility for amsip.

Parameters
fifilename of source file.
liline of source file.
levelLevel for debug data.
chfrFormat for data.

◆ am_event_get()

int am_event_get ( eXosip_event_t *  evt)

Get event.

Parameters
evtPointer to fill event.

◆ am_event_wait()

int am_event_wait ( eXosip_event_t *  evt,
int  tv_s,
int  tv_ms 
)

Wait for an event during a maximum timeout. NOTE: the maximum allowed value is theorically 0s and 500 ms

Parameters
evtPointer to fill event.
tv_sseconds for timeout.
tv_msmilliseconds for timeout.

◆ am_event_release()

void am_event_release ( eXosip_event_t *  evt)

Release event.

Parameters
evtEvent structure to release.

◆ am_message_get_header()

int am_message_get_header ( osip_message_t *  msg,
char *  header,
am_header_t *  value 
)

Get header from message.

Parameters
msgSIP message where to find header.
headerHeader name to search.
valuevalue of header.

◆ am_message_get_bodyinfo()

int am_message_get_bodyinfo ( osip_message_t *  msg,
int  attachemnt_index,
am_bodyinfo_t *  bodyinfo 
)

Get body from message.

Parameters
msgSIP message where to find header.
attachemnt_indexindex of attachement.
bodyinfoElements for bodyinfo.

◆ am_message_release_bodyinfo()

int am_message_release_bodyinfo ( am_bodyinfo_t *  bodyinfo)

Get body from message.

Parameters
bodyinfoElements to release.

◆ am_message_get_messageinfo()

int am_message_get_messageinfo ( osip_message_t *  msg,
am_messageinfo_t *  value 
)

Get message information (method, target//code, reason + From/To) from message.

Parameters
msgSIP message where to extract message info.
valueElements from message info.

◆ am_message_add_header_to_uri()

int am_message_add_header_to_uri ( const char *  uri,
const char *  header_name,
const char *  header_value,
char *  dest_uri,
int  dest_size 
)

Add a header parameter to a SIP URI. (This helps for escaping)

Parameters
uriOriginal uri.
header_nameHeader name to add
header_valueHeader value to add
dest_uritarget string for new uri
dest_sizesize of target string for new uri

◆ am_message_get_audio_rtpdirection()

int am_message_get_audio_rtpdirection ( osip_message_t *  msg)

Get audio RTP direction from SDP attribute. return -1 for no sdp or no such media return 0 for _SENDRECV return 1 for _SENDONLY return 2 for _RECVONLY return 3 for _INACTIVE

Parameters
msgSIP message where to extract message info.

◆ am_message_get_video_rtpdirection()

int am_message_get_video_rtpdirection ( osip_message_t *  msg)

Get video RTP direction from SDP attribute. return -1 for no sdp or no such media return 0 for _SENDRECV return 1 for _SENDONLY return 2 for _RECVONLY return 3 for _INACTIVE

Parameters
msgSIP message where to extract message info.

◆ am_message_set_body()

int am_message_set_body ( osip_message_t *  msg,
const char *  ctt,
const char *  body,
int  body_size 
)

Set body in SIP message

Parameters
msgSIP message where to add info.
cttContent-Type.
bodyBody To add.
body_sizeSize of Body To add.

◆ am_message_set_header()

int am_message_set_header ( osip_message_t *  sip,
const char *  hname,
const char *  hvalue 
)

Allocate and Add an "unknown" header (not defined in oSIP).

Parameters
sipThe element to work on.
hnameThe token name.
hvalueThe token value.

◆ am_helper_get_nameaddr_info()

int am_helper_get_nameaddr_info ( const char *  nameaddr,
am_nameaddress_t *  value 
)

Extract main parameter from a name-addr or URI (From, To, P-Asserted-Identity, etc...)

Parameters
nameaddrThe element to work on.
valueElements from message info.