The sunnah in Athan is to be in a high place so people can hear. It doesn't specifically have to be in the Masjid as narrated it was done in the highest building around the Masjid:
حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدِ بْنِ أَيُّوبَ، حَدَّثَنَا إِبْرَاهِيمُ بْنُ سَعْدٍ، عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ، عَنْ مُحَمَّدِ بْنِ جَعْفَرِ بْنِ الزُّبَيْرِ، عَنْ عُرْوَةَ بْنِ الزُّبَيْرِ، عَنِ امْرَأَةٍ، مِنْ بَنِي النَّجَّارِ قَالَتْ كَانَ بَيْتِي مِنْ أَطْوَلِ بَيْتٍ حَوْلَ الْمَسْجِدِ وَكَانَ بِلاَلٌ يُؤَذِّنُ عَلَيْهِ الْفَجْرَ فَيَأْتِي بِسَحَرٍ فَيَجْلِسُ عَلَى الْبَيْتِ يَنْظُرُ إِلَى الْفَجْرِ فَإِذَا رَآهُ تَمَطَّى ثُمَّ قَالَ اللَّهُمَّ إِنِّي أَحْمَدُكَ وَأَسْتَعِينُكَ عَلَى قُرَيْشٍ أَنْ يُقِيمُوا دِينَكَ قَالَتْ ثُمَّ يُؤَذِّنُ قَالَتْ وَاللَّهِ مَا عَلِمْتُهُ كَانَ تَرَكَهَا لَيْلَةً وَاحِدَةً تَعْنِي هَذِهِ الْكَلِمَاتِ .
Urwah ibn az-Zubayr reported on the authority of a woman from Banu an-Najjar. She said: My house was the loftiest of all the houses around the mosque (of the Prophet at Medina). Bilal used to make a call to the morning prayer from it. He would come there before the break of dawn and wait for it. When he saw it, he would yawn and say: O Allah, I praise you and seek Your assistance for the Quraysh so that they might establish Thine religion. He then would make the call to prayer. She (the narrator) said: By Allah, I do not know whether he ever left saying these words on any night.
As you see it wasn't even done in the Masjid, the point of it was that as Many people can hear it. It was also reported at times that it was done adjacent to the Wall of the Masjid (outside the Masjid):
جاء رجل من الأنصار إلى النبي صلى الله عليه وسلم فقال: إني رأيت في النوم كأني مستيقظ أرى رجلًا نزل من السماء عليه بردان أخضران، نزل على جذم حائط من المدينة، فأذن مثنى مثنى، ثم جلس، ثم أقام، فقال: مثنى مثنى. قال: "نعم ما رأيت، علمها بلالًا" قال: قال عمر: قد رأيت مثل ذلك ولكنه سبقني.
فجعله من مسند معاذ بن جبل، بدلًا من عبد الله بن زيد.
رواه أحمد في مسنده (22080) والبيهقي في سننه (1829) وابن أبي شيبة في مصنفه (2118) وقال الألباني في الثمر المستطاب: "إسناده في غاية الصحة".
A man from the Ansar came to the prophet PBUH and said, I saw a dream like I was awake, I saw a man coming from the sky with two green covers. He came down to the wall of the Masjid and he made athan in pair in pair and then sat down. He said, in pair in pair? Then he said, that is good teach it to Bilal. Omar said that he also saw the same dream but he told it before him. [Narrated by Ahmed 22080, Albihaqi 1829, Ibn Abi Shiba 2118]
However, nowadays this isn't really required, as we have Alarm clocks we can setup for Salah time (Phones, Clocks, etc..) so the Athan isn't even required to be on loud speakers as it is usually is (its more of a culture thing now).
So outside the Masjid is also considered the Sunnah, but then again it was done so that many people could hear the Athan, since they did not have loud speakers nor Alarm systems to help them remember the salah. With the invention of these instruments, many scholars say that it is OK now to make athan in the Masjid.