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

Re: [reSIProcate-users] [TP-SPAM] - How to got multiple connections ip from SDP ? - Email found in subject


There is only ever a maximum of one connection specified at the session level (sdpContent->session().connection().getAddress() extracts this).
However there may also be optionally connections specified per medium. To obtain these connections/addresses you need to iterate through the mediums:
 
// get session level connection
const Data& sessionAddress = sdpContent->session().connection().getAddress();
 
// now iterate through mediums
 
const list<SdpContents::Session::Medium>& mediums = sdpContent->session().media();
for (list<SdpContents::Session::Medium>::const_iterator m=mediums.begin(); m!=mediums.end(); m++)
{
   const list<SdpContents::Session::Connection>& mediumConnections = (*m).getMediumConnections();
 
   for (list<SdpContents::Session::Connection>::const_iterator mc=mediumConnections.begin(); mc!=mediumConnections.end(); mc++)
   {
      const Data& mediumAddress = (*mc).getAddress();
      ..
   }
 }
 
 
 


From: resiprocate-users-bounces@xxxxxxxxxxxxxxx [mailto:resiprocate-users-bounces@xxxxxxxxxxxxxxx] On Behalf Of Karlsson
Sent: 28 August 2008 17:00
To: resiprocate-users
Subject: [TP-SPAM] - [reSIProcate-users] How to got multiple connections ip from SDP ? - Email found in subject

Hi all, in the statck/test/testsdp.cxx, there has :

      Data txt("v=0\r\n"
               "o=CiscoSystemsSIP-GW-UserAgent 4316 2064 IN IP4 65.39.205.114\r\n"
               "s=SIP Call\r\n"
               "c=IN IP4 65.39.205.114\r\n"
               "t=0 0\r\n"
               "m=audio 36928 RTP/AVP 0\r\n"
               "c=IN IP4 65.39.205.114\r\n"
               "a=rtpmap:0 PCMU/8000\r\n"
               "m=video 36924 RTP/AVP\r\n"
               "c=IN IP4 65.39.205.114\r\n");


This SDP has two c= lines, how to parse it to got these two c= line IP ?

I just saw sdpContent->session().connection().getAddress();

Thanks

Telephonetics VIP is a limited company registered in England and Wales. Registered number: 2831215. Registered office: 7th Floor, Hamilton House, 111 Marlowes, Hemel Hempstead, Hertfordshire, HP1 1BB.
 The disclaimer available at: http://www.telephoneticsvip.co.uk/telephoneticsvip/emaildisclaimer.jsp , applies to this message and any associated files.