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

Hello,
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 10.0.0.2:5060;branch=z9hG4bKojq032000gq16i0ud700.1
To: ;tag=a190001-18393
From: ;tag=1838216357
Call-ID: 420069346-27029-23@BAA.GE.A.DI
CSeq: 230 INVITE
Contact:
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,INFO,REFER,NOTIFY,PRACK,UPDATE
Reason: Q.850;cause=7;text="Call awarded and being delivered in an established channel"
Record-Route:
User-Agent: Softswitch/1.0.0
Content-Type: application/sdp
Content-Length: 116
v=0
o=Softswitch 654 5178 IN IP4 10.0.0.1
s=phone-call
c=IN IP4 10.0.0.1
t=0 0
m=audio 10000 RTP/AVP 0
a=ptime:20
Thank you.

Please use http://community.freepbx.org/ 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.