Zhanchang / imsdroid

Automatically exported from code.google.com/p/imsdroid
0 stars 0 forks source link

Where are the documents downloaded through downloadDocuments method of XcapService class? #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I want to look over the document downloaded by Xcap.
2.I think that downloadDocuments() method of XcapService class should finish 
the download.
3.Where are the documents? downloadDocuments() calls getDocument method,what 
can I get through downloadDocuments or getDocument? 

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
IMSDroid 1.1.327, on Android 2.2

Please provide any additional information below.

Original issue reported on code.google.com by yuwenbin...@gmail.com on 8 Dec 2010 at 2:13

GoogleCodeExporter commented 9 years ago
downloadDocuments() will download all documents (resource-lists, rls-services, 
...) while getDocument(String) will download a single document. Both methods 
will return immediately as they are asynchronous. The data will be received in 
the XCAP callback function onEvent(XcapEvent).

Original comment by boss...@yahoo.fr on 8 Dec 2010 at 7:04

GoogleCodeExporter commented 9 years ago
I can capture the message package by using Wireshark.For testing Xcap,I change 
"pravite void downloadDocuments()" to "public void downloadDocuments()" to easy 
to call it.When I click "Sign In" button,I call downloadDocuments().I think I 
can capture some Xcap message.In fact,however,no Xcap message are captured by 
Wireshark.WHY? When calling downloadDocuments(),do GET Xcap message send?

Original comment by yuwenbin...@gmail.com on 9 Dec 2010 at 11:16

GoogleCodeExporter commented 9 years ago
If this function is private it's for good reasons.
To test XCAP: Options->Contacts->Remote Storage(XDMS) then configure the 
connection information.

Original comment by boss...@yahoo.fr on 9 Dec 2010 at 4:03

GoogleCodeExporter commented 9 years ago
Yeah,I have set the Remote Storage,then I called downloadDocuments().However,no 
Xcap message is captured by Wireshark software.When calling downloadDocuments() 
or downloadDocument(),will GET message be send?

Original comment by yuwenbin...@gmail.com on 9 Dec 2010 at 4:22

GoogleCodeExporter commented 9 years ago
Before calling downloadDocuments() you must configure the XcapStack then start 
it.
Could you please send the log file (from eclipse) and Wireshark trace?

Original comment by boss...@yahoo.fr on 9 Dec 2010 at 4:30

GoogleCodeExporter commented 9 years ago
When clicking Sign In button,I modify the code and call downloadDocuments().
if(position == ScreenHome.itemSignInOutPosition){
   // FIXME
   if(ScreenHome.this.adapter.inprogress){
      ScreenHome.this.sipService.stopStack();
      return;
   }                        
   if(ScreenHome.this.sipService.isRegistered()){
      ScreenHome.this.sipService.unregister();
   }
   else{
      ScreenHome.this.sipService.register();                
      XcapService XS = new XcapService();
      XS.prepare();
      XS.downloadDocuments();
   }
}

Original comment by yuwenbin...@gmail.com on 9 Dec 2010 at 5:22

GoogleCodeExporter commented 9 years ago
You cannot do it like this. At this stage the SipStack is not started and you 
are not registered. keep in mind that all is asynchronous => calling 
"ScreenHome.this.sipService.register()" will not block until you get registered.
What I was asking is: Have you managed to get it to work with the official 
source?

Original comment by boss...@yahoo.fr on 9 Dec 2010 at 5:31

GoogleCodeExporter commented 9 years ago
Well,how should I use XcapService?In another word,I want to capture Xcap 
message package by using Wireshark software,then what should I do or write the 
code?
It is better to give me a code demo of using XcapService class for sending Xcap 
message (PUT and GET).
For EXAMPLE:
--------------------------------------------------------------------------------
--
PUT 
/xcap-ap-service/pidf-manipulation/users/sip:aladdin@ims.chinamobile.com/perm-pr
esence/~~/presence/pdm:person/rpid:status-icon?xmlns(pdm=urn:ietf:params:xml:ns:
pidf:data-model)xmlns(rpid=urn:ietf:params:xml:ns:pidf:rpid) HTTP/1.1
X-3GPP-Intended-Identity: sip:aladdin@ims.chinamobile.com
Content-Length: <length>
Content-Type: application/xcap-el+xml
User-Agent: <agent name>
Host: <ip:port>
If-Match "<E-tag>"

<rpid:status-icon 
etag="85936">http://10.170.32.16:7077/xcap-ap-service/org.openmobilealliance.pre
s-content/users/sip:nemo@ims.chinamobile.com/oma_status-icon/rcs_status_icon</rp
id:status-icon>
--------------------------------------------------------------------------------
----

GET 
/xcap-ap-service/org.openmobilealliance.pres-content/users/sip:simba@ims.chinamo
bile.com/oma_status-icon/rcs_status_icon HTTP/1.1
X-3GPP-Intended-Identity: sip:nemo@ims.chinamobile.com
Content-Length: 0
Accept : application/vnd.oma.pres-content+xml
If-None-Match: "<Etag>"
Authorization: Digest username="sip:nemo@ims.chinamobile.com", 
realm="ims.chinamobile.com", nonce="1dc7ef3af7a591acecfe5663ca7b60bba", 
uri="/xcap-ap-service/org.openmobilealliance.pres-content/users/sip:simba@ims.ch
inamobile.com/oma_status-icon/rcs_status_icon", 
cnonce="2b0619ad94bc2aba54dd43425bff604c", nc="00000014", algorithm="MD5", 
response="e8ad337e591e6e9ee3a97c8327aac0a7", qop="auth", 
opaque="f26798d3e10a9880b91afbc473a224af"
Host: 10.170.32.16:7077
--------------------------------------------------------------------------------
----

