Using version 1.5.2.
Trying to migrate acc from db_mysql to db_flatstore to reduce io wait during heavy dialing.
However, the default time format changes from normal YYYY-MM-DD hh:mm:ss to unixtime (I think) in flatstore. I tried using $TF but its format is even more non-standard.
Is there a way to change time format for either the default acc time field in the db_flatstore module or $TF so I can 'LOAD DATA' into mysql as datetime?
Thanks, Matt
I'm trying to manually build a time value to send as a db_extra field.
This seems like it should work according to the wiki example, but I'm getting a syntax error.
Script variable:
$var(reg_time) = $time(year); ### + "-" + $time(mon) + "-" + $time(mday) + " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
Error from kamailio:
ERROR:core:eval_elem: invalid numeric operands
Any suggestions?
Thanks, Matt
ps. Sorry for the multiple posts - it seems the list mailer may be stalled a bit.
On 8/5/2010 1:24 PM, SIP Projects wrote:
Using version 1.5.2.
Trying to migrate acc from db_mysql to db_flatstore to reduce io wait during heavy dialing.
However, the default time format changes from normal YYYY-MM-DD hh:mm:ss to unixtime (I think) in flatstore. I tried using $TF but its format is even more non-standard.
Is there a way to change time format for either the default acc time field in the db_flatstore module or $TF so I can 'LOAD DATA' into mysql as datetime?
Thanks, Matt
doh!
here is the actual variable i'm trying to hack together:
$var(reg_time) = $time(year) + "-" + $time(mon) + "-" + $time(mday) + " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
On 8/5/2010 3:29 PM, SIP Projects wrote:
Script variable:
$var(reg_time) = $time(year); ### + "-" + $time(mon) + "-" + $time(mday)
- " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
On Thursday 05 August 2010, SIP Projects wrote:
doh!
here is the actual variable i'm trying to hack together:
$var(reg_time) = $time(year) + "-" + $time(mon) + "-" + $time(mday)
- " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
Hi Matt,
with regards to your first question, about changing the value in the flatstore module, its of course possible to just change the code of the database module.
I've tried your script variable in current git master, here it works (with some casting warnings..), and also in 1.5.2, where i could reproduce it:
Aug 9 17:43:20 [987] ERROR:core:eval_elem: invalid numeric operands Aug 9 17:43:20 [987] ERROR:core:do_assign: no value in right expression Aug 9 17:43:20 [987] ERROR:core:do_assign: error at line: 30
So the issue is that the script interpreter can not concat the time values (which are int only) to the string seperators. As i workaround i've tried to start with an empty string in the var:
$var(reg_time) = "" + $time(year) + "-" + $time(mon) + "-" + $time(mday) + " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
this seems to work:
Entering Route TEST 2010-8-9 18:8:0
Cheers,
Henning
Hello,
On 8/9/10 6:13 PM, Henning Westerholt wrote:
On Thursday 05 August 2010, SIP Projects wrote:
doh!
here is the actual variable i'm trying to hack together:
$var(reg_time) = $time(year) + "-" + $time(mon) + "-" + $time(mday)
- " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
Hi Matt,
with regards to your first question, about changing the value in the flatstore module, its of course possible to just change the code of the database module.
I've tried your script variable in current git master, here it works (with some casting warnings..), and also in 1.5.2, where i could reproduce it:
Aug 9 17:43:20 [987] ERROR:core:eval_elem: invalid numeric operands Aug 9 17:43:20 [987] ERROR:core:do_assign: no value in right expression Aug 9 17:43:20 [987] ERROR:core:do_assign: error at line: 30
So the issue is that the script interpreter can not concat the time values (which are int only) to the string seperators. As i workaround i've tried to start with an empty string in the var:
$var(reg_time) = "" + $time(year) + "-" + $time(mon) + "-" + $time(mday) + " "
- $time(hour) + ":" + $time(min) + ":" + $time(sec);
this seems to work:
Entering Route TEST 2010-8-9 18:8:0
for the record: there is a function called pv_printf("$pv", "formatted string").
So it can be:
pv_printf("$var(reg_time)", "$time(year)-$time(mon)-$time(mday) $time(hour):$time(min):$time(sec)");
First parameter can be any PV that is writable and can hold string values, second is a string with variables evaluated at runtime: http://kamailio.org/docs/modules/stable/modules_k/kex.html#id2976738
Cheers, Daniel
On 8/9/2010 2:33 PM, Daniel-Constantin Mierla wrote:
Hello,
On 8/9/10 6:13 PM, Henning Westerholt wrote:
On Thursday 05 August 2010, SIP Projects wrote:
doh!
here is the actual variable i'm trying to hack together:
$var(reg_time) = $time(year) + "-" + $time(mon) + "-" + $time(mday)
- " " + $time(hour) + ":" + $time(min) + ":" + $time(sec);
Hi Matt,
with regards to your first question, about changing the value in the flatstore module, its of course possible to just change the code of the database module.
I've tried your script variable in current git master, here it works (with some casting warnings..), and also in 1.5.2, where i could reproduce it:
Aug 9 17:43:20 [987] ERROR:core:eval_elem: invalid numeric operands Aug 9 17:43:20 [987] ERROR:core:do_assign: no value in right expression Aug 9 17:43:20 [987] ERROR:core:do_assign: error at line: 30
So the issue is that the script interpreter can not concat the time values (which are int only) to the string seperators. As i workaround i've tried to start with an empty string in the var:
$var(reg_time) = "" + $time(year) + "-" + $time(mon) + "-" + $time(mday) + " "
- $time(hour) + ":" + $time(min) + ":" + $time(sec);
this seems to work:
Entering Route TEST 2010-8-9 18:8:0
for the record: there is a function called pv_printf("$pv", "formatted string").
So it can be:
pv_printf("$var(reg_time)", "$time(year)-$time(mon)-$time(mday) $time(hour):$time(min):$time(sec)");
First parameter can be any PV that is writable and can hold string values, second is a string with variables evaluated at runtime: http://kamailio.org/docs/modules/stable/modules_k/kex.html#id2976738
Cheers, Daniel
Both very helpful pointers. Thanks very much!
Matt