New Module: Outbound Extension Groups

I needed to route outbound calls based on the location of the extension. I also needed to route emergency calls to different trunks from the normal outgoing calls.

I could have accomplished this using a custom context and 2 outgoing routes for each group of extensions. However the complexity of configuring and maintaining it seemed excessive.

So I created a new module for FreePBX 2.3 (it may work on 2.2, I haven’t tested it). I’ve enclosed a copy below of the description from the release notes.

This is alpha code and should be tested to ensure it works in your environment.

Also the usual caveats about emergency calls apply. I’m not responsible if your emergency calls aren’t routed correctly due to bugs in this software.

The module’s page is: http://gforge.opensource-sw.net/projects/outgroups

[size=18]Module Description[/size]

This is an add-on module for FreePBX version 2.3. It allows outbound routing based on the extension used for dialing.

Membership in an Extension Group can be either ad hoc (manual selection for each extension) or determined using a regular expression which matches against the extension number.

Outbound routes are specified using trunks. A trunk-specific prefix and / or suffix can be added to the number before dialing.

Emergency Call dialing (911 in North America) is fully configurable for both number and route. The only limitation is that the emergency number users dial itself is global although the number to dial out the trunk may be overridden in each group.

Here is a screenshot of the configuration page:

Hi,
this looks to be just what I need, thanks.

I have a customer setup where the business shares a common system but is split into departments with their own analog trunk lines.

Incoming calls are easy to route to the correct groups of extensions, but at present all outgoing calls use the same trunk pool.

I believe this will allow me to segregate outgoing calls so each department uses it’s own trunk lines.

Hi,
this looks to be just what I need, thanks.

I have a customer setup where the business shares a common system but is split into departments with their own analog trunk lines.

Incoming calls are easy to route to the correct groups of extensions, but at present all outgoing calls use the same trunk pool.

I believe this will allow me to segregate outgoing calls so each department uses it’s own trunk lines.

I had forgotten that I added a new class to extensions.class.php. I’ve moved my new definition to functions.inc.php for now.

You can download the updated version 0.1.1 from the same place.

[quote=“robert”]I had forgotten that I added a new class to extensions.class.php. I’ve moved my new definition to functions.inc.php for now.

You can download the updated version 0.1.1 from the same place.[/quote]

That’s better - I’ll have a play… thanks :slight_smile:

didn’t work for me…

got this in my httpd error_log

Then again, I’m running what appears to be the final release of 2.3 (just upgraded about 5 minutes ago)…

I’ll stay tuned!! This looks great!!

THX!!

Okay I added the missing require statement. You can download the fixed outgrps-0.1.2.tgz now.

got further that time - but still no dice…

[quote]Reload failed because retrieve_conf encountered an error: 255
Added 1 minute ago
(freepbx.RCONFFAIL)[/quote]

not sure where to look for more info on that…

found this in httpd error_log

not sure if that helps

Hopefully the 3rd fix is the charm. I made available a new version which should resolve these issues.

So far so good! THX!!!

I’ve uploaded a new release. This latest version fixes some quoting issues with CID and fixes some bugs in the field descriptions. This should fix all the outstanding problems that I know about. If you’ve downloaded a previous version you should update it. If there are any issues or you’d like to see additional features, let me know.

I’ve been working on version 0.2 and I wanted to get some feedback.

One of the things I’ve been thinking about adding is support for international calls
to separate them from other normal outbound calls.

I’d add an additional global option to the top section to specify the prefix. I new
section similar to the outbound calls section would be added for international
calls.

Would that make it more useful?

Also the subject of prefixes brings up another thought. I’m using my system for both
business and home use. So I have remote extensions in another country. For my
home use it is connected to an existing proprietary Panasonic phone system (what
can I say, it’s a big house :-). Since it is being used in an environment where people
are used to using a traditional pbx they are conditioned to using 9 to dial an outside
call, etc.

However because of the power of Asterisk dial plans and their support of variable
length patterns people are moving more to just dial the number and let the system
extract feature selection and destination information out of the dialed digits rather
than relying on leading digits.

So I was thinking of extending the current prefix so that one can specify a pattern or
a list of patterns separated by & (ampersand).

If only digits are specified it will work the way it does today, otherwise it will treat the
input as a list of patterns.

Comments?

Anthing else you would like added?

Hi

Thought I would try this out as it might be what I am looking for, however when this module is enabled the following is shown at the top of the FreePBX page when the extension catagory is selected

Notice: ‘outgrpsel’ does not exist in component->getoptlist() in /var/www/html/admin/components.class.php on line 144

Notice: $valarray must be a valid array in gui_selectbox in /var/www/html/admin/components.class.php on line 546

This only appear when this module is enabled. Disable it and they are not shown

Would liked to have reported this via the download site, however I seem to be having a blonde moment and could not work out how to do it!

Adrian

Hmm, I haven’t seen nor heard of anyone having problems like that. There must be something I didn’t anticipate in your configuration.

Which version of FreePBX are you using? Are all the other modules up to date? Which FreePBX configuration model are you using (Extensions or Devices and Users)?

In order to be able to submit bug reports or post messages on the site you have to register. This is to prevent spam and enable me to follow up on the bug reports.

I am running FreePBX 2.3.0.2, module administration claims everything is upto date, running in Extensions model.

If you need more information please let me know as I am more than happy to help you here. :slight_smile:

Thanks in advance

Adrian

you should post this to the trac

theres a new module option in in the trac post type.

Just as a heads up, here’s what we have planned about this: http://freepbx.org/trac/wiki/CustomContexts

It still requires some fundamental changes to take place before it can be implemented.


Greg MacLellan - Core freePBX Developer
http//freepbx.org - irc.freenode.net #freepbx

I originally looked at using the other custom contexts module to solve this problem but found the amount of configuration and maintenance prohibitive. Your planned “Dial Contexts” have the same problem.

Consider the case with 30 extensions spread over 5 locations. You would need to create 5 “Dial contexts”, 10 Outbound Routes and modify 30 extensions to set the context.

With the module in this thread you only create 5 groups, which involves modifying 5 pages versus 45 pages when using “Dial Contexts”. Its not hard to see that it is much easier to maintain when the information is on 5 pages then when it is spread across 45 pages.

I’ve been working on reproducing the problem.

I believe that the error you are seeing is benign. I’ll release a new version that fixes it soon. I think the reason you are seeing them on the web page is because your php.ini file has “display_errors” set to “on”. This isn’t a recommended setting in a production setting which is probably why no one else has reported it yet. You should use logging to a file instead.

Of course I should have checked my log before I released the module and I would have caught this much sooner. (Imagine embarrassed emoticon here)