code

How to write a great FreePBX extension

Update Voicepulse replied in a comment to this post. Though my post was a bit venomous, they replied thoughtfully, and they’re considering GPLing their FreePBX module. Keep in mind, while the Freepbx module annoyed me, and the contract annoyed me, I’m still using their service, I’ve switched to it full time, and I may be switching my mother to it if she goes VOIP. A 19 ping (versus 100-120) and 4 channels will do that.

  1. Write a FreePBX plugin that automatically creates trunks and inbound routes for people using your service.
  2. In the process, do the following
    1. Blindly try to install curl (using yum. On my Ubuntu machine.)
    2. Include FreePBX and your own function files with hardcoded paths for Trixbox, instead of using relative paths.
    3. Make tar.gz backups of my /etc/asterisk directory and quietly add them to your modules directory. Make sure not to do any checks for file size or free disk space.
    4. Write to my sip_general_custom.conf and extensions_custom.conf (bad FreePBX extension! bad!)
  3. Use PHP Obfuscator on your code, and copyright it, so that no one can see all the horrible things you’re doing to their system, or figure out why it doesn’t work.
  • I installed the extension and saw the paths didn’t work.
  • I looked at the code, and was appalled that they obfuscated it.
  • I symlinked /var/www/html so that it would install, then found out none of their actions (adding trunks, adding inbound routes) actually worked.
  • After seeing some of the fun things it does, I’m quite glad it didn’t work at all!

Thanks Voicepulse! Your rates are good, the voice quality seems great, but emailing you a signed contract and waiting for “verification” was annoying, and I wouldn’t touch your FreePBX extension with 9 1/2 foot poll. Your customers (including me) would probably clean up your mistakes if you GPL’d it. The only downside would be the possibility of helping someone you didn’t intend to.


JoeTerranova.net

code
linux
New Jersey LoCo Team
Planet Ubuntu
ubuntu

Comments (2)

Permalink

Flash Media Server 3.5 on Ubuntu

On Linux, Flash Media Server only supports Redhat. In February, Markus Bertheau posted a patch for FMS 3, so that it would run on Ubuntu. Based on that patch, here is a patch for FMS 3.5 . It’s patched in a similar way. From the installer directory, run:

patch -p1 < fms-3.5-ubuntu.patch

That gets it to install. I’ve not tried running it though. If you run into problems running it, please let me know.


JoeTerranova.net

code
New Jersey LoCo Team
Planet Ubuntu
ubuntu

Comments (7)

Permalink

RSS Feed Generator for DeviantArt

Just a quick post.

Wrote an RSS Feed Generator for DeviantArt Galleries.

To use it, replace yourusername with … your username.

//www.joeterranova.net/code/deviantart.php?artist=yourusername

Source code is available here.

Brief attempt at a man page.

How it Works

When life gives you lemons, use regular expressions.

I monitored http requests to find DeviantArt’s back end ajax interface (which they use to do previous/next on galleries). From there I wrote a regular expression to parse out each entry, along with entry url, image url, date, and title. From there it’s pretty straight forward.

Keep in mind, I can’t guarantee this will work for you. If it’s been some time since I posted this, you may want to check if they’ve reintegrated rss feeds. That said, unless they change their layout, I doubt they’ll be purposefully breaking this script.

Right now, the only thing it does is get the latest entries from the given user’s gallery — no tags or anything like that. That stuff is probably doable. If you want anything specific, you can a) use the source and change it yourself, or b) leave a comment, and I’ll add it (within reason) when I have time. If you make good changes, let me know and I’ll post them here.

Options:

artist — the artist to get the feed for (ie, your username)

ex: deviantart.php?artist=yourusername

count — the number of items to return. The default is 24. If set higher than your total deviations, it’ll return all of them.

ex: deviantart.php?artist=yourusername&count=10

export — if set, instead of returning an rss feed, it’ll just output the results in an array using var_export. Useful if you’re just trying to get your deviations on your site (and your site uses php).

ex: deviantart.php?artist=yourusername&export=1

nolink — by default, the rss feed will show the thumbnail image as a link back to the main deviation. Add this to disable the link part.

ex: deviantart.php?artist=yourusername&nolink=1

I’ll leave this up, but if I notice real major traffic, I’ll be taking it down and putting it elsewhere (I’ll of course leave the source up). Please don’t do anything silly like hit my url every 10 seconds. For maximum reliability, host it yourself.

If you host it yourself, there’s 3 parameters at the top of the script to change:

$usecurl=1;
$url = '//www.joeterranova.net/code/deviantart.php';
$webmaster='joeterranova@gmail.com (Joe Terranova)';

$usecurl — set this to 1 to use curl instead of file_get_contents. If your host doesn’t have the curl extension installed and you set this to 1, you’ll get an error — conversely, if your host has remote file opening off (like mine does), and this is set to 0, you’ll get an error.

$url — set this to the url of the script.

$webmaster — set this to your email address and name.

For any questions, comments, or feature requests, leave a comment here. I release this code under the GPL v3 (see code for details).


JoeTerranova.net

code
New Jersey LoCo Team

Comments (20)

Permalink

Bad Behavior has blocked 185 access attempts in the last 7 days.