[sip-comm-dev] SIP SDP BUG


#1

Hi!

I want to report a bug:

package net.java.sip.communicator.impl.media;
CallSessionImpl.java

Method: private void initStreamTargets(Connection globalConnParam,

                                   Vector mediaDescriptions)

The problem is in the first line: String globalConnectionAddress =
globalConnParam.getAddress();

According to the Jain-SIP doc, globalConnParam (obtained from
sdpAnswer.getConnection()) can be null, if the video and audio have
different connection addresses, so Sip-Communicator doesn't support this
case. The solution is very easy:

            // First, we test if there's a global address

String globalConnectionAddress = null;

            if (globalConnParam != null)

                  globalConnectionAddress = globalConnParam.getAddress();

            Iterator mediaDescsIter = mediaDescriptions.iterator();

            while (mediaDescsIter.hasNext())

            {

                SessionAddress target = null;

                MediaDescription mediaDescription

                    = (MediaDescription) mediaDescsIter.next();

                int port = mediaDescription.getMedia().getMediaPort();

                String type = mediaDescription.getMedia().getMediaType();

                String address;

               // If there's a global address, we use it.
               // If there isn't a global address, we get the address from
the media Description

                if (globalConnectionAddress != null)

                  address = globalConnectionAddress;

                else

                       address =
mediaDescription.getConnection().getAddress();

Regards. Pablo L.


#2

Hey Pablo,

Long time no chat.

You are absolutely right about this and your patch fixes the problem.

I've committed it and updated your entry on the Team and Contributors page.

Thank you!
Emil

Pablo wrote:

···

Hi!
I want to report a bug:
package net.java.sip.communicator.impl.media;
CallSessionImpl.java
Method: *private* *void* initStreamTargets(Connection globalConnParam,
                                   Vector mediaDescriptions)
The problem is in the first line: String globalConnectionAddress = globalConnParam.getAddress();
According to the Jain-SIP doc, globalConnParam (obtained from sdpAnswer.getConnection()) can be null, if the video and audio have different connection addresses, so Sip-Communicator doesn�t support this case. The solution is very easy:
             // First, we test if there�s a global address
String globalConnectionAddress = *null*;
            *if* (globalConnParam != *null*)
                  globalConnectionAddress = globalConnParam.getAddress();
                       Iterator mediaDescsIter = mediaDescriptions.iterator();
            *while* (mediaDescsIter.hasNext())
            {
                _SessionAddress_ target = *null*;
                MediaDescription mediaDescription
                    = (MediaDescription) mediaDescsIter.next();
                 *int* port = mediaDescription.getMedia().getMediaPort();
                String type = mediaDescription.getMedia().getMediaType();
                 String address;
               // If there�s a global address, we use it.
               // If there isn�t a global address, we get the address from the media Description
                *if* (globalConnectionAddress != *null*)
                  address = globalConnectionAddress;
                *else*
                       address = mediaDescription.getConnection().getAddress();
Regards. Pablo L.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net