But by playing the automated message you are being made aware that the call is record, hence the recording of the call is legal. In the absence of informing the other party ehat the being recorded and proceeding to record the call however is illegal.
If you stay on the line, you are therefor accepting that premise of being recorded