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:

 http://www.hsc.com/resourceCenter/resource.aspx 

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
problem)...

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

Thanks


Andy
--~--~---------~--~----~------------~-------~--~----~



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


 Hi,

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:

Authorization:
Digest username="xxx",
realm="xx.somewhere.com",
nonce="4874614acf6992cbc7cd3681a342ec2f0392180a",
uri="sip:xx.somewhere.com",
response="e5fa2fe1b25087b2632c64f8ae006503",
algorithm=MD5

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
ideas???





--~--~---------~--~----~------------~-------~--~----~



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
decrypted...)!

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

Regards,
Andy




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,
Andrea

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


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. WRAP_CONTENT to largest

greetings,

i have a TableLayout that has a bunch of rows that looks like this:


<TableRow android:id="@+id/ROW_CHOOSE_ANSWER_1">

  <Button android:id="@+id/BUTTON_CHOOSE_ANSWER_1"
          style="@style/cue_minor"
          android:clickable="true"
             android:cursorVisible="false"
             android:layout_height="wrap_content"
             android:layout_weight="45"
             android:layout_width="1dip"
             android:gravity="center|center_vertical"
             />

     <Button android:id="@+id/BUTTON_CHOOSE_ANSWER_2"
             style="@style/cue_minor"
             android:clickable="true"
             android:cursorVisible="false"
             android:layout_height="wrap_content"
             android:layout_weight="45"
             android:layout_width="1dip"
             android:gravity="center|center_vertical"
             />

</TableRow>

the current behavior is such that if the text of the first button
wraps to the second line, the height of the button will be larger.
this is good. however, the other button, if it does not have that much
text will be smaller.

i would like to have both buttons have the same height --- which is
the maximum height required by the button with the largest amount of
text.

can i do this with layout tags or would i need to do this manually
through code somehow?

i have tried to do this manually, with something like the following:


        Button button =
(Button)findViewById(R.id.BUTTON_CHOOSE_ANSWER_2);
        button.setText("zzzz asldfjlaksdjflks asldfjalskjfalskdjf");
        LayoutParams params = button.getLayoutParams();
        params.height = LayoutParams.WRAP_CONTENT;
        button.setLayoutParams(params);
        int height = button.getHeight();

but the getHeight() call gives me a height of 0. is there some kind of
measure call i can use perhaps?

thanks!
swine

-- 

2. contactslist

Hi everyone,

I'm wondering if there's any way I can launch contactlist, multiple
select it and return the phone numbers of selected contacts to my app?
so far I only succeed in selecting one person.  It's for school
project :)

Thank you in advance

-- 

3. Cocos2d-Guide

4. Mapping Application

5. Can override start() method in MediaRecorder class.

6. How to set data in google maps and further access that data

7. Can override start() method in MediaRecorder class.