http://en.wikipedia.org/wiki/Ogaden_War
From October 1977 until January 1978, the SNA-WSLF forces attempted to capture Harar, where 40,000 Ethiopians had regrouped and re-armed with Soviet-supplied artillery and armor; backed by 1500 Soviet "advisors" and 11,000 Cuban soldiers, they engaged the attackers in vicious fighting. Though the Somali forces reached the city outskirts by November, they were too exhausted to take the city and eventually had to withdraw to await the Ethiopian counterattack.
The expected Ethiopian-Cuban attack occurred in early February; however, it was accompanied by a second attack that the Somalis did not expect. A column of Ethiopian and Cuban troops crossed northeast into the highlands between Jijiga and the border with Somalia, bypassing the SNA-WSLF force defending the Marda Pass. The attackers were thus able to assault from two directions in a "pincer" action, allowing the re-capture of Jijiga in only two days while killing 3,000 defenders. The Somali defense collapsed and every major Ethiopian town was recaptured in the following weeks. Recognizing that his position was untenable, Siad Barre ordered the SNA to retreat back into Somalia on 9 March 1978, although Rene LaFort claims that the Somalis, having foreseen the inevitable, had already withdrawn its heavy weapons.The last significant Somali unit left Ethiopia on 15 March 1978, marking the end of the war.
Effects of the warFollowing the withdrawal of the SNA, the WSLF continued their insurgency. By May 1980, the rebels, with the assistance of a small number of SNA soldiers who continued to help the guerilla war, controlled a substantial region of the Ogaden. However by 1981 the insurgents were reduced to sporadic hit-and-run attacks and were finally defeated.
The Ogaden War weakened the Somali military. Almost one-third of the regular SNA soldiers, three-eighths of the armored units and half of the Somali Air Force (SAF) were lost. The weakness of the Barre regime led it to effectively abandon the dream of a unified Greater Somalia. The failure of the war aggravated discontent with the Barre regime; the first organized opposition group, the Somali Salvation Democratic Front (SSDF), was formed by army officers in 1979.
Wikipedia is very clear,Siad Barre position in Ogaden was untenable,so He retired his army from Ogaden.
WSLF was destroyed in 1981 and Greater Somalia dream was shattered after Ogaden War.
After Ogaden War,Ethiopia was the strongest power in Horn of Africa and Somali Army was no match to Ethiopia.
Perhaps Ethiopia losses were higher than Somalis but at the end of the day ,Ethiopians had more troops for fighting and weapons from Soviet Union and Somali Army could not recover from its losses,Ethiopia had Cuban troops and Soviet weapons and with this aid Somalia could not defeat Ethiopia alone.Ethiopian could lose more men than somalis that is not important they have many more somali population in 10 million Ethiopians are 70 millions and the end the allies(Cuba,Russia and Ethiopia) had more resources and weapons to continue the war but Somalia could not fight the war alone.
Final outcome of the war: Somalia failed to recover Ogaden War and afterwards Somali Army was not a serious threat to Ethiopia any longer.