Netgear DGN2200v4 Disable SIP ALG to make ringing stop

I had to disable SIP ALG on my Netgear DGN2200v4 ADSL Router to fix a SIP problem.

In my office I have a Grandstream HT802 ATA. This is a 2 port (2xFSX) ATA.
It connects to the internet via a Netgear DGN2200v4 ADSL router. Elsewhere across the internet is our Asterisk server, also behind a NAT broadband router.

Both FSX ports have SIP accounts linked to the Asterisk box and I had a phone on each FSX port. I’ll call these extension 401 and extension 402.

If ext 401 calls ext 402 then extension 402 will start ringing. (OK so far),
My problem was that if 401 then hung up the call before 402 answered, 402 would keep ringing and ringing so something was going wrong.

If I did this test the other way around then everything was fine.
i.e. Ext 402 calls Ext 401 and 401 starts to ring. If I then hangup on ext 402 the call clears down properly and ext 401 stops ringing.

The fix turned out to be disabling the SIP ALG support in the Netgear DGN2200 v4.
It is found in Advanced -> Settings -> WAN Setup