There is not built-in way. There is an audiohooks infrastructure which would allow this to be added by a C programmer. There is potentially quite a high overhead involved in poling and updating such a variable.
I get a strong feeling that you would be better off asking for solutons to the underlying requirement, rather than this sort of technical solution to it.
Those applications cannot be used once a call is connected. They would typically be used for automated cold calling, where Asterisk will Originate the call then connect to the cold call extension, which will use to try to decide the best time to send the annoying message.
You still haven’t explained what you are really trying to achieve.