<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi All,<br>
    <br>
    I've got a problem with Kamailio 3.3.2-1.1 on CentOS 6.3 with
    locally postgresql 8.4.13-1.el6_3 libraries, connected to a remote
    postgresql91-9.1.6-1PGDP.rhel6 server<br>
    <br>
    The presence module tries to insert a record in the presentity
    table, with some xml in the body column.<br>
    But the body value in the postgresql table is not represented as a
    string '&lt;?xml ...etc' But encodes as
'\x3c3f786d6c2076657273696f6e3d27312e302720656e636f64696e673d275554462...etc'<br>
    <br>
    This gives problems when the presense module is trying to send out a
    notify based on the value in the database.<br>
    With debugging, this gives the error:<br>
    Entity: line 1: parser error : Start tag expected, '&lt;' not found<br>
x3c3f786d6c2076657273696f6e3d27312e302720656e636f64696e673d275554462d38273f3e3c<br>
    <br>
    The \x in front of the hex encodes string is not properly
    interpreted by postgresql or kamailio.<br>
    <br>
    The body column of the table presentity is a bytea column, and I
    believe postgresql 9 outputs these bytea columns a bit differently
    then postgresql 8.<br>
    <br>
    When I try to run the sql statement:<br>
    <br>
    insert into presentity
    (domain,username,event,etag,sender,body,received_time,expires )
    values
    ('newsip.lifexs.nl','00086','presence','a.1352107949.18632.27.0','','&lt;?xml
    version=''1.0'' encoding=''UTF-',1343534532,1345213723)<br>
    <br>
    On the postgresql 9.1 server locally, I still get the
    '\x3c3f786d6c... etc' value in the database.<br>
    <br>
    The bytea_output setting in postgresql 9 is now standard set to
    'hex' in stead of escape.<br>
    <br>
    I've changed the bytea_output setting in postgresql.conf to
    'escape', and then the presence is working without any issues.<br>
    <br>
    So maybe the database module of postgresql has to be changed to pick
    up these bytea encodings properly?<br>
    Because i think kamailio should work correctly with the default
    postgresql settings.<br>
    <br>
    With kind regards,<br>
    Robert Verspuy<br>
    <br>
    <div class="moz-signature">-- <br>
      <b>Exa-Omicron</b><br>
      Eenspan 8-K<br>
      3897 AL Zeewolde<br>
      <a class="moz-txt-link-freetext" href="http://exa.nl">http://exa.nl</a></div>
  </body>
</html>