There’s many technologies that works on this principle of a decentralized, mesh-based networking, even when all the telecoms have shut down. This, of course, is only limited by the battery of your phone. Also, prepare a lot of batteries if that configuration ever happens.