Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion in sending BYE after transaction timeout #4107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion pjsip/src/pjsip-ua/sip_inv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4664,11 +4664,19 @@ static pj_bool_t handle_uac_tsx_response(pjsip_inv_session *inv,
pj_status_t status;

inv_set_cause(inv, tsx->status_code, &tsx->status_text);
inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e);

/* Do not shift state to DISCONNECTED here, as it will destroy the
* invite session and the BYE sending below will raise an assertion.
*/
//inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e);

/* Send BYE */
status = pjsip_dlg_create_request(inv->dlg, pjsip_get_bye_method(),
-1, &bye);
if (status == PJ_SUCCESS && tsx->status_text.slen) {
status = add_reason_warning_hdr(bye, tsx->status_code,
&tsx->status_text);
}
if (status == PJ_SUCCESS) {
pjsip_inv_send_msg(inv, bye);
}
Expand Down Expand Up @@ -5381,6 +5389,10 @@ static void inv_on_state_connecting( pjsip_inv_session *inv, pjsip_event *e)
status = pjsip_dlg_create_request(inv->dlg,
pjsip_get_bye_method(),
-1, &bye);
if (status == PJ_SUCCESS && tsx->status_text.slen) {
status = add_reason_warning_hdr(bye, tsx->status_code,
&tsx->status_text);
}
if (status == PJ_SUCCESS) {
pjsip_inv_send_msg(inv, bye);

Expand Down
Loading