-
Notifications
You must be signed in to change notification settings - Fork 948
PJSUA-LIB should report disconnection event immediately after pjsua_call_hangup() is called #1049
Description
2010-03-29 08:05:15: @bennylp created the issue on trac ticket 1049
There are several scenarios in which call DISCONNECTED state will only be reported later, if at all, after pjsua_call_hangup() is issued:
- when INVITE is not responded with any responses yet (not even provisional responses), which in this case, PJSIP will continue retransmitting the request until either a response is received (and if it's not a final response, CANCEL then will be issued), or retransmission times out 32 seconds after call is initiated.
- when BYE is issued against peer which doesn't exist; in this case, the DISCONNECTED state will be issued after the BYE transaction times out, 32 seconds after it is issued
when BYE is answered with failure final response; in this case, most likely call will stay as is. Note that 408 and 481 response would cause call to be terminated though.(ininv_handle_bye_response(), any response other than 401 and 407 will end the session).- when 200/OK for CANCEL is received, but the final response for the INVITE transaction never arrives; in this case, call will remain as is indefinitely (!) (done in Handle the case when CANCEL is responded with 200/OK but 487 is not sent #503)
- when ACK is not received yet for 200/OK, UAS is not able to send BYE. The stack ideally should send the BYE automatically once ACK is received (done in Must not send BYE before ACK is received #1712)
In all cases above, it is desirable to have the application receives the DISCONNECTED event immediately and let PJSUA-LIB handle the call under the hood. Several scenarios that must be handled by PJSUA-LIB include:
- sending BYE if call isn't disconnected after CANCEL is issued:
- it is possible that the CANCEL request and 200/OK to INVITE had crossed each other in the wire; in this case, the call will get CONNECTED and the CANCEL will be rejected with 481 (done in Automatically send BYE when sending CANCEL for INVITE is unsuccessful. #1817)
- peer may have been malfunctioning, not disconnecting the call even after sending 200/OK response to CANCEL. We may need to have a timer for this. (done in Handle the case when CANCEL is responded with 200/OK but 487 is not sent #503)
retry sending the BYE if previous ones fail and call remains connected. If this keeps happening (the BYE request gets rejected), we'll probably need to hard-terminate the call, that is to forcefully terminate the call without relying for the BYE to succeed.(done in Report disconnection event immediately when hanging up a call #2600).- when ACK is not received yet for 200/OK, UAS is not able to send BYE. The stack ideally should send the BYE automatically once ACK is received (done in Must not send BYE before ACK is received #1712)
- cease any PJSUA call related callback once call is declared to be disconnected (done in Report disconnection event immediately when hanging up a call #2600)
2010-09-14 12:04:10: @bennylp changed milestone from Known-Issues-and-Ideas to release-2.x
2014-04-07 10:24:40: @bennylp edited the issue description
2014-04-07 10:28:43: @bennylp edited the issue description
2014-04-07 10:31:31: @bennylp edited the issue description
2015-03-02 09:42:20: @mingteluu edited the issue description
2018-02-08 01:17:31: @nanangizz edited the issue description
2018-02-08 01:17:31: @nanangizz changed milestone from release-2.x to release-2.8