Original comment by yuwenbin...@gmail.com on 9 Dec 2010 at 6:28

GoogleCodeExporter commented 9 years ago
When I click Sign In button to login,some Xcap message should be sent.
Here is onRegistrationEvent method of XcapService class
/* ===================== Sip Events ========================*/
public boolean onRegistrationEvent(Object sender, RegistrationEventArgs e) {

       switch(e.getType()){
       case REGISTRATION_OK:
        this.enabled = ServiceManager.getConfigurationService().getBoolean(
            CONFIGURATION_SECTION.XCAP,
                           CONFIGURATION_ENTRY.ENABLED,
                Configuration.DEFAULT_XCAP_ENABLED);

                if(this.enabled && this.prepare()){
                    this.downloadDocuments();
                }
                break;
            case UNREGISTRATION_OK:
                if(this.enabled){
                    this.unPrepare();
                }
                break;
            default:
                break;
        }
        return true;
    }

this.downloadDocuments(); should be execute and then XDMC will send some Xcap 
message(GET).However,no Xcap message is be captured....

Here is Log ERROR.
-----------------------------------------------------------------------------
ERROR/tinyWRAP(616): ***ERROR: function: "tsip_header_Allow_Events_parse()" 
ERROR/tinyWRAP(616): file: "src/headers/tsip_header_Allow_Events.c" 
ERROR/tinyWRAP(616): line: "297" 
ERROR/tinyWRAP(616): MSG: Failed to parse SIP 'Allow-Events' header.
ERROR/tinyWRAP(616): ***ERROR: function: "tnet_tls_socket_init()" 
ERROR/tinyWRAP(616): file: "src/tls/tnet_tls.c" 
ERROR/tinyWRAP(616): line: "324" 
ERROR/tinyWRAP(616): MSG: You MUST enable OpenSSL
ERROR/tinyWRAP(616): ***ERROR: function: "tnet_tls_socket_ctor()" 
ERROR/tinyWRAP(616): file: "src/tls/tnet_tls.c" 
ERROR/tinyWRAP(616): line: "442" 
ERROR/tinyWRAP(616): MSG: Failed to initialize SSL socket [-200].
ERROR/tinyWRAP(616): ***ERROR: function: "tnet_tls_socket_connect()" 
ERROR/tinyWRAP(616): file: "src/tls/tnet_tls.c" 
ERROR/tinyWRAP(616): line: "105" 
ERROR/tinyWRAP(616): MSG: You MUST enable OpenSSL
ERROR/tinyWRAP(616): ***ERROR: function: "thttp_dialog_send_request()" 
ERROR/tinyWRAP(616): file: "src/thttp_dialog.c" 
ERROR/tinyWRAP(616): line: "372" 
ERROR/tinyWRAP(616): MSG: 2000 milliseconds elapsed and the socket is still not 
connected.
--------------------------------------------------------------------------------

Original comment by yuwenbin...@gmail.com on 10 Dec 2010 at 3:14

GoogleCodeExporter commented 9 years ago
This is my setting.
Remote Storage(XDMS)
Base URI(xcap-root):https://xcap.sipthor.net/xcap-root
XUI: sip:xxxxxxx@sip2sip.info
Password:xxxxxxx

Original comment by yuwenbin...@gmail.com on 10 Dec 2010 at 3:26

GoogleCodeExporter commented 9 years ago
By the way,I run IMSDroid on the emulator.  2.5G network.

Original comment by yuwenbin...@gmail.com on 10 Dec 2010 at 5:20

GoogleCodeExporter commented 9 years ago
You have the answer in your log: TLS is not supported.

Original comment by boss...@yahoo.fr on 10 Dec 2010 at 7:36

GoogleCodeExporter commented 9 years ago
I mean IMSDroid is not built with OpenSSL => you will not be able to query 
"https://" urls. You can only have access to "htt://" websites.

Original comment by boss...@yahoo.fr on 10 Dec 2010 at 7:53

GoogleCodeExporter commented 9 years ago
Er,what should I do fot supporting TLS?

Original comment by yuwenbin...@gmail.com on 10 Dec 2010 at 9:01

GoogleCodeExporter commented 9 years ago
In another word,what should I do to send Xcap Message?

Original comment by yuwenbin...@gmail.com on 10 Dec 2010 at 9:03

GoogleCodeExporter commented 9 years ago
You can rebuild doubango with OpenSSL but it's a bit complex. The easiest 
solutin is to use another xcap server which doesn't require TLS.

Original comment by boss...@yahoo.fr on 10 Dec 2010 at 9:39

GoogleCodeExporter commented 9 years ago
Setting as follow?
Remote Storage(XDMS)
Base URI(xcap-root):http://xcap.sipthor.net/xcap-root 
(https://xcap.sipthor.net/xcap-root)
XUI: sip:xxxxxxx@sip2sip.info
Password:xxxxxxx

Original comment by yuwenbin...@gmail.com on 10 Dec 2010 at 11:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,Dear boss...@yahoo.fr
   How do get the current input state by the Xcap protocol.
   for example:
   There are two users(User1 and User2) and have already registered on the server. When User1 input the message that will send to User2, User2 if know the current state of input of User1.
   If it's possible. How do this? What steps is required?
   Looking forward to your reply.Thank you very much.

Original comment by yangziji...@gmail.com on 2 Mar 2011 at 9:52

GoogleCodeExporter commented 9 years ago

Original comment by boss...@yahoo.fr on 23 Jul 2011 at 5:06