Skip to content

Commit

Permalink
rr: exported record_route_advertised_address() to kemi
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Apr 8, 2020
1 parent 0edff01 commit 66582c4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/modules/rr/rr_mod.c
Expand Up @@ -453,6 +453,23 @@ static int w_record_route_advertised_address(struct sip_msg *msg, char *addr, ch
return 1;
}

/**
*
*/
static int ki_record_route_advertised_address(sip_msg_t *msg, str *addr)
{
if (msg->msg_flags & FL_RR_ADDED) {
LM_ERR("Double attempt to record-route\n");
return -1;
}

if ( record_route_advertised_address(msg, addr) < 0)
return -1;

msg->msg_flags |= FL_RR_ADDED;
return 1;
}


static int w_add_rr_param(struct sip_msg *msg, char *key, char *foo)
{
Expand Down Expand Up @@ -865,6 +882,11 @@ static sr_kemi_t sr_kemi_rr_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("rr"), str_init("record_route_advertised_address"),
SR_KEMIP_INT, ki_record_route_advertised_address,
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
{ str_init("rr"), str_init("next_hop_route"),
SR_KEMIP_INT, ki_rr_next_hop_route,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
Expand Down

0 comments on commit 66582c4

Please sign in to comment.