]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_session: Fix off-nominal session refreshes.
authorJoshua C. Colp <jcolp@sangoma.com>
Mon, 10 Feb 2020 11:04:12 +0000 (07:04 -0400)
committerJoshua Colp <jcolp@sangoma.com>
Mon, 10 Feb 2020 12:12:05 +0000 (06:12 -0600)
commitac155decaed82a36f8ee9aed5811ef0180ca5cbe
tree779a50e94daa088ea17aa32daf223ba84b945592
parentb2b6f28ac2c89efe43bf6181c89b038fe4e5ede1
res_pjsip_session: Fix off-nominal session refreshes.

Given a scenario where session refreshes occur close to
each other while another is finishing it was possible for
the session refreshes to occur out of order. It was
also possible for session refreshes to be delayed for
quite some time if a session refresh did not result in
a topology change.

For the out of order session refreshes the first session
refresh would be queued due to a transaction in progress.
This transaction would then finish. When finished a
separate task to process the delayed requests queue
would be queued for handling. A second refresh would
be requested internally before this delayed request
queued task was processed. As no transaction was in
progress this session refresh would be immediately
handled before the queued session refresh.

The code will now check if any delayed requests exist
before allowing a session refresh to immediately occur.
If any exist then the session refresh is queued.

For the delayed session refreshes if a session refresh
did not result in a topology change the attempt would
be immediately stopped and no other delayed requests would
be processed.

The code will now go through the entire delayed requests
queue until a delayed request results in a request
actually being sent.

ASTERISK-28730

Change-Id: Ied640280133871f77d3f332be62265e754605088
res/res_pjsip_session.c