Extended Routing
Currently this is an unofficial module that must be manually installed. It can be downloaded from this unofficial repository. See this FreePBX module tutorial if you need help understanding how to install it.
Alternately, here is how to get and install this file (version 0.0.1) using wget:
cd /var/www/html/admin/modules
wget http://www.zelie.com/~n3glv/asterisk/extendedrouting-0.0.1.tgz
tar -xzvf extendedrouting-0.0.1.tgz
rm -f extendedrouting-0.0.1.tgz
[size=20]Description[/size]
This unofficial FreePBX module adds Extended Routing capabilities to FreePBX. It adds a failover destination to outbound routes, and also allows you to choose an outbound route as a destination from other parts of the dialplan.
Some possible uses for this module (just as examples, there are many others):
Use #1 - controlling costs.
Suppose that on a particular route, you have some free or low-cost trunks, and one trunk that costs (more) money to use, and you want to fall through to it only as a last resort, and you want to know when you are using that expensive trunk. You don't want to have a different route with a different dial pattern, since that would be a nuisance (i.e. dial... oops "all circuits are busy"... hang up and dial the expen$ive route). So you set the costly trunk as the last trunk in your standard route, but the problem is that up to now, you have had no way of knowing when you are talking on that trunk, other than by watching the CLI.
Enter extended routing.
You set up two routes, with the same dial patterns. The second is your high-cost route that includes the expen$ive trunk, and because of its priority it will normally never get hit (unless someone is in a custom context that only has access to the more expensive route). Add a failover destination on the first route that goes on to the second, and put a pin on the second. You now have a very simple method of trying multiple routes with the SAME dial pattern, and by requiring a pin the caller must affirmatively choose to use that route.
Alternatively you can fail the first route to a custom sound, and then continue to the second route without a pin. In this case it will simply warn you that you're on a more costly call, but are not required to input a pin. But, note that in version 0.0.1, you cannot use a dialplan injection as the sound source (see "Limitations" section below).
Use #2 - routes as a destination.
You have a few people in a restrictive custom context. But, you have another Asterisk box on which you don't mind them having unlimited access. You have an IAX2 trunk set up between the two. You can't set up an outbound route that allows "everything" (a dot as the pattern), or else all of your calls may start going out via that trunk. So instead, set up the route and give NO ONE access to it. Then you can fail over any custom context to that route, and anything they don't have permission for will try that route (this one can also be accomplished using priorities in a custom context, but this is probably safer.)
Use #3 - failover for routes.
You have DISA set up, and you don't want Allison to tell you that all circuits are busy and then hang up. You would rather have your outbound routes fail to the "all circuits busy" message, but then go to your IVR so you can reenter the DISA (thereby avoiding the need for you to hang up and call back).
Limitations in version 0.0.1: Dialplan Injections currently mess up the dialed number, and therefore should not send to an outbound route as a destination. For example, they cannot be used as a "middleman" to generate the sound mentioned in "Use #1" because they will lose the dialed number. This will be fixed soon. Also, when using outbound routing as a destination, it has the same rules as when using a custom context as a destination. You do NOT have the chance to dial another number (it is not DISA), it simply takes the dialed number and tries it out that route.
[size=20]Installation of Beta version[/size]
Download the latest Beta version using the instructions in the first paragraph.
If you did not use the instructions for getting and installing the module using wget, then expand the .tgz file into the /var/www/html/admin/modules directory - it will create a new directory called extendedrouting. Make sure the group and owner of that directory are asterisk and that the permissions match that of the other module subdirectories.
Browse to FreePBX, Tools | Module Administration. You should see an entry for Extended Routing. Click on it, click install, then click process and the red bar as usual.
Module Author: naftali5
Comments
stevecohen
Wed, 06/18/2008 - 18:03
Permalink
THis module does not work
Hi Everyone:
This module does not work correctly.
Regards,
Steve
fskrotzki
Thu, 06/19/2008 - 09:05
Permalink
Steve, As i read the
Steve,
As i read the attached documentation it is clearly noted it is beta and there are detailed steps to follow. I've not used it but if you provide documentation to the issue, etc. Maybe naftali5 the module author will post a newer version and/or correct the issues when details are provided.
stevecohen
Sat, 08/23/2008 - 19:29
Permalink
THis module does not work
I followed every step and it just does not work. What you get is:
Warning: Invalid argument supplied for foreach() in /var/www/html/admin/functions.inc.php on line 3120
Warning: Invalid argument supplied for foreach() in /var/www/html/admin/functions.inc.php on line 3120
Warning: Invalid argument supplied for foreach() in /var/www/html/admin/functions.inc.php on line 3120
I wished it would work because I need it.
Thanks
Steve
fskrotzki
Mon, 08/25/2008 - 14:19
Permalink
Steve please post the
Steve please post the details on your system. asterisk version, FreePBX version, etc. It looks like you are running a earlier version of FreeePBX then the author counted on so this will be helpful.
Thanks.
olifant820
Tue, 10/07/2008 - 01:49
Permalink
Extended routing module is indeed broken
Steve is right. I tried this on a FreePBX 2.4.0, Asterisk 1.4.21.2-2. The module is third party and beta and from 2006.
So nobody to blame I think, but it would be a very, very welcome addition to the module library. Hope the author is willing to correct this....
olifant820
Tue, 10/07/2008 - 08:50
Permalink
But Easy to Fix!
I'll reply to my own post. The issue mentioned by Steve is due to a permissions mismatch. As so often under Linux, the instructions are correct but not entirely complete, or better said, require a level of Linux experience that I am missing. When you follow the instructions, the Tar command expands the archive into a directory 'extendedrouting' and a couple of files in that directory. As a matter of fact the group and owner of this directory is the same as that of the user performing the tar command. In my case it was user root and group root.
For the module to work in FreePBX it needs to be asterisk and asterisk. So when you are still in the modules directory do:
chown -Rv asterisk:asterisk extendedrouting
This will change group and owner of the directory 'extendedrouting' and of all files inside that directory (-R from recursive)
Now go to module admin in FreePBX web GUI and install extended routing. Done!
Works great for me.
Asterisk 1.4 and FreePBX 2.4 on Centos 64 bit AMD.