Skip to content

Commit

Permalink
test: call - add call on-hold/resume test (baresip#990)
Browse files Browse the repository at this point in the history
* sess: add sipsess_ack_pending()

can be used for unit tests

* sess: add NULL pointer check

* sess: add doxygen to sipsess_ack_pending()
  • Loading branch information
cspiel1 authored Oct 26, 2023
1 parent 5791248 commit aa13ac7
Show file tree
Hide file tree
Showing 2 changed files with 15 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 @@ -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);
14 changes: 14 additions & 0 deletions src/sipsess/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit aa13ac7

Please sign in to comment.