2: Now A want to using G729, Update invite with G729 only(for this UPDATE mesage, the SDP just inclued the G729 only).
3: B received this UPDATE invite message, then parse the SDP:
list<SdpContents::Session::Medium>::const_iterator mediaiter = sdpContent->session().media().begin();
Data sdptext = Data::from(*sdpContent);
::MessageBoxA(NULL, sdptext.c_str(), "test", MB_ICONINFORMATION); // This message shows the SDP just has G729 only.
AudioCodec DTMFCodec;
for (; mediaiter!=sdpContent->session().media().end(); ++mediaiter)
{
if (compareStringNoCase(mediaiter->name().c_str(), "audio") == 0)
{
mRemoteAudioPort = mediaiter->port();
list<SdpContents::Session::Codec>::const_iterator codecIter = mediaiter->codecs().begin();
for (; codecIter!=mediaiter->codecs().end(); ++codecIter)
{
AudioCodec codec;
codec.setCodecName(codecIter->getName().c_str()); // <------------- But at here, I got the PCMU first when I received each UPDATE INVITE, after PCMU, then got the G729,
// the mediaiter->codecs() inclued two codecs(always PCMU first)
codec.setRemoteTypeValue(codecIter->payloadType());
audioCodecList.push_back(codec);
}
}
And I have captured the SIP message by wireshark, it's shows the UPDATE invite message SDP just inclued G729 codec only, but when I using the mediaiter->codecs() to
access the codecs, always got the PCMU first. This issue just appears with UPDATE invite message, with INVITE message, it's normal.
please help me, thank you in advance.