How to setup a macro

Hi,

I have a door unit connected to a fxs that opens door when a digit 5 is hit.
so today we have the workers in the office pick up the phone and hit the 5 key if a call is incoming from door 1 .

What I would like to do is open the door by caller id or through ivr with password.
e.g.
calling to the fxo line will give you an ivr , once you hit a password it will call the door fxo extension and send the 5 key. a better option would be not picking up the call at all, cross the caller id with a whitelist and execute the open door script as mentioned above.

I saw some macros online but I didn’t entirely get the feel of it.
so any “hello world” examples would be much appreciated.

any help is much appreciated.

NC.

Download or purchase the book “Asterisk, the Future of Telephony”, best programming guide.

cheers thanks