Skip to content

Commit

Permalink
topos: reuse uuid for requests withing dialog
Browse files Browse the repository at this point in the history
- related to GH #1496

(cherry picked from commit 63e5a1f)
  • Loading branch information
miconda committed Apr 22, 2018
1 parent 1eea811 commit f9e0bc3
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/modules/topos/tps_storage.c
Expand Up @@ -372,13 +372,28 @@ int tps_storage_link_msg(sip_msg_t *msg, tps_data_t *td, int dir)
int tps_storage_record(sip_msg_t *msg, tps_data_t *td, int dialog)
{
int ret;
str suid;

sruid_next(&_tps_sruid);
if(dialog==0) {
sruid_next(&_tps_sruid);
suid = _tps_sruid.uid;
} else {
if(td->a_uuid.len>0) {
suid = td->a_uuid;
} else if(td->b_uuid.len>0) {
suid = td->b_uuid;
} else {
goto error;
}
suid.s++;
suid.len--;
}

ret = tps_storage_fill_contact(msg, td, &_tps_sruid.uid, TPS_DIR_DOWNSTREAM);
ret = tps_storage_fill_contact(msg, td, &suid, TPS_DIR_DOWNSTREAM);
if(ret<0) goto error;
ret = tps_storage_fill_contact(msg, td, &_tps_sruid.uid, TPS_DIR_UPSTREAM);
ret = tps_storage_fill_contact(msg, td, &suid, TPS_DIR_UPSTREAM);
if(ret<0) goto error;

ret = tps_storage_link_msg(msg, td, TPS_DIR_DOWNSTREAM);
if(ret<0) goto error;
if(td->as_contact.len <= 0 && td->bs_contact.len <= 0) {
Expand Down

0 comments on commit f9e0bc3

Please sign in to comment.