You would use it exactly as you would when you're calling on a telephone. If it's an international fax, you have to put in the country code as well as the area code.
There is some thing wrong with your fax otherwise the long distance fax can be sent by first dialing country code, city code and then the number. Check whether you are dialing the country code and city code correct or not.