<div dir="ltr"><div>OK, then I'll go with linkedid, uniqueid and sequence number.<br><br></div>Thanks for sharing this on this list<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/3 Matthew Jordan <span dir="ltr"><<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">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>
<br>
</div></div>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: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>
<br>
<br>
<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></div>