Module: kamailio
Branch: master
Commit: 86e3ed032fc738a596bab8f2ff314a280bf18545
URL: 
https://github.com/kamailio/kamailio/commit/86e3ed032fc738a596bab8f2ff314a280bf18545

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2015-08-22T09:38:40+02:00

Merge pull request #289 from kamailio/vseva/session_timers

stt: add refresher param following RFC 4028

---

Modified: modules/sst/sst_handlers.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/86e3ed032fc738a596bab8f2ff314a280bf18545.diff
Patch: 
https://github.com/kamailio/kamailio/commit/86e3ed032fc738a596bab8f2ff314a280bf18545.patch

---

diff --git a/modules/sst/sst_handlers.c b/modules/sst/sst_handlers.c
index 1cacb29..8f622c2 100644
--- a/modules/sst/sst_handlers.c
+++ b/modules/sst/sst_handlers.c
@@ -173,13 +173,19 @@ static inline int sst_build_minse_hdr(int seval, str 
*sehdr)
        sehdr->s = sst_se_buf;
        return 0;
 }
-static inline int sst_build_se_hdr(int seval, str *sehdr)
+static inline int sst_build_se_hdr(int seval, str *sehdr, char *refresher)
 {
        if(sehdr==NULL)
                return -1;
 
-       sehdr->len = snprintf(sst_se_buf, SST_SE_BUF_SIZE,
-                       "Session-Expires: %d\r\n", seval);
+       if(refresher==NULL) {
+               sehdr->len = snprintf(sst_se_buf, SST_SE_BUF_SIZE,
+                               "Session-Expires: %d\r\n", seval);
+       }
+       else {
+               sehdr->len = snprintf(sst_se_buf, SST_SE_BUF_SIZE,
+                               "Session-Expires: %d;refresher=%s\r\n", seval, 
refresher);
+       }
        sehdr->s = sst_se_buf;
        return 0;
 }
@@ -342,7 +348,7 @@ void sst_dialog_created_CB(struct dlg_cell *did, int type,
                }
                
                info->requester = SST_PXY;
-               sst_build_se_hdr(info->interval, &msehdr);
+               sst_build_se_hdr(info->interval, &msehdr, NULL);
                if (append_header(msg, msehdr.s)) {
                        LM_ERR("failed to append Session-Expires header to 
proxy "
                                        "requested SST.\n");
@@ -562,7 +568,7 @@ static void sst_dialog_response_fwded_CB(struct dlg_cell* 
did, int type,
                                         * header and forward back to the UAC 
and it will
                                         * deal with refreshing the session.
                                         */
-                                       sst_build_se_hdr(info->interval, 
&sehdr);
+                                       sst_build_se_hdr(info->interval, 
&sehdr, "uac");
                                        if (append_header(msg, sehdr.s)) {
                                                LM_ERR("failed to append 
Session-Expires header\n");
                                                return;


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to