1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.

TUTORIAL Tally of Concurrent Calls

Discussion in 'Open Discussion' started by hmonroe, Mar 12, 2009.

  1. hmonroe New Member

    Is there a way I can tell the maximum number of concurrent calls over a period of time?

    We have a PRI which is overkill for our downsized company. I've heard that you can get a "fractional" PRI dedicating some bandwidth for calls, some Internet, but I need to know the maximum number of concurrent calls which are being made?
  2. jroper Guru

    Inspection of the CDR and reports will give that report, although you will have to do some searching.

  3. jmullinix Guru

    In the reports section, click on daily load. Choose the day you want to investigate and click search. Scroll town to the second part of the page, choose what hour you are interested in and choose fluctuation graph. There you go.
  4. deano Member

    This is a good question.

    I too would like to be able to see what and when in a day my lines hit the max load. Is there an easy report. I did see the one for each hour, but I would like to see one for the whole day. That way i can see if there is enough need for more lines. Also, if there was as way to see the duration that these lines were like this.

  5. hmonroe New Member

    That did the trick for hourly, I sure would like to know daily for the month, but this is a start. Thanks for the tip!
  6. JoelC707 New Member

    What I did was access the CDR in FreePBX and tell it to show the date range I want and filter by source. In the source I know my PRI uses ZAP channels Zap/1-1 to Zap/23-1. So I filtered by "Zap/2", inspected the results then re-filtered by "Zap/3" and so on till it quit giving me results. The last channel you filtered by was the total number of channels in use at any given time. In my case I ended on Zap/8 meaning the most channels ever in use in the past year was 8 channels. It was only one occurrence and the most channels used with more than one occurrence was 6 channels. A far cry from the 23 channels I have available which is causing me to look at cheaper alternatives since it is clear we don't even need half the channels.

    Is Nuvox a reseller in your area? I can't get it because I'm a legacy FDN customer but they offer a dynamic PRI. It's similar to what you are looking at but you don't have to choose how many channels you want for data and voice. When no calls are in use you essentially have a full T1 available for data. But as calls come in some of the data bandwidth gets reallocated to voice and you can still burst all the way up to 23 channels. The downside is that you need another internet source because it is a PRI first meaning if needed, the entire trunk will be allocated to voice. Unlike a dynamic T1 where it is data first and the voice can't fully allocate it. The other downside is price, it won't give you any cost savings because it's the same cost as a PRI. But what it will do is give you another internet source for load balancing and maybe even some redundancy.

  7. Boolah Guru

    I was somewhat surprised that this information could not be gleaned from the CDR reports, in anything other than one hour increments, so I wrote a quick PHP script to generate the information for any specified time period (seconds, days, months, etc.). Just specify a date and time for the period you're interested in looking at and click the Update button.

    Please note that this script was primarily created for my own edification, so it's not well documented, pretty or secure on the open Internet. I would make sure that it's only accessible from your LAN. Just drop this in your /var/www/html/admin folder and access it by going to http://<your PiaF IP>/admin/load.php

    The script only takes into account [incoming and outgoing] external calls and ignores calls between extensions.

    Checking the "debug" option will display the number of simultaneous calls at every "occurrence" (i.e. every time a call is started or stopped). Use this with care since looking at the debug info for months of CDRs can fill up your browser quickly.

    It also provides a distribution of simultaneous calls so you can tell how many times in the given time period you hit a given load.

    Hope someone finds this useful.

    EDIT: Please see this post for the most recent version.
  8. jroper Guru


    I've quickly knocked it up as a module so you can upload it through the PBX interface.

    It would look really good with a bit of tidying up, and I reckon we can also solve the issue of the username and password for the CDR reports by getting that from amportal - I think tshif is the master of that.

    Try it and upload via module admin in FreePBX, then enable it.

    I cannot attach tgz files to the forum, so its here for the moment.



    PS - The module is very rough and ready
  9. Boolah Guru

    There was a bug in the script where the distribution of calls was incorrect if the number of simultaneous calls jumped non-sequentially (i.e. jumping from 1 to 4). This only affected the distribution, not the the maximum, but it's been fixed and updated in my original post.
  10. Boolah Guru

    Joe - when using your module, when I click the Update button I just get taken to the main FreePBX page. I supposed this because the form I'm using submits to $_SERVER["PHP_SELF"]
  11. deano Member

    This is a good report.

    Ideally, I would like to see one that can tell me how many times my lines were maxed out. That way, I can determine if I need more lines. Also, it would help to understand what time of day these were hitting. But this is a great start. I will look at the script and see if I can modify it some more.

    The total Idea is to see how many times my lines are in full use and then for how long. That way I can assess the need for more lines.

    Thanks everyone.
  12. deano Member

    ok, so I looked it over and I am fooling myself. I don't know the database that well.

    Anyone interested in hammering this out?
  13. jroper Guru

  14. wardmundy Nerd Uno

    Here's the module in zip format. Thanks, Joe.

    Attached Files:

  15. Boolah Guru

    deano: If you have 5 lines and 5 concurrent calls, your lines are maxed out. If this occurs 10 times, you've maxed out your lines 10 times. Did I understand your question correctly?

    If you're asking for the number of times that a 6th person has called when you only have 5 lines, I don't think that's something you'll be able to glean from the CDR since the 6th call would never have made it to your PBX to begin with.

    To see what time of day you were hitting specific loads, enable debugging. It will list the time stamp and current load at each time stamp. You can also change the start and end date and time to look at different time periods, but watch out looking at months with debugging on - you'll get a screen full!
  16. TheShniz Guru

    This is an interesting 'lil report/page, but I have a question of how the calls are tabulated... the numbers seem to be accurate for each range I've put in w/ the exception of march.

    You see in march, my wiffle orchestrated a surprise birthday party for me which I found out about ahead of time... and so to 'put one over' on everyone, I put a whole bunch of peoples' cell numbers (that I knew were going to be there) in a ring group at work (which played a very funny announcement which I pieced together). The point being, a minute before I walked through the door, I rang everyone's cell phones and played this message... then I busted through the doors :)

    Well....... I put more telephone numbers that I had lines @ work, so the way Asterisk works is to keep trying until one becomes available, and this artificially raised the max simultaneous calls. Now I've not looked @ the script itself, but is there any way to filter that only calls that are connected/answered are included?



    ...this is what happens when you're married 2 a telecom-guy.:biggrinjester:
  17. Boolah Guru

    The script should only look at calls which actually connect. This is filtered through the SQL query which only retrieves records where billsec > 0 (if a call doesn't connect, billsec = 0, even though duration might be > 0).
  18. deano Member


    You are correct. What I want to know is when and how long within the time frame I specify my FXO lines were maxed out. That way i can determine if I need more lines. Right now, the default is lets me see only an hour at a time. But this is pretty good.

    for example, if at 3-5pm I have 25 times that my lines are maxed out for over 3 minutes, then I think this is an issue since my lines are are returning a busy to potential clients.

    I have set the max outbound calls to 3 so that people can't tie up all of the lines. But it would still be possible to lock these up if the inbound was exceeded. Not to good for business.

    So, Ideally, I would like to see a # times over the selection time period, then the top longest 10 and thier durations(so the top ten in the period and what the longest time was in which the lines were unavailable to new inbound calls.).

    Not much to ask right?

    Thanks, I am just hoping that others can see this need. It would be a great way to either sell more services to the client or provide a work around.

  19. Boolah Guru

    New Version

    There's a new version of this script available. The two big changes are the script is now a FreePBX module so it can be uploaded right into FreePBX (thanks, Joe) and the data is now displayed in a CDR-style graph.

    The new module can be downloaded from here.
  20. Boolah Guru


    I see what you're saying now. I'll add this into the next version.

Share This Page