diff -r b7fa3d2db8f4 -r b6d70b04aa2d multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp --- a/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp Fri Apr 23 23:37:24 2010 +0300 +++ b/multimediacommsengine/mmcesrv/mmcemediamanager/src/mcesdpsession.cpp Fri May 14 15:11:40 2010 +0300 @@ -95,7 +95,8 @@ iOOldSchoolProceeding( 0 ), iOOldSchoolCompleted( 0 ), iIsMaster( ETrue ), - iOldLocalMediaPort( 0 ) + iOldLocalMediaPort( 0 ), + iStoreRemoteOrigin ( ETrue ) { iSessionId = GetRandomNumber(); iSessionVersion = GetRandomNumber(); @@ -508,11 +509,15 @@ MCEMM_DEBUG("CMceSdpSession::DecodeOfferL(), Exit ") return KMceSipWarnIncompatibleMediaFormat; } - - // store the remote o= field - StoreRemoteOriginL(); - // store the remote a= field - StoreRemoteMediaFieldsL(); + + //avoid to store the value second time when in nat environment + if ( iStoreRemoteOrigin ) + { + // store the remote o= field + StoreRemoteOriginL(); + // store the remote a= field + StoreRemoteMediaFieldsL(); + } //set remote ip address result = SetRemoteIpAddressL( aSession, aSdpDocument ); @@ -921,7 +926,28 @@ CSdpConnectionField* connfield = aSdpDocument.ConnectionField(); const TInetAddr* inetAddr = NULL; - if( connfield ) + // find "c-" line from media level + TInt index = 0; + TBool found = ETrue; + while( found && index < mediaLines.Count() ) + { + RPointerArray& connfields = + mediaLines[index]->ConnectionFields(); + + if ( mediaLines[index++]->Port() > 0 ) + { + TInt cfindex = 0; + TBool cffound = EFalse; + while( !cffound && cfindex < connfields.Count() ) + { + inetAddr = connfields[cfindex++]->InetAddress(); + cffound = MCE_NOT_NULL_PTR( inetAddr ); + } + found = cffound; + } + } + + if( connfield && !found ) { inetAddr = connfield->InetAddress(); if( inetAddr ) @@ -931,29 +957,6 @@ MCE_SET_REMOTE_IP_ADDR( &aSession, inetAddress ); } } - - if ( !inetAddr ) - { - TInt index = 0; - TBool found = ETrue; - while( found && index < mediaLines.Count() ) - { - RPointerArray& connfields = - mediaLines[index]->ConnectionFields(); - - if ( mediaLines[index++]->Port() > 0 ) - { - TInt cfindex = 0; - TBool cffound = EFalse; - while( !cffound && cfindex < connfields.Count() ) - { - inetAddr = connfields[cfindex++]->InetAddress(); - cffound = MCE_NOT_NULL_PTR( inetAddr ); - } - found = cffound; - } - } - } if ( inetAddr ) {