<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hi,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I’ve been playing around with CEL in asterisk trunk
(SVN-Trunk-r236144) and have found some strange behaviour and am wondering if
these are bugs.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I have the CEL table in a postgreSQL database the layout of
which was taken from the cel_pgsql.conf file. I also added a “id”
serial to use a primary key. The SQL create statement is included below.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>CREATE TABLE cel<o:p></o:p></p>
<p class=MsoNormal>(<o:p></o:p></p>
<p class=MsoNormal> uniqueid character varying(150) NOT NULL,<o:p></o:p></p>
<p class=MsoNormal> linkedid character varying(150) NOT NULL,<o:p></o:p></p>
<p class=MsoNormal> eventtime timestamp with time zone NOT NULL,<o:p></o:p></p>
<p class=MsoNormal> eventtype integer NOT NULL,<o:p></o:p></p>
<p class=MsoNormal> userdeftype character varying(100),<o:p></o:p></p>
<p class=MsoNormal> cid_name character varying(100),<o:p></o:p></p>
<p class=MsoNormal> cid_num character varying(100),<o:p></o:p></p>
<p class=MsoNormal> cid_ani character varying(100),<o:p></o:p></p>
<p class=MsoNormal> cid_rdnis character varying(100),<o:p></o:p></p>
<p class=MsoNormal> cid_dnid character varying(100),<o:p></o:p></p>
<p class=MsoNormal> exten character varying(100),<o:p></o:p></p>
<p class=MsoNormal> context character varying(100),<o:p></o:p></p>
<p class=MsoNormal> channame character varying(100),<o:p></o:p></p>
<p class=MsoNormal> appname character varying(100),<o:p></o:p></p>
<p class=MsoNormal> appdata character varying(200),<o:p></o:p></p>
<p class=MsoNormal> accountcode character varying(100),<o:p></o:p></p>
<p class=MsoNormal> peeraccount character varying(100),<o:p></o:p></p>
<p class=MsoNormal> amaflag integer,<o:p></o:p></p>
<p class=MsoNormal> userfield character varying(100),<o:p></o:p></p>
<p class=MsoNormal> peer character varying(100),<o:p></o:p></p>
<p class=MsoNormal> id serial NOT NULL<o:p></o:p></p>
<p class=MsoNormal>)<o:p></o:p></p>
<p class=MsoNormal>WITH (<o:p></o:p></p>
<p class=MsoNormal> OIDS=FALSE<o:p></o:p></p>
<p class=MsoNormal>);<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Anyway, when I use cel_pgsql.conf to connect to the database
the “id” is always set to zero (which when it were a primary key
caused a violation and made errors to that effect show up in the asterisk
console).<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Ok, so not the end of the world, I tried cel_adaptive_odbc.conf.
Here the “id” serial is always set correctly by the database, but the
following errors show up in the asterisk console:<o:p></o:p></p>
<p class=MsoNormal>[Dec 28 16:30:38] WARNING[1416]: cel_adaptive_odbc.c:574
odbc_log: CEL variable amaflag is not an integer.<o:p></o:p></p>
<p class=MsoNormal>[Dec 28 16:30:38] WARNING[1416]: cel_adaptive_odbc.c:574
odbc_log: CEL variable id is not an integer.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Any idea what’s going on here? I’m working under
the assumption that amaflag should be an int because the cel_pgsql.conf file
comments say “amaflag (an int)”.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Is there any way to make the pgsql backend ignore the ID (serial)
column so that the database will sort its value out properly?<o:p></o:p></p>
<p class=MsoNormal>What are these other two errors from the adaptive ODBC
backend?<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I think it makes sense to have a primary key on this table,
unless I’m missing something obvious I don’t think one can be made
from the other columns, can it?<o:p></o:p></p>
<p class=MsoNormal>Maybe it would be better to have asterisk make a extra field
so that uniqueid + [somthing extra] can be used as a primary key? Of course I’m
assuming it’s not possible to use something that already exists when I
suggest this. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks in advance.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Regards,<o:p></o:p></p>
<p class=MsoNormal>Nic Colledge<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>