All, I have a feeling this question has already been addressed, but the alternative to me asking is searching through six years of list archive messages... month-by-month. We have two asterisk boxes that are using realtime for sip.conf, both static and ... I guess 'realtime' realtime. A polycom phone registers with the first Asterisk box (well actually it registers with OpenSER who forwards the registration to the first Asterisk box... but that shouldn't be too relevant). I check the sip_buddies table in mysql and I can see that the contact info has been updated for this phone. First question, if I do not set rtcachefriends, then the fullcontact field is not updated. Why? There's also another polycom phone that came in through the other Asterisk box. It also updated that phone's contact info in sip_buddies. When I make a call, while running ngrep on the mysql server, I can see the asterisk box doing a 'select * from sip_buddies where username=<caller-username>' and 'select * from sip_buddies where username=<called-username>'. Under certain circumstances that I don't yet understand, it fails periodically.... it can't find the contact details for the callee. Why? Also, if I DO set rtcachefriends to yes, then it updates /var/lib/asterisk/astdb, and the calls FAILS EVERY time eventhough it is still doing the same two select queries above. Why? Why doesn't it use the values it just pulled out of the database? The info is there! This is pretty basic stuff. Why doesn't it work? Trying to implement a HA solution with Asterisk. CrAzY me thought that realtime might be the solution. If I can't get this to work (and it would have been cool if it did), then it's back to registering with SER, and having SER forward the registration to _all_ the Asterisk boxes, such that every Asterisk box knows the contact details for every user agent. This works well in small test situations, but I don't know how well it will scale. How fast would retrievals be on a fully loaded (ie 120 calls) Asterisk box trying to pull a key/value pair out of 16,000 records in astdb? Help appreciated. Thanks.
Doug, When you use Realtime SIP Peers, registration information is stored in the mysql database, the astdb database, as well as being cached in memory. When a SIP lookup is done, and registration information is stored in cache, that information will be used rather than querying sip_buddies. We tried similar experiments of sharing registration information using a single mysql database or using mysql replication across all of the asterisk servers without any success. It seems like a patch to the Realtime architecture needs to be developed such that sip_buddies is always queried first before looking in cache or astdb. Anish Basu Field Systems Engineer Softel, Inc. Phone: (732) 705-9202 Cell: (732) 312-6634
Thanks for the reply Anish. I turned off the caching with rtcachefriends=no, verified the registrations where not stored in astdb, and saw select queries being performed to the database, and it still failed. Did you ever try that? Douglas. -----Original Message----- From: Anish Basu [mailto:anish@softelinc.com] Sent: Tuesday, December 06, 2005 8:33 AM To: asterisk-users@lists.digium.com Cc: Douglas Garstang Subject: Realtime SIP Lookups Doug, When you use Realtime SIP Peers, registration information is stored in the mysql database, the astdb database, as well as being cached in memory. When a SIP lookup is done, and registration information is stored in cache, that information will be used rather than querying sip_buddies. We tried similar experiments of sharing registration information using a single mysql database or using mysql replication across all of the asterisk servers without any success. It seems like a patch to the Realtime architecture needs to be developed such that sip_buddies is always queried first before looking in cache or astdb. Anish Basu Field Systems Engineer Softel, Inc. Phone: (732) 705-9202 Cell: (732) 312-6634
Actually this is completely screwy. I have rtcachefriends=no and Asterisk is still populating the astdb file. Why the hell is it doing this? mysql> select * from ast_config; +----+------------+------------+-----------+----------+----------+----------------+---------+ | id | cat_metric | var_metric | commented | filename | category | var_name | var_val | +----+------------+------------+-----------+----------+----------+----------------+---------+ | 1 | 0 | 0 | 0 | sip.conf | general | context | default | | 2 | 0 | 0 | 0 | sip.conf | general | rtcachefriends | no | | 3 | 0 | 0 | 0 | sip.conf | general | rtupdate | yes | | 4 | 0 | 0 | 0 | sip.conf | general | rtautoclear | no | -----Original Message----- From: Douglas Garstang Sent: Tuesday, December 06, 2005 8:37 AM To: asterisk-users@lists.digium.com Subject: RE: Realtime SIP Lookups Thanks for the reply Anish. I turned off the caching with rtcachefriends=no, verified the registrations where not stored in astdb, and saw select queries being performed to the database, and it still failed. Did you ever try that? Douglas. -----Original Message----- From: Anish Basu [mailto:anish@softelinc.com] Sent: Tuesday, December 06, 2005 8:33 AM To: asterisk-users@lists.digium.com Cc: Douglas Garstang Subject: Realtime SIP Lookups Doug, When you use Realtime SIP Peers, registration information is stored in the mysql database, the astdb database, as well as being cached in memory. When a SIP lookup is done, and registration information is stored in cache, that information will be used rather than querying sip_buddies. We tried similar experiments of sharing registration information using a single mysql database or using mysql replication across all of the asterisk servers without any success. It seems like a patch to the Realtime architecture needs to be developed such that sip_buddies is always queried first before looking in cache or astdb. Anish Basu Field Systems Engineer Softel, Inc. Phone: (732) 705-9202 Cell: (732) 312-6634