MjSip authentication problem

by andyn » Tue, 08 Jul 2008 15:24:30 GMT

Sponsored Links
 Hi there,

have anyone tried to get the demo application running included in the
MjSip zip package from HSC?
The whole zip package can be downloaded under:


I used Wireshark for checking the data transmitted to my sip server.
But there's only one request been sent which is answered by the server
with an "401 Unauthorized". To register again (to start a new try) the
emulator must be restarted.

I checked the authentication data by running x-lite on my notebook and
it works. So it doesn't seem to be a server problem does it? And data
is transmitted to server (hence it isn't a forwarding / firewall

Any suggestions?
I hope to get some help...



MjSip authentication problem

by Zhihong GUO » Wed, 09 Jul 2008 01:19:03 GMT

 Have you try a user id followed by @xx.xx.xx.xx where xx.xx.xx.xx is the
server ip.

2008/7/8 andyn <[EMAIL PROTECTED]>:


Sponsored Links

MjSip authentication problem

by andyn » Wed, 09 Jul 2008 15:18:16 GMT


yes, I've tried both the name and the id after the "@". But what I
just found out:
if I try the same (registering on the sip server) with x-lite, the
same error comes up. So after the first request of x-lite, the
response contains also a 401 error saying the same like on Android /
the demo application (unauthorized). The difference between the demo
application and x-Lite:
x-Lite sends a request AGAIN, and the second request also contains the
authorization data that looks like this:

Digest username="xxx",

So what I'm now trying to do is to get the application sending these
authorization data too after the first response.

I don't know if it is a normal procedure that first a request is sent
without the authorization data and when it fails the second request
contains this data or if it is a server specific problem...any


MjSip authentication problem

by Andrea Bernardi » Wed, 09 Jul 2008 19:00:59 GMT

 Yes, is a standard procedure for digest-authentication.
The MjSip MjSip should manage this situation, in the code present in
RegisterAgent.java in the function onTransFailureResponse.
Maybe you can debug this section to see if there is an error.

Best Regards,
Andrea Bernardi

2008/7/9 andyn <[EMAIL PROTECTED]>:


MjSip authentication problem

by andyn » Wed, 09 Jul 2008 20:21:33 GMT

  found out the same. It is automatically handled by the
RegisterAgent, but there seems to be another problem at reading out
some data. So the "realm" and "username" values can not be read out
although they were defined.
I just assigned them my standard values and will take care of that
problem later.

After doing that the demo application also sends a second request
containing the authorization data. But this request is also still
answered with a 401 error.
There's at least one more error....

Andrea, did you change anything in the code or did you just run it and
the app works perfectly?
Did you just try the call functionality or also the register function
by using a sip server?

Making calls isn't also a problem. That now (after rebuilding the
project) works. But the register functionality not....

On 9 Jul., 13:00, "Andrea Bernardi" <[EMAIL PROTECTED]> wrote:

MjSip authentication problem

by andyn » Wed, 09 Jul 2008 21:03:48 GMT

 've got it!!!

The problem was the password...
I entered one and this password was also saved by the application. But
it wasn't used for generating the nonces etc. (don't ask me why...)
So there always were contents in the several frames (udp / ip /...),
but when the server compared his calculated nonces with these created
by the application, it responses that the authorization failed (but it
didn't say that there was no password used when creating the checksum
what the server cant't know because md5 can be encrypted, but not

Such a silly error.... Don't you have the same problem???


On 9 Jul., 14:21, andyn <[EMAIL PROTECTED]> wrote:

MjSip authentication problem

by Andrea Bernardi » Wed, 09 Jul 2008 21:13:20 GMT

 lso I have made some changes in the code because I should use a proprietary
sip network.
In your case, if you pass the same user, realm and uri used by x-lite user
agent and pass these
values with the nonce obtained from the network value to the
DigestAuthentication class,
you should obtain a digest response to authenticate successfully.

When you close sipdroid a process called hsc.org.sip.ua isn't closed and
mantain the connection,
so instead to restart the emulator you can take the process id from a shell
on the emulator via
command ps and kill it. After that you can restart sipdroid user agent.
It's a bug in the code but I haven't correct it.

Best Regards,

2008/7/9 andyn <[EMAIL PROTECTED]>:


Other Threads

1. digest

Does anyone know if I can switch to receiving group digests rather than
individual emails? My email is getting flooded.


From: android-beginners@googlegroups.com
[EMAIL PROTECTED] On Behalf Of Megha Joshi
Sent: Monday, April 28, 2008 5:55 PM
To: android-beginners@googlegroups.com
Subject: [android-beginners] Re: Bluetooth api

Hi Prashant,

The bluetooth APIs as available in android.org.bluez package.
The emulator does not have bluetooth capabilities.


On Sun, Apr 27, 2008 at 6:10 AM, Prashant Kalkar

        Does any one know when will the bluetooth api be available? Will
it be available in the next SDK release?


2. Tips for doing a presentation on the Android SDK

- Warm up the emulator and install all your required apps well before
you are required to start. The emulator takes a while to startup, and
can sometimes get stuck on the Cylon animation, which (for me at
least) seems to require a reboot to put right. Don risk doing this
messing around when you have 50 people already seated and waiting for
you to start.

- Do not try and use the maps or browser feature if you have an
intermittent internet connection (i.e. a conference Wi-Fi). There is a
bug in the current release which means that no Google service will be
able to achieve a network connection if it couldn find one on
startup. If you encounter this bug, consider restarting the emulator
(see above)

- Demo Snowball. At least it will keep working even after youe lost

Tips for doing a presentation on the iPhone SDK
- Read those SDK terms and conditions again and you will find that
youe signed a non-disclosure agreement with Apple.

ll information disclosed by Apple to you that relates to Apple
products, designs, business plans, business opportunities...without
the prior written approval of an authorized representative of Apple in
each instance."

This effectively means youe signed away your right to talk about
iPhone when you signed on to Apples developer program.

- Maybe youe developing for the wrong platform?

Anybody got any more tips while we are at it?

Blogged here:

3. how can i get a button click event in ActivityTaseCase

4. Using FrameLayout inside of LinearLayout causing some problems with OnMeasure

5. Using FrameLayout inside of LinearLayout causing some problems with OnMeasure

6. New tutorial: Image & Text-Only Buttons

7. How to get another application's data path?