Module: kamailio
Branch: master
Commit: 90ab15e714b7d88f7f36c8da36c1f380d22f131b
URL: 
https://github.com/kamailio/kamailio/commit/90ab15e714b7d88f7f36c8da36c1f380d22f131b

Author: Victor Seva <[email protected]>
Committer: Victor Seva <[email protected]>
Date: 2026-06-09T09:05:39+02:00

presence: use same logic to calculate header length

---

Modified: src/modules/presence/notify.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/90ab15e714b7d88f7f36c8da36c1f380d22f131b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/90ab15e714b7d88f7f36c8da36c1f380d22f131b.patch

---

diff --git a/src/modules/presence/notify.c b/src/modules/presence/notify.c
index d28159fcd0f..6683229ccd3 100644
--- a/src/modules/presence/notify.c
+++ b/src/modules/presence/notify.c
@@ -187,7 +187,8 @@ int build_str_hdr(subs_t *subs, int is_body, str *hdr)
                        + 1 /*>*/ + 15 /*";transport=xxxx"*/ + CRLF_LEN
                        + 20 /*Subscription-State: */ + status.len
                        + 10 /*reason/expires params*/
-                       + (subs->reason.len > expires.len ? subs->reason.len : 
expires.len)
+                       + (subs->status == TERMINATED_STATUS ? subs->reason.len
+                                                                               
                 : expires.len)
                        + CRLF_LEN
                        + (is_body ? (14 /*Content-Type: */ + 
subs->event->content_type.len
                                                                 + CRLF_LEN)

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to