Skip to content

Commit

Permalink
mid_registrar: Improve function docs
Browse files Browse the repository at this point in the history
(cherry picked from commit 0b19616)
  • Loading branch information
liviuchircu committed Apr 21, 2017
1 parent 2936773 commit 858796c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/mid_registrar/mid_registrar.c
Expand Up @@ -250,7 +250,7 @@ static int registrar_fixup(void** param, int param_no)
/* AoR */
return fixup_sgp(param);
case 4:
/* outbound registration interval */
/* outgoing registration interval */
return fixup_igp(param);
}

Expand Down
12 changes: 9 additions & 3 deletions modules/mid_registrar/save.c
Expand Up @@ -73,7 +73,10 @@ static struct {
#define RETRY_AFTER "Retry-After: "
#define RETRY_AFTER_LEN (sizeof(RETRY_AFTER) - 1)

/* with the optionally added outbound timeout extension */
/* with the optionally added outgoing timeout extension
*
* @_e: output param (UNIX timestamp) - expiration time on the main registrar
*/
void calc_ob_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e, struct save_ctx *_sctx)
{
if (!_ep || !_ep->body.len) {
Expand All @@ -84,7 +87,7 @@ void calc_ob_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e, struct s
}
}

/* extend outbound timeout, thus "throttling" heavy incoming traffic */
/* extend outgoing timeout, thus "throttling" heavy incoming traffic */
if (*_e > 0 && *_e < outgoing_expires)
*_e = outgoing_expires;

Expand All @@ -100,7 +103,7 @@ void calc_ob_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e, struct s
*_e = max_expires + get_act_time();
}

LM_DBG("outbound expires: %d\n", *_e);
LM_DBG("outgoing expires: %d\n", *_e);
}

static int trim_to_single_contact(struct sip_msg *msg, str *aor)
Expand Down Expand Up @@ -319,6 +322,9 @@ static int replace_expires(contact_t *c, struct sip_msg *msg, int new_expires,
return 0;
}

/*
* @_e: output param (integer) - value of the ";expires" Contact hf param or "Expires" hf
*/
void calc_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e, struct save_ctx *_sctx)
{
if (!_ep || !_ep->body.len) {
Expand Down

0 comments on commit 858796c

Please sign in to comment.