Fedora 14 PHP daemon error

I’m using PHP to create a daemon(system process) that listens for request to dial outbound calls from a Asterisk based dialer.  Before I even got started I got the following error:

[root@AsteriskPBX Desktop]# php daemon.php
PHP Fatal error: Uncaught System_Daemon_Exception: PHP is compiled without –enable-posix directive in /root/Desktop/daemon.php on line 6

Many websites suggest recompiling PHP or installing ‘php-posix’, which isn’t in the Fedora repo. After some searching I found that ‘php-posix’ is part of the ‘php-process’ package in Fedora.  It now works!


Written by mattb in: Uncategorized |

Asterisk: Holiday Macro

Below is an example of a macro that checks to see if the ‘holiday’ menu is enabled.  I also added extension 2970, a ‘one touch’ utility to enable/disable the holiday macro.  Remember to create a ‘holiday_disabled.wav’ that literally says, “Holiday menu disabled”.  To rercord a message simply disable and enable the utility again.  Enjoy!




;Check if holiday message set

;Check if it is a holiday
exten => s,1,NoOp(Check for Holidays)
exten => s,n,Answer()
exten => s,n,set(HOLIDAY=${DB(closed/1)})
exten => s,n,NoOp(${HOLIDAY})
exten => s,n,gotoIf($[“${HOLIDAY}” = “1”]?main-holiday,s,1)   ; Custom Holiday

exten => s,n,gotoiftime(08:00-19:00,mon-fri,*,*?${ARG1},s,1) ; Main Operating Hours
exten => s,n,goto(${ARG2},s,3)



; usage: macro(holiday,ARG1,ARG2)
; argument one and two are that day and night menu
; Some DID

exten => 12134974061,1,macro(holiday,main-day,main-night)


; One touch Record/Set Holiday Closed Message
exten => 2970,1,NoOp(============ Set Holiday Message ==============)
;exten => 2970,1,authenticate(5678)
exten => 2970,n,Wait(1)

; check to see if holiday message is set
exten => 2970,n,set(HOLIDAY=${DB(closed/1)})
exten => 2970,n,NoOp(${HOLIDAY})
exten => 2970,n,NoOp(${HOLIDAY})
exten => 2970,n,NoOp(${DB(closed/1)})
exten => 2970,n,gotoIf($[“${HOLIDAY}”=”1”]?utilities,2970(disable),1:utilities,2970(enable),1)

; if disabled record a new greeting
exten => 2970(enable),1,Record(en/custom/holiday_message:gsm)
exten => 2970(enable),n,Wait(1)
exten => 2970(enable),n,set(DB(closed/1)=1)
exten => 2970(enable),n,Playback(en/custom/holiday_message)
exten => 2970(enable),n,wait(1)
exten => 2970(enable),n,Hangup

; disable the holiday message and alert the caller

exten => 2970(disable),1,set(DB(closed/1)=0)
exten => 2970(disable),n,Playback(en/custom/holiday_disabled)
exten => 2970(disable),n,Hangup


Fox News commentator contends Anonymous is, “major organizers of the Occupy Wall Street protests”

I know Fox News says and writes some nutty stuff, but this article I read  today takes the cake.  Contributer Dan Gainor writes about the poor defensless police of America being cyber bullied by ‘liberal protesters’.


He blames Anonmous(the online hacktivist group) for largely being responsible for the ‘Occupy Wallstreet’ movement.

What?  Are you f$^%&! kidding me? LOL… wow.  I think the movement was far more likely caused by 99% of Americas wealth in the hands of 1% of the population.  Is that liberal nonsense or basic math?

What I think Occupy Wallstreet is pissed about:

  1. massive wealth inequity
  2. bail outs for banks and large corporations
  3. jobs being shipped over seas by thoughtless trade agreements
  4. lack of health care
  5. lack of education
  6. lack of jobs
  7. high wages & benifits of public servants
  8. American debt
  9. endless war
  10. never ending taxes & fee’s
  11. cost of living increases
  12. etc…

