A few bugs?

11 views
Skip to first unread message
Message has been deleted

Hauke X

unread,
Oct 13, 2008, 8:24:00 AM10/13/08
to mobicents-public
Hello everyone,

I've been working on a fairly large SIP servlet and have been testing
it in the Mobicents SIP container. So far so good, I just have a few
problems that I have run across. The first two are small but I
consider the third issue to be important. If you would like me to open
issues or provide more information on these please let me know and I
will do so. Any replies would be appreciated.


1) org.mobicents.servlet.sip.address.SipURIImpl.getUser(), line 120:

RFC2396UrlDecoder.decode(...) throws a NullPointerException if the
argument - the underlying SIP URI's user part - is null. A quick fix
might be:

return getSipURI().getUser()==null ? null :
RFC2396UrlDecoder.decode(getSipURI().getUser());

I'm not sure if there are any implications if
javax.servlet.sip.SipURI.getUser() were to return null? JAIN SIP does
return null if there is no user portion, e.g. in registrar SIP URIs.


2) When we first tried out Mobicents 0.4.1 we had trouble with the
Click-To-Call example (we're now on 0.6 but I see the code for the
example hasn't changed much). We believe the problem stemmed from our
phones sending SIP URIs in the format "sip: 12...@sip.test.com:
5080;user=phone" (i.e. with the user=phone parameter). We were able to
fix the problem and get the example to work by changing "fromAddr" to
"from" in the following line:

org.mobicents.servlet.sip.example.SimpleWebServlet.doGet(...), line
110:
req.getSession().setAttribute("SecondPartyAddress",
sipFactory.createAddress(fromAddr));


3)
org.mobicents.servlet.sip.message.SipFactoryImpl.createSipServletRequest(...),
line 410:

callIdHeader = SipFactories.headerFactory.createCallIdHeader(
MobicentsSipApplicationSession.getKey().getId());

So the App. Session ID is being used as the Call-ID header. However,
if I have previously created the App. Session myself (e.g.
SipSessionsUtil.getApplicationSessionByKey("testing", true)), this
means that the Call-ID header will always be set to "testing", which
is obviously a problem. I am not sure of a fix at this point - perhaps
the Call-ID should be generated the same way it is in
createApplicationSession(...) in the same class, but I am not sure of
all the implications?


Thanks, Regards,
-- Hauke D

P.S. All files & line numbers refer to the trunk revision (3177).

Vladimir Ralev

unread,
Oct 13, 2008, 2:59:35 PM10/13/08
to mobicent...@googlegroups.com
Thanks for the feedback. Can you open an issues here http://code.google.com/p/mobicents/issues/list ? We will address them in the next release.

On Mon, Oct 13, 2008 at 3:03 PM, Hauke X <hau...@zero-g.net> wrote:

Hello everyone,

I've been working on a fairly large SIP servlet and have been testing
it in the Mobicents SIP container. So far so good, I just have a few
problems that I have run across. The first two are small but I
consider the third issue to be important. If you would like me to open
issues or provide more information on these please let me know and I
will do so. Any replies would be appreciated.


1) org.mobicents.servlet.sip.address.SipURIImpl.getUser(), line 120:

RFC2396UrlDecoder.decode(...) throws a NullPointerException if the
argument - the underlying SIP URI's user part - is null. A quick fix
might be:

return getSipURI().getUser()==null ? null :
RFC2396UrlDecoder.decode(getSipURI().getUser());

I'm not sure if there are any implications if
javax.servlet.sip.SipURI.getUser() were to return null? JAIN SIP does
return null if there is no user portion, e.g. in registrar SIP URIs.


2) When we first tried out Mobicents 0.4.1 we had trouble with the
Click-To-Call example (we're now on 0.6 but I see the code for the
example hasn't changed much). We believe the problem stemmed from our
phones sending SIP URIs in the format "sip:
2...@test2.callctrldev.ebuero.de:5080;user=phone" (i.e. with the
user=phone) parameter. We were able to fix the problem and get the

Hauke X

unread,
Oct 14, 2008, 6:50:41 AM10/14/08
to mobicents-public
Hi,

Thanks for the reply. I have opened two issues, 410 and 411. The
latter issue is currently proving to be quite a show stopper for us,
and I am very interested in resolving this issue, so any thoughts on
my suggested fix would be greatly appreciated.

http://code.google.com/p/mobicents/issues/detail?id=410
http://code.google.com/p/mobicents/issues/detail?id=411

Thanks,
-- Hauke D


