diff --git a/include/re_sipsess.h b/include/re_sipsess.h index 28cc2b6cc..87006197b 100644 --- a/include/re_sipsess.h +++ b/include/re_sipsess.h @@ -73,3 +73,4 @@ bool sipsess_refresh_allowed(const struct sipsess *sess); 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); diff --git a/src/sipsess/sess.c b/src/sipsess/sess.c index e919e0d65..bb62db33c 100644 --- a/src/sipsess/sess.c +++ b/src/sipsess/sess.c @@ -352,3 +352,17 @@ bool sipsess_refresh_allowed(const struct sipsess *sess) return ((sess->established || sess->refresh_allowed) && !sess->terminated && !sess->awaiting_answer); } + + +/** + * Return true if there is an open SIP Session Reply for which an ACK is + * expected + * + * @param sess SIP Session + * + * @return True if ACK is pending, otherwise false + */ +bool sipsess_ack_pending(const struct sipsess *sess) +{ + return sess && sess->replyl.head ? true : false; +}