 
         rtp_types = rtp_types.concat(parseInt(type) for type in types.split(" "))
 
+      else if m = line.match(/a=mid:(.*)/)
+        stream.mid = m[1]
+
       else if m = line.match(/a=ice-ufrag:(.*)/)
         # replace and apply ufrag
         stream.ufrag = m[1]

        gatheringDone = (stream) => (candidates) =>
          log stream.id + " gathering done"
          for candidate in candidates
            @signaling.sendCandidate stream.id, stream.index, candidate + '\r\n'

        nice_stream.on 'gatheringDone', gatheringDone stream



        stream = {
          id: id
          mid: id
          index: index
          nice: nice_stream
          needs_ice_cred: true
        }

        @streams[index] = stream

        # send candidates when gathered
        # TODO: move to trickling ...
