Skip to content

Commit

Permalink
rr: all "record_route_...()" functions consider custom user AVP
Browse files Browse the repository at this point in the history
Until this fix, only the function record_route() considered the
value of the custom user AVP (if present). The functions
record_route_preset() and record_route_advertised_address(),
on the other hand, ignored the value of the custom user AVP,
even if it was presnt.
Now all three functions, record_route(), record_route_preset()
and record_route_advertised_address(), consider the value of the
custom user VP, if it is present.
  • Loading branch information
christoph-v-kontron authored and miconda committed Jul 22, 2021
1 parent a582134 commit f3a031a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/modules/rr/record.c
Expand Up @@ -527,9 +527,12 @@ int record_route_preset(struct sip_msg* _m, str* _data)
}

if (add_username) {
if (get_username(_m, &user) < 0) {
LM_ERR("failed to extract username\n");
return -1;
/* check if there is a custom user set */
if (get_custom_user(_m, &user) < 0) {
if (get_username(_m, &user) < 0) {
LM_ERR("failed to extract username\n");
return -1;
}
}
} else if (use_ob == 1) {
if (rr_obb.encode_flow_token(&user, &_m->rcv) != 0) {
Expand Down Expand Up @@ -814,9 +817,12 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data)
user.s = 0;

if (add_username) {
if (get_username(_m, &user) < 0) {
LM_ERR("failed to extract username\n");
return -1;
/* check if there is a custom user set */
if (get_custom_user(_m, &user) < 0) {
if (get_username(_m, &user) < 0) {
LM_ERR("failed to extract username\n");
return -1;
}
}
} else if (use_ob == 1) {
if (rr_obb.encode_flow_token(&user, &_m->rcv) != 0) {
Expand Down

0 comments on commit f3a031a

Please sign in to comment.