<div dir="ltr">Try to add it in onreply_route using htable but in-memory not in database.<br><br>Steps :<div><br>You have to initialize an htable by : <div>modparam("htable", "htable", "counter_404=>size=32;initval=0;autoexpire=600;")<br></div><div><br></div><div>And you can increase counter like that (i did not test but i think should give you a clue how to proceed further, the initval is set to 0)<br>I used key as request uri + call-id to have an unique key and the value expired after 600sec. </div><div><br></div><div>In onreply_route for $rs=="404" ( if response status is 404 add to htable the request uri with conjunction of call-id for allowing the values to expire ) </div><div><br></div><div>$sht(counter_404=>$T_req($ru)::$ci) = 

$shtinc(counter_404=>$T_req($ru)::$ci); <br></div><div><br></div><div>After that somewhere in beginning of request_route once you receive an INVITE you could check the $ru if its in htable counter_404 and if count is lets say higher than 10 (10 replies 404 in last 10 minutes) you can immediately reply 404.</div><div><br></div><div>if( $shtcn(counter_404=>$ru::.*) > 10 ) {<br></div><div>send_reply(404);</div><div>exit;</div><div>}</div><div><br></div><div>Hope it helps - you need to play a bit with it on test environment.<br><br>Greetings from Poland <br>Tom</div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">pt., 10 sty 2020 o 08:10 Krzysztof Drewicz <<a href="mailto:kdrewicz@cludo.pl">kdrewicz@cludo.pl</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello<div><br></div><div>would like to see if I'm not reinventing the wheel:</div><div>scenario: some old powerdialler/predictive calls  kamailio as call dispatcher, kamailio then dials carrier.</div><div><br></div><div>But this dialler does many calls to the same B number with 404 response (from carrier) in short (retry is < 600s) time, so no need to bother PSTN/carrier with retry.</div><div><br></div><div>Should I simply use htable, cache 404 hit, use some reasonable value</div><div>modparam("htable", "db_expires", 1)<br></div><div>put there like 600 s TTL </div><div><div><br></div><div>or something like that?</div><div><br></div><div>Any hints/thoughts? Maybe this scenario is common and being used with success somewhere (and yes, this powerdialer is not very clever, and I do know it should not be needed for this) </div><div><br></div><div>Thanks, </div><div><br></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px;margin:0px"><table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none">
 <tbody><tr>
  <td width="85" valign="top" style="width:63.8pt;border-top:none;border-bottom:none;border-left:none;border-right:1pt solid rgb(0,176,240);padding:0cm 5.4pt">
  <p style="margin-bottom:0.0001pt;line-height:normal"> <img src="https://docs.google.com/uc?export=download&id=1UZPiHIVoexSMVBUypTive-hBXD-KxImF&revid=0By--xb0hHO1ET0FmdzNzQUVlRXdsZnNFNWNDdzRTY1p6NDVBPQ"></p>
  </td>
  <td width="519" valign="top" style="width:389.3pt;border:none;padding:0cm 5.4pt">
  <p style="margin-bottom:0.0001pt;line-height:normal"><b><span lang="NL" style="color:rgb(0,176,240)">Krzysztof
  Drewicz</span></b><b><span lang="NL" style="color:rgb(51,102,255)"><br>
  </span></b><span lang="NL" style="color:rgb(0,176,240)">Senior
  Infrastructure Administrator</span><span lang="NL" style="color:rgb(51,102,255)"><br>
  </span><span lang="NL" style="font-family:"Calibri Light",sans-serif;color:rgb(102,102,102);background-image:initial;background-position:initial;background-repeat:initial">CLUDO | ul. </span><span style="font-family:"Calibri Light",sans-serif;color:rgb(102,102,102);background-image:initial;background-position:initial;background-repeat:initial">Grochowska 306/308, 03-840 Warszawa<br>
  </span><span style="font-family:"Calibri Light",sans-serif;color:rgb(0,176,240);background-image:initial;background-position:initial;background-repeat:initial">t</span><span style="font-family:"Calibri Light",sans-serif;color:rgb(102,102,102);background-image:initial;background-position:initial;background-repeat:initial">+48221223977 <br>
  </span><span style="font-family:Arial,sans-serif;color:rgb(51,102,255);background-image:initial;background-position:initial;background-repeat:initial"> </span><span style="color:rgb(51,102,255)"><br>
  </span><a href="mailto:kdrewicz@cludo.pl" target="_blank"><span style="color:rgb(0,176,240)">kdrewicz@cludo.pl</span></a><span style="color:rgb(0,176,240)">
  | </span><span style="color:rgb(0,176,240)">w</span><a href="http://www.cludo.pl/" target="_blank"><span style="color:rgb(0,176,240)">ww.cludo.pl</span></a></p>
  </td>
 </tr>
</tbody></table>

<p> </p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>