<p>I've tracked this issue down to a combination of using HEP mode siptrace and turning on the track_cseq_updates at the same time.  It looks like when HEP mode is turned on it adds the HEP header in front of the message it's duplicating, then uses msg_send() to send it.  When this happens the callback for SREV_NET_DATA_OUT triggers dlg_cseq_msg_sent() in the dialog module which runs a parse_msg() on the buffer sent in.  Since the buffer has the HEP data in the front when it tries to parse the message it leads to a parse error.</p>

<p>I'm not sure how to fix this, though, since there's really only this special case where msg_send() has some additional metadata at the beginning of the data.</p>

<p>This is a minimal config that reproduces the issue: <a href="https://github.com/kamailio/kamailio/files/155253/kam-cseq-parse-error.txt">kam-cseq-parse-error.txt</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/526#issuecomment-191327909">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZQzcPDOdMRmb5-YMQYnjSuZtTAREks5ppcO0gaJpZM4Hm_n9.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/526#issuecomment-191327909"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>