Skip to content

Commit

Permalink
Merge pull request #1830 from gaaf/rr-lr-retval
Browse files Browse the repository at this point in the history
rr: Add new return value for preloaded route set to loose_route()
  • Loading branch information
miconda committed Feb 1, 2019
2 parents 9f9ec19 + c5b8e5b commit 9805625
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/modules/rr/doc/rr_admin.xml
Expand Up @@ -364,7 +364,7 @@ modparam("rr", "ignore_sips", 1)

<listitem>
<para><emphasis>2</emphasis> - route calculation based on
flow-token has been successful</para>
flow-token has been successful</para>
</listitem>

<listitem>
Expand All @@ -376,6 +376,11 @@ modparam("rr", "ignore_sips", 1)
<para><emphasis>-2</emphasis> - outbound flow-token shows evidence
of tampering</para>
</listitem>

<listitem>
<para><emphasis>-3</emphasis> - next hop is taken from
a preloaded route set</para>
</listitem>
</itemizedlist>

<para>This function can be used from REQUEST_ROUTE.</para>
Expand Down
5 changes: 3 additions & 2 deletions src/modules/rr/loose.c
Expand Up @@ -48,6 +48,7 @@
#define RR_OB_DRIVEN 2 /*!< The next hop is determined from the route set based on flow-token */
#define NOT_RR_DRIVEN -1 /*!< The next hop is not determined from the route set */
#define FLOW_TOKEN_BROKEN -2 /*!< Outbound flow-token shows evidence of tampering */
#define RR_PRELOADED -3 /*!< The next hop is determined from a preloaded route set */

#define RR_ROUTE_PREFIX ROUTE_PREFIX "<"
#define RR_ROUTE_PREFIX_LEN (sizeof(RR_ROUTE_PREFIX)-1)
Expand Down Expand Up @@ -840,7 +841,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
}
if (res > 0) { /* No next route found */
LM_DBG("No next URI found\n");
status = (preloaded ? NOT_RR_DRIVEN : RR_DRIVEN);
status = (preloaded ? RR_PRELOADED : RR_DRIVEN);
goto done;
}
rt = (rr_t*)hdr->parsed;
Expand Down Expand Up @@ -873,7 +874,7 @@ static inline int after_loose(struct sip_msg* _m, int preloaded)
}
if (res > 0) { /* No next route found */
LM_DBG("no next URI found\n");
status = (preloaded ? NOT_RR_DRIVEN : RR_DRIVEN);
status = (preloaded ? RR_PRELOADED : RR_DRIVEN);
goto done;
}
rt = (rr_t*)hdr->parsed;
Expand Down

0 comments on commit 9805625

Please sign in to comment.