Thank you for taking the time to reply Henning, and for the insight.
This is exactly what we are doing; we use FreeSWITCH as a B2BUA. In the scenario I
described earlier, the UAC is the second leg of FreeSWITCH.
When FreeSWITCH receives the final response "negative reply sent from kamailio",
it gets confused and doesn't know where to relay it. It takes 32 seconds before
generating a negative SIP message to the UAC in leg A, indicating a timeout.
FreeSWITCH expects to receive a SIP message with the same To and From tags as the previous
SIP messages. In this case, I think it considers it as a different dialog with new To and
From tags.
Cheers,
Mohamed