2) When the
INVITE transaction is terminated by a final [3456]XX
response, the dialog remains in memory in state 5
for ~4 seconds. I've inspected the code and couldn't find a timer or
whatever that could make the dialog information to be kept for such
time.
Not in dialog module, but it is tm module. IIRC, the last reference to such
dialog is destroyed when the transaction is deleted from memory. That should
happen aprox 2sec after the transaction is completed and reply sent. To be
sure it is this one, you can play with tm parameter delete_timer or so. I am
going to dig in more as well.
This is correct. The transaction deletion triggers an unref in the
dialog context and when the ref counter comes down to zero, the dialog
is deleted.
Regards,
Ovidiu Sas