extract media attribute from sdp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Peter,
  here is a code snippet showing how to read the a=sendonly or a=inactive attributes from the SDP of a PJSIP SIP msg.
  
     pjmedia_sdp_session  *offer;
     pjmedia_sdp_media    *media;
     pjmedia_sdp_attr     *attr = NULL
  
     status =  pjmedia_sdp_parse(pSipCallLeg->m_pool, (char*)sipMsg->body->data, sipMsg->body->len, &offer);
     if (status == PJ_SUCCESS) {
         for (i=0; i < (int)offer->media_count; ++i) {
            media = offer->media[i];
           if (pjmedia_sdp_media_find_attr2(media, "sendonly", NULL) || pjmedia_sdp_media_find_attr2(media, "inactive", NULL))
                      ...
           }
        }
     }

--- On Thu, 11/11/10, Peter Darvasi <darvasi.peter at gmail.com> wrote:

> From: Peter Darvasi <darvasi.peter@xxxxxxxxx>
> Subject: extract media attribute from sdp
> To: pjsip at lists.pjsip.org
> Date: Thursday, November 11, 2010, 12:26 AM
> Hi all!
> 
> Could someone please tell me the proper way of extracting a
> media
> attribute (a=...) from an incoming 200 OK SDP body?
> Or is the whole body accessible somehow?
> I am trying to implement a session establishment procedure
> (SIP
> INVITE-200-ACK), but could not extract the info of the
> remote endpoint
> from the 200 body.
> 
> Thank you!
> 
> BR,
> 
> Peter Darvasi
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 


      



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux