<p>I am having issues using uac_auth function and dialog module track_cseq_update option. The issue is related to CSeq mangling done by dialog module to keep synced CSeq in both parties involved. </p>

<p>It works fine when 1xx response is received for generated INVITE before retr_timer1 expires but, if not, the generated retransmission has the same CSeq as the original INVITE (the one without Authorization headers), instead of increasing CSeq by one again:</p>

<ul>
<li>INVITE sent by UAC (CSeq 100).</li>
<li>407 from UAS.</li>
<li>INVITE generated by uac_auth (CSeq 101).</li>
<li>(... no answer ...)</li>
<li>Retransmission INVITE with Authorization header but with CSeq 100.</li>
</ul>

<p>This is the minimal configuration file needed to test this behaviour:</p>

<pre><code>loadmodule    "tm.so"
loadmodule    "pv.so"
loadmodule    "sl.so"
loadmodule    "avpops.so"
loadmodule    "dialog.so"
loadmodule    "uac.so"
loadmodule    "rr.so"

modparam("dialog", "dlg_flag", 1)
modparam("dialog", "track_cseq_updates", 1)
modparam("uac", "auth_realm_avp", "$avp(realm)")
modparam("uac", "auth_username_avp", "$avp(provideruser)")
modparam("uac", "auth_password_avp", "$avp(secret)")
modparam("tm", "retr_timer1", 100)

request_route {
    dlg_manage();
    $ru = "sip:test@**SIPSERVER**";
    t_on_failure("MANAGE_FAILURE");
    t_relay();
    exit;
}

failure_route[MANAGE_FAILURE] {
    if (t_is_canceled()) {
        exit;
    }

    if (t_check_status("(401)|(407)")) {
        $avp(realm) = '';
        $avp(provideruser) = 'foo';
        $avp(secret) = 'bar';

        uac_auth();
    }

    t_on_failure("MANAGE_FAILURE");
    t_relay();
    exit;}
</code></pre>

<p>This is the Kamailio version I am using on a amd64 machine (Debian 7):</p>

<pre><code>version: kamailio 4.4.1 (x86_64/linux) 99e1c3
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_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 99e1c3 
compiled on 13:37:42 Jun 20 2016 with gcc 4.7.2
</code></pre>

<p>Is something wrong on my kamailio.cfg? Do you need any extra information?</p>

<p>Best regards.</p>

<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/679">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AF36ZUArBuxfvIjtYFZ0tDnB1BJKxT3Pks5qN_LQgaJpZM4I6yYU">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZYpWdHRxrioQpjbSscK5H65xa6ZIks5qN_LQgaJpZM4I6yYU.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/679"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>