[sip-comm-dev] [PATCH] Sip account with no registrar : Presence fail


#1

Hi,
when I register a sip account that has no registrar, if the presence is
checked, I get an exception like this one

     [java] java.lang.NullPointerException: null address arg
     [java] at
gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
     [java] at
net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

As far as I understand the presence is set on the registrar, so presence
notification should be disabled if the account has no registrar.

My patch applies to the wizard during the account creation :
What my patch do is disabling presence options and checkbox if there is no
registrar and enabling them if a registrar is here

Matthieu

Fix_presence_exception_when_no_registrar.patch (2.41 KB)


#2

Ok I understand but in that case there is a problem somewhere else :

In that exception

[java] java.lang.NullPointerException: null address arg
     [java] at
gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
     [java] at
net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

The exception occurs when generating the toHeader :

Address ourAOR = parentProvider.getRegistrarConnection()
                                                    .getAddressOfRecord();
            //FromHeader
            fromHeader = this.parentProvider.getHeaderFactory()
                .createFromHeader(ourAOR,
                                  localTag);

            //ToHeader (it's ourselves)
            toHeader = this.parentProvider.getHeaderFactory()
                .createToHeader(ourAOR, null);

The problem is that ourAOR is null.
And if I see the getAddressOfRecord() method, it returns null when there is
no registrar

Matthieu

···

2010/3/26 Emil Ivov <emcho@sip-communicator.org>

Hey Matthieu

One could still use P2P presence in registrarless mode so rather than
disabling it we may try to force the P2P mode and see how that works.

Cheers,
Emil

--sent from my mobile

On 26 mars 2010, at 09:15, Matthieu Casanova <chocolat.mou@gmail.com> > wrote:

Hi,

when I register a sip account that has no registrar, if the presence is
checked, I get an exception like this one

    [java] java.lang.NullPointerException: null address arg
    [java] at
gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
    [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
    [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
    [java] at
net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

As far as I understand the presence is set on the registrar, so presence
notification should be disabled if the account has no registrar.

My patch applies to the wizard during the account creation :
What my patch do is disabling presence options and checkbox if there is no
registrar and enabling them if a registrar is here

Matthieu
<Fix_presence_exception_when_no_registrar.patch>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

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


#3

Hey Matthieu,

Yes, there definitely is a problem. Guess we haven't been testing
presence with RegistrarlLess accounts that much. Calls work however so
you may want to have a look at the createInviteRequest() method in our
SipMessageFactory and see how we go about creating the from header in there.

Cheers,
Emil

На 26.03.10 16:00, Matthieu Casanova написа:

···

Ok I understand but in that case there is a problem somewhere else :

In that exception

[java] java.lang.NullPointerException: null address arg
     [java] at
gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
     [java] at
net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

The exception occurs when generating the toHeader :

Address ourAOR = parentProvider.getRegistrarConnection()
                                                    .getAddressOfRecord();
            //FromHeader
            fromHeader = this.parentProvider.getHeaderFactory()
                .createFromHeader(ourAOR,
                                  localTag);

            //ToHeader (it's ourselves)
            toHeader = this.parentProvider.getHeaderFactory()
                .createToHeader(ourAOR, null);

The problem is that ourAOR is null.
And if I see the getAddressOfRecord() method, it returns null when there
is no registrar

Matthieu

2010/3/26 Emil Ivov <emcho@sip-communicator.org
<mailto:emcho@sip-communicator.org>>

    Hey Matthieu

    One could still use P2P presence in registrarless mode so rather
    than disabling it we may try to force the P2P mode and see how that
    works.

    Cheers,
    Emil

    --sent from my mobile

    On 26 mars 2010, at 09:15, Matthieu Casanova <chocolat.mou@gmail.com > <mailto:chocolat.mou@gmail.com>> wrote:

        Hi,
        when I register a sip account that has no registrar, if the
        presence is checked, I get an exception like this one

            [java] java.lang.NullPointerException: null address arg
            [java] at
        gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
            [java] at
        net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
            [java] at
        net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
            [java] at
        net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

        As far as I understand the presence is set on the registrar, so
        presence notification should be disabled if the account has no
        registrar.

        My patch applies to the wizard during the account creation :
        What my patch do is disabling presence options and checkbox if
        there is no registrar and enabling them if a registrar is here

        Matthieu
        <Fix_presence_exception_when_no_registrar.patch>
        ---------------------------------------------------------------------
        To unsubscribe, e-mail:
        dev-unsubscribe@sip-communicator.dev.java.net
        <mailto:dev-unsubscribe@sip-communicator.dev.java.net>
        For additional commands, e-mail:
        dev-help@sip-communicator.dev.java.net
        <mailto:dev-help@sip-communicator.dev.java.net>

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

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

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


#4

Hi, so when we don't have a registrar, the presence mode should be
forced to p2p isn't it ?

Matthieu

···

2010/3/29 Emil Ivov <emcho@sip-communicator.org>:

Hey Matthieu,

Yes, there definitely is a problem. Guess we haven't been testing
presence with RegistrarlLess accounts that much. Calls work however so
you may want to have a look at the createInviteRequest() method in our
SipMessageFactory and see how we go about creating the from header in there.

Cheers,
Emil

На 26.03.10 16:00, Matthieu Casanova написа:

Ok I understand but in that case there is a problem somewhere else :

In that exception

[java] java.lang.NullPointerException: null address arg
[java] at
gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
[java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
[java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
[java] at
net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

The exception occurs when generating the toHeader :

Address ourAOR = parentProvider.getRegistrarConnection()
.getAddressOfRecord();
//FromHeader
fromHeader = this.parentProvider.getHeaderFactory()
.createFromHeader(ourAOR,
localTag);

        //ToHeader \(it&#39;s ourselves\)
        toHeader = this\.parentProvider\.getHeaderFactory\(\)
            \.createToHeader\(ourAOR, null\);

The problem is that ourAOR is null.
And if I see the getAddressOfRecord() method, it returns null when there
is no registrar

Matthieu

2010/3/26 Emil Ivov <emcho@sip-communicator.org
<mailto:emcho@sip-communicator.org>>

Hey Matthieu

One could still use P2P presence in registrarless mode so rather
than disabling it we may try to force the P2P mode and see how that
works\.

Cheers,
Emil

\-\-sent from my mobile

On 26 mars 2010, at 09:15, Matthieu Casanova &lt;chocolat\.mou@gmail\.com &gt;&gt;     &lt;mailto:chocolat\.mou@gmail\.com&gt;&gt; wrote:

    Hi,
    when I register a sip account that has no registrar, if the
    presence is checked, I get an exception like this one

        \[java\] java\.lang\.NullPointerException: null address arg
        \[java\]     at
    gov\.nist\.javax\.sip\.header\.HeaderFactoryImpl\.createFromHeader\(HeaderFactoryImpl\.java:513\)
        \[java\]     at
    net\.java\.sip\.communicator\.impl\.protocol\.sip\.OperationSetPresenceSipImpl\.createPublish\(OperationSetPresenceSipImpl\.java:626\)
        \[java\]     at
    net\.java\.sip\.communicator\.impl\.protocol\.sip\.OperationSetPresenceSipImpl\.publishPresenceStatus\(OperationSetPresenceSipImpl\.java:526\)
        \[java\]     at
    net\.java\.sip\.communicator\.impl\.gui\.main\.presence\.PresenceStatusMenu$PublishPresenceStatusThread\.run\(PresenceStatusMenu\.java:281\)

    As far as I understand the presence is set on the registrar, so
    presence notification should be disabled if the account has no
    registrar\.

    My patch applies to the wizard during the account creation :
    What my patch do is disabling presence options and checkbox if
    there is no registrar and enabling them if a registrar is here

    Matthieu
    &lt;Fix\_presence\_exception\_when\_no\_registrar\.patch&gt;
    \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
    To unsubscribe, e\-mail:
    dev\-unsubscribe@sip\-communicator\.dev\.java\.net
    &lt;mailto:dev\-unsubscribe@sip\-communicator\.dev\.java\.net&gt;
    For additional commands, e\-mail:
    dev\-help@sip\-communicator\.dev\.java\.net
    &lt;mailto:dev\-help@sip\-communicator\.dev\.java\.net&gt;

\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
To unsubscribe, e\-mail:
dev\-unsubscribe@sip\-communicator\.dev\.java\.net
&lt;mailto:dev\-unsubscribe@sip\-communicator\.dev\.java\.net&gt;
For additional commands, e\-mail:
dev\-help@sip\-communicator\.dev\.java\.net
&lt;mailto:dev\-help@sip\-communicator\.dev\.java\.net&gt;

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31


#5

Hey Matthieu,

На 06.04.10 20:18, Matthieu Casanova написа:

Hi, so when we don't have a registrar, the presence mode should be
forced to p2p isn't it ?

Yes, correct, and it should be impossible for the user to change this
(although they may very well disable it).

As you pointed out however, this will probably not resolve the exception
you describe below, and we'd need to fix this additionally.

Cheers,
Emil

···

Matthieu

2010/3/29 Emil Ivov <emcho@sip-communicator.org>:

Hey Matthieu,

Yes, there definitely is a problem. Guess we haven't been testing
presence with RegistrarlLess accounts that much. Calls work however so
you may want to have a look at the createInviteRequest() method in our
SipMessageFactory and see how we go about creating the from header in there.

Cheers,
Emil

На 26.03.10 16:00, Matthieu Casanova написа:

Ok I understand but in that case there is a problem somewhere else :

In that exception

[java] java.lang.NullPointerException: null address arg
     [java] at
gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
     [java] at
net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
     [java] at
net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

The exception occurs when generating the toHeader :

Address ourAOR = parentProvider.getRegistrarConnection()
                                                    .getAddressOfRecord();
            //FromHeader
            fromHeader = this.parentProvider.getHeaderFactory()
                .createFromHeader(ourAOR,
                                  localTag);

            //ToHeader (it's ourselves)
            toHeader = this.parentProvider.getHeaderFactory()
                .createToHeader(ourAOR, null);

The problem is that ourAOR is null.
And if I see the getAddressOfRecord() method, it returns null when there
is no registrar

Matthieu

2010/3/26 Emil Ivov <emcho@sip-communicator.org
<mailto:emcho@sip-communicator.org>>

    Hey Matthieu

    One could still use P2P presence in registrarless mode so rather
    than disabling it we may try to force the P2P mode and see how that
    works.

    Cheers,
    Emil

    --sent from my mobile

    On 26 mars 2010, at 09:15, Matthieu Casanova <chocolat.mou@gmail.com >>> <mailto:chocolat.mou@gmail.com>> wrote:

        Hi,
        when I register a sip account that has no registrar, if the
        presence is checked, I get an exception like this one

            [java] java.lang.NullPointerException: null address arg
            [java] at
        gov.nist.javax.sip.header.HeaderFactoryImpl.createFromHeader(HeaderFactoryImpl.java:513)
            [java] at
        net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.createPublish(OperationSetPresenceSipImpl.java:626)
            [java] at
        net.java.sip.communicator.impl.protocol.sip.OperationSetPresenceSipImpl.publishPresenceStatus(OperationSetPresenceSipImpl.java:526)
            [java] at
        net.java.sip.communicator.impl.gui.main.presence.PresenceStatusMenu$PublishPresenceStatusThread.run(PresenceStatusMenu.java:281)

        As far as I understand the presence is set on the registrar, so
        presence notification should be disabled if the account has no
        registrar.

        My patch applies to the wizard during the account creation :
        What my patch do is disabling presence options and checkbox if
        there is no registrar and enabling them if a registrar is here

        Matthieu
        <Fix_presence_exception_when_no_registrar.patch>
        ---------------------------------------------------------------------
        To unsubscribe, e-mail:
        dev-unsubscribe@sip-communicator.dev.java.net
        <mailto:dev-unsubscribe@sip-communicator.dev.java.net>
        For additional commands, e-mail:
        dev-help@sip-communicator.dev.java.net
        <mailto:dev-help@sip-communicator.dev.java.net>

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

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

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