From aeea83133d3b54cb01546d03c737bea47fad9318 Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Wed, 11 Dec 2024 11:25:30 +0100 Subject: [PATCH] sipsess: add sipsess_msg getter function (#1225) --- include/re_sipsess.h | 1 + src/sipsess/sess.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/re_sipsess.h b/include/re_sipsess.h index b1f0087e1..b228be5f5 100644 --- a/include/re_sipsess.h +++ b/include/re_sipsess.h @@ -83,4 +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); +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 18123aa91..016524182 100644 --- a/src/sipsess/sess.c +++ b/src/sipsess/sess.c @@ -372,6 +372,17 @@ bool sipsess_ack_pending(const struct sipsess *sess) } +/** + * Get the SIP message of a SIP Session + * + * @param sess SIP Session + * @return SIP Message + */ +const struct sip_msg *sipsess_msg(const struct sipsess *sess) +{ + return sess ? sess->msg : NULL; +} + /** * Get the SDP negotiation state of a SIP Session *