<p>In <a href="https://github.com/kamailio/kamailio/pull/390#discussion_r44656355">modules/rtpengine/rtpengine.c</a>:</p>
<pre style='color:#555'>>      }
>  
>    if (body_out)
>            *body_out = body;
>  
> +  if (op == OP_DELETE) {
> +          /* Delete the key<->value from the hashtable */
> +          if (!rtpengine_hash_table_remove(&callid)) {
</pre>
<p>If you can be bothered with 2, then go for it, but I think it would take a lot of work and fine-tuning to make it work just right. The proxies already do all the tag and branch handling so I see no need to duplicate it here.</p>

<p>Setting the expiry to the near future on "delete" would help to keep the hash table small if it was indeed the final BYE, but it would also require resetting the expiry to now+timeout on every operation, i.e. not only when the key is created but on a lookup as well.</p>

<p>Another option would be to extend the control protocol and have the RTP proxy tell the module whether this call is finished now or if it should be kept alive.</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/pull/390/files#r44656355">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZTQDng3b8wOO4EGxh6nuU2m3mAy1ks5pFIwZgaJpZM4GcraR.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/pull/390/files#r44656355"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>