gbaughma is correct. Your DID number is pinned to your SIP provider.
A quality SIP provider has multiple POP’s (Points Of Presence) or Proxies. Depending on how your SIP provider implements failover technology they may handle this on their side or you may have to configure some secondary backup settings.
We use Flowroute and they handle it.
We do however have a second trunk configured on our FreePBX that uses our secondary internet connection to our PBX and office, just in case the primary internet goes offline.