CDR SQL editing

We are using Digium D70 phones and each user has 3-4 lines, however as far as users are concerned, they only have a single 4-digit extension - which beings with a 4. This works out just fine for us, however I run into a little snag when it comes to CDR and recorded calls. I have come up with a solution which I have tested and works fine, but I’d like to run it past the community to make sure I’m not missing any “gotchyas”.

Main extension is 4xxx, then it goes down the line to 3xxx, 2xxx, and one or two people needed an extra so they have a 5xxx extension as well. I’ve written and tested the following SQL update that changes the first digit of the src and destination to a 4, allowing the recorded calls and other CDR records to match up as the user would expect it.

update cdr set src= concat('4',right(src,3)) where src < '5801' and src > '2000';
update cdr set dst= concat('4',right(dst,3)) where src < '5801' and src > '2000';

Do you see this causing any issues that I may not have taken into account? Might there be a better way to do it, possibly via the dialplan?

Asterisk 1.8.15-cert5