<h3>Description</h3>
<p>Topos don't restore the via on the correct position towards the caller.</p>

<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>SIP/2.0 200 OK.<br>
From: "N" sip:+111111111@proxy1;tag=as68c113e4.<br>
To: sip:0000000@proxy1;tag=DHpXgm46a8QgQ.<br>
Call-ID: 09e5173225bed77e5cd7247550ee5b60<br>
CSeq: 104 BYE.<br>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY.<br>
Supported: path, replaces.<br>
Content-Length: 0.<br>
Via: SIP/2.0/UDP IP:10060;rport=10060;branch=z9hG4bK7e7ab41c.<br>
Contact: sip:atpsh-5c710f13-962-c@IP.</p>
<p>Should be</p>
<p>SIP/2.0 200 OK.<br>
Via: SIP/2.0/UDP IP:10060;rport=10060;branch=z9hG4bK7e7ab41c.<br>
From: "N" sip:+111111111@proxy1;tag=as68c113e4.<br>
To: sip:0000000@proxy1;tag=DHpXgm46a8QgQ.<br>
Call-ID: 09e5173225bed77e5cd7247550ee5b60<br>
CSeq: 104 BYE.<br>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY.<br>
Supported: path, replaces.<br>
Content-Length: 0.<br>
Contact: sip:atpsh-5c710f13-962-c@IP.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<p>version: kamailio 5.1.7 (x86_64/linux) 567df3<br>
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES<br>
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: 567df3<br>
compiled on 07:05:54 Feb 21 2019 with gcc 4.4.7</p>
<pre><code>(paste your output here)
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>(paste your output here)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1865">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZbNVqr04QWzmelHv95bIkl5uhIYwks5vQtDBgaJpZM4bOql0">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZeTs1b7IiRuC9vfeaGfiC-w6VzHdks5vQtDBgaJpZM4bOql0.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Topos - Via Restore (#1865)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1865"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1865",
"url": "https://github.com/kamailio/kamailio/issues/1865",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>