diff -r 2cdd984ec527 -r 654ed625511d realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp --- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Mon Jun 21 16:03:44 2010 +0300 +++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CTransport.cpp Thu Jul 15 19:02:22 2010 +0300 @@ -1455,39 +1455,44 @@ RStringF transportParam = uri.SIPURI()->ParamValue( SIPStrings::StringF( SipStrConsts::ETransport ) ); - - if ( Protocol() == KProtocolTls ) + + RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS ); + //If the Contact header has parameter transport=tls, remove it + //as it is deprecated in RFC 3261 + if(transportParam == tls) + { + uri.SIPURI()->DeleteParam(SIPStrings::StringF( SipStrConsts::ETransport )); + } + + //If the message is CSIPRequest, make sure its scheme is as per From Header. + //So if the FROM header is SIPS, Contact header is SIPS, if FROM header is SIP, + //Contact header scheme is sip + if(aMessage->IsRequest()) { - RStringF tls = SIPStrings::StringF( SipStrConsts::ETLS ); - // SIP Scheme in Contact header should be same as From Header - CURIContainer& FromUri = (((aMessage->From())->SIPAddress()).URI()); - if(FromUri.IsSIPURI()) - { - CSIPURI* FromSIPUri =FromUri.SIPURI(); - if(FromSIPUri->IsSIPSURI()) + if ( Protocol() == KProtocolTls ) + { + CURIContainer& FromUri = (((aMessage->From())->SIPAddress()).URI()); + if(FromUri.IsSIPURI()) { - uri.SIPURI()->SetSIPS( ETrue ); - } - else - { - uri.SIPURI()->SetSIPS( EFalse ); + CSIPURI* FromSIPUri =FromUri.SIPURI(); + if(FromSIPUri->IsSIPSURI()) + { + uri.SIPURI()->SetSIPS( ETrue ); + } + else + { + uri.SIPURI()->SetSIPS( EFalse ); + } } - } - if(transportParam == tls) + } + else { - //uri.SIPURI()->SetSIPS(EFalse); - //Delete the param transport=tls from the URI as it is deprecated in RFC 3261 - uri.SIPURI()->DeleteParam(SIPStrings::StringF( SipStrConsts::ETransport )); + uri.SIPURI()->SetSIPS( EFalse ); } - } - else - { - uri.SIPURI()->SetSIPS( EFalse ); - } - } - } - } - + } //end if (aMessage->IsRequest) + } //end if (uri.IsSIPURI()) + } //end if(sipaddr) + } //end while } // -----------------------------------------------------------------------------