exosip2ctypes.message module

class exosip2ctypes.message.OsipMessage(ptr)

Bases: object

class for osip2 message API

Parameters:ptr (ctypes.c_void_p) – Pointer to the osip_message_t structure in C library
add_allow(val)

Set the Allow header.

Parameters:val (str) – The string describing the element.

Attention

This method will ADD a create ALLOW header

add_body(val)

Fill the body of message.

Parameters:val (str) – Body string.

Attention

This method will ADD a create body

add_contact(val)

Set the Contact header.

Parameters:val (str) – The string describing the element.

Attention

This method will ADD a create Contact header

add_header(name, value)

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

Parameters:
  • name (str) – The token name.
  • value (str) – The token value.

Attention

This method will ADD a create header

allows

Get Allow header list.

Return type:list
bodies

Get body header list.

Return type:list
call_id

Call-id header.

Return type:str
contacts

Get Contact header list.

Return type:list
content_length

Content-length header.

Return type:int
content_type

Content Type string of the SIP message

Return type:str
from_

From header

Return type:str
get_headers(name)

Find “unknown” header’s list. (not defined in oSIP)

Parameters:name (str) – The name of the header to find.
Returns:Header’s value string list.
Return type:list
ptr

Pointer to the osip_message_t C Structure

Return type:ctypes.c_void_p
to

To header.

Return type:str
class exosip2ctypes.message.ExosipMessage(ptr, context)

Bases: exosip2ctypes.message.OsipMessage

class for eXosip2 message API

Parameters:
  • ptr (ctypes.c_void_p) – Pointer to the osip_message_t structure in C library
  • context (Context) – eXosip context

Danger

Do NOT con/destruct the class yourself unless you known what you are doing.

Attention

In eXosip2, messages are managed inside the library, so we should NOT free OsipMessage object manually.

context

eXosip context of the message

Return type:Context
send()