I can understand what you r going through. The best way to fight it is to talk to your close friends or family members or someone who has passed through similar situation.
Keep yourself busy listen to music or read a book that will keep your mind occupied.
I suffer from claustrophobia since past few months I don't have any clue from where my problem developed. I get panic attacks while travelling in metro, or flight or entering crowded places, but I try not to avoid them. When ever I get such attacks I start breathing deeply, chanting mantras, and thinking something else, about anything maybe a piece of jewellery I liked, or plan an outing for the weekend (it sounds odd I know but it works for me) I continue this till I feel close to normal.
What is it about going outside the causes a panic? Do you have a supportive family or friends that live near you?
You can try some over-the-counter medications like St. Johns Wort or Valerian if they are available. Other than that, you would need to see your doctor about it.