Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-6750

FIWARE.Request.Tech.Data.Stream-oriented.Kurento: Detecting Connection failed in Kurento

    Details

    • Type: extRequest
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:
      None
    • HD-Chapter:
      Data
    • HD-Enabler:
      Kurento

      Description

      Dear FIWARE coach,
      we forward you a support request received from a CreatiFI applicant we are
      not able to solve.
      Please let us know if you need direct contact with the submitter.
      Thanks.

      *********************************

      We are using kurento to stream and save videos of users webcams and
      screens. We have this working but it is not always working. Sometimes we
      get a failure but we do not have indication in the client that the
      connection failed. Sometimes we have the screen record but the webcam
      fails, sometimes the reverse, sometimes both fail.

      We have a nodejs app in front of our kurento server managing the
      connection. We listen to OnIceComponentStateChanged and MediaStateChanged
      of the WebRtcEndpoint. Sometimes I see in my logs that the
      OnIceComponentStateChanged goes GATHERING, CONNECTING and then nothing past
      this and does not get to READY.

      Question is - how can we detect that the connection cannot happen and
      properly notify in the client?

      In my client I use the kurento utils and with WebRtcPeer.WebRtcPeerSendonly
      I pass an error function but I do not see this being called.

      thanks
      Paul

      *********************************

      Since January 1st, old domains won't be supported and messages sent to any domain different to @lists.fiware.org will be lost.
      Please, send your messages using the new domain (Fiware-creatifi-coaching@lists.fiware.org) instead of the old one.
      _______________________________________________
      Fiware-creatifi-coaching mailing list
      Fiware-creatifi-coaching@lists.fiware.org
      https://lists.fiware.org/listinfo/fiware-creatifi-coaching
      [Created via e-mail received from: Andrea Maestrini <amaestrini@create-net.org>]

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          3d 18h 49m 1 NaevaTeC Development Team 13/Jun/16 12:11 PM
          In Progress In Progress Answered Answered
          4d 1h 46m 1 NaevaTeC Development Team 17/Jun/16 1:57 PM
          Answered Answered Closed Closed
          2d 49m 1 NaevaTeC Development Team 19/Jun/16 2:46 PM
          fla Fernando Lopez made changes -
          Fix Version/s 2021 [ 12600 ]
          Hide
          llopez NaevaTeC Development Team added a comment -

          We didn't had any further communication from the applicant. Hence, we assume the issued was solved. If it is not the case, let us know.

          Show
          llopez NaevaTeC Development Team added a comment - We didn't had any further communication from the applicant. Hence, we assume the issued was solved. If it is not the case, let us know.
          Hide
          silviocretti Silvio Cretti added a comment -

          Dear Luis,
          I will check with the applicant if he needs other support and in this case to be more reactive to send you feedback and I will came back to you
          BR

          Show
          silviocretti Silvio Cretti added a comment - Dear Luis, I will check with the applicant if he needs other support and in this case to be more reactive to send you feedback and I will came back to you BR
          Hide
          silviocretti Silvio Cretti added a comment -

          Dear Luis,
          only to be sure, did you fix with the applicant the issue?
          BR

          Show
          silviocretti Silvio Cretti added a comment - Dear Luis, only to be sure, did you fix with the applicant the issue? BR
          backlogmanager Backlog Manager made changes -
          Summary [Fiware-creatifi-coaching] [CreatiFI Benelx Hub] Kurento: Detecting Connection failed in Kurento FIWARE.Request.Tech.Data.Stream-oriented.Kurento: Detecting Connection failed in Kurento
          HD-Node Unknown [ 10852 ]
          llopez NaevaTeC Development Team made changes -
          Resolution Done [ 10000 ]
          Status Answered [ 10104 ] Closed [ 6 ]
          llopez NaevaTeC Development Team made changes -
          Status In Progress [ 3 ] Answered [ 10104 ]
          Hide
          llopez NaevaTeC Development Team added a comment -

          Paul Davis answered today. Following is the chain of mail updates.

          That would be the MediaFlowInStateChange. Here is a link to the JSDoc.

          Ivan Gracia

          On Thu, Jun 16, 2016 at 5:20 PM, Paul Davies <paul.davies@uxpro.be> wrote:
          We use the javascript client library on our node app - how does WebRtcEndpoint.isMediaFlowingIn map in javascript?

          thanks

          Paul

          Show
          llopez NaevaTeC Development Team added a comment - Paul Davis answered today. Following is the chain of mail updates. That would be the MediaFlowInStateChange. Here is a link to the JSDoc. Ivan Gracia On Thu, Jun 16, 2016 at 5:20 PM, Paul Davies <paul.davies@uxpro.be> wrote: We use the javascript client library on our node app - how does WebRtcEndpoint.isMediaFlowingIn map in javascript? thanks Paul –
          Hide
          llopez NaevaTeC Development Team added a comment -

          I've emailed the applicant. Silvio Cretti is CC'ed.

          Show
          llopez NaevaTeC Development Team added a comment - I've emailed the applicant. Silvio Cretti is CC'ed.
          Hide
          silviocretti Silvio Cretti added a comment -

          Dear,
          following the applicant contact: paul.davies@uxpro.be
          BR

          Show
          silviocretti Silvio Cretti added a comment - Dear, following the applicant contact: paul.davies@uxpro.be BR
          Hide
          silviocretti Silvio Cretti added a comment -

          Yes I forward to the applicant
          BR

          Show
          silviocretti Silvio Cretti added a comment - Yes I forward to the applicant BR
          llopez NaevaTeC Development Team made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          llopez NaevaTeC Development Team added a comment -

          Errors are only produced when something is broken, so to speak. An unnegotiated connection, though it could be interpreted as an error, it is not defined as an error by the WebRTC standard. During the negotiation, a number of candidates defining an IP and port pair, are exchanged. If none of these candidates are valid (i.e. define a location that is reachable by the other peer), the connection will not be successful and arriving as to what you have defined as an error state (though it is not, as per the standard). The issue is that new candidates might be discovered, and thus there is no way to define when a negotiation is never going to be possible, or just that the right candidates haven't arrived yet.

          In that sense, the recommendation is to wait for a graceful period of time, and then signal the client that the connection could not be established. Trials have shown that almost all connections take 25sec at most to be negotiated using trickle ICE (it's normally about 2-3 secs). On the server side, you can rely on two events to know the state of the connection:

          • OnIceComponentStateChanged: This event informs only about changes in the ICE connection state. The transitions between states are covered in RFC5245. It could be said that it's network-only, as it only takes into account the state of the network connection, ignoring other higher level stuff, like DTLS handshake, RTCP flow, etc. This implies that, while the component state is CONNECTED, there might be no media flowing between the peers. This makes this event useful only to receive low-level information about the connection between peers. Even more, while other events might leave a graceful period of time before firing, this event fires immediately after the state change is detected. Possible values are:
            • DISCONNECTED: No activity scheduled
            • GATHERING: Gathering local candidates
            • CONNECTING: Establishing connectivity
            • CONNECTED: At least one working candidate pair
            • READY: ICE concluded, candidate pair selection is now final
            • FAILED: Connectivity checks have been completed, but media connection was not established
          • MediaFlowOutStateChangeEvent: changes to FLOWING when there is media in the output of the media element. For instance, when a WebRTC endpoint starts receiving media, this event will be fired with FLOWING, as there will be media redia to be sent to other endpoint.
          • MediaFlowInStateChangeEvent: changes to FLOWING when there is media being fed to this endpoint, by another endpoint.

          You can use OnIceComponentStateChanged to get when the negotiation has completed, and MediaFlowInStateChangeEvent or MediaFlowOutStateChangeEvent to know when the endpoint is sending or receiving media. If after a certain amount of time, those events are not fires, you can assume that something has gone wrong, most likely that there hasn't been a valid candidate found. Then you can signal the clients and indicate that there has been an error in the connection process.

          The kurento-utils-js library is a wrapper of the RTCPeerConnection. Some of the events raised by the peer connection are wrapped by the WebRtcPeer object from the library. For those that are not, you can access directly the wrapped object in this way

          var pc = webrtcpeer.peerConnection;
          

          Nevertheless, we have found some of those events to be unreliable, depending on the browser version (for instance, oniceconnectionstatechange wasn't fired in older versions of FF), thus we recommend setting that timeout on the server side, and checking the isMediaFlowingIn and isMediaFlowingOut properties of the WebRtcEndpoint.

          Silvio Cretti Could you please forward this information to the applicant?

          Show
          llopez NaevaTeC Development Team added a comment - Errors are only produced when something is broken, so to speak. An unnegotiated connection, though it could be interpreted as an error, it is not defined as an error by the WebRTC standard. During the negotiation, a number of candidates defining an IP and port pair, are exchanged. If none of these candidates are valid (i.e. define a location that is reachable by the other peer), the connection will not be successful and arriving as to what you have defined as an error state (though it is not, as per the standard). The issue is that new candidates might be discovered, and thus there is no way to define when a negotiation is never going to be possible, or just that the right candidates haven't arrived yet. In that sense, the recommendation is to wait for a graceful period of time, and then signal the client that the connection could not be established. Trials have shown that almost all connections take 25sec at most to be negotiated using trickle ICE (it's normally about 2-3 secs). On the server side, you can rely on two events to know the state of the connection: OnIceComponentStateChanged : This event informs only about changes in the ICE connection state. The transitions between states are covered in RFC5245. It could be said that it's network-only, as it only takes into account the state of the network connection, ignoring other higher level stuff, like DTLS handshake, RTCP flow, etc. This implies that, while the component state is CONNECTED, there might be no media flowing between the peers. This makes this event useful only to receive low-level information about the connection between peers. Even more, while other events might leave a graceful period of time before firing, this event fires immediately after the state change is detected. Possible values are: DISCONNECTED: No activity scheduled GATHERING: Gathering local candidates CONNECTING: Establishing connectivity CONNECTED: At least one working candidate pair READY: ICE concluded, candidate pair selection is now final FAILED: Connectivity checks have been completed, but media connection was not established MediaFlowOutStateChangeEvent : changes to FLOWING when there is media in the output of the media element. For instance, when a WebRTC endpoint starts receiving media, this event will be fired with FLOWING , as there will be media redia to be sent to other endpoint. MediaFlowInStateChangeEvent : changes to FLOWING when there is media being fed to this endpoint, by another endpoint. You can use OnIceComponentStateChanged to get when the negotiation has completed, and MediaFlowInStateChangeEvent or MediaFlowOutStateChangeEvent to know when the endpoint is sending or receiving media. If after a certain amount of time, those events are not fires, you can assume that something has gone wrong, most likely that there hasn't been a valid candidate found. Then you can signal the clients and indicate that there has been an error in the connection process. The kurento-utils-js library is a wrapper of the RTCPeerConnection . Some of the events raised by the peer connection are wrapped by the WebRtcPeer object from the library. For those that are not, you can access directly the wrapped object in this way var pc = webrtcpeer.peerConnection; Nevertheless, we have found some of those events to be unreliable, depending on the browser version (for instance, oniceconnectionstatechange wasn't fired in older versions of FF), thus we recommend setting that timeout on the server side, and checking the isMediaFlowingIn and isMediaFlowingOut properties of the WebRtcEndpoint. Silvio Cretti Could you please forward this information to the applicant?
          Hide
          llopez NaevaTeC Development Team added a comment -

          In order to make support more agile it is important to have a contact with the issue reporter. Can you please provide an email address. Thanks in advance

          Show
          llopez NaevaTeC Development Team added a comment - In order to make support more agile it is important to have a contact with the issue reporter. Can you please provide an email address. Thanks in advance
          backlogmanager Backlog Manager made changes -
          Assignee Luis López Fernández [ llopez ]
          backlogmanager Backlog Manager made changes -
          HD-Chapter Unknown [ 10845 ] Data [ 10838 ]
          mev Manuel Escriche made changes -
          HD-Enabler Unknown [ 10910 ] Kurento [ 10873 ]
          Hide
          silviocretti Silvio Cretti added a comment -

          Dear,
          you can forward the issue to Kurento expert
          BR

          Show
          silviocretti Silvio Cretti added a comment - Dear, you can forward the issue to Kurento expert BR
          backlogmanager Backlog Manager made changes -
          HD-Enabler Unknown [ 10910 ]
          HD-Chapter Unknown [ 10845 ]
          HD-Node Unknown [ 10852 ]
          backlogmanager Backlog Manager made changes -
          Field Original Value New Value
          Link This issue relates to HELC-1418 [ HELC-1418 ]
          backlogmanager Backlog Manager created issue -

            People

            • Assignee:
              llopez NaevaTeC Development Team
              Reporter:
              fw.ext.user FW External User
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: