std::string SdpEndpointImpl::processAnswer (const std::string &answer) { GstSDPMessage *answerSdp; std::string resultStr; bool expected = true; bool expected_false = false; if (!waitingAnswer.compare_exchange_strong (expected, true) ) { //offer not generated throw KurentoException (SDP_END_POINT_NOT_OFFER_GENERATED, "Offer not generated. It is not possible to process an answer."); } if (!answerProcessed.compare_exchange_strong (expected_false, true) ) { //the endpoint is already negotiated throw KurentoException (SDP_END_POINT_ANSWER_ALREADY_PROCCESED, "Sdp Answer already processed"); } answerSdp = str_to_sdp (answer); g_signal_emit_by_name (element, "process-answer", answerSdp, NULL); gst_sdp_message_free (answerSdp); MediaSessionStarted event (shared_from_this(), MediaSessionStarted::getName() ); signalMediaSessionStarted (event); return getLocalSessionDescriptor (); }
std::string SdpEndpointImpl::processAnswer (const std::string &answer) { GstSDPMessage *answerSdp; std::string resultStr; answerSdp = str_to_sdp (answer); g_signal_emit_by_name (element, "process-answer", answerSdp, NULL); gst_sdp_message_free (answerSdp); MediaSessionStarted event (shared_from_this(), MediaSessionStarted::getName() ); signalMediaSessionStarted (event); return getLocalSessionDescriptor (); }