diff --git a/include/re_sipsess.h b/include/re_sipsess.h index 5c9db188b..b228be5f5 100644 --- a/include/re_sipsess.h +++ b/include/re_sipsess.h @@ -83,5 +83,5 @@ void sipsess_close_all(struct sipsess_sock *sock); struct sip_dialog *sipsess_dialog(const struct sipsess *sess); void sipsess_abort(struct sipsess *sess); bool sipsess_ack_pending(const struct sipsess *sess); -bool sipsess_msg_equal(const struct sipsess *sess, const struct sip_msg *msg); +const struct sip_msg *sipsess_msg(const struct sipsess *sess); enum sdp_neg_state sipsess_sdp_neg_state(const struct sipsess *sess); diff --git a/src/sipsess/sess.c b/src/sipsess/sess.c index a14ef8180..016524182 100644 --- a/src/sipsess/sess.c +++ b/src/sipsess/sess.c @@ -373,18 +373,14 @@ bool sipsess_ack_pending(const struct sipsess *sess) /** - * Compares the sessions SIP message with given SIP message + * Get the SIP message of a SIP Session * * @param sess SIP Session - * @param msg SIP Message - * @return True if msg matches with sess->msg + * @return SIP Message */ -bool sipsess_msg_equal(const struct sipsess *sess, const struct sip_msg *msg) +const struct sip_msg *sipsess_msg(const struct sipsess *sess) { - if (!sess) - return false; - - return sess->msg == msg; + return sess ? sess->msg : NULL; } /**