xadhoom created an issue (kamailio/kamailio#4301)
<!-- Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio....
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.or...
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months if there is no interest from developers or community users on pursuing it, being considered expired. In such case, it can be reopened by writing a comment that includes the token `/notexpired`. About two weeks before considered expired, the issue is marked with the label `stale`, trying to notify the submitter and everyone else that might be interested in it. To remove the label `stale`, write a comment that includes the token `/notstale`. Also, any comment postpone the `expire` timeline, being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment). -->
### Description
When topos receives an in-dialog REFER, it correctly unmask everywhing as expected, but not the Refer-To header, which breaks transfers.
### Troubleshooting
#### SIP Traffic
<!-- If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site). -->
For example, this is the refer from a client:
``` REFER sip:atpsh-685d3cd2-69-2@172.23.42.1;transport=tcp SIP/2.0 Via: SIP/2.0/TCP 172.23.42.1:23045;rport;branch=z9hG4bKlaklhcax Max-Forwards: 70 To: sip:3338063766@example.voismart.com;tag=Brcm20gBS5eZe From: "Joe" sip:1001@example.voismart.com;tag=xbdlk Call-ID: kpjiixyvombnlkw@fedora.fritz.box CSeq: 340 REFER Contact: sip:1001@172.23.42.1:23045;transport=tcp Refer-To: sip:atpsh-685d3cd2-69-4@172.23.42.1;transport=tcp?Replaces=lmhzfrkbucirwbc%40fedora.fritz.box%3bto-tag%3dXDQD403r30jeS%3bfrom-tag%3dtwbnd Referred-By: "Joe" sip:1001@example.voismart.com User-Agent: Twinkle/1.10.3 Content-Length: 0
```
And this is what exits from topos proxy: ``` REFER sip:3338063766@172.23.42.211:5060;transport=udp SIP/2.0 Via: SIP/2.0/TCP 172.23.42.250;branch=z9hG4bK89f.32493a6f0ee894aad0bf66f581e5053a.0;i=3 Max-Forwards: 69 To: sip:3338063766@example.voismart.com;tag=Brcm20gBS5eZe From: "Joe" sip:1001@example.voismart.com;tag=xbdlk Call-ID: kpjiixyvombnlkw@fedora.fritz.box CSeq: 340 REFER Refer-To: sip:atpsh-685d3cd2-69-4@172.23.42.1;transport=tcp?Replaces=lmhzfrkbucirwbc%40fedora.fritz.box%3bto-tag%3dXDQD403r30jeS%3bfrom-tag%3dtwbnd Referred-By: "Joe" sip:1001@example.voismart.com User-Agent: Twinkle/1.10.3 Content-Length: 0 Route: sip:172.23.42.3;transport=tcp;r2=on;lr=on;ftag=xbdlk;did=c84.2b02 Route: sip:172.23.42.3;r2=on;lr=on;ftag=xbdlk;did=c84.2b02 Contact: sip:btpsh-685d3cd2-69-2@172.23.42.250 ```
### Possible Solutions
Will try to find a solution, I see that in `tps_msg.c` `parse_refer_to.h` is included so perhaps there was some idea about it, but since I'm not an expert in kamailio internals may need some time.
### Additional Information v6.0.x and master