Star code scripting?

Next step in my master plan.

I want to implement star codes so that I can do something such as permanent transfers of numbers.

I’m thinking I will need to implement it through an outside scripting language.

*4 (extension)
^6 (number) * (extension)

Implement a script to rewrite portions of extensions.conf so that the last call gets automagically gets redirected to another extension which will probably be for spam calls which I will catch through voicemail or maybe a get lost message.

If any one has done or seen something like this please speak up.