SIP API Developer's Guide

Dialog Caching

For an incoming message, the stack sends any existing dialog, along with the message to the application. When the application's receive function returns, the stack decrements the reference count to the dialog. If the dialog's reference count is zero after this decrement, the stack destroys the dialog if the dialog is in a terminated state. If the application needs to use the dialog in the future, it must hold a reference to the dialog by using the sip_hold_dialog() function to prevent the stack from destroying the dialog After using the dialog the application must release the reference by using the sip_release_dialog() function.