[OpenSIPS-Users] bogus to header in rls subscribe
Juha Heinanen
jh at tutpro.com
Fri Jun 11 21:13:58 CEST 2010
Juha Heinanen writes:
> i then went to see how multipart body is generated and found that its
> parts are taken from rls_presentity table and indeed start value is
> bogus already there:
>
> -- Dumping data for table `rls_presentity`
>
> INSERT INTO `rls_presentity` (`id`, `rlsubs_did`, `resource_uri`, `content_type`
> , `presence_state`, `expires`, `updated`, `auth_state`, `reason`) VALUES
> (12, '5r-2-hdkX6N0GsQLtLWjvnOJZFNP6O-h;ka03rLGY7hep5k4keaKfAaHGIYeTB6rV;48de7c3c
> b9f0a00e953b10ae4e49e9de-70fc', 'sip:test-buddies at test.fi', 'multipart/related;t
> ype="application/rlmi+xml";start="<1276274962', ....
ok, i found the bug. it is not in the code, but in rls_presentity table
schema! content_type column is simply too short. for some reason,
schema specifies length of the field to be &domain_len;
<column>
<name>content_type</name>
<type>string</type>
<size>&domain_len;</size>
<description>Event</description>
</column>
which results in 64 chars:
CREATE TABLE rls_presentity (
id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
rlsubs_did CHAR(255) NOT NULL,
resource_uri CHAR(128) NOT NULL,
content_type CHAR(64) NOT NULL,
and 64 chars is this much:
multipart/related;type="application/rlmi+xml";start="<1276282927
could someone please fix the schema and also it would be nice if the
extra space could be eliminated like i suggested earlier (see below).
-- juha
by the way, i think there is a an extra space after ;start= in the
original version:
Content-Type: multipart/related;type="application/rlmi+xml";start= "<127550059\r\n\r\n
the code is this:
memcpy(p, ";start= \"<", 10);
i changed it to
memcpy(p, ";start=\"<", 9);
which eliminated the extra space.
More information about the Users
mailing list