919 |
919 |
920 // get the remote ip address |
920 // get the remote ip address |
921 CSdpConnectionField* connfield = aSdpDocument.ConnectionField(); |
921 CSdpConnectionField* connfield = aSdpDocument.ConnectionField(); |
922 const TInetAddr* inetAddr = NULL; |
922 const TInetAddr* inetAddr = NULL; |
923 |
923 |
924 if( connfield ) |
924 // find "c-" line from media level |
|
925 TInt index = 0; |
|
926 TBool found = ETrue; |
|
927 while( found && index < mediaLines.Count() ) |
|
928 { |
|
929 RPointerArray<CSdpConnectionField>& connfields = |
|
930 mediaLines[index]->ConnectionFields(); |
|
931 |
|
932 if ( mediaLines[index++]->Port() > 0 ) |
|
933 { |
|
934 TInt cfindex = 0; |
|
935 TBool cffound = EFalse; |
|
936 while( !cffound && cfindex < connfields.Count() ) |
|
937 { |
|
938 inetAddr = connfields[cfindex++]->InetAddress(); |
|
939 cffound = MCE_NOT_NULL_PTR( inetAddr ); |
|
940 } |
|
941 found = cffound; |
|
942 } |
|
943 } |
|
944 |
|
945 if( connfield && !found ) |
925 { |
946 { |
926 inetAddr = connfield->InetAddress(); |
947 inetAddr = connfield->InetAddress(); |
927 if( inetAddr ) |
948 if( inetAddr ) |
928 { |
949 { |
929 const TInetAddr inetAddress = *(connfield->InetAddress() ); |
950 const TInetAddr inetAddress = *(connfield->InetAddress() ); |
930 // if present, if not then should be media level |
951 // if present, if not then should be media level |
931 MCE_SET_REMOTE_IP_ADDR( &aSession, inetAddress ); |
952 MCE_SET_REMOTE_IP_ADDR( &aSession, inetAddress ); |
932 } |
953 } |
933 } |
|
934 |
|
935 if ( !inetAddr ) |
|
936 { |
|
937 TInt index = 0; |
|
938 TBool found = ETrue; |
|
939 while( found && index < mediaLines.Count() ) |
|
940 { |
|
941 RPointerArray<CSdpConnectionField>& connfields = |
|
942 mediaLines[index]->ConnectionFields(); |
|
943 |
|
944 if ( mediaLines[index++]->Port() > 0 ) |
|
945 { |
|
946 TInt cfindex = 0; |
|
947 TBool cffound = EFalse; |
|
948 while( !cffound && cfindex < connfields.Count() ) |
|
949 { |
|
950 inetAddr = connfields[cfindex++]->InetAddress(); |
|
951 cffound = MCE_NOT_NULL_PTR( inetAddr ); |
|
952 } |
|
953 found = cffound; |
|
954 } |
|
955 } |
|
956 } |
954 } |
957 |
955 |
958 if ( inetAddr ) |
956 if ( inetAddr ) |
959 { |
957 { |
960 MCE_SET_REMOTE_IP_ADDR( &aSession, *inetAddr ); |
958 MCE_SET_REMOTE_IP_ADDR( &aSession, *inetAddr ); |