Author Topic: update database table with called number of calls with < 120 sec duration  (Read 472 times)

hamtrix

  • Newbie
  • *
  • Posts: 3
    • View Profile
Hi
The script works as it expected except in call.cdr, which is supposed to update a table in database with the called number of the calls with duration less than 120 second, the finished calls of calls of course, but it update the table the table once the call starts and of course its duration is less than 120 second at the start time.

asymetrixs

  • Administrator
  • Newbie
  • *****
  • Posts: 41
    • View Profile
Re: update database table with called number of calls with < 120 sec duration
« Reply #1 on: February 05, 2017, 06:31:53 AM »
I dont understand what you are trying to do.

Do you want the script to update ALL cdrs or just the one for the current channel the script is working on?
If you want to update a cdr record only if the call has finished, then wait until the cdr.finalize message is sent. If you receive this, you can flag the call as ended and perform post operations (run an sql or something like that) on the database record.