<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Re[2]: [Freeswitch-users] Using odbc in FS core</title>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
body {
  margin: 5px 5px 5px 5px;
  background-color: #ffffff;
}
/* ========== Text Styles ========== */
hr { color: #000000}
body, table /* Normal text */
{
 font-size: 9pt;
 font-family: 'Courier New';
 font-style: normal;
 font-weight: normal;
 color: #000000;
 text-decoration: none;
}
span.rvts1 /* Heading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #0000ff;
}
span.rvts2 /* Subheading */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-weight: bold;
 color: #000080;
}
span.rvts3 /* Keywords */
{
 font-size: 10pt;
 font-family: 'Arial';
 font-style: italic;
 color: #800000;
}
a.rvts4, span.rvts4 /* Jump 1 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
a.rvts5, span.rvts5 /* Jump 2 */
{
 font-size: 10pt;
 font-family: 'Arial';
 color: #008000;
 text-decoration: underline;
}
span.rvts6
{
 font-size: 11pt;
 font-family: 'segoe ui';
 font-weight: bold;
 color: #ffffff;
 background-color: #0000ff;
}
span.rvts7
{
 font-size: 11pt;
 font-family: 'segoe ui';
}
a.rvts8, span.rvts8
{
 font-size: 11pt;
 font-family: 'segoe ui';
 color: #0000ff;
 text-decoration: underline;
}
/* ========== Para Styles ========== */
p,ul,ol /* Paragraph Style */
{
 text-align: left;
 text-indent: 0px;
 padding: 0px 0px 0px 0px;
 margin: 0px 0px 0px 0px;
}
.rvps1 /* Centered */
{
 text-align: center;
}
--></style>
</head>
<body>

