Compartir a través de


MediaProvider Recommendations

To implement bandwidth management in a class derived from the MediaProvider class, the derived provider class must carry out the following tasks.

  • Honor the bandwidth policy-check flag provided by the base media provider to determine whether a bandwidth check should be performed.

  • On the answerer side, if the bandwidth check returns with a call-redirect message, throw OfferAnswerException with an OfferAnswerFailureReason value of RedirectDueToBandwidthPolicy.

    If the bandwidth check returns with a call-fail message, throw OfferAnswerException with an OfferAnswerFailureReason value of FailDueToBandwidthPolicy.

    Note

    Even though a media provider returns RedirectDueToBandwidthPolicy, the signaling layer can override this value and terminate the call with a failure response code based on application preferences.

  • In the event of a partial failure, populate the appropriate headers in the 200 OK message if some of the modalities were rejected due to bandwidth policy check.

  • Provide a way to inform the application of partial failures through MediaFlow.

  • Provide a way to inform the application of RE-INVITE bandwidth failures through MediaFlow.

  • On the offerer side, be prepared to handle a null answer with an SdpAnswerStatus value of NotAcceptableDueToBandwidthPolicy when the answerer rejects the call with a 488 status code.

  • (Optional) In FlowConfigurationRequested event, expose a way to get application preferences on enabling and disabling bandwidth policy.