private IQ receiveContentAcceptAction ( Jingle jingle , JingleDescription description ) throws XMPPException , NotConnectedException , InterruptedException { IQ response ; List < PayloadType > offeredPayloads = description . getAudioPayloadTypesList ( ) ; bestCommonAudioPt = calculateBestCommonAudioPt ( offeredPayloads ) ; if ( bestCommonAudioPt == null ) { setNegotiatorState ( JingleNegotiatorState . FAILED ) ; response = session . createJingleError ( jingle , JingleError . NEGOTIATION_ERROR ) ; } else { setNegotiatorState ( JingleNegotiatorState . SUCCEEDED ) ; triggerMediaEstablished ( getBestCommonAudioPt ( ) ) ; LOGGER . severe ( "Media choice:" + getBestCommonAudioPt ( ) . getName ( ) ) ; response = session . createAck ( jingle ) ; } return response ; }
The other side has sent us a content - accept . The payload types in that message may not match with what we sent but XEP - 167 says that the other side should retain the order of the payload types we first sent .