Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Getting Bill Seconds in Lua


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
alexanderhenryperkins ...
Guest





PostPosted: Tue May 03, 2022 12:13 pm    Post subject: [Freeswitch-users] Getting Bill Seconds in Lua Reply with quote

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
Back to top
joel at textplus.com
Guest





PostPosted: Tue May 03, 2022 12:44 pm    Post subject: [Freeswitch-users] Getting Bill Seconds in Lua Reply with quote

Have you tried with: 

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






On Tue, May 3, 2022 at 9:53 AM Alexander Perkins <alexanderhenryperkins@gmail.com (alexanderhenryperkins@gmail.com)> wrote:

Quote:
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

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
Back to top
covici at ccs.covici.com
Guest





PostPosted: Tue May 03, 2022 5:59 pm    Post subject: [Freeswitch-users] Getting Bill Seconds in Lua Reply with quote

I think its not available there, its only in the csv that you get
after the call is done, so it may be in your database, if you create
one.

On Tue, 03 May 2022 13:23:56 -0400,
Joel Serrano wrote:
Quote:

[1 <multipart/alternative (7bit)>]
[1.1 <text/plain; UTF-8 (7bit)>]
Have you tried with:

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


On Tue, May 3, 2022 at 9:53 AM Alexander Perkins <
alexanderhenryperkins@gmail.com> wrote:

Quote:
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
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time
https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
[1.2 <text/html; UTF-8 (quoted-printable)>]
[2 <text/plain; utf-8 (base64)>]
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com

--
Your life is like a penny. You're going to lose it. The question is:
How do
you spend it?

John Covici wb2una
covici@ccs.covici.com

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
Back to top
joel at textplus.com
Guest





PostPosted: Tue May 03, 2022 9:27 pm    Post subject: [Freeswitch-users] Getting Bill Seconds in Lua Reply with quote

Then you might be missing this before the api_hangup_hook:

<action application="set" data="session_in_hangup_hook=true"/>











On Tue, May 3, 2022 at 3:43 PM John Covici <covici@ccs.covici.com (covici@ccs.covici.com)> wrote:

Quote:
I think its not available there, its only in the csv that you get
after the call is done, so it may be in your database, if you create
one.

On Tue, 03 May 2022 13:23:56 -0400,
Joel Serrano wrote:
Quote:

[1  <multipart/alternative (7bit)>]
[1.1  <text/plain; UTF-8 (7bit)>]
Have you tried with:

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


On Tue, May 3, 2022 at 9:53 AM Alexander Perkins <
alexanderhenryperkins@gmail.com (alexanderhenryperkins@gmail.com)> wrote:

Quote:
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
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time
https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
[1.2  <text/html; UTF-8 (quoted-printable)>]
[2  <text/plain; utf-8 (base64)>]
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com

--
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         covici@ccs.covici.com (covici@ccs.covici.com)

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
Back to top
krice at freeswitch.org
Guest





PostPosted: Wed May 04, 2022 12:10 pm    Post subject: [Freeswitch-users] Getting Bill Seconds in Lua Reply with quote

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@lists.freeswitch.org> On Behalf Of Alexander Perkins
Sent: Tuesday, May 3, 2022 11:52 AM
To: freeswitch-users@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
Back to top
jprangi at gmail.com
Guest





PostPosted: Wed May 04, 2022 6:51 pm    Post subject: [Freeswitch-users] Getting Bill Seconds in Lua Reply with quote

Did you check the Nibblebill module?


-jai



On Tue, May 3, 2022 at 7:01 PM Joel Serrano <joel@textplus.com (joel@textplus.com)> wrote:

Quote:
Then you might be missing this before the api_hangup_hook:

<action application="set" data="session_in_hangup_hook=true"/>











On Tue, May 3, 2022 at 3:43 PM John Covici <covici@ccs.covici.com (covici@ccs.covici.com)> wrote:

Quote:
I think its not available there, its only in the csv that you get
after the call is done, so it may be in your database, if you create
one.

On Tue, 03 May 2022 13:23:56 -0400,
Joel Serrano wrote:
Quote:

[1  <multipart/alternative (7bit)>]
[1.1  <text/plain; UTF-8 (7bit)>]
Have you tried with:

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


On Tue, May 3, 2022 at 9:53 AM Alexander Perkins <
alexanderhenryperkins@gmail.com (alexanderhenryperkins@gmail.com)> wrote:

Quote:
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
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time
https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
[1.2  <text/html; UTF-8 (quoted-printable)>]
[2  <text/plain; utf-8 (base64)>]
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com

--
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici wb2una
         covici@ccs.covici.com (covici@ccs.covici.com)

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services