Change call output to speaker/earpiece depending upon the distance from device.
This is a workaround for phones on which Tasker's speaker on action doesn't work.
(Tested on my Oneplus-5)
Adaptive call output by AutoNotification 3.0
Use AutoNotification to turn on/off loudspeaker depending on distance (workaround for 1+ phones)