<p>Hello Anthony,</p>
<p><br></p>
<p>&nbsp;Is clear, thanks, I'll test and will let you know.</p>
<p>&nbsp;Should I add 'core-db-dsn' parameter description to Wiki? Maybe we need to add this parameter also to sample conf files?</p>
<p><br></p>
<p>Saturday, November 21, 2009 6:14:59 PM, you wrote:</p>
<p><br></p>
<div><table border=0 cellpadding=1 cellspacing=2>
<tr valign=top>
<td width=11 style="background-color: #0000ff;">
<p><span class=rvts6>&gt;</span></p>
</td>
<td width=910 style="background-color: #ffffff;">
<p><span class=rvts7>we had the code slightly out of order, you should update to latest trunk for the right version.</span></p>
<p><br></p>
<p><span class=rvts7>The test of 2 deletes is to see if your odbc driver will fail when trying to execute 2 statements at once so I can properly</span></p>
<p><span class=rvts7>fail over to sqlite because transactions are mandatory for a database running core in odbc.</span></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts7>On Sat, Nov 21, 2009 at 6:02 AM, Mike Tkachuk &lt;</span><a class=rvts8 href="mailto:mike@yes.net.ua">mike@yes.net.ua</a><span class=rvts7>&gt; wrote:</span></p>
<p><br></p>
<p><span class=rvts7>Hello,</span></p>
<p><br></p>
<p><span class=rvts7>&nbsp;Looks like the issue is not in multi statements in one request.</span></p>
<p><span class=rvts7>&nbsp;Manually creating DB schema helped and everything started up.</span></p>
<p><span class=rvts7>&nbsp;I will continue testing</span></p>
<p><br></p>
<p><span class=rvts7>&nbsp;Also in code I see such construction:</span></p>
<p><span class=rvts7>&nbsp;&gt; switch_cache_db_execute_sql(dbh, "begin;delete from channels where hostname='';delete from channels where hostname='';commit;", &amp;err);</span></p>
<p><span class=rvts7>&nbsp;Anyone can explain why to do such delete twice and in transaction?</span></p>
<p><br></p>
<p><span class=rvts7>&nbsp;Thanks.</span></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts7>Saturday, November 21, 2009 1:41:06 PM, you wrote:</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; Hello Folks,</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; &nbsp;I'm interesting in completely moving away from sqlite and use</span></p>
<p><span class=rvts7>MT&gt; &nbsp;postgresql everywhere including core ( switch_core.c )</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; &nbsp;All other applications can use odbc without issues (sofia, limit,</span></p>
<p><span class=rvts7>MT&gt; &nbsp;fifo etc), but as I see in core only sqlite3 supported.</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; &nbsp;I correctly set 'core-db-dsn' parameter, but looks like the problem</span></p>
<p><span class=rvts7>MT&gt; &nbsp;that latest psqlodbc_08_04_0100 don't support multiple statements in</span></p>
<p><span class=rvts7>MT&gt; &nbsp;one request that is often used in switch_core_sqldb.c:</span></p>
<p><br></p>
<p><br></p>
<p><span class=rvts7>&gt;&gt; sql = switch_mprintf(</span></p>
<p><span class=rvts7>&gt;&gt; &nbsp; "update channels set uuid='%q' where uuid='%q' and hostname='%q';"</span></p>
<p><span class=rvts7>&gt;&gt; &nbsp; "update calls set caller_uuid='%q' where caller_uuid='%q' and hostname='%q';"</span></p>
<p><span class=rvts7>&gt;&gt; &nbsp; "update calls set callee_uuid='%q' where callee_uuid='%q' and hostname='%q'",</span></p>
<p><span class=rvts7>&gt;&gt; &nbsp; switch_event_get_header_nil(event, "unique-id"),</span></p>
<p><span class=rvts7>&gt;&gt; &nbsp; ... SKIP ...</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; &nbsp;So, does anyone have any clue how to us postgresql in the FS core?</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; &nbsp;Thanks.</span></p>
<p><br></p>
<p><span class=rvts7>MT&gt; --</span></p>
<p><span class=rvts7>MT&gt; Mike Tkachuk</span></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts7>--</span></p>
<p><span class=rvts7>Mike Tkachuk</span></p>
<p><br></p>
<p><br></p>
<p><span class=rvts7>_______________________________________________</span></p>
<p><span class=rvts7>FreeSWITCH-users mailing list</span></p>
<p><a class=rvts8 href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a></p>
<p><a class=rvts8 href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></p>
<p><span class=rvts7>UNSUBSCRIBE:</span><a class=rvts8 href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></p>
<p><a class=rvts8 href="http://www.freeswitch.org">http://www.freeswitch.org</a></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p><span class=rvts7>--&nbsp;</span></p>
<p><span class=rvts7>Anthony Minessale II</span></p>
<p><br></p>
<p><span class=rvts7>FreeSWITCH&nbsp;</span><a class=rvts8 href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></p>
<p><span class=rvts7>ClueCon&nbsp;</span><a class=rvts8 href="http://www.cluecon.com/">http://www.cluecon.com/</a></p>
<p><span class=rvts7>Twitter:&nbsp;</span><a class=rvts8 href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a></p>
<p><br></p>
<p><span class=rvts7>AIM: anthm</span></p>
<p><a class=rvts8 href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a></p>
<p><span class=rvts7>GTALK/JABBER/</span><a class=rvts8 href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a></p>
<p><span class=rvts7>IRC:&nbsp;</span><a class=rvts8 href="http://irc.freenode.net">irc.freenode.net</a><span class=rvts7>&nbsp;#freeswitch</span></p>
<p><br></p>
<p><span class=rvts7>FreeSWITCH Developer Conference</span></p>
<p><a class=rvts8 href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a></p>
<p><a class=rvts8 href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a></p>
<p><a class=rvts8 href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a></p>
<p><span class=rvts7>pstn:213-799-1400</span></p>
</td>
</tr>
</table>
</div>
<p><br></p>
<p><br></p>
<p><br></p>
<p><br></p>
<p>--</p>
<p>Mike Tkachuk</p>

</body></html>