[SR-Users] Kamailio and Oracle database

Mele Giovanni giovanni.mele at nagra.com
Mon May 2 14:01:43 CEST 2016


Hello Daniel,

It seems oracle is expecting the body value converted as an hex string. i.e:

<?xml version="1.0" encoding="UTF-8"?><presence xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="sip:giovanni.mele at ims-nagra.test" xmlns="urn:ietf:params:xml:ns:pidf"> <tuple id="d5zdxq">  <status>   <basic>open</basic>  </status>  <contact priority="0.8">sip:giovanni.mele at ims-nagra.test</contact>  <timestamp>2016-05-02T11:06:54Z</timestamp> </tuple></presence>

Should be

3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c70726573656e636520786d6c6e733a646d3d2275726e3a696574663a706172616d733a786d6c3a6e733a706964663a646174612d6d6f64656c2220786d6c6e733a727069643d2275726e3a696574663a706172616d733a786d6c3a6e733a706964663a727069642220656e746974793d227369703a67696f76616e6e692e6d656c6540696d732d6e616772612e746573742220786d6c6e733d2275726e3a696574663a706172616d733a786d6c3a6e733a70696466223e203c7475706c652069643d2264357a647871223e20203c7374617475733e2020203c62617369633e6f70656e3c2f62617369633e20203c2f7374617475733e20203c636f6e74616374207072696f726974793d22302e38223e7369703a67696f76616e6e692e6d656c6540696d732d6e616772612e746573743c2f636f6e746163743e20203c74696d657374616d703e323031362d30352d30325431313a30363a35345a3c2f74696d657374616d703e203c2f7475706c653e3c2f70726573656e63653e

If I execute the following query in isql:

> insert into presentity (domain,username,event,etag,sender,body,received_time,priority,expires ) values ('ims-nagra.test','giovanni.mele','presence','a.1462186899.8822.1.0','','3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c70726573656e636520786d6c6e733a646d3d2275726e3a696574663a706172616d733a786d6c3a6e733a706964663a646174612d6d6f64656c2220786d6c6e733a727069643d2275726e3a696574663a706172616d733a786d6c3a6e733a706964663a727069642220656e746974793d227369703a67696f76616e6e692e6d656c6540696d732d6e616772612e746573742220786d6c6e733d2275726e3a696574663a706172616d733a786d6c3a6e733a70696466223e203c7475706c652069643d2264357a647871223e20203c7374617475733e2020203c62617369633e6f70656e3c2f62617369633e20203c2f7374617475733e20203c636f6e74616374207072696f726974793d22302e38223e7369703a67696f76616e6e692e6d656c6540696d732d6e616772612e746573743c2f636f6e746163743e20203c74696d657374616d703e323031362d30352d30325431313a30363a35345a3c2f74696d657374616d703e203c2f7475706c653e3c2f70726573656e63653e',1462187244,0,1462190844);

it works....

But if you convert it in hex string when inserting, I suppose you will have to do the reverse operation when reading it from the db...


Regards


Giovanni


From: sr-users [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla
Sent: lundi 2 mai 2016 13:57
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Kamailio and Oracle database


Hello,

I wrote in a previous email as well -- it seems that oracle doesn't like '\n' characters in the xml doc for presence. Can you check the docs for oracle and see if needs some special format in such case or maybe a special column definition? The xml is sent by the client, kamailio just has to store it in db.
Cheers,
Daniel
On 02/05/16 13:25, gmele wrote:

Hello,



it seems kamailio has a problem inserting a value in the oracle BLOB column

BODY in the PRESENTITY table.



I executed the command without the BLOB value and all is working fine. As

soon as I try to insert the BLOB, it fails.



Is there some incompatibility handling Oracle blobs?





Regards





Giovanni







--

View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148026.html

Sent from the Users mailing list archive at Nabble.com.



_______________________________________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--

Daniel-Constantin Mierla

http://www.asipto.com

http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160502/84cc763f/attachment.html>


More information about the sr-users mailing list