How release a call if Receive a specific reason (e.g. Q.850;cause=7) in 183 Session Progress message

I have a fully working freepbx interconnected with a network softswitch. I’m wondering if it is possible to force a call to disconnect if freepbx receives specific information on a 183 Session Progress header message. Is this possible?
In this example I have Reason: Q.850;cause=7;*text="Call awarded and being delivered in an established channel"
This is my example:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP;branch=z9hG4bKojq032000gq16i0ud700.1
To: ;tag=a190001-18393
From: ;tag=1838216357
Call-ID: 420069346-27029-23@BAA.GE.A.DI
CSeq: 230 INVITE
Reason: Q.850;cause=7;text="Call awarded and being delivered in an established channel"
User-Agent: Softswitch/1.0.0
Content-Type: application/sdp
Content-Length: 116
o=Softswitch 654 5178 IN IP4
c=IN IP4
t=0 0
m=audio 10000 RTP/AVP 0
Thank you.

Please use for FreePBX questions.

You will have to make moderately difficult change the the source code of chan_sip if you want to do this at the point that you receive the 183. I imagine the same is true for PJSIP.

Thank you David.
I was hopping that there was some feature available to perform this task.

Yeah, neither chan_sip or chan_pjsip will behave this way and both would require custom modification to do so.

I never performed this kind of change on the .c file. Can you point me the function or a location where I should start looking?

This is not going to be a change that is suitable for someone unfamiliar with the code. You are going to have to schedule a CANCEL transaction, which will involve real time programming issues.

There are specific mailing lists and IRC channels for developers.