So it is time to check out Zend Framework seeing how powerful everyone says it is. Setup is a bit annoying in comparison to other “funner” frameworks so I am going to document my findings as I learn. Here’s a guide to getting ZF working on your *nix dev box.
Setting up your environment
Using a SSH client such as Putty – connect to your web server and create a directory in your users home named “bin”
$ cd ~
$ mkdir bin
$ cd bin
Next we need to download a stable copy of Zend Framework via subversion using the following command :
$ svn checkout http://framework.zend.com/svn/framework/standard/branches/release-1.10/
If svn (Subversion) is not installed you can download via wget using the following command :
$ wget http://framework.zend.com/releases/ZendFramework-1.10.3/ZendFramework-1.10.3-minimal.tar.gz
Next we need to untar (decompress) the framework :
$ tar -zxvf ZendFramework-1.10.3-minimal.tar.gz
Rename the decompressed folder :
$ mv ZendFramework-1.10.3-minimal Zend
** Note if you used subversion to acquire Zend Framework – you probably have downloaded the release directory – use the command above replacing the first argument with the release directory name.
Move the scripts from the Zend/bin directory into the ~/bin directory; make them executable; rename zf.sh to just zf (for simplicity) :
$ mv Zend/bin/* .
$ chmod +x zf.sh
$ mv zf.sh zf
The next step is to add the zf script to the users include path, this allows us to use the zf command without having to specify the absolute path. Copy and paste the next 6 lines into your shell :
cat << EOF >> ~/.bashrc
if [ -d ~/bin ] ; then
PATH=~/bin:"\${PATH}"
fi
export PATH
EOF
You must now log out and back in to activate this path. Once you are logged back in you can test the zf command by typing :
$ zf show version
If you see “Zend Framework Version: 1.10.3″ you are ready to start your first project.
Creating your first project
Change to your web server document root, assuming you are using a Debian based server you can find it usually in /var/www (RHEL generally defaults to /var/www/html) :
$ cd /var/www
Create a project using the following command :
$ zf create project <project_name>
Where <project_name> is the name of your project in lowercase alpha numeric form (no symbols, spaces, uppercase letters (hyphens and underscores are OK))
Link your Zend library to your projects library directory as such :
$ ln -s ~/bin/Zend /var/www/project_name/library
Where /var/www is your web server document root and project_name is the name of your project.
If all went well – point your browser to your web server hostname or IP / your project name / public ( http://example.com/project_name/public ).
That is all for now – we’ll get into the actually writing some code next time. Leave me some comments below!
This video describes how to connect to the VMWare web interface over X tunnel via SSH for access on unsupported platforms (specifically Mac).
This is probably a widely overdone how-to but I figured I would contribute to the cruft and let you decide if it is useful or not. I often run into mis-tagged rips and lossless files; I find it really helps to watch a video to get the info I need fastest. Here’s how I convert FLAC to WAV, import to iTunes then convert to MP3 and tag using completely free software, enjoy!
I stumbled upon this module last night when trying to delimit access to an outbound route per extension. I added a colleague to my PBX who had purchased an account at voip.ms; problem was when he would dial out it would always display my Caller ID and use my trunk (which is bad if he dials international). I guess this is a frequently asked question so I created a video demonstrating the great power of this module – you will be surprised how easy creating permissive contexts can be This video will show you how to install the module and limit access to outbound routes / trunks per extension. The goal is to partition an Asterisk IP PBX in order to host multiple tenants on one system.
The following information is from this site. Please check it out for download link and changelog / usage.
Possible Uses
- Restrict access to certain outbound routes or feature codes by a particular extension or group of extensions.
- Give particular extension(s) priority access to certain outbound routes, such as a particular emergency route associated with their geographic location.
- Give certain outbound routes top priority for use during “free” or low cost calling periods, while making those same routes lower priority (or disallowing access entirely) during higher cost time periods.
- Disallow access to outbound routes (with possible exception of Emergency access) to certain (or all) extensions during particular time periods (don’t let night cleaning crew make long distance calls, or disallow outgoing night calls from telephones in children’s rooms, while still allowing emergency number calls).
- Allow two or more families/companies/organizations to use the same FreePBX box, while still allowing each to have access only to “their” outgoing routes and trunks.
- If you have a SIP provider that does not send DID (normally a pain to handle because you can’t create a normal Inbound Route), set up a new custom context (call it idiot-provider), give them no access to anything (deny all), and then specify where you want their calls to go in the Failover Destination. Then put context=idiot-provider in that provider’s trunk user details.
Module Description
One feature which was a bit lacking in Asterisk/FreePBX was the ability to easily create multiple tenants.
This module creates custom contexts which can be used to allow limited access to dialplan applications.
Now allows for time restrictions on any dialplan access!
This can be very useful for multi-tenant systems.
Inbound routing can be done using DID or zap channel routing, this module allows for selective outbound routing.
House/public phones can be placed in a restricted context allowing them only internal calls.
Custom contexts can now be used as destinations. An IVR menu, Time Condition, etc. can now send a caller into a custom context. This feature requires FreePBX 2.2.0rc2 (or the latest SVN version if prior to the release of rc2)
(The following are the module author’s comments, “I” refers to the module author, not the original creator of this wiki page).
A number of improvements have been made to freePbx to handle multiple tenants.
1) inbound routing based on zap channel – i used to have to hack it by putting each zap channel in its own context.
2) authtype = database allows for dividing extension ranges
the main problem for me was outbound routing…
I wanted some extensions to dial out one route, and others out another route.
I had to create a custom context for each, then place each in their own custom context, then include all of the contexts which they should have access to. This became a nuisance as each module added its own context to from-internal-additional which could not be included as it also contains outbound-allroutes.
The purpose of this module is to dynamically list all contexts included in any contexts you choose, and allow you to create custom contexts which can include any of these all without config editing.
Being woken up several times throughout the night from anonymous calls is not fun. Here is a screencast (shot with my shiny new MacBook) that explains how to delimit these annoying calls while still being able to route incoming SIP calls from Gizmo and IPKall to their appropriate destinations.
Here is the code I used to allow IPKall incoming SIP connections :
[ipkall]
disallow=all
host=66.54.140.46
context=from-trunk
insecure=port,invite
qualify=yes
type=peer
dtmfmode=rfc2833
allow=ulaw
nat=no
[ipkall2]
disallow=all
host=66.54.140.47
context=from-trunk
insecure=port,invite
qualify=yes
type=peer
dtmfmode=rfc2833
allow=ulaw
nat=no



