[sip-comm] Re: [nist-sip] Re: 480 temporarily unavailable; address resolution: hasRegistration


#1

Hi Brian, hi all,

after fighting for while with the source code, I made
it work!!

Now registrations made with communicator do not
include the port number!!

I touched a line inside the method getFromHeader, in
SipManager.java. Attached below you can find the final
look of the method (I only commented out the "setport"
line... according to what Brian told me).

// ***************************************
// THE METHOD, IN sipmanager.java
// ***************************************

public FromHeader getFromHeader() throws
CommunicationsException
    {
        try {
            console.logEntry();
            if (fromHeader != null) {
                return fromHeader;
            }
            try {
                SipURI fromURI = (SipURI)
addressFactory.createURI(
                    currentlyUsedURI);
                //Unnecessary test (report by Willem
Romijn)
                //if (console.isDebugEnabled())
               
fromURI.setTransportParam(listeningPoint.getTransport());

//
fromURI.setPort(listeningPoint.getPort()); // by
alvaro
                Address fromAddress =
addressFactory.createAddress(fromURI);
                if (displayName != null &&
displayName.trim().length() > 0) {
                   
fromAddress.setDisplayName(displayName);
                }
                fromHeader =
headerFactory.createFromHeader(fromAddress,
                    Integer.toString(hashCode()));
                console.debug("Generated from header:
" + fromHeader);
            }
            catch (ParseException ex) {
                console.error(
                    "A ParseException occurred while
creating From Header!", ex);
                throw new CommunicationsException(
                    "A ParseException occurred while
creating From Header!", ex);
            }
            return fromHeader;
        }
        finally {
            console.logExit();
        }
    }

--- Brian Callinan <brian.callinan@gmail.com>
escribi�:

···

Hello Alvero

I had exactly the same problem with mu softphone,
unfortunately I dont
have my code in front of me and I cant remember
exactly which header I
changed. Just go to where you construct the REGISTER
message and
wherever you are using the "set port" function to
alter a URI, reomove
it. I think it may have been the from header.
If that doesnt work for you tell me and I'll email
you the portion of
code where I construct the REGISTRATION message.

Good Luck

Brian

______________________________________________
Renovamos el Correo Yahoo!
1GB de capacidad, nuevos servicios y m�s seguridad
http://correo.yahoo.es

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


#2

Thanks!

Hope Emil will take it from there.

Ranga.

Alvaro Canivell wrote:

···

Hi Brian, hi all,

after fighting for while with the source code, I made
it work!!

Now registrations made with communicator do not
include the port number!!

I touched a line inside the method getFromHeader, in
SipManager.java. Attached below you can find the final
look of the method (I only commented out the "setport"
line... according to what Brian told me).

// ***************************************
// THE METHOD, IN sipmanager.java
// ***************************************

public FromHeader getFromHeader() throws
CommunicationsException
   {
       try {
           console.logEntry();
           if (fromHeader != null) {
               return fromHeader;
           }
           try {
               SipURI fromURI = (SipURI)
addressFactory.createURI(
                   currentlyUsedURI);
               //Unnecessary test (report by Willem
Romijn)
               //if (console.isDebugEnabled())
              fromURI.setTransportParam(listeningPoint.getTransport());

// fromURI.setPort(listeningPoint.getPort()); // by
alvaro
               Address fromAddress =
addressFactory.createAddress(fromURI);
               if (displayName != null &&
displayName.trim().length() > 0) {
                  fromAddress.setDisplayName(displayName);
               }
               fromHeader =
headerFactory.createFromHeader(fromAddress,
                   Integer.toString(hashCode()));
               console.debug("Generated from header:
" + fromHeader);
           }
           catch (ParseException ex) {
               console.error(
                   "A ParseException occurred while
creating From Header!", ex);
               throw new CommunicationsException(
                   "A ParseException occurred while
creating From Header!", ex);
           }
           return fromHeader;
       }
       finally {
           console.logExit();
       }
   }

--- Brian Callinan <brian.callinan@gmail.com>
escribi�:

Hello Alvero

I had exactly the same problem with mu softphone,
unfortunately I dont
have my code in front of me and I cant remember
exactly which header I
changed. Just go to where you construct the REGISTER
message and
wherever you are using the "set port" function to
alter a URI, reomove
it. I think it may have been the from header.
If that doesnt work for you tell me and I'll email
you the portion of
code where I construct the REGISTRATION message.

Good Luck

Brian

______________________________________________ Renovamos el Correo Yahoo! 1GB de capacidad, nuevos servicios y m�s seguridad http://correo.yahoo.es

_______________________________________________
nist-sip mailing list
nist-sip@antd.nist.gov
http://www.antd.nist.gov/mailman/listinfo/nist-sip

--
M. Ranganathan
"There are two ways to write error-free programs; only the third one works." -- Alan Perlis


#3

Indeed, port numbers are not welcome in From header URI's which are supposed to be "logical" addresses. Thanks for the report!

Alvaro, could you please create a corresponding Issue on sip-communicator.dev.java.net ?

Thanks
Emil

M. Ranganathan wrote:

···

Thanks!

Hope Emil will take it from there.

Ranga.

Alvaro Canivell wrote:

Hi Brian, hi all,

after fighting for while with the source code, I made
it work!!

Now registrations made with communicator do not
include the port number!!

I touched a line inside the method getFromHeader, in
SipManager.java. Attached below you can find the final
look of the method (I only commented out the "setport"
line... according to what Brian told me).

// ***************************************
// THE METHOD, IN sipmanager.java
// ***************************************

public FromHeader getFromHeader() throws
CommunicationsException
   {
       try {
           console.logEntry();
           if (fromHeader != null) {
               return fromHeader;
           }
           try {
               SipURI fromURI = (SipURI)
addressFactory.createURI(
                   currentlyUsedURI);
               //Unnecessary test (report by Willem
Romijn)
               //if (console.isDebugEnabled())
              fromURI.setTransportParam(listeningPoint.getTransport());

// fromURI.setPort(listeningPoint.getPort()); // by
alvaro
               Address fromAddress =
addressFactory.createAddress(fromURI);
               if (displayName != null &&
displayName.trim().length() > 0) {
                  fromAddress.setDisplayName(displayName);
               }
               fromHeader =
headerFactory.createFromHeader(fromAddress,
                   Integer.toString(hashCode()));
               console.debug("Generated from header:
" + fromHeader);
           }
           catch (ParseException ex) {
               console.error(
                   "A ParseException occurred while
creating From Header!", ex);
               throw new CommunicationsException(
                   "A ParseException occurred while
creating From Header!", ex);
           }
           return fromHeader;
       }
       finally {
           console.logExit();
       }
   }

--- Brian Callinan <brian.callinan@gmail.com>
escribi�:

Hello Alvero

I had exactly the same problem with mu softphone,
unfortunately I dont
have my code in front of me and I cant remember
exactly which header I
changed. Just go to where you construct the REGISTER
message and
wherever you are using the "set port" function to
alter a URI, reomove
it. I think it may have been the from header.
If that doesnt work for you tell me and I'll email
you the portion of
code where I construct the REGISTRATION message.

Good Luck

Brian

______________________________________________ Renovamos el Correo Yahoo! 1GB de capacidad, nuevos servicios y m�s seguridad http://correo.yahoo.es

_______________________________________________
nist-sip mailing list
nist-sip@antd.nist.gov
http://www.antd.nist.gov/mailman/listinfo/nist-sip

--
M. Ranganathan
"There are two ways to write error-free programs; only the third one works." -- Alan Perlis

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