< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] Does this is a SdpContents bug ?


Hi, I really think this is a bug, but no anyone reproduce it?

When I received an UPDATE request, onOffer will be fired:

void UserAgent::onOffer(InviteSessionHandle h, const SipMessage& msg, const SdpContents& sdpContent)

 Then parese the SDP, use this code to access the codecs:


const SdpContents * sdp = dynamic_cast<SdpContents *>(msg.getContents());

list<SdpContents::Session::Medium>::const_iterator mediaiter = sdp->session().media().begin();
for (; mediaiter!=sdpContent->session().media().end(); ++mediaiter)
    {
        if (utility.compareStringNoCase(mediaiter->name().c_str(), "audio") == 0)
        {
            list<SdpContents::Session::Codec>::const_iterator codecIter = mediaiter->codecs().begin();

            for (; codecIter!=mediaiter->codecs().end(); ++codecIter)
            {
                AudioCodec codec;
                codec.setCodecName(codecIter->getName().c_str());   <---------------I always got the PCMU codec first
                codec.setRemoteTypeValue(codecIter->payloadType());


                audioCodecList.push_back(codec);
            }

        }

I always got the PCMU codec first. But I use this code not saw the PCMU in the sdp contents:

    Data sdptext = Data::from(*sdp);
    ::MessageBoxA(NULL, sdptext.c_str(), "test", MB_ICONINFORMATION);  <----------- this not shows the PCMU in SDP


Please help me ,thanks.




On Thu, Jun 19, 2008 at 6:33 PM, Karlsson <boost.regex@xxxxxxxxx> wrote:
Also, I'm using 1.31.


 
On Thu, Jun 19, 2008 at 5:33 PM, Karlsson <boost.regex@xxxxxxxxx> wrote:
Sorry, there have a mistake, please ignore my previous email.

The attachment it's log file.


1: A called B with GSM  codec,  B answered call with GSM.

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.