<div dir="ltr"><div><div><div>Yes, using cdr_adaptive_odbc.conf.<br><br></div>As it is a new table, just changed the name from <span style="font-family:courier new,monospace">calldate</span> to <span style="font-family:courier new,monospace">start</span> and now it is inserting the field ok.<br>
<br></div>Thank you very much for your help.<br><br></div>Best.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/11 Kevin Larsen <span dir="ltr"><<a href="mailto:kevin.larsen@pioneerballoon.com" target="_blank">kevin.larsen@pioneerballoon.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font face="sans-serif">Are you using cdr_adaptive_odbc.conf to
populate it? If so, there is no Asterisk analog to calldate. You would
need an alias set up. Mine looks like:</font>
<br>
<br><font face="sans-serif">alias start => calldate</font>
<br>
<br><font face="sans-serif">so that the start of my call is what
gets logged to the database as the calldate.</font>
<br><font face="sans-serif"><br>
Kevin Larsen </font>
<br>
<br>
<br>
<br><font color="#5f5f5f" face="sans-serif" size="1">From:
</font><font face="sans-serif" size="1">Jairo <<a href="mailto:jairo@intermol.com.br" target="_blank">jairo@intermol.com.br</a>></font>
<br><font color="#5f5f5f" face="sans-serif" size="1">To:
</font><font face="sans-serif" size="1">Asterisk Users Mailing
List - Non-Commercial Discussion <<a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a>>,
</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Date:
</font><font face="sans-serif" size="1">06/11/2013 08:28 AM</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Subject:
</font><font face="sans-serif" size="1">Re: [asterisk-users]
Is uniqueid/sequence a safe CDR table primary key ?</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Sent by:
</font><font face="sans-serif" size="1"><a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a></font>
<br>
<hr noshade><div><div class="h5">
<br>
<br>
<br><font size="3">Hello, <br>
<br>
Still about CDR and MySQL table, should the calldate field be inserted
by Asterisk?</font>
<br>
<br><font size="3">This is the table structure we are using, based on Asterisk
wiki:<br>
</font><font face="Courier" size="3"><br>
mysql> describe cdr;<br>
+-------------+-----------------------+------+-----+---------------------+----------------+<br>
| Field | Type
| Null | Key | Default
| Extra |<br>
+-------------+-----------------------+------+-----+---------------------+----------------+<br>
| id | mediumint(8)
unsigned | NO | PRI | NULL
| auto_increment |<br>
| calldate | datetime
| NO | | 0000-00-00 00:00:00 |
|<br>
| clid | varchar(80)
| NO | |
|
|<br>
| src | varchar(80)
| NO | |
|
|<br>
| dst | varchar(80)
| NO | |
|
|<br>
| dcontext | varchar(80)
| NO | |
|
|<br>
| channel | varchar(80)
| NO | |
|
|<br>
| dstchannel | varchar(80)
| NO | |
|
|<br>
| lastapp | varchar(80)
| NO | |
|
|<br>
| lastdata | varchar(80)
| NO | |
|
|<br>
| duration | int(11)
| NO | | 0
|
|<br>
| billsec | int(11)
| NO | | 0
|
|<br>
| disposition | varchar(45)
| NO | |
|
|<br>
| amaflags | int(11)
| NO | | 0
|
|<br>
| accountcode | varchar(20)
| NO | |
|
|<br>
| uniqueid | varchar(32)
| NO | |
|
|<br>
| userfield | varchar(255)
| NO | |
|
|<br>
| peeraccount | varchar(20)
| NO | |
|
|<br>
| linkedid | varchar(32)
| NO | |
|
|<br>
| sequence | int(11)
| NO | | 0
|
|<br>
+-------------+-----------------------+------+-----+---------------------+----------------+<br>
20 rows in set (0.01 sec)</font>
<br>
<br><font size="3">Thank you!<br>
</font>
<br><font size="3"><br>
</font>
<br><font size="3">2013/6/4 Olivier <</font><a href="mailto:oza_4h07@yahoo.fr" target="_blank"><font color="blue" size="3"><u>oza_4h07@yahoo.fr</u></font></a><font size="3">></font>
<br><font size="3">OK, then I'll go with linkedid, uniqueid and sequence
number.<br>
</font>
<br><font size="3">Thanks for sharing this on this list</font>
<br><font size="3"><br>
</font>
<br><font size="3">2013/6/3 Matthew Jordan <</font><a href="mailto:mjordan@digium.com" target="_blank"><font color="blue" size="3"><u>mjordan@digium.com</u></font></a><font size="3">></font>
<br><font size="3">On 06/03/2013 11:20 AM, Olivier wrote:<br>
> Hi,<br>
><br>
> When dealing with CDR SQL tables, I always added an auto-incremented<br>
> cdr_id key as a primary key, just in case provided uniqueid key went
wrong.<br>
><br>
> Now I'm facing a situation where I need to insert into a database's<br>
> table and from the dialplan, a reference to the CDR record which is<br>
> currently processed.<br>
><br>
> So my questions are:<br>
><br>
> 1. Can uniqueid/sequence (or uniqueid/sequence/calldate) bundle be<br>
> safely used as CDR's table primary key (ie I cannot have any<br>
> uniqueid/sequence combination from one CDR record to match a past<br>
> uniqueid/sequence combination) ?<br>
</font>
<br><font size="3">Possibly. Things to keep in mind:<br>
<br>
* You can run into uniqueid collisions across multiple systems if you do<br>
not specify a system name in asterisk.conf or do not specify a unique<br>
system name in asterisk.conf.<br>
* You can run into uniqueid collisions if your system clock goes<br>
backwards for any reason (the uniqueid for a channel happens to use a<br>
timestamp for its uniqueness)<br>
<br>
Whether or not this is unique enough will be completely dependent on<br>
your overall system configuration.<br>
<br>
In general, the recommended combination that *should* uniquely specify
a<br>
CDR (when configured correctly) is linkedid (which should be enabled and<br>
added to your schema), uniqueid, and sequence number, with the asterisk<br>
system name specified.<br>
<br>
--<br>
Matthew Jordan<br>
Digium, Inc. | Engineering Manager<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at: </font><a href="http://digium.com/" target="_blank"><font color="blue" size="3"><u>http://digium.com</u></font></a><font size="3">
& </font><a href="http://asterisk.org/" target="_blank"><font color="blue" size="3"><u>http://asterisk.org</u></font></a><font size="3"><br>
<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by </font><a href="http://www.api-digital.com/" target="_blank"><font color="blue" size="3"><u>http://www.api-digital.com</u></font></a><font size="3">
--<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
</font><a href="http://www.asterisk.org/hello" target="_blank"><font color="blue" size="3"><u>http://www.asterisk.org/hello</u></font></a><font size="3"><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
</font><a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><font color="blue" size="3"><u>http://lists.digium.com/mailman/listinfo/asterisk-users</u></font></a>
<br>
<br><font size="3"><br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by </font><a href="http://www.api-digital.com/" target="_blank"><font color="blue" size="3"><u>http://www.api-digital.com</u></font></a><font size="3">
--<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
</font><a href="http://www.asterisk.org/hello" target="_blank"><font color="blue" size="3"><u>http://www.asterisk.org/hello</u></font></a><font size="3"><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
</font><a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><font color="blue" size="3"><u>http://lists.digium.com/mailman/listinfo/asterisk-users</u></font></a>
<br><font size="3"><br>
<br>
<br>
-- <br>
Jairo Molina Jr∴</font><font color="blue" size="3"><u><br>
</u></font></div></div><a href="http://www.intermol.com.br/" target="_blank"><font color="blue" size="3"><u>http://www.intermol.com.br</u></font></a><font size="3">
</font><tt><font>--<div class="im"><br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by </div></font></tt><a href="http://www.api-digital.com/" target="_blank"><tt><font>http://www.api-digital.com</font></tt></a><tt><font>
--<div class="im"><br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
</div></font></tt><a href="http://www.asterisk.org/hello" target="_blank"><tt><font>http://www.asterisk.org/hello</font></tt></a><div class="HOEnZb"><div class="h5"><tt><font><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
</font></tt><a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank"><tt><font>http://lists.digium.com/mailman/listinfo/asterisk-users</font></tt></a>
<br></div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Jairo Molina Jr∴<br>
<a href="http://www.intermol.com.br/" target="_blank">http://www.intermol.com.br</a><font face="arial, helvetica, sans-serif"><span style="border-collapse:collapse"><a value="+551183288940"><span dir="ltr"></span></a></span></font>
</div>