Realtime Extensions, Multiple SQL Lookups?

Home » Asterisk Users » Realtime Extensions, Multiple SQL Lookups?
Asterisk Users 1 Comment

I’m toying with the idea of replacing a statically generated file I include in my extensions.conf with a realtime lookup against my database.

I’ve got it working but something seems off in my logs, It looks like I’m getting two lookups for every priority?

[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_odbc.c: Reusing ODBC handle
0x7f8da8002938 from class ‘odbc_kiniston-test’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Skip: 0; SQL:
SELECT * FROM extensions-test WHERE exten = ? AND priority = ? AND context
= ?
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Parameter 1
(‘exten’) = ‘5206700792’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Parameter 2
(‘priority’) = ‘5’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Parameter 3
(‘context’) = ‘sip-in’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_odbc.c: Releasing ODBC
handle 0x7f8da8002938 into pool
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_odbc.c: Reusing ODBC handle
0x7f8da8002938 from class ‘odbc_kiniston-test’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Skip: 0; SQL:
SELECT * FROM extensions-test WHERE exten = ? AND priority = ? AND context
= ?
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Parameter 1
(‘exten’) = ‘5206700792’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Parameter 2
(‘priority’) = ‘5’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_config_odbc.c: Parameter 3
(‘context’) = ‘sip-in’
[Oct 12 16:45:24] DEBUG[26541][C-0000000e] res_odbc.c: Releasing ODBC
handle 0x7f8da8002938 into pool
[Oct 12 16:45:24] VERBOSE[26541][C-0000000e] pbx_realtime.c: Executing
[5206700792@sip-in:5] Gosub(“PJSIP/trunks1-0000000e”,
“sub-setupinboundcall,s,1(kiniston,Pop_Country_Crossover,300,VOIP)”)

—SNIP-

One thought on - Realtime Extensions, Multiple SQL Lookups?