[Freeswitch-users] Getting Bill Seconds in Lua

krice at freeswitch.org krice at freeswitch.org
Wed May 4 16:49:51 UTC 2022


Please tell me you arent doing billing in the a hangup hook with lua. 

 

You pretty much have to set the session to zombie mode and the session will not die until your billing run is completed.  This will also cause other excessive load in FreeSWITCH possibly leading to hung channels in the event of any failure down the chain.

 

You are far better off doing billing (or just post call handling in general)  via xml or json cdrs and they will auto trigger your external billing via http post. You can also have them drop a file per call (or call leg) to the filesystem to make sure you don’t miss billing a call and leave open sessions all over your switch.

 

 

From: FreeSWITCH-users <freeswitch-users-bounces at lists.freeswitch.org> On Behalf Of Alexander Perkins
Sent: Tuesday, May 3, 2022 11:52 AM
To: freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] Getting Bill Seconds in Lua

 

Hi All.  I am trying to access the billmsec from lua, but not being very successful at it.  Here's what I've done so far:

 

freeswitch.consoleLog("info", "Billable Duration: " .. session:getVariable("variable_billmsec"));

 

However, when I look at the cli, I get an error because it is nil.  I am calling this script from the api_hangup_hook.

 

Any suggestions?

 

Thank you,

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20220504/224123f3/attachment.html>


More information about the FreeSWITCH-users mailing list