<h3>Description</h3>
<p>siptrace module not mirror relayed ACK message.</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Need patch vanilla kamailio config like this diff</p>
<div class="highlight highlight-source-diff"><pre><span class="pl-md">--- kamailio.cfg</span>
<span class="pl-mi1">+++ /etc/kamailio/kamailio.cfg</span>
<span class="pl-mdr">@@ -1,4 +1,8 @@</span>
 #!KAMAILIO
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define WITH_DEBUG</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define WITH_PSTN</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define WITH_NAT</span>
<span class="pl-mi1"><span class="pl-mi1">+</span></span>
 #
 # Kamailio (OpenSER) SIP Server v5.1 - default configuration script
 #     - web: https://www.kamailio.org
<span class="pl-mdr">@@ -137,7 +141,9 @@</span>
 #!define FLT_ACCMISSED 2
 #!define FLT_ACCFAILED 3
 #!define FLT_NATS 5
<span class="pl-mi1"><span class="pl-mi1">+</span>#!define FLT_SIPTRACE 8</span>
 
<span class="pl-mi1"><span class="pl-mi1">+</span></span>
 #!define FLB_NATB 6
 #!define FLB_NATSIPPING 7
 
<span class="pl-mdr">@@ -198,8 +204,8 @@</span>
  * pstn.gw_ip = "10.0.0.101" desc "My PSTN GW Address"
  *
  * - by default is empty to avoid misrouting */
<span class="pl-md"><span class="pl-md">-</span>pstn.gw_ip = "" desc "PSTN GW Address"</span>
<span class="pl-md"><span class="pl-md">-</span>pstn.gw_port = "" desc "PSTN GW Port"</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>pstn.gw_ip = "8.8.8.8" desc "PSTN GW Address"</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>pstn.gw_port = "5060" desc "PSTN GW Port"</span>
 #!endif
 
 #!ifdef WITH_VOICEMAIL
<span class="pl-mdr">@@ -286,6 +292,16 @@</span>
 loadmodule "debugger.so"
 #!endif
 
<span class="pl-mi1"><span class="pl-mi1">+</span>loadmodule "siptrace.so"</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "duplicate_uri", "sip:217.12.247.98:9060")</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "hep_mode_on", 1)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "hep_version", 3)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "hep_capture_id", 1)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "trace_to_database", 0)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>## `trace_flag` value must be equal to FLT_SIPTRACE value at head of "default.cfg" file</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "trace_flag", 8)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("siptrace", "trace_on", 1)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span></span>
 # ----------------- setting module-specific parameters ---------------
 
 
<span class="pl-mdr">@@ -310,9 +326,10 @@</span>
 
 # ----- rr params -----
 # set next param to 1 to add value to ;lr param (helps with some UAs)
<span class="pl-md"><span class="pl-md">-</span>modparam("rr", "enable_full_lr", 0)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("rr", "enable_full_lr", 1)</span>
 # do not append from tag to the RR (no need for this script)
 modparam("rr", "append_fromtag", 0)
<span class="pl-mi1"><span class="pl-mi1">+</span>modparam("rr", "enable_double_rr", 1)</span>
 
 # ----- registrar params -----
 modparam("registrar", "method_filtering", 1)
<span class="pl-mdr">@@ -536,6 +553,9 @@</span>
                if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");
        }
 
<span class="pl-mi1"><span class="pl-mi1">+</span>        sip_trace();                    </span>
<span class="pl-mi1"><span class="pl-mi1">+</span>        setflag(FLT_SIPTRACE);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span></span>
        if (!t_relay()) {
                sl_reply_error();
        }</pre></div>
<h4>Debugging Data</h4>
<p>none</p>
<h4>Log Messages</h4>
<pre lang="text"><code>{1 20 ACK 1258335781} 15(2198) DEBUG: siptrace [siptrace.c:507]: sip_trace_store_db(): database connection not initialized
{1 20 ACK 1258335781} 15(2198) DEBUG: siptrace [siptrace_hep.c:498]: pipport2su(): the port string is 35060
{1 20 ACK 1258335781} 15(2198) DEBUG: siptrace [siptrace_hep.c:498]: pipport2su(): the port string is 5060
{1 20 ACK 1258335781} 15(2198) DEBUG: <core> [core/proxy.c:264]: mk_proxy(): doing DNS lookup...
{1 20 ACK 1258335781} 15(2198) DEBUG: siptrace [siptrace_hep.c:183]: trace_send_hep3_duplicate(): setting up the socket_info
{1 20 ACK 1258335781} 15(2198) exec: *** cfgtrace:request_route=[RELAY] c=[/etc/kamailio/kamailio.cfg] l=557 a=39 n=setflag
{1 20 ACK 1258335781} 15(2198) exec: *** cfgtrace:request_route=[RELAY] c=[/etc/kamailio/kamailio.cfg] l=562 a=16 n=if
{1 20 ACK 1258335781} 15(2198) exec: *** cfgtrace:request_route=[RELAY] c=[/etc/kamailio/kamailio.cfg] l=559 a=24 n=t_relay
{1 20 ACK 1258335781} 15(2198) DEBUG: tm [t_lookup.c:1319]: t_newtran(): msg id=1 , global msg id=0 , T on entrance=0xffffffffffffffff
{1 20 ACK 1258335781} 15(2198) DEBUG: tm [t_lookup.c:476]: t_lookup_request(): start searching: hash=11341, isACK=1
{1 20 ACK 1258335781} 15(2198) DEBUG: tm [t_lookup.c:435]: matching_3261(): RFC3261 transaction matching failed
{1 20 ACK 1258335781} 15(2198) DEBUG: tm [t_lookup.c:659]: t_lookup_request(): no transaction found
{1 20 ACK 1258335781} 15(2198) DEBUG: tm [t_funcs.c:284]: t_relay_to(): forwarding ACK statelessly
{1 20 ACK 1258335781} 15(2198) DEBUG: <core> [core/md5utils.c:67]: MD5StringArray(): MD5 calculated: 307e4757bd94a80e26f17adb5260cb13
{1 20 ACK 1258335781} 15(2198) DEBUG: <core> [core/forward.c:557]: forward_request(): Sending:
</code></pre>
<p>Received ACK is mirrored but relayed ACK is not mirrored.<br>
Full log in attached file <code>kamailio.log</code><br>
<a href="https://github.com/kamailio/kamailio/files/2766269/kamailio.log">kamailio.log</a></p>
<h4>SIP Traffic</h4>
<p>SIP messages and mirrored traffic in attached pcap file.<br>
Packet 19 is not mirrored.<br>
<a href="https://github.com/kamailio/kamailio/files/2766281/kamailio-ack.zip">kamailio-ack.zip</a></p>
<h3>Possible Solutions</h3>
<p>Not know</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>/ # kamailio -v
version: kamailio 5.1.6 (x86_64/linux) 
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
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled on 03:24:34 Nov 23 2018 with gcc 8.2.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<p>Alpine Linux edge</p>
<pre><code>/ # cat /etc/os-release 
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.8.0
PRETTY_NAME="Alpine Linux v3.8"
HOME_URL="http://alpinelinux.org"
BUG_REPORT_URL="http://bugs.alpinelinux.org"
</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/1811">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZYRHNuA3YMd0TqpxmmDLQc8bcJN7ks5vD6OXgaJpZM4aEDrC">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZTIPsrrPMpdO5V40qRN7q_dFRp3Nks5vD6OXgaJpZM4aEDrC.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":"siptrace module not send ACK (#1811)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1811"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1811",
"url": "https://github.com/kamailio/kamailio/issues/1811",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>