I’m interested in running some code inside of asterisk whenever Asterisk starts. I am running Asterisk on a VM which makes it easy to spin up new instances. So, whenever a new instance is started I want it to announce itself to a central database. I’d also use this to alert me whenever Asterisk crashes and restarts itself.
Are there any hooks in Asterisk that allow me to do this? I suppose I could put it into the init.d script, but that wouldn’t help me whenever it crashed.