You can handle this directly inside the conversational flow by creating a spam/sales detection node with intent or keyword classification. Once phrases like “marketing offer,” “sales call,” or suspicious patterns are detected, transition to an Ending node or trigger the end_call tool automatically. Retell already supports automated call termination flows, so you don’t necessarily need external logic unless you want more advanced scoring or AI-based spam detection.
I can help if you don't mind @neerajjoshi_