...and to follow up on that, some consulates will allow you to apply in advance. What I have been able to do in the past is to fill out my visa application form here in the US online, and email the generated PDF to relatives in my home country along with scanned (clear) copies of my passport data page, previous visas, visa eligibility form, and all other necessary evidence. My relatives then printed everything and forwarded the material, along with the visa fee (which of course I reimbursed them for later) and a photograph to the consulate. This allows the consulate to begin the visa application process and security check. In my case, I did all of this one month before I traveled back home myself. 2 weeks after I arrived, the security clearance came through and I was able to schedule an interview at the consulate and get my visa stamp the same day.
.
This is very interesting, I was planning to go to Canada for my H-1 stamp if there is no other option left and I have to take risk. From what country did you apply for H-1 visa stamp. Actually I could apply for H1 visa from any country, be it Iran or Mexica or Canada.