We have a number of Asterisk servers; occasionally, human error means someone messes up the dialplan and incoming calls are rejected:
NOTICE[27927][C-00000188]: chan_sip.c:26826 handle_request_invite: Call from 'upstream-peer' (192.168.1.1:5060) to extension '44123123123' rejected because extension not found in context 'ourcontext'.
I'd like to implement a small piece of code that will raise some kind of alert when this happens, so we can fix it quickly.
I can (and do) use AMI to get all sorts of events out of the server - when channels are created, when calls end etc - but I can't seem to find any event or command that will raise an AMI event when a call is rejected. Does anyone know if such a thing exists?