But Dan writes further that Anonymous is the main culprit of publishing public data about individual officers that have arrested or pepper sprayed protesters.  Yet he offers no proof that any genuine member of Anonymous had anything to do with releasing any data about any officers at all.  In fact he doesn’t cite any supposed documents or examples personal information being released.



Asterisk: How to setup Agent Status on Polycom Idle Display

Polycom Soundpoint IP 550 idle display screen


This tutorial describes how to configure the idle display screens on Polycom phones to subscribe to a XHTML file that reads their Agent status from Asterisk.  When the phone is not in active use it displays the web page.

My tutorial has three components.  A specific Polycom option(found in sip.cfg) added to the configuration file of each phone, a BASH script I wrote, and a little Asterisk configuration.  This tutorial assumes you have a working Asterisk 1.6+ PBX with a basic queue setup.  It also assumes you are using automatic web provisioning of your Polycom phones.

Here is a link to my previous article on  configuring Polycom SoundPoint IP phones for Asterisk:

How to configure a Polycom SoundPoint IP phone for Asterisk on Fedora 10

To get the idle display screen to work correctly we will need to modify our standard configuration file a bit.  Navigate to the FTP/HTPP directory you provision your phones from.  Edit an Agent phone similar to the following,

Written by mattb in: Asterisk,Scripts | Tags: , , , ,

Asterisk: How to Install Queuemetrics and Qloader

queuemetrics login

Queuemetrics is by far the best Call Center software Linux.  My only complaint might be that Java is huge resource hog when it parses the Asterisk. ‘/var/log/asterisk/queue_log’.  Luckily Loway provides an excellent PERL script called Qloader.

Today we will walk through installing Queuemeteics,MySQL,and Qloader daemon. My installation instructions are basically a quick rundown of the excellent infomation on Loways site:


My Setup:
Fedora 14 – (32 bit)
Asterisk 1.6
QEMU-KVM virtual machine on Intel i7



AT&T takes Billions from US Tax Payers while Imposing Download Caps

For AT&T it’s another day, another dollar…  or rather billions of dollars. Your’s, collected from taxes and deficit spending.  I read a article on cnet about AT&T’s justification of ‘download usage caps’.  AT&T General Counsel Wayne Watts reasoned the need for caps like this,

 “It is hardly surprising that the general counsel of Netflix, a company that accounts for a whopping 30% of peak-hour Internet traffic in North America, would oppose Internet service providers charging customers based on how much Internet data (movies) they download,” Watts said in a letter posted on WSJ.com today.

What this genius(sarcasm) doesn’t get is that Netflix is the ONLY affordable and legal way to access lots of movies from the internet.  That’s all there is to it.  Do you think if a brand new movie at the super market check-out line was merely $1.99 people would bother to steal or stream?  My first point is that there are many ways to distribute content; Netflix happens to be popular now, but the buz was against hulu and youtube previously. My second point is that AT&T should be the last company in America to complain about it, much less feel entitled to gouge their customers.



BASH script to logout Dynamic Agents

This is a simple script for logging out Dynamic Agents in Asterisk.  The most common use would be to logout Agents automatically each day in case they forget or are on PAUSE.  Edit the “LOGGEDIN” variable below to match the correct length of digits.  By default it is three,  ‘SIP/…’.

You can add as many or as few Queues in place of QUEUE1, QUEUE2, & QUEUE3.  This is the ‘foreach’ section of the script.  Whatever that is here will be applied to each instance of SIP/xxx detected by grep.  Good luck.




#set -x

# Execute from the command line, Asterisk or by cron

LOGGEDIN=$(/usr/sbin/asterisk -rx “queue show” | /bin/grep -o ‘SIP/…’)

for i in $LOGGEDIN


echo “$i removed”

#  Add in all queues that should be included

/usr/sbin/asterisk -rx “queue remove member $i from QUEUE1”
/usr/sbin/asterisk -rx “queue remove member $i from QUEUE2”
/usr/sbin/asterisk -rx “queue remove member $i from QUEUE3”




How to migrate a QEMU – KVM image to a Physical Machine(PC)

