Google has that, but I'm not sure if it's on-phone.
I'd wager someone could write an app to do this.
I would probably pay $50 for an on-phone version of Lenny; basically a voice-based chat-bot that keeps spammers occupied, without having to conference another number in.
( https://www.vice.com/en_us/article/d3b7na/the-story-of-lenny... )