MT#59022 Handle faked legs during B2BTerminateLeg properly

If the leg during the `B2BEvent::B2BTerminateLeg` event
handling turns out to be in the 183/200 faked state,
then handle the leg termination with CANCEL, instead of BYE.

This is because this leg has never seen the real 200OK
response, and hence remains indeed in the early stage.

Change-Id: I4a9d4197a6ea42f1cfbbcdc5fb306c48684e64bf
mr12.3.1
Donat Zenichev 2 years ago
parent 241ca6a30c
commit 2763f18cd3

@ -688,6 +688,26 @@ int AmSipDialog::bye(const string& hdrs, int flags)
send_200_ack(*it);
}
/* handle case with force early announce (leg is in pseudo-connected state),
* but indeed on the SIP level, leg has never seen 2XX response */
if (getFaked183As200()) {
setFaked183As200(false); /* reset faked state */
for (TransMap::reverse_iterator t = uac_trans.rbegin();
t != uac_trans.rend();
t++)
{
if (t->second.method == SIP_METH_INVITE || t->second.method == SIP_METH_BYE) {
setStatus(Cancelling);
return SipCtrlInterface::cancel(&t->second.tt, local_tag,
t->first, t->second.hdrs + hdrs);
}
}
/* if faked state doesn't find required transaction,
* it's going to a usual way of handling with BYE */
}
/* usual handling */
if (status != Disconnecting) {
setStatus(Disconnected);
return sendRequest(SIP_METH_BYE, NULL, hdrs, flags);

Loading…
Cancel
Save