diff --git a/controller/protocol/Protocol.cpp b/controller/protocol/Protocol.cpp index 21dba4f..77756ef 100644 --- a/controller/protocol/Protocol.cpp +++ b/controller/protocol/Protocol.cpp @@ -376,7 +376,8 @@ void VoIPController::ProcessExtraData(const Wrapped &_data, Endpoint &src for (const auto &stream : outgoingStreams) { - ack->streams.v.push_back(stream->getStreamInfo()); + if (ver.isNew() || stream->type == StreamType::Audio) + ack->streams.v.push_back(stream->getStreamInfo()); } LOGI("Sending init ack"); @@ -422,6 +423,10 @@ void VoIPController::ProcessExtraData(const Wrapped &_data, Endpoint &src } LOGI("peer version from init ack %d", ver.peerVersion); + if (!ver.isNew()) + { + incomingStreams.push_back(std::make_shared(StreamId::Signaling, StreamType::Signaling)); + } shared_ptr incomingAudioStream; for (const auto &stmInfo : data.streams) diff --git a/controller/protocol/protocol/Extra.h b/controller/protocol/protocol/Extra.h index f3cebef..5010254 100644 --- a/controller/protocol/protocol/Extra.h +++ b/controller/protocol/protocol/Extra.h @@ -22,7 +22,7 @@ struct Extra : public Serializable, MultiChoice void choose(BufferOutputStream &out, const VersionInfo &ver) const override; - std::string print() const override; + virtual std::string print() const override; uint64_t hash; @@ -91,7 +91,7 @@ public: std::string print() const override { std::stringstream ss; - ss << "StreamInfo id=" << streamId << ", type=" << type << ", codec=" << codec.print() << ", frameDuration=" << frameDuration << ", enabled=" << enabled; + ss << "StreamInfo id=" << (int)streamId << ", type=" << type << ", codec=" << codec.print() << ", frameDuration=" << frameDuration << ", enabled=" << enabled; return ss.str(); } @@ -325,6 +325,12 @@ struct ExtraInitAck : public Extra } static const uint8_t ID = 9; + std::string print() const override + { + std::stringstream s; + s << "ExtraInitAck (peerVersion=" << peerVersion << ", minVersion=" << minVersion << ", streams: " << streams.print() << ")"; + return s.str(); + } size_t getConstructorSize(const VersionInfo &ver) const override { return sizeof(peerVersion) + sizeof(minVersion) + streams.getSize(ver);