The ast_sip_dialog_get_session function returns the session
with reference count increased. This was not taken into
account and was causing sessions to remain around when they
should not be.
ASTERISK-29089
Change-Id: I430fa721b0a824311a59effec6056e9ec528e3e8
tdata->mod_data, session_module.id, MOD_DATA_NAT_HOOK);
struct pjmedia_sdp_session *sdp;
pjsip_dialog *dlg = pjsip_tdata_get_dlg(tdata);
- struct ast_sip_session *session = dlg ? ast_sip_dialog_get_session(dlg) : NULL;
+ RAII_VAR(struct ast_sip_session *, session, dlg ? ast_sip_dialog_get_session(dlg) : NULL, ao2_cleanup);
int stream;
/* SDP produced by us directly will never be multipart */