Skip to content

Commit

Permalink
sess: replace compare function by getter
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Dec 9, 2024
1 parent 19194c3 commit 4685f8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/re_sipsess.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 4 additions & 8 deletions src/sipsess/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 4685f8a

Please sign in to comment.