As per the documentation, TALK_DETECT applies to the channel you set it on. Since this is an incoming call over your provider trunk, you’re applying TALK_DETECT on the caller’s channel. You need to apply TALK_DETECT on the agents channel.
That’s going to require you messing with existing dialplan for calling users/agents either at the extension or queue level.
I tried adding Queue Custom with changing the member function as below, but the its still responding only to caller channel even CLI mentions the Local channel
ex : CLI output
Local/440@from-queue-00000501;2 is now silent
Local/440@from-queue-00000501;2 is now talking
Local/440@from-queue-00000501;2 is now silent
Local/440@from-queue-00000501;2 is now talking
Local/440@from-queue-00000501;2 is now silent
Yeah the local channel is still not the place. The local channel is going to call the agent via PJSIP that is where it needs to be done. So that means it needs to be done in the predial hook of Dial() when calling the extension.