[Home]

Summary:ASTERISK-29603: res_pjsip: UPDATE/re-INVITE not sent when "timers=always" is specified in pjsip.conf
Reporter:Ray Crumrine (proftech)Labels:patch
Date Opened:2021-08-17 11:47:34Date Closed:2022-06-08 21:52:32
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:16.8.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 10.4Attachments:( 0) fix-session-timer.patch
( 1) timers_handler.c
Description:When using pjsip.conf option "timers=always", asterisk function "timers_handler" does not set complete flag information before calling pjsip and as a result pjsip does not go into the uac mode and does not send sip UPDATES or re-INVITES.

-The "required" state needs flag settings (PJSIP_INV_REQUIRE_TIMER | PJSIP_INV_SUPPORT_TIMER)-

the "always" state needs flag settings (PJSIP_INV_ALWAYS_USE_TIMER | PJSIP_INV_SUPPORT_TIMER)
Comments:By: Asterisk Team (asteriskteam) 2021-08-17 11:47:37.985-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Ray Crumrine (proftech) 2021-08-18 00:26:04.685-0500

I discovered today after some simple testing that setting the *PJSIP_INV_SUPPORT_TIMER* flag *may* not be necessary for the "timers=required" option. Operation  *appears* to be normal without setting that bit. No negative effects were observed. I was unable to find any documentation on pjlib Git that stated one way or the other.
*edited 8/18* After further consideration and review, I am almost 100% certain that modification of the "required" line is not necessary and should not be changed. Per a note from Git pjlib and further perusal of the current timers_handler code, the following looks to be true;
timers=no -> = pjlib "use-timer=0"
timers=yes -> = "use-timer=1"
timers=required -> = "use-timer=2"
timers=always -> = "use-timer=3"
I have deleted the line in the note shown above. Sorry for any confusion.

By: Ray Crumrine (proftech) 2021-08-19 10:30:47.602-0500

File attached on 8/19

By: Ray Crumrine (proftech) 2021-12-19 10:50:49.097-0600

Thought I would bump this. Master code in timers_handler not corrected in Asterisk 16.23.0

By: Trevor Peirce (trev) 2022-06-07 01:39:56.019-0500

Just ran in to this with Asterisk 18.12.1 and independently came up with the same solution.  Exactly what is proposed in the description is the correct fix.  The pjsip library will not do any timer processing without PJSIP_INV_SUPPORT_TIMER being set.  So this is a prerequisite of PJSIP_INV_ALWAYS_USE_TIMER.

By: Friendly Automation (friendly-automation) 2022-06-08 21:52:32.709-0500

Change 18636 merged by Friendly Automation:
res_pjsip: Actually enable session timers when timers=always

[https://gerrit.asterisk.org/c/asterisk/+/18636|https://gerrit.asterisk.org/c/asterisk/+/18636]

By: Friendly Automation (friendly-automation) 2022-06-08 22:33:49.387-0500

Change 18635 merged by Friendly Automation:
res_pjsip: Actually enable session timers when timers=always

[https://gerrit.asterisk.org/c/asterisk/+/18635|https://gerrit.asterisk.org/c/asterisk/+/18635]

By: Friendly Automation (friendly-automation) 2022-06-09 03:48:46.714-0500

Change 18645 merged by Joshua Colp:
res_pjsip: Actually enable session timers when timers=always

[https://gerrit.asterisk.org/c/asterisk/+/18645|https://gerrit.asterisk.org/c/asterisk/+/18645]

By: Friendly Automation (friendly-automation) 2022-06-09 03:49:20.223-0500

Change 18611 merged by Joshua Colp:
res_pjsip: Actually enable session timers when timers=always

[https://gerrit.asterisk.org/c/asterisk/+/18611|https://gerrit.asterisk.org/c/asterisk/+/18611]