Skip to content

Commit

Permalink
For INVITE transactions generate and dispense ACK before we call
Browse files Browse the repository at this point in the history
final response handling routine. This makes sure that for example
2-nd INVITE after 401/407 is going to be send after ACK, not
before. Previous behaviour while not strictly against RFC (since
it could be often caused by reordering on network), but it can
cause confuse some "naive" UAS implementation out there leading
to various interop issues.

Discovered at: OpenSIPIt'00
  • Loading branch information
sobomax committed Sep 16, 2020
1 parent e4160cc commit 8adb5f9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sippy/SipTransactionManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ def incomingResponse(self, msg, t, checksum):
t.resp_cb(msg, t)
else:
# Final response - notify upper layer and remove transaction
if t.resp_cb != None:
if t.cb_ifver == 1:
t.resp_cb(msg)
else:
t.resp_cb(msg, t)
if t.needack:
# Prepare and send ACK if necessary
fcode = msg.getSCode()[0]
Expand Down Expand Up @@ -479,9 +474,15 @@ def incomingResponse(self, msg, t, checksum):
t.ack_checksum = checksum
self.l1rcache[checksum] = SipTMRetransmitO()
t.teG = Timeout(self.timerG, 64, 1, t)
return
else:
self.l1rcache[checksum] = SipTMRetransmitO()
if t.resp_cb != None:
if t.cb_ifver == 1:
t.resp_cb(msg)
else:
t.resp_cb(msg, t)
if t.state == UACK:
return
del self.tclient[t.tid]
t.cleanup()

Expand Down

0 comments on commit 8adb5f9

Please sign in to comment.