I have been banging my head against the desk trying to solve a problem where incoming calls were being disconnected/hang up after about 5-10 seconds. The same thing also happened to outgoing calls that reached my voicemail greeting.
I have solved the problem and wanted to post it here so that it may help anyone else experiencing the same issue as me. The problem is caused by a Retransmission Timeout which you will find in your Asterisk Log (/var/log/asterisk/full). It will look something like this.
WARNING chan_sip.c: Retransmission timeout reached on transmission for seqno 102 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6399ms with no response
WARNING chan_sip.c: Hanging up call - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
This means data that is supposed to be recieved by Asterisk is not being receieved therefore it will terminate the call.
I discovered that this problem was caused by FreePBX/Asterisk not having the correct External IP address for my network in the settings.
Firstly go to www.whatismyip.com to find out your External IP address.
Then in your FreePBX Administration Panel, go to Settings>Asterisk SIP Settings on the top NavBar. On the page that opens, make sure Static IP is selected and type your IP address you obtained earlier into the "External IP" box.
Save and Apply Config. You may need to restart your phone(s) and then you could be able to accept incoming calls and not have voicemail greetings drop out.