Skip to content

Commit

Permalink
Merge pull request #289 from kamailio/vseva/session_timers
Browse files Browse the repository at this point in the history
stt: add refresher param following RFC 4028
  • Loading branch information
miconda committed Aug 22, 2015
2 parents 9902ca1 + 5b97d81 commit 86e3ed0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions modules/sst/sst_handlers.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 86e3ed0

Please sign in to comment.