The al Qaeda-linked al Shabaab group attacked a hotel in the Somali city of Mogadishu and took control of the building.