In our setup the Original To: and From: addresses are modified using the uac_replace_* methods. Opensips will add a vst and vsf parameter in the Route information. When the BYE message comes from the callee the To: and From: addresses are replaced to their original values. However this restore_uri process will garble the To: address field. I will look something like:
while it is supposed to be something like:
(replaced sensitive info with x-es)
A bit of digging around showed me that the garbled value is a BASE64 decode of the vsf parameter. (should the vsf parameter contain a BASE64 encoded representation of the original address?)
In some cases the garbled address contains a (hex) 0x0a character (CR/LF) which would mess up the whole SIP message.
I've tried this with 1.8.2 and 1.8.3 release. Both versions have the same problem.
Do you have any idea what's going on here?