Re: [Freeswitch-dev] Add accountcode to Show Channels
On 15/09/09 6:13 PM, Trixter aka Bret McDanel wrote:
On Tue, 2009-09-15 at 16:24 +1200, Matt Riddell wrote:
2. Check how many calls the system currently has (broken down by accountcode so that I can restrict individual accounts).
could this be done with mod_limit with the key as the customer id that you set as a variable with originate?
I should have been more accurate - basically I'm looking to maintain a number of channels through increasing and decreasing call rate - basically repurposing the predictive engine in SmoothTorque.
So, in Asterisk the way we do it is "show channels concise" which provides a list of channels with their details (much the same as freeswitch), but also provides the accountcode which allows me to group the calls.
well you could potentially just view the limit data that is set with mod_limit and get this info, if that is a suitable solution. I really dont have a firm grasp of what it is that you want to do so I dont know if this is acceptable for other reasons.
The problem is that I'll also need to see where in the dialplan each channel is up to and then from there relate back to customers. With "show channels" this other info is also provided - although I'll look into mod_limit.
esl_send_recv(&ser->handle, "bgapi originate {variable_accountcode=bar}sofia/internal/1000%x.x.x.x 9999\n\n");
Then the accountcode is blank - maybe because it is initially set up without one and the variable is set later?
where is it blank? In your patch? Would the mod_limit stuff help so that you dont have to approach it this way and still have every feature that you want?
Yeah, basically the patch just copies the accountcode into the channel in the sqlite db. I'd love to be able to do it some other way! I'm not in any way tied to making it work like Asterisk :) In fact I have even created a new SVN branch for dealing with this even though the code will support both Asterisk and FreeSwitch :) I'll have a look at mod_limit and maybe that's a better place to patch if need be. -- Cheers, Matt Riddell Director _______________________________________________ http://www.venturevoip.com/news.php (Daily Asterisk News) http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer) http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)
On Tue, 2009-09-15 at 18:21 +1200, Matt Riddell wrote:
On 15/09/09 6:13 PM, Trixter aka Bret McDanel wrote:
could this be done with mod_limit with the key as the customer id that you set as a variable with originate?
I should have been more accurate - basically I'm looking to maintain a number of channels through increasing and decreasing call rate - basically repurposing the predictive engine in SmoothTorque.
mod_limit can do just that, in fact that is its primary purpose as I understand it (although it can be tasked to do other things). You can query it to see what the current volume is, as a call drops it gets removed. The key can be the account code, so that you can look for each code you are interested in and know how many calls are up for that code itself. http://wiki.freeswitch.org/wiki/Mod_limit#Limit_Example http://wiki.freeswitch.org/wiki/Mod_limit#limit_hash_usage Will that do what you want? Granted you have to tweak the example to use the account code and all, but ...
The problem is that I'll also need to see where in the dialplan each channel is up to and then from there relate back to customers.
there are a couple ways to accomplish this. For one thing the dialplan can actually be a socket connection where you can say exactly where it is at any time. Depending on load you could actually have the call store its state data via odbc using a update, although this does add load, it lets you query a DB server instead of the switch for this information which can relieve some load on your switch. My preference is to offload most things elsewhere and leave the switches just for calls, but that is just me. I am just throwing options out there, the best option for what you need may be the patch you did, one of the things about FreeSWITCH is that there are usually multiple ways to accomplish the same task. -- Trixter http://www.0xdecafbad.com Bret McDanel pgp key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8AE5C721
participants (2)
-
Matt Riddell
-
Trixter aka Bret McDanel