<p>In <a href="https://github.com/kamailio/kamailio/pull/390#discussion_r44550420">modules/rtpengine/rtpengine.c</a>:</p>
<pre style='color:#555'>> +
> +/*
> + * Main balancing routine. This DO try to keep the same proxy for
> + * the call if some proxies were disabled or enabled (e.g. kamctl command)
> + */
> +static struct rtpp_node *
> +select_rtpp_node(str callid, int do_test, int op)
> +{
> +  if(!active_rtpp_set) {
> +          LM_ERR("script error - no valid set selected\n");
> +          return NULL;
> +  }
> +
> +  // calculate and choose a node
> +  if (op == OP_OFFER) {
> +          // run the selection algorithm
</pre>
<p>"Offer" doesn't necessarily mean that this will be a new entry. A re-invite will also do an "offer" but needs to do a lookup into the hash table first. I think a lookup should always be done first, with fallback to creating a new entry in case of an offer.</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#r44550420">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZXeXGM33KQvUr8MESTLdvZI4F68Mks5pE2E4gaJpZM4GcraR.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#r44550420"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>