[Asterisk-code-review] chan_sip.c Session timers get removed on UPDATE (asterisk[master])

George Joseph asteriskteam at digium.com
Wed Apr 27 03:28:45 CDT 2022


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/18457 )

Change subject: chan_sip.c Session timers get removed on UPDATE
......................................................................

chan_sip.c Session timers get removed on UPDATE

If Asterisk receives a SIP REFER with Session-Timers UAC
maintain Session-Timers when sending UPDATE"

ASTERISK-29843

Change-Id: I8e9a21c13bf757fa34d778f49ba3cf859b29ae5c
---
M channels/chan_sip.c
A doc/CHANGES-staging/chan_sip_session-timer_on_update.txt
2 files changed, 7 insertions(+), 3 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, approved
  George Joseph: Approved for Submit



diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 77685b2..affd73f 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -12507,11 +12507,9 @@
 	   An exception to this behavior is the ACK request. Since Asterisk never requires
 	   session-timers support from a remote end-point (UAS) in an INVITE, it must
 	   not send 'Require: timer' header in the ACK request.
-	   This should only be added in the INVITE transactions, not MESSAGE or REFER or other
-	   in-dialog messages.
 	*/
 	if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE
-	    && sipmethod == SIP_INVITE) {
+	    && (sipmethod == SIP_INVITE || sipmethod == SIP_UPDATE)) {
 		char se_hdr[256];
 		snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
 			p->stimer->st_ref == SESSION_TIMER_REFRESHER_US ? "uac" : "uas");
diff --git a/doc/CHANGES-staging/chan_sip_session-timer_on_update.txt b/doc/CHANGES-staging/chan_sip_session-timer_on_update.txt
new file mode 100644
index 0000000..259782f
--- /dev/null
+++ b/doc/CHANGES-staging/chan_sip_session-timer_on_update.txt
@@ -0,0 +1,6 @@
+Subject: chan_sip
+
+Session timers get removed on UPDATE
+Fix if Asterisk receives a SIP REFER with Session-Timers UAC
+that Asterisk maintains Session-Timers when sending UPDATE request
+

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18457
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I8e9a21c13bf757fa34d778f49ba3cf859b29ae5c
Gerrit-Change-Number: 18457
Gerrit-PatchSet: 2
Gerrit-Owner: Mark Petersen <asterisk.org at zombie.dk>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-CC: Mark Petersen <bugs.digium.com at zombie.dk>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220427/cb424e97/attachment.html>


More information about the asterisk-code-review mailing list