Thanks all for the feedback. It was a default value set in the PBX that gave the gateway timeout after 5 minutes.