#522 OPAL calls OpalManager::OnMediaFailed while closing source media stream (OPAL trunk)

  1. OPAL receives SIP ReINVITE with a HOLD and closes source media stream.
  2. Media patch thread receives a socket error in the OpalRTPSession::ReadRawPDU and calls

m_connection.OnMediaFailed(m_sessionId, true);


  • Valeriy V. Argunov

    I see that the PChannel::Interrupted error code exists.
    It seems like PTLIB should use it for this case, but I see that OPAL detects "Miscellaneous" code there.

  • Valeriy V. Argunov

    In the PChannel::ConvertOSError:

    libcReturnValue is -1 and (osError = os_errno()) returns 10054.

  • Valeriy V. Argunov

    Just checked again: OPAL receives 10054 before the OnHold() processing.
    I'll try to find the reason.

  • Valeriy V. Argunov

    The real reason for this bug:

    WSARecvFrom terminates with 10054 if socket receives ICMP port unreachable.
    I see that OPAL checks the socket for the PChannel::Unavailable code, but I don't see where it can set that error code on the socket.

  • Valeriy V. Argunov

    PSocket::ConvertOSError could set Unavailable code, but it doesn't check for the 10054 code:

      switch (lastErrorNumber[group]) {
        case ECONNRESET :
        case ECONNREFUSED :
        case EHOSTUNREACH :
        case ENETUNREACH :
          SetErrorValues(Unavailable, lastErrorNumber[group], group);
        case EMSGSIZE :
          return SetErrorValues(BufferTooSmall, lastErrorNumber[group], group);
  • Valeriy V. Argunov

    In PChannel::ConvertOSError from the "win32.cxx":

        case -1 :
          if ((osError = os_errno()) != 0)
          // Do next case
        case -2 :
            case WSAECONNRESET :
              osError = ECONNRESET;

    osError = os_errno() gets 10054 and ignores "case -2".

  • Valeriy V. Argunov

    Patch #285 fixes this.

  • Robert Jongbloed

    • status: open --> closed-fixed
  • Robert Jongbloed

    Fixed At revision: 32954


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks