Pre-paid impossible with freeSwitch ?
Hello, I am trying to make a Pre-Paid or Advanced billing method for test. But i applied Javascript with FS. - In my test i am running calls for 3 or 4 hours - With a billing per minute of 10 US Dollar Now those calls balance is -200 or -300, how can i tell FS via javascript please kindly stop it because its crossing the limit. Is there any way to manage it ? Thanks & Regards
Did mod_nibblebill not meet your needs for some reason? -MC On Tue, Dec 14, 2010 at 11:45 AM, Shamun toha md <shamun.toha@gmail.com>wrote:
Hello,
I am trying to make a Pre-Paid or Advanced billing method for test. But i applied Javascript with FS.
- In my test i am running calls for 3 or 4 hours - With a billing per minute of 10 US Dollar
Now those calls balance is -200 or -300, how can i tell FS via javascript please kindly stop it because its crossing the limit.
Is there any way to manage it ?
Thanks & Regards
_______________________________________________ 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
Mod_nibblebill has this functionality. Give it a try. There's also schedule hangup, but if you have more than one channel open on the same account that will skew the numbers. The alternative is some sort of ESL application to handle that the multi-channel calculations. -Avi On Tue, Dec 14, 2010 at 10:02 PM, Michael Collins <msc@freeswitch.org>wrote:
Did mod_nibblebill not meet your needs for some reason? -MC
On Tue, Dec 14, 2010 at 11:45 AM, Shamun toha md <shamun.toha@gmail.com>wrote:
Hello,
I am trying to make a Pre-Paid or Advanced billing method for test. But i applied Javascript with FS.
- In my test i am running calls for 3 or 4 hours - With a billing per minute of 10 US Dollar
Now those calls balance is -200 or -300, how can i tell FS via javascript please kindly stop it because its crossing the limit.
Is there any way to manage it ?
Thanks & Regards
_______________________________________________ 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
Hello There, No the existing billing not solving my problem. Because of custom project, it for many channels when gets connected it becomes 1 call and then it needs to check the balance and also deduct the balance when the call is connected. If the balance is 0 or -0 FS trigger the call drop. I build the whole billing using Javascript but i cant find any resource where i can say while call running, allow me to negotiate with my alternative pipe line. Code example: ... connected call .. voice will now get freezed..... default: module = EYE_HELPER + "________FAIL__________"; break; } while(session.state == "CS_EXECUTE") { i++; if (i > 1000) { console_log('err', '.'); i=0; } // here i wanted to go to my BALANCE module, But whole fs_cli gets FREEZED. } Already tried those, but FS gets freezed: ======================== CS_NEW Channel is newly created. CS_INIT Channel has been initialized. CS_ROUTING Channel is looking for an extension to execute. CS_SOFT_EXECUTE Channel is ready to execute from 3rd party control. CS_EXECUTE Channel is executing its dialplan. CS_EXCHANGE_MEDIA Channel is exchanging media with another channel. CS_PARK Channel is accepting media awaiting commands. CS_CONSUME_MEDIA Channel is consuming all media and dropping it. CS_HIBERNATE Channel is in a sleep state. CS_RESET Channel is in a reset state. CS_HANGUP Channel is flagged for hangup and ready to end. Media will now end, and no further call routing will occur. CS_REPORTING The channel is already hung up, media is already down, and now it's time to do any sort of reporting processes such as CDR logging. CS_DESTROY Channel is ready to be destroyed and out of the state machine. Memory pools are returned to the core and utilized memory from the channel is freed. Please guide kindly.... Thanks & Regards
I have to say that statement right there is WRONG. You should never ever be doing billing inline like this and if you are you're doing it wrong. Just my advice here... you don't have to follow it you can take it with a grain of salt but if you really want to do this correctly then you had better learn C. /b On Dec 14, 2010, at 3:32 PM, Shamun toha md wrote:
I build the whole billing using Javascript
Line 577 ex: http://pastebin.freeswitch.org/14782 I need to have a background thread, to lookup my billing via CURL and deduct that live real time. How can i do that any suggestion plz. ** There are almost relative more 5,000 lines of codes and modules i wrote, when this module get passed. Looking forward for any tips or guides.... Thanks & Regards On Tue, Dec 14, 2010 at 10:34 PM, Brian West <brian@freeswitch.org> wrote:
I have to say that statement right there is WRONG. You should never ever be doing billing inline like this and if you are you're doing it wrong.
Just my advice here... you don't have to follow it you can take it with a grain of salt but if you really want to do this correctly then you had better learn C.
/b
On Dec 14, 2010, at 3:32 PM, Shamun toha md wrote:
I build the whole billing using Javascript
_______________________________________________ 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
Is there no scanner using crontab to connnect FS and trigger command uuid_drop uuid that i want to drop ? - How can i solve this using ? "SpiderMonkey" is there any patch to have the setTimeout() function alteast, which will be a scanner for my session.uuid's ??? On Tue, Dec 14, 2010 at 10:34 PM, Brian West <brian@freeswitch.org> wrote:
I have to say that statement right there is WRONG. You should never ever be doing billing inline like this and if you are you're doing it wrong.
Just my advice here... you don't have to follow it you can take it with a grain of salt but if you really want to do this correctly then you had better learn C.
/b
On Dec 14, 2010, at 3:32 PM, Shamun toha md wrote:
I build the whole billing using Javascript
_______________________________________________ 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
USE ESL http://wiki.freeswitch.org/wiki/ESL Le 14/12/2010 23:27, Shamun toha md a écrit :
Is there no scanner using crontab to connnect FS and trigger command uuid_drop uuid that i want to drop ?
- How can i solve this using ? "SpiderMonkey" is there any patch to have the setTimeout() function alteast, which will be a scanner for my session.uuid's ???
On Tue, Dec 14, 2010 at 10:34 PM, Brian West <brian@freeswitch.org <mailto:brian@freeswitch.org>> wrote:
I have to say that statement right there is WRONG. You should never ever be doing billing inline like this and if you are you're doing it wrong.
Just my advice here... you don't have to follow it you can take it with a grain of salt but if you really want to do this correctly then you had better learn C.
/b
On Dec 14, 2010, at 3:32 PM, Shamun toha md wrote:
> I build the whole billing using Javascript
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto: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
-- Meftah Tayeb inum: +883510001288000 Phone: +13602276297 Fax: +12538020313
If you can execute a system command then you could do something as simple as this: system('fs_cli -x "uuid_kill xxxxxxxx"') Where xxx is the uuid you want to hang up. Just so you know, the method you've chosen may have been somewhat easy to implement, it probably won't scale very well because you'll have a JS instance for every call that goes through this billing system. A few dozen calls won't be a problem, but if you intend to scale then I would recommend you look at creating a call control system written in C or use ESL (event socket library) to have a program connect to FS via TCP where you can control many hundreds of calls simultaneously and you can have your program connect to an external database, checking balances, etc. Just my two cents. -MC On Tue, Dec 14, 2010 at 2:27 PM, Shamun toha md <shamun.toha@gmail.com>wrote:
Is there no scanner using crontab to connnect FS and trigger command uuid_drop uuid that i want to drop ?
- How can i solve this using ? "SpiderMonkey" is there any patch to have the setTimeout() function alteast, which will be a scanner for my session.uuid's ???
On Tue, Dec 14, 2010 at 10:34 PM, Brian West <brian@freeswitch.org> wrote:
I have to say that statement right there is WRONG. You should never ever be doing billing inline like this and if you are you're doing it wrong.
Just my advice here... you don't have to follow it you can take it with a grain of salt but if you really want to do this correctly then you had better learn C.
/b
On Dec 14, 2010, at 3:32 PM, Shamun toha md wrote:
I build the whole billing using Javascript
_______________________________________________ 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
Today JS, does scale very well, when you use the techniques and knowledge below: How to scale JS ... Node.JS , MongoDB/CouchDB http://howtonode.org/node-and-mongo http://developer.yahoo.com/yui/theater/video.php?v=zakas-architecture JavaScript The Good Parts (D Crockford) http://oreilly.com/catalog/9780596517748 Event Faster WebSites (Steve Souder) http://oreilly.com/catalog/9780596522308/ -E Gpro.ws
Let me know when you have all that integrated into mod_spidermonkey. :) -MC On Tue, Dec 14, 2010 at 4:32 PM, EdPimentl <edpimentl@gmail.com> wrote:
Today JS, does scale very well, when you use the techniques and knowledge below:
How to scale JS ... Node.JS , MongoDB/CouchDB http://howtonode.org/node-and-mongo http://developer.yahoo.com/yui/theater/video.php?v=zakas-architecture JavaScript The Good Parts (D Crockford) http://oreilly.com/catalog/9780596517748 Event Faster WebSites (Steve Souder) http://oreilly.com/catalog/9780596522308/
-E Gpro.ws
_______________________________________________ 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
participants (6)
-
Avi Marcus
-
Brian West
-
EdPimentl
-
Meftah Tayeb
-
Michael Collins
-
Shamun toha md