Yes, currently we can use "Phone Idle" event to trigger a task to set a variable which will be represented as phone/call state. Then we can use the former variable in our other tasks. But it's not that convenient for us. So I think Tasker should implement a "Phone/Call state" function in the category of "Phone ---> Test Phone".
I made a task using "Java Function" of Tasker. It works very well. Xml file attached.
Note: The Java lines below is unusable in Tasker. I use reflection instead.
ITelephony phone = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
It will be much better if Tasker intergrate the same function into "Test Phone---> Phone State". Just my brainstorm. :-)