This change ensures that the INVITE session remains valid for the lifetime
of the session object itself by increasing the session count on the dialog that
the INVITE session is allocated from. Once this reaches zero (normally as a result
of decrementing it within the session destructor) the dialog, and INVITE session,
are destroyed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389609
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
ast_party_id_free(&session->id);
ao2_cleanup(session->endpoint);
ast_format_cap_destroy(session->req_caps);
+
+ if (session->inv_session) {
+ pjsip_dlg_dec_session(session->inv_session->dlg, &session_module);
+ }
}
static int add_supplements(struct ast_sip_session *session)
}
ast_sip_dialog_set_serializer(inv_session->dlg, session->serializer);
ast_sip_dialog_set_endpoint(inv_session->dlg, endpoint);
+ pjsip_dlg_inc_session(inv_session->dlg, &session_module);
ao2_ref(endpoint, +1);
inv_session->mod_data[session_module.id] = session;
session->endpoint = endpoint;