Problem with uniqueid

Hi all.
I need to save all information of a call. I have 2 table :
1.To save the duration : Table1(uniqueid,userid,timestart,timeend)
2.To save the action of user : Table2(uniqueid,userid,timestamp,action)
The uniqueid is the UNIQUEID environment variable. How does asterisk create UNIQUEID ? Can I use uniqueid as the key of table ?

It’s a 2 integer method, from unixtime and instance increment and is guaranteed to be machine-unique, so I think you can use it as the key of your tables; if informations for more than one pbx will be saved in the same table you need to be sure that the uniqueids will be differents, for example you may attach the ip of the pbx to the uniqueid.

Cheers.

Marco Bruni
www.marcobruni.net

Only thing you need to beware of is that “RINGNOANSWER” will create multiple of the same uniqueid, in case you want to count how many times an agent ignores a call.