I have 3 dumb GSM relays that control the gates. If a person whose number is in device's address book calls, gate opens. Call gets rejected (in my country calls that didn't connect or lasted less than 5 seconds are free).
The problem with this setup is that rejected calls do not appear in the operator's call data register (CDR) and, thus, in online statement. I had no means to check who exactly opened the gate at given time.
As a workaround I enabled SIP for those 3 numbers. Operator simultaneously routes the incoming call to GSM modem over air and to SIP account where I see Caller ID.
Trouble is that now I have to use 3 ancient Android phones with operator's SIP app to log incoming calls. It works, but it is a weird inconvenient kludge. Plus, it breaks the user experience of my neighbours - they got used that their call gets dropped instantly by GSM relay, and now they will hear rings until SIP app decides to reject the call.
I have an old netbook where I've installed FreePBX distro. I will add those 3 SIP accounts to it. I need an advice on how to configure Asterisk to record the Caller ID of every incoming SIP call plus its date and time in its MySQL database, wait few seconds and reject call. I'll later write a simple Perl script to look into this database and make a neat HTML report for me.
I get that this must be very simple, but this sort of setup is weird use case for Asterisk and I can't find any existing HOWTOs on it.
P.S. Editing GSM relay firmware to make it accept and immediately reject call is not an option - it is proprietary.