Mindaugas Kezys
2007-Dec-19 22:12 UTC
[asterisk-users] Realtime logic in Asterisk 1.4.16.1
Hello, I have configured one provider in Asterisk Realtime DB without username and password, only host=<providers_IP> and ipaddress=<providers_IP> Now when I'm trying to send call using this provider I'm using following string: Dial(SIP/NUMBER at Provider) In Asterisk 1.4.15 debug I see that Realtime engine is using query: [Dec 20 00:02:15] DEBUG[14634]: res_config_mysql.c:138 realtime_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM devices WHERE name = 'Provider' to retrieve info about this device. And in Asterisk 1.4.16.1 I see: [Dec 20 00:04:12] DEBUG[25686]: res_config_mysql.c:138 realtime_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM devices WHERE name = 'Provider' AND host = 'dynamic' Note: host = 'dynamic' Where this came from? In mine DB host=<providers_IP>, how Asterisk managed to visualize that it should be "dynamic"?! Offcourse I get: [Dec 20 00:05:58] WARNING[25686]: chan_sip.c:2898 create_addr: No such host: Provider [Dec 20 00:05:58] WARNING[25686]: app_dial.c:1191 dial_exec_full: Unable to create channel of type 'SIP' (cause 3 - No route to destination) == Everyone is busy/congested at this time (1:0/0/1) Because Realtime Engine is not able to find my Provider which is NOT DYNAMIC! No other settings changed. Same configuration files. res_config_mysql.so recompiled to 1.4.16.1. Please help or explain what's wrong! Regards, Mindaugas Kezys http://www.kolmisoft.com MOR - Advanced Billing for Asterisk PBX
Michiel van Baak
2007-Dec-19 22:22 UTC
[asterisk-users] Realtime logic in Asterisk 1.4.16.1
On 00:12, Thu 20 Dec 07, Mindaugas Kezys wrote:> Hello, > > I have configured one provider in Asterisk Realtime DB without username and password, only host=<providers_IP> and ipaddress=<providers_IP> > > Now when I'm trying to send call using this provider I'm using following string: Dial(SIP/NUMBER at Provider) > > In Asterisk 1.4.15 debug I see that Realtime engine is using query: > > [Dec 20 00:02:15] DEBUG[14634]: res_config_mysql.c:138 realtime_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM devices WHERE name = 'Provider' > > to retrieve info about this device. > > And in Asterisk 1.4.16.1 I see: > > [Dec 20 00:04:12] DEBUG[25686]: res_config_mysql.c:138 realtime_mysql: MySQL RealTime: Retrieve SQL: SELECT * FROM devices WHERE name = 'Provider' AND host = 'dynamic' > > Note: host = 'dynamic' > > Where this came from? In mine DB host=<providers_IP>, how Asterisk managed to visualize that it should be "dynamic"?! > > Offcourse I get: > > [Dec 20 00:05:58] WARNING[25686]: chan_sip.c:2898 create_addr: No such host: Provider > [Dec 20 00:05:58] WARNING[25686]: app_dial.c:1191 dial_exec_full: Unable to create channel of type 'SIP' (cause 3 - No route to destination) > == Everyone is busy/congested at this time (1:0/0/1) > > Because Realtime Engine is not able to find my Provider which is NOT DYNAMIC! > > No other settings changed. Same configuration files. res_config_mysql.so recompiled to 1.4.16.1. > > Please help or explain what's wrong!Have a look at http://downloads.digium.com/pub/security/AST-2007-027.pdf That's why it's not working anymore -- Michiel van Baak michiel at vanbaak.eu http://michiel.vanbaak.eu GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD "Why is it drug addicts and computer afficionados are both called users?"
Tilghman Lesher
2007-Dec-19 23:34 UTC
[asterisk-users] Realtime logic in Asterisk 1.4.16.1
On Wednesday 19 December 2007 16:12:27 Mindaugas Kezys wrote:> [Dec 20 00:04:12] DEBUG[25686]: res_config_mysql.c:138 realtime_mysql: > MySQL RealTime: Retrieve SQL: SELECT * FROM devices WHERE name = 'Provider' > AND host = 'dynamic' > > Note: host = 'dynamic'Correct, that's the FIRST lookup that is done. It then checks the IP address and does: "SELECT * FROM devices WHERE name = 'Provider' AND host='23.45.67.89'" where the IP address is what is sent in the SIP INVITE. If that fails, it does a lookup only on the name (old behavior). If that fails: SELECT * FROM devices WHERE host='23.45.67.89' AND port='5060' If that fails: SELECT * FROM devices WHERE ipaddr='23.45.67.89' AND port='5060' If that fails: SELECT * FROM devices WHERE host='23.45.67.89' and checks every match for insecure=yes If that fails: SELECT * FROM devices WHERE ipaddr='23.45.67.89' and checks every match for insecure=yes And if that fails, then it returns no match. So all of those queries had to run and fail for you to get no match. -- Tilghman
Anthony Messina
2007-Dec-30 11:46 UTC
[asterisk-users] Realtime logic in Asterisk 1.4.16.1
On Sunday 30 December 2007 05:34:12 am Mindaugas Kezys wrote:> Currently we are using 1.4.15 which does not have such nasty BUG. > > When I will be free, I will try to review Asterisk sources to find a > problem and submit patch to this. > > From this case I see that not much people are using Asterisk Realtime with > newest Asterisk version. > > When holidays will end more and more people will start to complain about > this.i found that it did not affect my iax2 tunks (outbound peers) in mysql realtime, but it did affect the sip trunks (outbound peers) in realtime. -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20071230/38ee0b13/attachment.pgp