Sounds like an episode of acute bronchitis. If it lasts that long then something underlying is going on. Please see a lung specialist if not already done to get imaging and further diagnostic tests. There are several lung conditions that need to be evaluated.