My Android/iOS API knowledge is bit rusty, but I think if mic is being currently being used i.e. unavailable we get an error and likely the case with camera. Should be straightforward to do that with desktop operating systems.
The real issue is setting 'common status' across all these IM/VoIP apps for informing them we are on call, although ironically I think some of them use XMPP for status internally.