[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeswitch-users
Subject:    [Freeswitch-users] Help with lua and channel variable processing
From:       lcm () marshap ! com (Larry Marshall)
Date:       2009-05-31 16:50:07
Message-ID: 000701c9e20f$da8759a0$8f960ce0$ () com
[Download RAW message or body]

I would like to process the ${billsec} variable in the
conf/autoload_configs/cdr_csv.conf.xml file below, returning a different
value for the INSERT command.

 

I already have written a lua function which takes an integer value from
${billsec} and returns a string. It is stored in freeswitch/scripts as
sec2time.lua.

 

Do I change the sql template below to ., ${lua(billsec)}, .?

 

  <configuration name="cdr_csv.conf" description="CDR CSV Format">

    <settings>

      <param name="default-template" value="sql"/>

      <param name="rotate-on-hup" value="true"/>

      <param name="legs" value="a"/>

    </settings>

   <templates>

      <template name="sql">INSERT INTO cdr VALUES
("${caller_id_name}","${caller_id_number}","${destination_number}","${contex
t}"

 
,"${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}
",...

  </templates>

 </configuration>

 

Thanks, Lars

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090531/756ba9f6/attachment.html \



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic