[Asterisk-Users] RealTime extensions - why so many SELECTs per call?

Eric Lyons eric at gus.to
Wed Nov 2 17:25:10 MST 2005


Just got realtime working in 1.2.0-beta2 and I'm wondering why there are so many sql selects for a call.

My extensions.conf:
[test-realtime]
switch => RealTime/test-realtime@${EXTEN}

The extensions table in the db contains one record:
mysql> select * from extensions;
+----+---------------+-------------+----------+------+--------------+
| id | context       | exten       | priority | app  | appdata      |
+----+---------------+-------------+----------+------+--------------+
|  1 | test-realtime | 18669999999 |        1 | Dial | IAX2/creeble |
+----+---------------+-------------+----------+------+--------------+

and when a call comes into that switch, I get NINE queries into mysql, of which the first four are identical:

SELECT * FROM extensions WHERE exten = '18669999999' AND context = 'test-realtime' AND priority = '1'
SELECT * FROM extensions WHERE exten = '18669999999' AND context = 'test-realtime' AND priority = '1'
SELECT * FROM extensions WHERE exten = '18669999999' AND context = 'test-realtime' AND priority = '1'
SELECT * FROM extensions WHERE exten = '18669999999' AND context = 'test-realtime' AND priority = '1'
SELECT * FROM extensions WHERE exten = '18669999999' AND context = 'test-realtime' AND priority = '1'
SELECT * FROM extensions WHERE exten = '18669999999' AND context = 'test-realtime' AND priority = '-1'
SELECT * FROM extensions WHERE exten LIKE '\_%' AND context = 'test-realtime' AND priority = '-1' ORDER BY exten
SELECT * FROM extensions WHERE exten = 'h' AND context = 'test-realtime' AND priority = '1'
SELECT * FROM extensions WHERE exten LIKE '\_%' AND context = 'test-realtime' AND priority = '1' ORDER BY exten

Can anybody explain what's going on there?

Eric.



More information about the asterisk-users mailing list