Can I route a call via SIP based on a phone number? My Android 4.0.4 phone supports SIP. However, the options when to use the "Internet calling" are very limited: "For all calls", "Only for Internet calls", "Ask for each call". 

I would like to use Internet (SIP) calls for all calls outside of my area code (e.g. all international and long-distance calls should go via SIP, and local calls should go via my regular voice account). 

Is there any application, patch or tweak that can help me with that? My phone is rooted.
Csipsimple indeed does the job if you want to use it as your SIP client. If you prefer the built-in SIP client, try the Advanced Dialer app.