Hi Martin,
I ran into the same issue (among many others) when I was trying to connect OpenSER to Oracle. I ended up changing code in the unixodbc module. Here is a patch you can try, at your own risk of course... This will work if you use unixodbc only with Oracle.
--- /usr/src/openser-1.2.x/modules/unixodbc/utils.c 2007-06-05 17:12:58.000000000 +0300 +++ utils.c 2007-06-07 14:18:36.000000000 +0300 @@ -46,7 +46,7 @@ struct tm* t;
t = localtime(&_time); - return strftime(_result, _res_len, "%Y-%m-%d %H:%M:%S", t); + return strftime(_result, _res_len, "to_date('%Y-%m-%d %H:%M:%S','YYYY-MM-DD HH24:MI:SS')", t); }
--- /usr/src/openser-1.2.x/modules/unixodbc/val.c 2007-06-05 17:12:58.000000000 +0300 +++ val.c 2007-06-07 15:07:00.000000000 +0300 @@ -157,10 +181,8 @@ return -1; }
- *_s++ = '''; l = time2odbc(_v, _s, *_l - 1); - *(_s + l) = '''; - *_l = l + 2; + *_l = l; return 0; }
Regards,
George
Date: Wed, 8 Aug 2007 09:01:10 +0200 From: Martin.Gruber1@infineon.com Subject: [OpenSER-Users] OpenSER Oracle Connection To: users@openser.org Message-ID:
2934B34075D2164BB8F95C3EB2C813D90205DDC6@mucse341.eu.infineon.com Content-Type: text/plain; charset="us-ascii"
Hi @all,
I want to run OpenSER with ORACLE Database. I use unixODBC and libsqora.so.10.1 to connect to the DB. But now I have problems with inserting Data in the DB. When OpenSER wants to add Data in the "location" table I always get an error because of the timeformat (expires, last_modified)
I use SQL*Plus Client in Windows and when I write the Connection String from OpenSER usrloc here, everything is running well, Because I did alter session set nls_date_format = 'YYYY-MM-DD HH24:MM:SS'; Is it a Driver problem?
Does anybody have a solution or experience with it?
Thanks
Martin
Disclaimer The information in this e-mail and any attachments is confidential. It is intended solely for the attention and use of the named addressee(s). If you are not the intended recipient, or person responsible for delivering this information to the intended recipient, please notify the sender immediately. Unless you are the intended recipient or his/her representative you are not authorized to, and must not, read, copy, distribute, use or retain this message or any part of it. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
Hi Georgios,
I only want to ask you, if you also use the LCR-Tool. With mysql it was running well, but now I have problems with it. I do not know, if it is a problem of Unixodbc (I do not think so).
I use the following table structure: Lcr:
PREFIX | FROM_URI | GRP_ID | PRIORITY | ------------------------------------------------------------------------ ------------------------------------------------------------- | | 1 | 1 |
Gw:
GW_NAME | GRP_ID | IP_ADDR | PORT | URI_SCHEME | TRANSPORT | STRIP | PREFIX ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------- Gw 1 xxx.xx.xxx.xx 5060
Gw_grp:
GRP_ID GRP_NAME ---------- ---------------------------------------------------------------- 1 VIH
I always get the following error: CALL: Call to international number sip:0004312345586@server.com from sip:1004@server.com 0(23072) LCR: no gateways found m=INVITE ruri=sip:0004312345586@server.com f=sip:1004@server.com t=sip:0004312345586@server.com ip=xxx.xx.xxx.xxx
My openser.cfg looks like this:
if (uri=~"sip:0[0-9]+@.*") { #authorize if a call is going to PSTN if(!proxy_authorize("", "subscriber")) { proxy_challenge("", "0"); return; }; xlog("L_INFO", "CALL: Call to international number <$ru> from <$fu>\n");
perl_exec("dialnr");
if(!load_gws()) { sl_send_reply("500", "Internal server error, unable to load phone gateways"); xlog("L_Info", "LCR: unable to load gateways\n"); exit; }
if(!next_gw()) { sl_send_reply("503", "Service not available, no gateways found"); xlog("L_Info", "LCR: no gateways found m=$rm ruri=$ru f=$fu t=$tu ip=$si id=$ci\n"); exit; };
Can you help me?
Thanks and regards
Martin