<div dir="ltr"><div dir="ltr">Hi,<div>first of all you definitely do not want to put the contact received in the INVITE in the 200 OK, since you will, in the best case generate a loop of the UAC sending the ACK to itself.</div><div>About having to call msg_apply_changes this comes probably by the fact that you've already manipulated the header with  fix_nated_contact(). Due to kamailio's internals you cannot change the headers twice in a row without invoking msg_apply_changes().</div><div>For your main problem with the ACK, I'd rather look at the Record-Route. I see in the 200 OK that Record-Route has a private IP. Unless the caller is on the same network or on a network that can communicate with your server, you need to have there a public address (or a double Record-Route if your server is running on two interfaces).</div><div>Have a look at "advertise" parameter of listen directive and to <a href="http://www.kamailio.org/docs/modules/devel/modules/rr.html#rr.p.enable_double_rr">http://www.kamailio.org/docs/modules/devel/modules/rr.html#rr.p.enable_double_rr</a>.</div><div><br></div><div>Best regards,</div><div><br></div><div>Federico</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 25, 2018 at 12:24 AM Ben Hood <<a href="mailto:ben@relops.com">ben@relops.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On 24 Sep 2018, at 23:04, Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> wrote:<br>
> <br>
> On Mon, Sep 24, 2018 at 10:46:44PM +0100, Ben Hood wrote:<br>
> <br>
>> I was trying (as a temporary hack) to mangle this to become<br>
>> <br>
>> Contact: <sip:2018092417381900003@81.x.x.x <sip:2018092417381900003@81.x.x.x>><br>
> <br>
> But that's not grammatically valid…<br>
<br>
You are absolutely correct, but I don’t think that is what I wrote (might be a typo from me?). I was trying to produce:<br>
<br>
Contact: <sip:2018092423082500003@81.x.x.x><br>
<br>
Which I have now achieved by adding<br>
<br>
msg_apply_changes();<br>
<br>
after the invocation of subst_hf().<br>
<br>
Seems that the SIP buffer needs to be explicitly finalised before transport.<br>
<br>
However, my theory about patching the Contact header to make the remote system happy is wrong - the 200 OK is still not ACK’ed. So I need to look into the NAT’ing a bit more to see what might be going on - but this is a different question to how to use subst_hf().<br>
<br>
Many thanks for helping me out with this, very much appreciated.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>