I presume that's an issue because you are trying to join those tables in a meaningful way for a report of some sort.
Correct. I have build some api to send data gathered from inbound/outbound calls . Joining with uniqueid column seems the most straightforward way and would be better in terms of performance even if I am using a slave for this.
Please also note that "uniqueid" ... is NOT a unique field because the values are (rarely, but technically) duplicated.
In the call log table uniqueid is a primary key not possible to be duplicated, on vicidial_log there is no uniqueid twice , at least on my system which is up and running for years. There are duplicates on recording_log table, but it doesn't matter as long as it contains the same recording file.
Vicidial uses lead_id for table connection , at least this is the common field on the reports generated by admin_modify_lead.php.
If multiple calls for the same number I have to use the date to distinguish the call.
At the moment, since my script is executed on h extension I am retrieving the last record from above tables for the phone_number.
With this method the only issue is if 1234567789 number is in call and another agent manually tries to call 1234567789 when the first call will hang up will retrieve the data from the second call, because I am using order by insert_record_dt which is a column which I have added to the tables
- Code: Select all
`insert_record_dt` timestamp NOT NULL DEFAULT current_timestamp()