I don't think this is particular to realtime, I've encountered this before and had to hack around it. What I want to do is authenticate by IP, usually to some upstream PSTN carrier. Works fine provided the user part in the 'From' field doesn't coincidently match a local user.
<br><br><div class="gmail_quote">On Oct 30, 2007 12:12 PM, Philipp Kempgen <<a href="mailto:philipp.kempgen@amooma.de">philipp.kempgen@amooma.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Andy Davidson wrote:<br><br>> Asterisk fires some SQL queries (to get all of them, i temporarily<br>> removed the select privs from the asterisk user) based on the code at<br>> the top of this email, akin to :
<br>><br>> SELECT * FROM sip_buddies WHERE name = 'customer5'<br>> SELECT * FROM sip_buddies WHERE host = '<a href="http://1.1.1.1" target="_blank">1.1.1.1</a>' AND port = '5060'<br>> SELECT * FROM sip_buddies WHERE ipaddr = '
<a href="http://1.1.1.1" target="_blank">1.1.1.1</a>' AND port = '5060'<br>> SELECT * FROM sip_buddies WHERE host = '<a href="http://1.1.1.1" target="_blank">1.1.1.1</a>' ORDER BY host<br>> SELECT * FROM sip_buddies WHERE ipaddr = '
<a href="http://1.1.1.1" target="_blank">1.1.1.1</a>' ORDER BY ipaddr<br>> SELECT * FROM sip_buddies WHERE name = '<a href="http://1.1.1.1" target="_blank">1.1.1.1</a>'<br>> SELECT * FROM sip_buddies WHERE name = '
<a href="http://1.1.1.1" target="_blank">1.1.1.1</a>'<br><br></div>I don't see a problem here.<br>However, two things:<br><br>It doesn't make sense to ORDER BY host if you have a<br>host = '<a href="http://1.1.1.1" target="_blank">
1.1.1.1</a>' clause anyway. Same thing for ipaddr. The DBMS<br>might be clever enough to optimize the query. But it might just<br>mean more work. (I would have to look up whether the MySQL<br>query optimizer does that or not.)
<br><br>I'd prefer the port column (and others) to be numeric (no quotes).<br>Numeric columns use less space on the disk and less space in memory.<br>The indexes are smaller and comparing numeric values is faster than
<br>comparing strings. I know that you can simply make the port column<br>numeric (unsigned smallint or something) and let MySQL tolerate that<br>the query uses quotes. But then there's a little extra work for MySQL<br>
to convert the value back to an integer.<br><br>Regards,<br> Philipp Kempgen<br><font color="#888888"><br>--<br>amooma GmbH - Bachstr. 126 - 56566 Neuwied - <a href="http://www.amooma.de" target="_blank">http://www.amooma.de
</a><br> Let's use IT to solve problems and not to create new ones.<br> Asterisk? -> <a href="http://www.das-asterisk-buch.de" target="_blank">http://www.das-asterisk-buch.de</a><br><br>Geschäftsführer: Stefan Wintermeyer
<br>Handelsregister: Neuwied B 14998<br></font><div><div></div><div class="Wj3C7c"><br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com--" target="_blank">
http://www.api-digital.com--</a><br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev
</a><br></div></div></blockquote></div><br><br clear="all"><br>-- <br>Ryan Mitchell <<a href="mailto:rjm@tcl.net">rjm@tcl.net</a>><br>Telecom Logic, LLC<br><a href="http://www.tcl.net">http://www.tcl.net</a>