Skip to content

Commit

Permalink
sipsess: add compare function for sess->msg
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Dec 4, 2024
1 parent 5c7fe3f commit 19194c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/re_sipsess.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
bool sipsess_msg_equal(const struct sipsess *sess, const struct sip_msg *msg);
enum sdp_neg_state sipsess_sdp_neg_state(const struct sipsess *sess);
15 changes: 15 additions & 0 deletions src/sipsess/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,21 @@ bool sipsess_ack_pending(const struct sipsess *sess)
}


/**
* Compares the sessions SIP message with given SIP message
*
* @param sess SIP Session
* @param msg SIP Message
* @return True if msg matches with sess->msg
*/
bool sipsess_msg_equal(const struct sipsess *sess, const struct sip_msg *msg)
{
if (!sess)
return false;

return sess->msg == msg;
}

/**
* Get the SDP negotiation state of a SIP Session
*
Expand Down

0 comments on commit 19194c3

Please sign in to comment.