Failover destination

We have a site that was implemented with a grandstream 4008 in front of their panasonic pbx. The grandstream has 3 extensions registered with the freepbx system emulating the 3 channels of the panasonic.
The 3 extensions are setup as a ring group and call the grandstream accordingly. My question:
If the freepbx connection fails from the grandstream (separate sites), how would I have incoming calls to this site failover to call the grandstream ‘lifeline feature a pots line that is a failover on the grandstream’