Here is a piece of code that listens for an outgoing call, the code then takes the number that was being called, blocks the outgoing call and I then add a Call Log entry to the call Log via the Call Log content provider.

Its not very useful as is but can be used for example to stop a call when roaming and add the required prefix for ringing internationally