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

Re: [reSIProcate-users] getFormats() in SdpContents


Once SdpContents::Session::Medium::codecs() is called the formats list
is converted into a codecs list, then the format list itself is
cleared.  Check out the code in
SdpContents::Session::Medium::codecs().  I'll add some comments to the
header file to make this clear.

Scott

On Thu, Dec 18, 2008 at 11:29 AM, Vasanthi <vasanthi@xxxxxxxxx> wrote:
> Hi,
>
> While processing an INVITE with offer SDP, getFormats() returns empty. When
> the codec list is correct, getFormats() always return empty. I have attached
> the SIP INVITE as pcap. "codec details" gets printed correctly in the code,
> but getFormats() returns empty always.  Am I missing something here ????
>
> Following is my code:
> ----------------------------------------------------------------------------
> session = offer->session();
> for (std::list<SdpContents::Session::Medium>::const_iterator
>           MediaIt = session.media().begin();
>           MediaIt != session.media().end(); MediaIt++) {
>
>       // Find out whether this is a SendRecv stream or not
>       if (MediaIt->exists("sendrecv") && MediaIt->name() == "audio") {
>
>         for (std::list<SdpContents::Session::Codec>::const_iterator
>          codecsIt = MediaIt->codecs().begin();
>          codecsIt != MediaIt->codecs().end(); codecsIt++)
>         {
>           unsigned int pt = codecsIt->payloadType();
>           Data encName = codecsIt->getName();
>           unsigned int rate = codecsIt->getRate();
>           INFO(" codec details " << pt << " " << encName << " " << rate );
>
>         }
>
>         if (MediaIt->getFormats().empty())
>           INFO(" getFormats() returned empty " <<
> MediaIt->getFormats().size());
>         else {
>                INFO(" getFormats() returned "  <<
>                        MediaIt->getFormats().size());
>           }
> }
>
> Thanks,
> Vasanthi
>
>
>
> _______________________________________________
> resiprocate-users mailing list
> resiprocate-users@xxxxxxxxxxxxxxx
> List Archive: http://list.resiprocate.org/archive/resiprocate-users/
>