Star User
2005-Jul-11 18:12 UTC
[Asterisk-Users] Enabling rtcachefriends prevents phones from calling each other
With rtcachefriends = yes in sip.conf, my SIP phone registered to Asterisk Server A cannot dial another SIP phone registered to Asterisk Server B. The error message is: "Cannot create channel of type SIP (Cause 3 - no route to destination)". The two phones _can_ call each other if I set rtcachefriends = no. The common extensions.conf simply uses Dial(SIP/extension) to dial extensions. Both Asterisk servers are using identical MySQL databases, kept in sync using replication. The sipusers tables in both databases show the correct dynamic IP address and port for both phones, indicating that the phones did register successfully. And the dynamic registration information is reflected in both databases because of the MySQL replication. However, running "sip show peers" on Server A only shows the phone registered to Server A. Running the same command on Server B only shows the phone registered to Server B. So despite the fact that phone B's registration data (IP address and port) is in Server A's database, the Asterisk on Server A doesn't know how to route the call to phone B. It looks like Asterisk is using cached data and ignoring the database, but the registration info for phone B never got into the cache. I need rtcachefriends enabled, because I need MWI to work. I've seen this problem discussed before, but I haven't come across a solution. Anyone have an answer? Thanks in advance. Rana Dutt Softel Solutions, Inc. rdutt@softelinc.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050711/624ff9bc/attachment.htm
Kevin P. Fleming
2005-Jul-11 18:48 UTC
[Asterisk-Users] Enabling rtcachefriends prevents phones from calling each other
Star User wrote:> So despite the fact that phone B's registration data (IP address and port) is in Server A's database, the Asterisk on Server A doesn't know how to route the call to phone B. It looks like Asterisk is using cached data and ignoring the database, but the registration info for phone B never got into the cache.rtcachefriends is not designed for use in this way, it assumes it has _exclusive_ control of the database. If Server A makes _any_ reference at all to Phone B before it has registered to Server B, then Server A will have a cached "unknown address" for Phone B, expecting that it will later see a registration for Phone B. It will not ever look back into the database for Phone B's address until the cached record expires from memory. Basically, you cannot cache records when you are sharing a database, unless the systems doing the caching are aware of each other and can tell each other when to flush and/or update their caches.
Rana Dutt
2005-Jul-12 05:42 UTC
[Asterisk-Users] Enabling rtcachefriends prevents phones from calling each other
> Kevin P. Fleming wrote: >> Matthew Boehm wrote:>> Can't it be changed so that if Server A has stored an "unknown address"for>> phone B that if it needs to contact B again it should look up in the >> database to "try" and contact it instead of just giving up? Perhaps >> rtagressive option? Contact only, not storing info in cache.> "Can" it be done? Of course, it's all just code :-)> I think it would be reasonable to add that as an option, but the number > of Realtime-related options is rapidly getting out of hand and people > will not be able to understand what they all do and how they interact...Please, please add this option. If you send me a patch, I will gladly volunteer to test it thoroughly. Having both MWI working and multiple servers working is a must for us. Thanks much, Rana Dutt