[OpenSIPS-Devel] Interaction with Mobicents XDMS

Iñaki Baz Castillo ibc at aliax.net
Wed Aug 5 12:25:18 CEST 2009


El Miércoles, 5 de Agosto de 2009, Andaleeb Roomy escribió:
> > I don't see issues in the response. Well, I see one: "Content-Type"
> > includes a parameter "charset" different than UTF-8, while RFC 4825
> > (XCAP) requires UTF-8 for all the documents.
>
> I was finally able to find where the error was occurring. It was not
> the charset.
>
> libcurl doc says that if the callback function set by
> CURLOPT_WRITEFUNCTION returns a value that differs from the amount of
> data passed the function, it will signal an error. The same applies
> for CURLOPT_HEADERFUNCTION. This was happening in my case because
> get_xcap_etag in xcap_functions.c was returning a different value
> because of deducting ETAG_HDR_LEN from size*nmemb.
> 	int len= 0;
>         .
>         .
> 	if(strncasecmp(ptr, ETAG_HDR, ETAG_HDR_LEN)== 0)
> 	{
> 		len= size* nmemb- ETAG_HDR_LEN;
>                .
>                .
> 	}
> 	return len;
>
>
> Same thing happened with write_function returning buff->len instead of
> size*nmemb. buff->len may have been right in case this callback was
> called only once with all the data of the message body, but in
> reality, it is called whenever libcurl thinks that some data needs to
> saved, according to libcurl doc. In this case, buff->len was returning
> the aggregate length of the message which differs from the size*nmemb
> of a single call.
>
>
>
> I also found issues with pointers, like passing &etag instead of just
> etag, which is already a char**, as CURLOPT_WRITEHEADER. This was
> causing the etag to be written in a wrong location.
> 	..
> 	curl_easy_setopt(curl_handle, CURLOPT_WRITEHEADER, &etag);
> 	..
>
>
>
> I guess OpenSIPS presence modules need to be developed and tested more
> to work with third party XDMSs and clients. Currently I am facing a
> difficulty because it does not follow resource-list childs under
> services element in an rls-services doc. This is required to subscribe
> to all the presentities of a presence list set by Mercuro IMS client.


Please, report a bug in the tracker. It's interesting.


-- 
Iñaki Baz Castillo <ibc at aliax.net>



More information about the Devel mailing list