Skip to content

Avoid call disconnection due to request timeout when network is changing#2737

Merged
nanangizz merged 1 commit intomasterfrom
ipchange-ignore-408
Jun 29, 2021
Merged

Avoid call disconnection due to request timeout when network is changing#2737
nanangizz merged 1 commit intomasterfrom
ipchange-ignore-408

Conversation

@nanangizz
Copy link
Copy Markdown
Member

@nanangizz nanangizz commented Jun 16, 2021

Some requests (within dialog) may be in progress when network is changing, they may eventually get timed out and cause call disconnection.

This PR introduces a new PJSIP endpoint setting: pjsip_cfg_t.endpt.keep_inv_after_tsx_timeout, default is PJ_FALSE (maintaining the existing behavior). The IP change processing in PJSUA temporarily changes this setting value to PJ_TRUE to avoid call disconnection due to request timeout.

sauwming
sauwming previously approved these changes Jun 17, 2021
PJ_UNUSED_ARG(user_data);

PJ_LOG(4,(THIS_FILE,"IP change stops ignoring request timeout"));
pjsip_cfg()->endpt.keep_inv_after_tsx_timeout = PJ_FALSE;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we revert it to the previous value instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timer is scheduled only when the value is PJ_FALSE.

((tsx->status_code == PJSIP_SC_CALL_TSX_DOES_NOT_EXIST &&
tsx->method.id != PJSIP_CANCEL_METHOD) ||
tsx->status_code == PJSIP_SC_REQUEST_TIMEOUT ||
tsx->status_code == PJSIP_SC_TSX_TIMEOUT))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so PJSIP_SC_TSX_TIMEOUT is removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the same, see here, and as it is defined in a public header file, it should not be changed.

@sauwming sauwming self-requested a review June 17, 2021 04:50
@sauwming sauwming dismissed their stale review June 17, 2021 04:52

Incorrect approval

@nanangizz nanangizz merged commit bc6f0ee into master Jun 29, 2021
@nanangizz nanangizz deleted the ipchange-ignore-408 branch June 29, 2021 08:01
BarryYin pushed a commit to BarryYin/pjproject that referenced this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants