For immediate answering, just assign the line or pools to the Voice Mail Calling Group. (Usually 770, but it is whatever you dial to log into voice mail)
For delayed answering, assign the lines to an unused calling group, then set it up to overflow to the voice mail calling group, but you also need to make a mailbox in the voice mail that steers the call to the auto attendant.