Skip to content

Commit e65173f

Browse files
committed
topology_hiding: do not mark the contacts parts as HDR_CONTACT_T
This ensures that when a fixed contact is restored from a shm lump, it does not overlap to contact parts, as topology hiding builds them. Many thanks to David Trihy from Genesys for reporting and helping us troubleshoot.
1 parent 307a986 commit e65173f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

modules/tm/t_msgbuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static inline int fix_fake_req_headers(struct sip_msg *req)
160160
for (c = ((contact_body_t *)hdr->parsed)->contacts; c; c = c->next) {
161161
/* search for the lump */
162162
for (ld = req->add_rm; ld; ld = ld->next) {
163-
if (ld->op != LUMP_DEL)
163+
if (ld->op != LUMP_DEL && ld->op != LUMP_NOP)
164164
continue;
165165
for (la = ld->after; la; la = la->after) {
166166
/* LM_DBG("matching contact lump op=%d type=%d offset=%d"

modules/topology_hiding/topo_hiding_logic.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static int topo_dlg_replace_contact(struct sip_msg* msg, struct dlg_cell* dlg, i
420420
goto error;
421421
}
422422

423-
if ((lump = insert_new_lump_after(lump, prefix, ct->len, HDR_CONTACT_T)) == 0) {
423+
if ((lump = insert_new_lump_after(lump, prefix, ct->len, 0)) == 0) {
424424
LM_ERR("failed inserting '%.*s'\n", ct->len, prefix);
425425
goto error;
426426
}
@@ -597,19 +597,19 @@ static int topo_dlg_replace_contact(struct sip_msg* msg, struct dlg_cell* dlg, i
597597
goto error;
598598
}
599599

600-
if ((lump = insert_new_lump_after(lump,prefix,prefix_len,HDR_CONTACT_T)) == 0) {
600+
if ((lump = insert_new_lump_after(lump,prefix,prefix_len,0)) == 0) {
601601
LM_ERR("failed inserting '<sip:'\n");
602602
goto error;
603603
}
604604
/* make sure we do not free this string in case of a further error */
605605
prefix = NULL;
606606

607-
if ((lump = insert_subst_lump_after(lump, SUBST_SND_ALL, HDR_CONTACT_T)) == 0) {
607+
if ((lump = insert_subst_lump_after(lump, SUBST_SND_ALL, 0)) == 0) {
608608
LM_ERR("failed inserting SUBST_SND buf\n");
609609
goto error;
610610
}
611611

612-
if ((lump = insert_new_lump_after(lump,suffix,suffix_len,HDR_CONTACT_T)) == 0) {
612+
if ((lump = insert_new_lump_after(lump,suffix,suffix_len,0)) == 0) {
613613
LM_ERR("failed inserting '<sip:'\n");
614614
goto error;
615615
}
@@ -1775,7 +1775,7 @@ static int topo_no_dlg_encode_contact(struct sip_msg *msg,int flags, str *routes
17751775
prefix[prefix_len-1] = '@';
17761776
}
17771777

1778-
if (!(lump = insert_new_lump_after(lump,prefix,prefix_len,HDR_CONTACT_T))) {
1778+
if (!(lump = insert_new_lump_after(lump,prefix,prefix_len,0))) {
17791779
LM_ERR("failed inserting '<sip:'\n");
17801780
goto error;
17811781
}
@@ -1787,12 +1787,12 @@ static int topo_no_dlg_encode_contact(struct sip_msg *msg,int flags, str *routes
17871787
goto error;
17881788
}
17891789

1790-
if (!(lump = insert_subst_lump_after(lump, SUBST_SND_ALL, HDR_CONTACT_T))) {
1790+
if (!(lump = insert_subst_lump_after(lump, SUBST_SND_ALL, 0))) {
17911791
LM_ERR("failed inserting SUBST_SND buf\n");
17921792
goto error;
17931793
}
17941794

1795-
if (!(lump = insert_new_lump_after(lump,suffix,suffix_len,HDR_CONTACT_T))) {
1795+
if (!(lump = insert_new_lump_after(lump,suffix,suffix_len,0))) {
17961796
LM_ERR("failed inserting '<sip:'\n");
17971797
goto error;
17981798
}

0 commit comments

Comments
 (0)