Just configur your applicatin as a STP to the MSC. Configure the MSC in such a way that it acts as SSP.
In other words make your application as a virtual loop back just as we make in GSM networks.
If we do so. The MSC will store all the information regading from which MSC it receieved the ISUP message and when your application send back a response it will just loop back another message to the same MSC.
If you send me your mail id I can send you a detailed call flow how it will work.