The rants and raves of a technogeek
Posts tagged FreePBX
A2Billing+Apache vs. A2Billing+Lighttpd
Oct 14th
Ok, it goes without saying: “A2Billing is one of the most complete Calling Card systems in the Asterisk market today.” – on the other hand, it is also true that: “A2Billing is one of the most complex and convoluted pieces of code ever written!”.
The combination of the above makes for a fairly combustible mixture, especially if you have a big system. Now, I recently ran into an issue, where PHP was litterally eating up almost 512MB of ram, in order to run the A2Billing reports. In it self, that didn’t make much sense to me. However, after inspecting the code, and realizing that A2Billing uses GD in run-time to generate images out of thousands of CDR records, it made perfect sense that it may just be eating up memory.
So, increasing the memory on PHP to go up to 512MB of RAM helps, but creates an interesting probelm. Whenever Apache will invoke a script, it will automatically consume a shitload of RAM, and for each time I intiate a new query, it will spawn a new Apache instance, and consume the same amount of memory. That said, after 6 queries of 512MB, about 50% of the machines RAM was already eaten up – and Apache will not free it!
At this point, I had 2 choices:
- Go into the A2Billing code, change the GD code to work right or simply change it completely to something else (maybe flash).
- Work around the problem with a mix of proper IT practices.
I admit that I hate quite a lot of things (I won’t list these here); however; nothing ranks up the list as modifying someone elses code, when I know for fact that it will be unmaintainable in the future. So, I choose option number 2.
I’ve being playing alot with Lighttpd lately, and got some really nice performance from it. So, I said to myself, this would be a great test to see if Lighttpd+FastCGI can solve the problem here. I had to work my way around lighttpd to do what I wanted and verify that my FastCGI server in Lighttpd doesn’t consume all memory, however, here is what I got working with A2Billing, and really nice.
Step 1: Enable the required modules:
server.modules = (
"mod_access",
"mod_auth",
"mod_status",
"mod_fastcgi",
"mod_accesslog" )
Step 2: Enable the FastCGI Server
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
"idle-timeout" => 30,
"max-procs" => 1,
"min-procs" => 1
)
)
)
Step 3: Modify user permissions (required if you are using FreePBX)
server.username = "asterisk"
server.groupname = "asterisk"
Step 4: Setup authentication and authorization (optional)
#### auth module
## read authentication.txt for more info
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/var/www/.htpasswd"
auth.require = ( "/" =>
(
"method" => "basic",
"realm" => "A2Billing Management",
"require" => "valid-user"
)
)
The above configuration made the interface spwan a single FastCGI, insuring that memory usage is never over utilized. I still need 512MB of RAM to run the scripts, but at least now it’s limited to only 512MB of RAM, out of a machine that has 16GB of RAM.
TrixBox shows its support (or lack of it)
Sep 22nd
Well, it’s quite common to get a flame here and there on any Internet technical maling list, but the following really caught my eye. Here’s an extract from the TrixBox forum:
———————- CUT HERE ———————-
Subject: SS7 on Sangoma a101D
Why are you trying to do this? Is your goal to terminate SS-7 trunks to an Asterisk box at some point?
Your exercise sounds academic, ISDN User Part is essentially SS-7 and besides who trunks Asterisk with PRI’s
The last guy that asked these questions was working on a University project, if this is what you are doing then do your own homework. If not please explain your application so I can make a few suggestions.
aka “Skyking”
———————- CUT HERE ———————-
Ok, putting aside the discussion of Digium vs. Sangoma (It’s a well known fact I’m a Digium fan), I think I hadn’t seen any remark on any Asterisk forum which was rude as this one. The fact that TrixBox is not something you would naturally use for SS7, the fact that it’s Asterisk based simply makes it possible. Why does the responder care “Why the user wants SS7?” – it doesn’t matter one bit, he wants to do it, he has his reasons – just give the guy an answer and help him out.
Our responder says: “… and besides who trunks Asterisk with PRI’s …” – well, I can number multiple situations when Asterisk was required to be trunked with PRI circuits. For one, security measures sometime insist that you interconnect Asterisk with PRI circuits and not over IP. For example, one of my customers, a company in the defense industry required a secured VoIP connection to a provider, without exposing it’s internal network on the physical layer – the only way to do it was to interconnect Asterisk via a PRI circuit.
“… if this is what you are doing then do your own homework …” – That’s even worse than saying RTFM. In the Asterisk world, and especially in the SS7 world, nothing is straight forward and usually, things are slightly more complex than anticipated. Saying something like: “Do your homework” is like saying, “I know how to help you, it’s complex, but I won’t tell you”.
The good old saying says: “If you don’t have anything nice to say, don’t say anything” – it applies well to mailing lists and forums.
I admit, I had been known to throw a flame or two here and there – however, it is always related to a specific issue, and is usually related to non-technical issues being published on a technical list.
Say No To TrixBox Campaign – Update
Jun 23rd
As some of you noticed, I’ve started a “Say No To TrixBox” campaign. In order toPL go about and monitor the usage of the banner, and it’s deployment across the net, I’ve installed an OpenX ad server to support the campaign. I guess that I didn’t realize what the little campaign would do!
Current statistics show that the banner had been deployed to over 300 different websites across the world, had been viewed over 60,000 times and had been clicked on for about 800 times. Not a bad CTR ratio for a little community oriented campaign.
If you are an Asterisk user, and you are fed up with the way Fonality/TrixBox had been conducting their business over the past 3 years, it’s time to show your support and put this banner on your website. If you have a blog, a company website, an Asterisk oriented business, show your support to FreePBX and other Open Source Asterisk oriented projects and website by showing the world that the community has power.
I am all for competition, as a healthy competition always keeps us on our toes and makes sure we always progress and improve – but Fonality/TrixBox’s actions must be denounced and rejected.
I don’t feel right charging for 15 minutes
Apr 21st
Ok, I’m a consultant and developer, but asking somebody to pay me for 15 minutes worth of work – I feel like a total heel. I’m a member of this Freelancers website called oDesk. Every once in a while I get a notification from oDesk, asking me to participate in an interview – which I usually accept (after all, we’re all looking for work).
I have to admit that most of the people that come to oDesk are usually seeking to outsource some work to somebody, in the hope that it will be for a cheap price. Now, I admit, my services aren’t cheap and that’s because I take high pride in what I do, and I aim to provide a service from A-to-Z. However, I never take a job without clearly looking at what I’m about to take upon myself – and most importantly, I’ll never ever charge for something that takes me up-to 15-20 minutes.
Tonight, I got an interview request from a man in Miami, asking me to look at his FreePBX installation. The man also stated that he required some development work to be done, so I replied positively to the interview request. Shortly after 10 minutes, I got an IM from the man and we started talking. I started looking at his Asterisk box and as I didn’t have any root access at the point, I commented that it may take anything from 2 hours to 4 hours to solve. In any case, we started talking about the payment, which was a little high for the guy, so we agreed on a price – pending that I take a quick look at the server at root level.
I got root access and logged on – after 2 minutes I replied to the man: “Dude, I can’t charge you for this, it will take me exactly 4 minutes to fix, and 2 more minutes to add the feature”. So, I did the change for the guy, who still wanted to pay me, which I replied: “donate the funds to your favorite charity, I can’t charge for this”. Now, everybody would say: “Are you fuck’n mad? taking 200$ for 6 minutes of work, that’s like a world record!”, well, it’s not a world record to me if I feel like a heel. Charging somebody for something has to mean something, I’ve seen people charge other people for nothing, and I believe things shouldn’t work like that. I truly believe in the existence of Karma, and that the world strives for balance. As I do on to others, others may also do on to me – so there is no use to charge somebody for 10 minutes of help, as I may need these 10 minutes of help some day from someone else.




Picasa
Twitter
Facebook
LinkedIn
Youtube
RSS
hello
i have a two running trixbox server with sangoma a101D cards in them. i want to connect these two servers with each other over a SS7 link. i have installed wanpipe utilities and using T1 cross over cable. both card are showing green light and also there is no alarm in the system. now i am trying to install some ss7 library in the system. i have tried both chan_ss7 and libss7. chan_ss7 didnt work in any way.
so i am trying to use libss7.
with new asterisk 1.6 and libss7, digium says it will supports mtp2 signalling. just need to add command
signalling=mtp2. but they also said that only digium card will support this feature. can i use direct mtp2 signalling on sangoma cards or is there is any other way around???????