FreeSWITCH Randomly Answer Calls

Posted on Thu 24 December 2020 in misc

I needed to answer calls randomly and came across the mod_expr module that is used to evaluate math functions. The below script generates a number between 1 and 4. It then checks if the generated number is greater than 2. If true, it answers the call and sends a random DTMF. If false, it hangs up the call with NO_ANSWER.