Do you have any idea about how I can modify the source code?
guus, with all due respect, if you have to ask this, then you should consider subcontracting this feature to the pfSense core developers, who are intimately familiar with the CP code. Especially if you want to use this feature in a production setup, not just for testing.