On 07/21/2011 05:00 PM, Roberto Fichera wrote:
On 07/21/2011 01:55 PM, Klaus Darilion wrote:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b39747e213e350609761d14583db3e689ad6fefc

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=403ba772771545f4410ba4a5cf396125be353b12

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=460fc8bf6ad5108ff3779c85ff150e4f5145b189
I've applied all the listed patches than regenerated and installed
the rpms and set back to not null the sender constraint in the db.
After restarting kamailio I'm still getting the problem as before.

Mmmhhh! The sender still null, but after removing the not null constraint again
from the sender field, I just see another problem:

Jul 21 17:02:37 roberto /usr/sbin/kamailio[24781]: ERROR: presence [subscribe.c:711]: Missing or unsupported event header field value
Jul 21 17:02:37 roberto /usr/sbin/kamailio[24781]: ERROR: presence [subscribe.c:714]: #011event= message-summary
Jul 21 17:02:37 roberto /usr/sbin/kamailio[24780]: ERROR: db_postgres [km_dbase.c:427]: invalid query, execution aborted
Jul 21 17:02:37 roberto /usr/sbin/kamailio[24780]: ERROR: db_postgres [km_dbase.c:428]: driver error: PGRES_FATAL_ERROR, ERROR:  null value in column "expires" violates not-null constraint#012

so since the expires isn't present in the same query than the db trigger the
not null problem. New query is below:

ERROR:  null value in column "expires" violates not-null constraint
STATEMENT:  insert into presentity (domain,username,event,etag,sender,body,received_time ) values ('192.168.2.92','roberto','presence','a.1311260173.24780.4.0','','<?xml version="1.0" encoding="UTF-8" standalone="no"?><presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="sip:roberto@192.168.2.92"><dm:person id="p3387"><rpid:activities/></dm:person><tuple id="t8698"><status><basic>open</basic></status><contact>sip:roberto@192.168.2.92</contact><note>Online</note></tuple></presence>',1311260557)



Am 21.07.2011 13:13, schrieb Roberto Fichera:
On 07/21/2011 08:21 AM, Daniel-Constantin Mierla wrote:
Hello,

indeed there was some inconsistency. I just committed a patch to store
empty string if the sender parameter is not set. That for the fact
that later (about line 450) there is a query and the sender value is
taken from db and strlen used. All over, these checks are used for
SLA/BLA case.
Could you please send me the diff so that I can apply it to my local v3.1.4
for rebuilding the rpms?

Cheers,
Daniel

On 7/20/11 7:00 PM, Bucur Marius wrote:
Hi,

It think there is something wrong with the sql scripts, hence the
code obviously accepts a null sender.

presentity.c:357
if( presentity->sender)
{
query_cols[n_query_cols] = &str_sender_col;
query_vals[n_query_cols].type = DB1_STR;
query_vals[n_query_cols].nul = 0;
query_vals[n_query_cols].val.str_val.s = presentity->sender->s;
query_vals[n_query_cols].val.str_val.len = presentity->sender->len;
n_query_cols++;
}

>From a logical point of view, I believe the sender should not be
mandatory hence it could be generated by a machine - whose
identity/location is not needed.

Regards,
Marius

------------------------------------------------------------------------
*From:* Daniel-Constantine Mierla <miconda@gmail.com>
*To:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER)
-Users Mailing List <sr-users@lists.sip-router.org>
*Cc:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
UsersMailing List <sr-users@lists.sip-router.org>
*Sent:* Wednesday, July 20, 2011 6:53 PM
*Subject:* Re: [SR-Users] Kamailio presence server problem with
PostgreSQL

Hello,

Thanks for troubleshooting further. What intrigues me is that the
error message from syslog is printed from store result function,
which is used after doing a select query. So something else might
have to be reviewed as well.

Anyhow, missing sender value should be checked, since it is a
constraint for non-null. Interesting it was not risen with mysql.

Cheers,
Daniel

On Jul 20, 2011, at 5:46 PM, Roberto Fichera <kernel@tekno-soft.it
<mailto:kernel@tekno-soft.it>> wrote:

On 07/20/2011 05:34 PM, Roberto Fichera wrote:
On 07/20/2011 05:18 PM, Klaus Darilion wrote:
Am 20.07.2011 17:00, schrieb Roberto Fichera:
ERROR:  null value in column "sender" violates not-null constraint
STATEMENT:  insert into presentity
(domain,username,event,etag,expires,body,received_time ) values

('192.168.2.92','roberto','presence','a.1311173612.4970.2.0',1311177224,'<?xml
version="1.0" encoding="UTF-8" standalone="no"?><presence
xmlns="urn:ietf:params:xml:ns:pidf"
xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model"
xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid"
entity="sip:roberto@192.168.2.92"><dm:person
id="p3619"><rpid:activities/></dm:person><tuple

id="t9285"><status><basic>open</basic></status><contact>sip:roberto@192.168.2.92</contact><note>Online</note></tuple></presence>',1311173624)
Seems like the statement does not insert the "sender" although it is
mandatory. If "sender" is really mandatory, then it seems the
statement
is buggy.
how does look the corresponding presentity mysql table, does it
has the same
constraint or not?
Anyway I can confirm that removing the constraint the problem
of presence backed by postgresql seems solved.

regards
Klaus

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
mailing list
sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list
sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- http://www.asipto.com
Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat
http://linkedin.com/in/miconda -- http://twitter.com/miconda


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users