SIP API Developer's Guide

Message Allocation Functions

sip_msg_t sip_new_msg();

The sip_new_msg() function allocates and returns a SIP message.

void sip_free_msg(sip_msg_t sip_msg);

The sip_free_msg() function frees the resources that are associated with a SIP message. The function decrements the reference count. If the decremented reference count is zero, the function destroys the SIP message. If the decremented reference count is not zero, the function does not destroy the SIP message until the last thread that holds a reference to the message releases that reference.

void sip_hold_msg(sip_msg_t sip_msg);

Threads use the sip_hold_msg() function to hold a reference to the SIP message. A SIP message persists while the number of references to the message is greater than zero.