<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>ok thanks I will read again</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>F</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=gcd@i.ph href="mailto:gcd@i.ph">Nandy Dagondon</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=freeswitch-users@lists.freeswitch.org
href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, June 10, 2010 3:09
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Freeswitch-users]
mod_lcr</DIV>
<DIV><BR></DIV>it's the digits_prefix in the WHERE clause that's causing the
error. <BR><BR>ur question re prefix+digits, it's explained in the Custom SQL
portion in the wiki.<BR><BR>-nandy<BR><BR><BR>
<DIV class=gmail_quote>On Thu, Jun 10, 2010 at 2:56 PM, Madovsky <SPAN
dir=ltr><<A
href="mailto:infos@madovsky.org">infos@madovsky.org</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV bgcolor="#ffffff">
<DIV><FONT size=2>ok so it needs also the alias l.digits in the condition I
think.</FONT></DIV>
<DIV><FONT size=2>I'm a little confused about digits and
prefix.</FONT></DIV>
<DIV><FONT size=2>if I check a number with the country code is it need to
join</FONT></DIV>
<DIV><FONT size=2>prefix+digits ? how with this kinkd of sql request
?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Thanks</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>F</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(0,0,0) 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style="FONT: 10pt arial; BACKGROUND: rgb(228,228,228)"><B>From:</B>
<A title=gcd@i.ph href="mailto:gcd@i.ph" target=_blank>Nandy Dagondon</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=freeswitch-users@lists.freeswitch.org
href="mailto:freeswitch-users@lists.freeswitch.org"
target=_blank>freeswitch-users@lists.freeswitch.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, June 10, 2010 2:44
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Freeswitch-users]
mod_lcr</DIV>
<DIV><BR></DIV>i think it's a typo. i changed digits_prefix to digits. to
be sure, pls check the CREATE TABLE entries. <BR>-nandy<BR><BR><BR>
<DIV class=gmail_quote>On Thu, Jun 10, 2010 at 2:16 PM, Madovsky <SPAN
dir=ltr><<A href="mailto:infos@madovsky.org"
target=_blank>infos@madovsky.org</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV bgcolor="#ffffff">
<DIV><FONT size=2>I'm experimenting with mod_lcr with postgresql
(8.4.4)</FONT></DIV>
<DIV><FONT size=2>there s an example of custom sql on wiki below
:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><PRE> <profile name="use_prefix">
<param name="custom_sql" value="
SELECT l.digits, c.carrier_name, l.${lcr_rate_field}, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix,
l.lead_strip, l.trail_strip, l.prefix, l.suffix, cg.codec, l.cid
FROM lcr l
JOIN carriers c ON l.carrier_id=<A href="http://c.id" target=_blank>c.id</A>
JOIN carrier_gateway cg ON <A href="http://c.id" target=_blank>c.id</A>=cg.carrier_id
WHERE c.enabled = '1' AND cg.enabled = '1' AND l.enabled = '1'
AND digits_prefix @> '%q'
AND CURRENT_TIMESTAMP BETWEEN date_start AND date_end
ORDER BY digits DESC, ${lcr_rate_field} asc, random();
"/>
</profile>
</PRE><PRE><FONT face=Arial>however the query failed cause of digits_prefix field doesn't exist in the table.</FONT></PRE><PRE><FONT face=Arial>is it a typo ? or does it need a field concatenation of prefix and digits ?</FONT></PRE><PRE><FONT face=Arial>Thanks</FONT></PRE><PRE><FONT face=Arial></FONT> </PRE><PRE><FONT face=Arial>Franck</FONT></PRE></DIV></DIV><BR>_______________________________________________<BR>FreeSWITCH-users
mailing list<BR><A href="mailto:FreeSWITCH-users@lists.freeswitch.org"
target=_blank>FreeSWITCH-users@lists.freeswitch.org</A><BR><A
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target=_blank>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A
href="http://www.freeswitch.org"
target=_blank>http://www.freeswitch.org</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV>
<P></P>
<HR>
<DIV class=im>
<P></P>_______________________________________________<BR>FreeSWITCH-users
mailing list<BR><A href="mailto:FreeSWITCH-users@lists.freeswitch.org"
target=_blank>FreeSWITCH-users@lists.freeswitch.org</A><BR><A
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target=_blank>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A
href="http://www.freeswitch.org"
target=_blank>http://www.freeswitch.org</A><BR></DIV></BLOCKQUOTE></DIV><BR>_______________________________________________<BR>FreeSWITCH-users
mailing list<BR><A
href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</A><BR><A
href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target=_blank>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>UNSUBSCRIBE:<A
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target=_blank>http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR><A
href="http://www.freeswitch.org"
target=_blank>http://www.freeswitch.org</A><BR><BR></BLOCKQUOTE></DIV><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>FreeSWITCH-users
mailing
list<BR>FreeSWITCH-users@lists.freeswitch.org<BR>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<BR>http://www.freeswitch.org<BR></BLOCKQUOTE></BODY></HTML>