<h3>Description</h3>
<p>When called from within an event_route[tm:branch-failure:id], rtpengine_manage() will do an offer instead of a delete, resulting in duplicated sdp lines in body. Is this an omission or is it intentional?</p>

<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<pre><code>event_route[tm:branch-failure:DISPATCH_PROVIDER_FAILOVER] {

    rtpengine_manage("trust-address replace-origin replace-session-connection");

    # next DST - only for 5xx or local timeout
    if ( t_check_status("5[[:digit:]]+") || (t_branch_timeout() && !t_branch_replied()) ) {
        if ( ds_next_dst() ) {
            xlog("L_NOTICE", "--- SCRIPT_DISPATCH_PROVIDER_FAILOVER: A failover destination was selected: Forwarding to $du\n");
            t_on_branch("PROVIDER_BRANCH");
            t_on_branch_failure("DISPATCH_PROVIDER_FAILOVER");
            t_on_failure("NEXT_PROVIDER");
            route(RELAY);
            exit;
        } else {
            xlog("L_NOTICE", "--- DISPATCH_PROVIDER_FAILOVER: PROVIDER DOWN! Failed to route request to provider! Giving Up. Negative response will be sent upstream.\n");
        }
    }
}
</code></pre>

<h3>Possible Solutions</h3>
<p>Explicitly use rtpengine_delete() instead.</p>

<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.3.2 (x86_64/linux) 
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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, TLS_PTHREAD_MUTEX_SHARED
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 with gcc 8.3.0
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>Debian 10.3
Linux #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

</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/2222?email_source=notifications&email_token=ABO7UZJKDHLDSTIXW5NIMRDRDVJR5A5CNFSM4KX3YGFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IOVYLAQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZK2WI7ALUSGRD6G573RDVJR5ANCNFSM4KX3YGFA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZNIMSFJOJCPEYJGVDDRDVJR5A5CNFSM4KX3YGFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IOVYLAQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2222?email_source=notifications\u0026email_token=ABO7UZJKDHLDSTIXW5NIMRDRDVJR5A5CNFSM4KX3YGFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IOVYLAQ",
"url": "https://github.com/kamailio/kamailio/issues/2222?email_source=notifications\u0026email_token=ABO7UZJKDHLDSTIXW5NIMRDRDVJR5A5CNFSM4KX3YGFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IOVYLAQ",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>