I have sorted out the malformed SIP header, but editing the source of FS. (freeswitch-1.10.10.-release)
endpoints/mod_sofia/sofia.c
inside the calls to check if extension_in_contact is set.
around Line 4201 in
ā format = strchr(sipip, ā:ā) ? āsip:gw+%s@[%s]:%d%s%sā : āsip:gw+%s@%s:%d%s%sā;
++ format = strchr(sipip, ā:ā) ? āsip:[%s]:%d%sā : āsip:%s:%d%sā;
Now my interconnect to the mobile operator has passed all the integration tests and we are going live, without the need for an additional SBC.
Is there a way to unset the core contact header for a gateway, even from sofia.c? Setting gateway ā register_contact = NULL; result in freeswitch using he default contact header.
We needed to set the contact user part of the contact header to the dynamic caller id. This seems impossible as the core contact header is set at gateway registration. The solution seems to be to add a new contact header with the caller id as contact user. However the new header does not replace the core header resulting in 2 contact headers in the invite.
Our gateway provider requires dynamic caller id as contact user of the contact header.