Some voicemail recordings too long

I have noticed that some voicemails continue recording well after the caller has hung up. Is there a setting that I'm missing that allows 3CX to detect a disconnection from the caller and stop recording? Would this be something that needs to be set in the PSTN gateway. We're using a Grandstream GXW4108.