Are you using FreePBX? If so, why not use the from-internal context? AFAIK, It should store the unique ID automatically in CDR.
And if you want something custom, use the accountcode field.
there is a ‘linkedid’ column in both the cdr table and the cel table, if the two calls are linked in any way, you could likely construct a query based on a ‘union’ between the two tables
Feel free to alter the tables with columns of your making , as long as you understand the ramifications if the generally unused userfield is inadequate for you.