I am trying to configure FreePBX to have different call handling depending on external script output:
When call comes (SIP invite), FreePBX should recognize CID/DID, and before sending call to extension and before sending ringing (or session in progress) to originator, to trigger external script. Script will invoke call on external system and get feedback.
Based on this feedback, call should be either: - forwarded to specific extension with normal call flow (ringing and then answer) - deny call and send SIP 503 (or any other denial SIP code) to originator
From sender/originator point of view, in case of call denial, call should have SIP INVITE and SIP 503 at end (with no intermediate messages).
Any suggestion how to solve this or what would be best approach for this?
I use FreePBX and microSIP as end point client.