]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Resolve race condition where channels enter dialplan application before media has...
authorMark Michelson <mmichelson@digium.com>
Tue, 2 Sep 2014 20:29:09 +0000 (20:29 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 2 Sep 2014 20:29:09 +0000 (20:29 +0000)
commitc98e04753bf3c1e3e3b9764d848f5d948e0dc7ae
tree3fe2d3e3f1774499c0c7de36ed86c94b7b76cf55
parent6033c16fc37e6b56976c9d7eb5c74977d0367734
Resolve race condition where channels enter dialplan application before media has been negotiated.

Testsuite tests will occasionally fail because on reception of a 200 OK SIP response,
an AST_CONTROL_ANSWER frame is queued prior to when media has finished being
negotiated. This is because session supplements are called into before PJSIP's
inv_session code has told us that media has been updated. Sometimes the queued answer
frame is handled by the PBX thread before the ensuing media negotiations occur, causing
a test failure.

As it turns out, there is another place that session supplements could be called into, which is
after media has finished getting negotiated. What this commit introduces is a means for session
supplements to indicate when they wish to be called into when handling an incoming SIP response.
By default, all session supplements will be run at the same point that they were prior to this
commit. However, session supplements may indicate that they wish to be handled earlier than
normal on redirects, or they may indicate they wish to be handled after media has been negotiated.

In this changeset, two session supplements have been updated to indicate a preference for when
they should be run: res_pjsip_diversion executes before handling redirection in order to get
information from the Diversion header, and chan_pjsip now handles responses to INVITEs after
media negotiation to fix the race condition mentioned previously.

ASTERISK-24212 #close
Reported by Matt Jordan

Review: https://reviewboard.asterisk.org/r/3930
........

Merged revisions 422536 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@422542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_pjsip.c
include/asterisk/res_pjsip_session.h
res/res_pjsip_diversion.c
res/res_pjsip_session.c