On Oct 13, 8:59 pm, "Vladimir Ralev" <vladimir.ra...@gmail.com> wrote:
> Thanks for the feedback. Can you open an issues herehttp://code.google.com/p/mobicents/issues/list? We will address them in the
> next release.
>
> On Mon, Oct 13, 2008 at 3:03 PM, Hauke X <hau...@zero-g.net> wrote:
>
> > Hello everyone,
>
> > I've been working on a fairly large SIP servlet and have been testing
> > it in the Mobicents SIP container. So far so good, I just have a few
> > problems that I have run across. The first two are small but I
> > consider the third issue to be important. If you would like me to open
> > issues or provide more information on these please let me know and I
> > will do so. Any replies would be appreciated.
>
> > 1) org.mobicents.servlet.sip.address.SipURIImpl.getUser(), line 120:
>
> > RFC2396UrlDecoder.decode(...) throws a NullPointerException if the
> > argument - the underlying SIP URI's user part - is null. A quick fix
> > might be:
>
> > return getSipURI().getUser()==null ? null :
> > RFC2396UrlDecoder.decode(getSipURI().getUser());
>
> > I'm not sure if there are any implications if
> > javax.servlet.sip.SipURI.getUser() were to return null? JAIN SIP does
> > return null if there is no user portion, e.g. in registrar SIP URIs.
>
> > 2) When we first tried out Mobicents 0.4.1 we had trouble with the
> > Click-To-Call example (we're now on 0.6 but I see the code for the
> > example hasn't changed much). We believe the problem stemmed from our
> > phones sending SIP URIs in the format "sip:
> > 12...@sip.test.com:5080;user=phone" (i.e. with the

Jean Deruelle

unread,
Oct 14, 2008, 8:04:58 AM10/14/08
to mobicent...@googlegroups.com
Thanks for reporting this Hauke. Let me try to fix this ASAP, taking care of it now.

Hauke X

unread,
Oct 14, 2008, 9:29:06 AM10/14/08
to mobicents-public
Hi,

Thanks very much!

Regards,
-- Hauke D

Jean Deruelle

unread,
Oct 15, 2008, 5:51:52 AM10/15/08
to mobicent...@googlegroups.com
Issues have been fixed and regression tests added. See comments on the respective Issues. you can either test from the trunk or from the snapshot binary build available from here http://hudson.jboss.org/hudson/job/MobicentsSipServletsRelease/108 ?
Can you report back if it works ?

Thanks in advance
Jean

Hauke X

unread,
Oct 15, 2008, 12:44:35 PM10/15/08
to mobicents-public
Hi,

Thanks very much for the quick fix! I have looked at the source code
and it looks good; once I have tested it out I will let you know.

Thanks, Regards,
-- Hauke D


On Oct 15, 11:51 am, "Jean Deruelle" <jean.derue...@gmail.com> wrote:
> Issues have been fixed and regression tests added. See comments on the
> respective Issues. you can either test from the trunk or from the snapshot
> binary build available from herehttp://hudson.jboss.org/hudson/job/MobicentsSipServletsRelease/108?
> Can you report back if it works ?
>
> Thanks in advance
> Jean
>

Jean Deruelle

unread,
Oct 15, 2008, 12:50:39 PM10/15/08
to mobicent...@googlegroups.com
Hi Hauke,

You're welcome :-)
Since we plan to do a release by end of week (due to mobicents all 1.2.GA) if you could give us the feedback before the end of week that would be great.

Jean

Hauke X

unread,
Oct 16, 2008, 10:11:05 AM10/16/08
to mobicents-public
Hi Jean,

Okay, I'm currently working with Rev 3267, installed in JBoss
4.2.2.GA. When I call the method
SipFactoryFacade.createRequest(SipApplicationSession appSession,
String method, String from, String to), I am getting a
NullPointerException thrown in SipSessionImpl.setHandler(String name).
The root cause seems to be that in the former method, the call
((MobicentsSipApplicationSession)appSession).getCurrentRequestHandler()
is returning null. I have been inspecting the source and it seems the
reason might be that I recently removed <main-servlet> from my
sip.xml. I added the tag again and it works again, but as far as I
remember the tag is not required if there is only one servlet in the
application, which is the case in my SIP servlet - unless the HTTP
servlet also counts?

As for the fixed Call-ID header, that seems to be generated correctly
now, and the issue with the NullPointerException seems to be fixed now
as well. At the moment I am having other problems with my servlet that
do not seem to be related to Mobicents however. I will let you know
when things are working.

Jean Deruelle

unread,
Oct 16, 2008, 10:21:59 AM10/16/08
to mobicent...@googlegroups.com
Replies inline

On Thu, Oct 16, 2008 at 4:11 PM, Hauke X <hau...@zero-g.net> wrote:

Hi Jean,

Okay, I'm currently working with Rev 3267, installed in JBoss
4.2.2.GA. When I call the method
SipFactoryFacade.createRequest(SipApplicationSession appSession,
String method, String from, String to), I am getting a
NullPointerException thrown in SipSessionImpl.setHandler(String name).
The root cause seems to be that in the former method, the call
((MobicentsSipApplicationSession)appSession).getCurrentRequestHandler()
is returning null. I have been inspecting the source and it seems the
reason might be that I recently removed <main-servlet> from my
sip.xml. I added the tag again and it works again, but as far as I
remember the tag is not required if there is only one servlet in the
application, which is the case in my SIP servlet - unless the HTTP
servlet also counts?

No you're right this is a bug. I'll open an Issue for it
 


As for the fixed Call-ID header, that seems to be generated correctly
now, and the issue with the NullPointerException seems to be fixed now
as well. At the moment I am having other problems with my servlet that
do not seem to be related to Mobicents however. I will let you know
when things are working.

Please keep us updated
thanks a lot for your feedback
Jean
 

Jean Deruelle

unread,
Oct 16, 2008, 10:57:02 AM10/16/08
to mobicent...@googlegroups.com
Issue 413 created http://code.google.com/p/mobicents/issues/detail?id=413 regarding the main handler problem

Hauke X

unread,
Oct 16, 2008, 11:42:51 AM10/16/08
to mobicents-public
Hi,

On Oct 16, 4:57 pm, "Jean Deruelle" <jean.derue...@gmail.com> wrote:
> Issue 413 created http://code.google.com/p/mobicents/issues/detail?id=413 regarding the
> main handler problem

Thanks!

I have a quick question: when creating an INVITE request, should the
Contact header's SIP URI contain a user portion?

Thanks,
-- Hauke D

Vladimir Ralev

unread,
Oct 16, 2008, 10:01:20 PM10/16/08
to mobicent...@googlegroups.com
The spec allows it, however many phones will reject requests with no user (they respond with 404 when you attempt to call that contact later). At the same time phones that work with no user usually don't have problems with a fake username.

Hauke X

unread,
Oct 17, 2008, 7:47:04 AM10/17/08
to mobicents-public
Hi,

Thanks for the info - however this does not seem to be the problem in
our testing, instead it seems to be an issue with the From tags
generated by the Mobicents container that are causing INVITEs to be
dropped by our phone. I have opened issue 416:

http://code.google.com/p/mobicents/issues/detail?id=416

Thanks,
-- Hauke D

Jean Deruelle

unread,
Oct 17, 2008, 8:09:43 AM10/17/08
to mobicent...@googlegroups.com
Hi Hauke,

Thanks for the new bug report, we will take care of it and you should have a fix available soon.
Regarding the Issue 413, One Sip Servlet and no main servlet tag, it has been fixed and is available either from the trunk or in the nightly snapshot at http://hudson.jboss.org/hudson/job/MobicentsSipServletsRelease/110/

Also if you want to be acknowledged for your contributions to Mobicents Sip Servlets, feel free to provide your name (and optionally company name) and we will add your contribution here http://www.mobicents.org/acknowledgements.html for the 2 previous fixes you provided for the Issues 410 and 411.

Thanks again for helping us making Mobicents Sip Servlets better by the day
Best regards
Jean

Hauke X

unread,
Oct 17, 2008, 9:36:17 AM10/17/08
to mobicents-public
Hi,

Thanks very much for the quick fix! I can now confirm that issues 410,
411, 413 and 416 are working on my end. If I run into any more
problems I will let you know.

I've also submitted a class you might find useful for your project,
TagGenerator, to issue 416:

http://code.google.com/p/mobicents/issues/detail?id=416

Regards,
-- Hauke D


On Oct 17, 2:09 pm, "Jean Deruelle" <jean.derue...@gmail.com> wrote:
> Hi Hauke,
>
> Thanks for the new bug report, we will take care of it and you should have a
> fix available soon.
> Regarding the Issue 413, One Sip Servlet and no main servlet tag, it has
> been fixed and is available either from the trunk or in the nightly snapshot
> athttp://hudson.jboss.org/hudson/job/MobicentsSipServletsRelease/110/
>
> Also if you want to be acknowledged for your contributions to Mobicents Sip
> Servlets, feel free to provide your name (and optionally company name) and
> we will add your contribution herehttp://www.mobicents.org/acknowledgements.htmlfor the 2 previous fixes you

Jean Deruelle

unread,
Oct 17, 2008, 10:03:18 AM10/17/08
to mobicent...@googlegroups.com
Ok you're acknowledged, the page has been updated and many thanks for the bug reports and contributions !
we will definitely look into it.
The latest snapshot binary with all bug fixes is available here http://hudson.jboss.org/hudson/job/MobicentsSipServletsRelease/111/

Thanks
BR
Jean
Reply all
Reply to author
Forward
0 new messages