little hangup problem - prepaid application
hello i try to implement a prepaid application and mod_nibblebill isn't my first choice. the implementation is quite ok so far. now my problem: - the call setup is normal (a little scripting) - the calls get ended by sched_hangup (max duration of calls) - then i would like to execute a script with api_hangup_hook in this last script i would also like to use some channel vars (a-number, call duration after answer) but i can't do that i try to use an outbound event socket script but i couldn't get the variables/information i need to calculate the amount charge any hint here br -- Ing. Christian Löschenkohl Technische Leitung, Forschung & Entwicklung VoIP xpirio Telekommunikation & Service GmbH Lakeside B04 9020 Klagenfurt Austria T +43 (0) 5 77 11 - 1000 F +43 (0) 5 77 11 - 1002 E christian.loeschenkohl@xpirio.com
To my experience most of "interesting" billing-related variables are created not when channel is hung up, but later, when channel enters REPORTING state. I use mod_cdr_csv to access these variables: cdr_csv.conf.xml: <param name="default-template" value="lua"/> <template name="lua">${lua(onhangup.lua)}</template> onhangup.lua script accesses required variables like "billsec", does final calculations and writes CDR to DB. On Monday 25 January 2010, Christian Löschenkohl wrote:
hello
i try to implement a prepaid application and mod_nibblebill isn't my first choice. the implementation is quite ok so far. now my problem:
- the call setup is normal (a little scripting) - the calls get ended by sched_hangup (max duration of calls) - then i would like to execute a script with api_hangup_hook in this last script i would also like to use some channel vars (a-number, call duration after answer) but i can't do that
i try to use an outbound event socket script but i couldn't get the variables/information i need to calculate the amount charge
any hint here
br
I am new to Freeswitch and I am interested in how it works. When the record is sent to the lua program what format is it sent in? Are the details sent like parameters on the command line like script_lua -calleridname=XXXXXX --caller_id_number=XXXXXXX --start_stamp=XXXXXX ...? On looking at the template as well, how is the SQL configured? <template name="sql">INSERT INTO cdr VALUES ("${caller_id_name}","${caller_id_number}","${destination_number}","${context}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${billsec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}");</template> Is it a matter of configuring with the 2010/1/25 Sergey Okhapkin <sos@sokhapkin.dyndns.org>:
To my experience most of "interesting" billing-related variables are created not when channel is hung up, but later, when channel enters REPORTING state. I use mod_cdr_csv to access these variables:
cdr_csv.conf.xml:
<param name="default-template" value="lua"/>
<template name="lua">${lua(onhangup.lua)}</template>
onhangup.lua script accesses required variables like "billsec", does final calculations and writes CDR to DB.
On Monday 25 January 2010, Christian Löschenkohl wrote:
hello
i try to implement a prepaid application and mod_nibblebill isn't my first choice. the implementation is quite ok so far. now my problem:
- the call setup is normal (a little scripting) - the calls get ended by sched_hangup (max duration of calls) - then i would like to execute a script with api_hangup_hook in this last script i would also like to use some channel vars (a-number, call duration after answer) but i can't do that
i try to use an outbound event socket script but i couldn't get the variables/information i need to calculate the amount charge
any hint here
br
_______________________________________________ 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 http://www.freeswitch.org
-- Frank Church ======================= <a href="http://devblog.brahmancreations.com">devblog.brahmancreations.com</a>
No record is sent to the script, but the script has access to all channel variables. On Monday 25 January 2010, Frank Church wrote:
I am new to Freeswitch and I am interested in how it works. When the record is sent to the lua program what format is it sent in?
Are the details sent like parameters on the command line like
script_lua -calleridname=XXXXXX --caller_id_number=XXXXXXX --start_stamp=XXXXXX ...?
On looking at the template as well, how is the SQL configured?
<template name="sql">INSERT INTO cdr VALUES ("${caller_id_name}","${caller_id_number}","${destination_number}","${conte xt}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${bill sec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}");</template>
Is it a matter of configuring with the
2010/1/25 Sergey Okhapkin <sos@sokhapkin.dyndns.org>:
To my experience most of "interesting" billing-related variables are created not when channel is hung up, but later, when channel enters REPORTING state. I use mod_cdr_csv to access these variables:
cdr_csv.conf.xml:
<param name="default-template" value="lua"/>
<template name="lua">${lua(onhangup.lua)}</template>
onhangup.lua script accesses required variables like "billsec", does final calculations and writes CDR to DB.
On Monday 25 January 2010, Christian Löschenkohl wrote:
hello
i try to implement a prepaid application and mod_nibblebill isn't my first choice. the implementation is quite ok so far. now my problem:
- the call setup is normal (a little scripting) - the calls get ended by sched_hangup (max duration of calls) - then i would like to execute a script with api_hangup_hook in this last script i would also like to use some channel vars (a-number, call duration after answer) but i can't do that
i try to use an outbound event socket script but i couldn't get the variables/information i need to calculate the amount charge
any hint here
br
_______________________________________________ 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 http://www.freeswitch.org
That is new to me, does that mean that all the languages linked in with Freeswitch have access to the events and variables in FS at all times? Can you link me to the documenation that describes this part in more detail and some examples? 2010/1/26 Sergey Okhapkin <sos@sokhapkin.dyndns.org>:
No record is sent to the script, but the script has access to all channel variables.
On Monday 25 January 2010, Frank Church wrote:
I am new to Freeswitch and I am interested in how it works. When the record is sent to the lua program what format is it sent in?
Are the details sent like parameters on the command line like
script_lua -calleridname=XXXXXX --caller_id_number=XXXXXXX --start_stamp=XXXXXX ...?
On looking at the template as well, how is the SQL configured?
<template name="sql">INSERT INTO cdr VALUES ("${caller_id_name}","${caller_id_number}","${destination_number}","${conte xt}","${start_stamp}","${answer_stamp}","${end_stamp}","${duration}","${bill sec}","${hangup_cause}","${uuid}","${bleg_uuid}", "${accountcode}");</template>
Is it a matter of configuring with the
2010/1/25 Sergey Okhapkin <sos@sokhapkin.dyndns.org>:
To my experience most of "interesting" billing-related variables are created not when channel is hung up, but later, when channel enters REPORTING state. I use mod_cdr_csv to access these variables:
cdr_csv.conf.xml:
<param name="default-template" value="lua"/>
<template name="lua">${lua(onhangup.lua)}</template>
onhangup.lua script accesses required variables like "billsec", does final calculations and writes CDR to DB.
On Monday 25 January 2010, Christian Löschenkohl wrote:
hello
i try to implement a prepaid application and mod_nibblebill isn't my first choice. the implementation is quite ok so far. now my problem:
- the call setup is normal (a little scripting) - the calls get ended by sched_hangup (max duration of calls) - then i would like to execute a script with api_hangup_hook in this last script i would also like to use some channel vars (a-number, call duration after answer) but i can't do that
i try to use an outbound event socket script but i couldn't get the variables/information i need to calculate the amount charge
any hint here
br
_______________________________________________ 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 http://www.freeswitch.org
_______________________________________________ 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 http://www.freeswitch.org
-- Frank Church ======================= <a href="http://devblog.brahmancreations.com">devblog.brahmancreations.com</a>
http://wiki.freeswitch.org/wiki/Lua is a good place to start. On Jan 25, 2010, at 11:34 PM, Frank Church wrote:
That is new to me, does that mean that all the languages linked in with Freeswitch have access to the events and variables in FS at all times?
Can you link me to the documenation that describes this part in more detail and some examples?
2010/1/26 Sergey Okhapkin <sos@sokhapkin.dyndns.org>:
No record is sent to the script, but the script has access to all channel variables.
On Monday 25 January 2010, Frank Church wrote:
I am new to Freeswitch and I am interested in how it works. When the record is sent to the lua program what format is it sent in?
Frank Church
participants (4)
-
Christian Löschenkohl
-
Frank Church
-
Michael Jerris
-
Sergey Okhapkin