<div dir="ltr">On Fri, Aug 22, 2008 at 7:41 PM, Tilghman Lesher <span dir="ltr"><<a href="mailto:tilghman@mail.jeffandtilghman.com">tilghman@mail.jeffandtilghman.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Thursday 21 August 2008 10:08:53 J.M. wrote:<br>
> I am running Asterisk <a href="http://1.4.21.2" target="_blank">1.4.21.2</a> with Realtime. I have a phone setup in the<br>
> database and when I connect that phone to Asterisk there are suddenly an<br>
> endless number of "SELECT * FROM sip WHERE name = '1001' AND host =<br>
> 'dynamic'" queries being run. The only way to stop the flood of queries<br>
> coming from Asterisk to restart the Asterisk process. Even disconnecting<br>
> the phone doesn't stop Asterisk from running the queries.<br>
><br>
> Has anyone seen this before? Why would Asterisk do that and does anyone<br>
> know the fix?<br>
<br>
</div></div>Asterisk does that because realtime data is not cached by default, so for each<br>
access of the peer in question, Asterisk needs to reload the data on the peer<br>
from the database. If you'd like, turn on rtcachefriends in sip.conf, which<br>
will cache the peer for the duration of the registration interval (or whatever<br>
you have rtexpire set to). Also, to get correct behavior on reload, you'll<br>
need to have rtupdate turned on. Some of the behavior isn't quite right in<br>
<a href="http://1.4.21.2" target="_blank">1.4.21.2</a>, even, but it should be fixed once 1.4.22 is released.<br>
<br>
BTW, I would otherwise have responded sooner, but I am on vacation this week,<br>
and I am not responding to email as quickly as I would usually.<br>
</blockquote><div><br>Another way, which has worked so far for me, is to set the "qualify" field in the "sip" table (or whatever you called the table that corresponds to the sip.conf file) to "no". I found this out from reading the following URL: <a href="http://www.asteriskguru.com/tutorials/peer_is_now_unreachable.html">http://www.asteriskguru.com/tutorials/peer_is_now_unreachable.html</a><br>
<br>If this continues to work it has the advantages of putting as little in the .conf files as is possible and keeping the real-time feel of using a database without having to worry about whether the cache is updated or not.<br>
<br>jm<br><br></div></div><br></div>