A crash course in how IVRs work in Asterisk is presented here. Asterisk IVRs are configured in the dialplan, and a simple but complete example is offered.
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.