Skip to content

Commit

Permalink
topos: keep original contact in 3xx responses sent out
Browse files Browse the repository at this point in the history
- reported by Andrew Pogrebennyk
  • Loading branch information
miconda committed Jul 24, 2018
1 parent 2dfe895 commit fcf1d3d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/modules/topos/tps_msg.c
Expand Up @@ -1074,12 +1074,17 @@ int tps_response_sent(sip_msg_t *msg)
mtsd.direction = direction;

tps_remove_headers(msg, HDR_RECORDROUTE_T);
tps_remove_headers(msg, HDR_CONTACT_T);

if(direction==TPS_DIR_DOWNSTREAM) {
tps_reinsert_contact(msg, &stsd, &stsd.as_contact);
} else {
tps_reinsert_contact(msg, &stsd, &stsd.bs_contact);
/* keep contact without updates for redirect responses sent out */
if(msg->first_line.u.reply.statuscode<300
|| msg->first_line.u.reply.statuscode>=400) {
tps_remove_headers(msg, HDR_CONTACT_T);

if(direction==TPS_DIR_DOWNSTREAM) {
tps_reinsert_contact(msg, &stsd, &stsd.as_contact);
} else {
tps_reinsert_contact(msg, &stsd, &stsd.bs_contact);
}
}

tps_reappend_rr(msg, &btsd, &btsd.x_rr);
Expand Down

0 comments on commit fcf1d3d

Please sign in to comment.