If the disconnects happen on the trunks connected to the SIP to FXO gateway trunks, check if you included the option
session-timers=refuse
in the corresponding SIP trunk configuration. As far as I remember, this option is required for Grandstream gateways (some others might need it, too).
If the disconnects happen on the internal card's trunks, look at Global Settings on the PSTN Cards page - specifically at the three Busy Detect related settings. If you have Busy Detect Enabled set to Yes, make sure the Busy Detect Pattern matches the cadence of the tone the CO sends when far end disconnected the call (e.g. set it to 500,500 if the tone is on for 500 msec and off for 500 msec). Also, set the Busy Detect Count to something like 10 to avoid false detection.