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

RE: [reSIProcate] InviteSession::getLocalSdp undefined return ifmCurrentLocalSdp not set?


I committed the following fix for both API's:
const SdpContents&
InviteSession::getLocalSdp() const
{
   if(mCurrentLocalSdp.get())
   {
      return *mCurrentLocalSdp;
   }
   else
   {
      return SdpContents::Empty;
   }
}

Thanks!
Scott

________________________________________
From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx 
[mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Justin 
Matthews
Sent: Tuesday, October 18, 2005 11:02 AM
To: 'resiprocate-devel'
Subject: [reSIProcate] InviteSession::getLocalSdp undefined return 
ifmCurrentLocalSdp not set?

Hi,

Calling getLocalSdp on an InviteSession returns a de-referenced auto_ptr, but 
if it hasn't been set to anything yet errors will occur (also would occur for 
getRemoteSdp).

Would something like this fix this situation, or am I missing something?

InviteSession::InviteSession(DialogUsageManager& dum, Dialog& dialog)
   : DialogUsage(dum, dialog),
     mState(Undefined),
     mNitState(NitComplete),
     mCurrentRetransmit200(0),
     mSessionInterval(0),
     mMinSE(90), 
     mSessionRefresher(false),
     mSessionTimerSeq(0),
     mSentRefer(false),
     mCurrentEncryptionLevel(DialogUsageManager::None),
     mProposedEncryptionLevel(DialogUsageManager::None),
       mCurrentLocalSdp(auto_ptr<SdpContents>(new SdpContents()),
mCurrentRemoteSdp(auto_ptr<SdpContents>(new SdpContents()))

Thanks,

-Justin