Virtualization and cloud services are great!  Everyone wants to move services to web space, but little is written about migrating to physical hardware.  Even though virtualized environments are ideal for labs(at least from cost and organization stand point).

Open Source QEMU-KVM provides an excellent set of tools through libvirtd/virt-manager.  I use virtualization for test lab environments and creating virtual upgrades for my customers.  The main benefit is that I can test 90% of their Asterisk PBX without touching the production system.

In the past, I used several boxes with removable drive bays.  There are many problems with this setup and I’m sure many of my readers will agree with the conclusion: that test labs can get messy and can hinder work. Other engineers, will frequently need the lab equipment, or hard drives(with important experiments) go missing.

Sometimes test servers get cannibalized for parts when there is an emergency.  Then consider the cost of the hardware and electricity.  Luckily, one Intel i7 with 8G of RAM can easily manage three or four Linux guests.  The conclusion I came too is that virtualization is the most effective way to get around these problems.

My hardware specs:

Fedora 14
8 Gigabytes DDR3
Intel(R) Core(TM) i7 CPU  860  @ 2.80GHz

What you need:

– QEMU-KVM image
– Linux Boot CD or USB stick
– DVD, USB, BD-r or external drive of some kind

This tutorial is to help system administrators migrate server images(created from virt-manager) from the virtual realm to a PC for production use.  I’m assuming that the reader has basic knowledge of Linux, QEMU, KVM, and virt-manager.  Before you begin, test that the image contains necessary drivers for any proprietary hardware.

Goals of this Post:
– Export QEMU-KVM image to a physical machine
– Resize VM Image to take up to fill harddrive space

Written by mattb in: Linux | Tags: , , , ,

How to Backup and Recover Windows 7 from Blueray BD-RE(rewritable)

Having a good backup and recovery plan is a must for every systems admin, but every day users can greatly benifit from a little preventive maintenence.  I for instance, only use Windows for games; every time a hard drive fails or ‘Windows recovery’ wipes out my MBR I have to start from scratch.  So this last week after getting a Direct X, ATI, Windows 7 ‘Blue Screen of Death’ for the third time in three monthes I made the wise decision to replace the disk and install Windows 7 from scratch.

The Windows 7 installation itself goes pretty smooth, but the patches, drivers, direct X and game setup triples the time to reinstall.  The easiest thing to do is make a image of fresh install with your favorite default apps and settings.  Overall I like Windows 7, but it’s still a ways off from Linux and OSX in terms of price, stability and tools, but the ISO backup is a great built-in feature.

For my setup I’m using a LG 12x burner and  22.5 GB BD-RE(rewritable) disk.  I like BlueRay BD-RE, they burn up to like 44 GB disks.  Even at $10.00(for the 22.5 GB)  a disk, that’s a cheap easy successor to Tape drives.  BD-RE’s supposedly last much long than DVD-RW, but obviously not as long as tape drives.

Goals of this Post:

– Use Windows 7 recovery console to create an image of a fresh install
– Recover to New Hard Disk
– Expand Logical Volume to fit new Hard Drive


Written by mattb in: Windows | Tags: , , ,

How to Configure Anonymous Web Surfing on Linux with Tor

Tor is a Open Source distributed network of virtual tunnels for the purpose of anonmity online.  Here is a excerpt from their site describing the mission of Tor:

Ongoing trends in law, policy, and technology threaten anonymity as never before, undermining our ability to speak and read freely online. These trends also undermine national security and critical infrastructure by making communication among individuals, organizations, corporations, and governments more vulnerable to analysis. Each new user and relay provides additional diversity, enhancing Tor’s ability to put control over your security and privacy back into your hands.

In simple words Tor helps disguise your true IP address, making it more difficult on third partyies to snoop on your web browsing.  For my installation I’m using Fedora 13 i686 and Firefox version 3.1.13.

Goals of this post:

– Install Tor client
– Install Polipo proxy
– Install Torbutton Firefox extensions


Written by mattb in: Linux | Tags: , , , , ,