Third-Party Unsupported Modules

These modules are unsupported and may cause dizzyness.


Call Cost

This downloadable FreePBX plug-in allows you to setup the Call Cost
parameters, categorize each calls and assing a cost for each. From this
data you can generate call costs by create a new table called cdrcost
in the asteriskcdrdb (which contains the cost and the used rate of each
calls which is not 0). After you can generate many kind of statistics
from this (to see which extension, group etc. called which direction,
cost how much for you).

You can define the following parameters:

Zone Group

These are a collection of zones which is only used for grouping of
Zones (for the UI). You can put each Zone into one Zone Group.

Parameters:

  • You can give a name for each Zone Groups.

Example of Zone Groups:

  • Local
  • Long Distance
  • Mobile
  • Internationale, etc.

Zone

These are the definition of the Zones.

Parameters:

  • You can give a name for each Zones,
  • Assign it to the Zone Group which belongs to (choose from the list),
  • Define which pattern used for this Zone. This pattern is a
    regular expression which will be fitted on the destination number (ie. Do not use the asterisk style patters NXZ!!!). example:

    			^1888[0-9]{7}$
    	

Schedule

A Schedule is a collection of Schedule Parts.

Parameters:

  • You can give a name for each Schedule.

A Schedule Part define an interval(s).

Parameters:

  • You can give a name for each Schedule Part.
  • Assign it to the Schedule which belongs to,
  • Weekday of this Part 0-7 (both 0 and 7 means sunday) or -1 in case it's applied for all days,
  • From which time valid (format is: 'hh:mm:ss'),
  • Until which time vaild (format is: 'hh:mm:ss').

Rate

This define the cost paramters from which the cost can be calculated.

Parameters:

  • You can give a name for each Rate.
  • The accountcode of the call when this rate can be applied,
  • From when this rate is valid (format is: 'yyyy-mm-dd hh:mm:ss'),
  • Until when this rate can be used (format is: 'yyyy-mm-dd hh:mm:ss'),
  • The outbound Trunk perfix of the call (eg. Zap),
  • Zone for this rate is valid,
  • Rate is the call cost per minutes,
  • Minimum duration which will be charged in seconds,
  • Block size of the call duration (step size) in seconds,
  • Cost of the established connection, connection fee,
  • Disconnection cost,
  • The schedule in which rate is vaild.

Maintenance

In this tab you can run a few maintenance operations on the cdrcost table.


CustomContexts

Currently this is an unofficial module that must be manually installed. It can be downloaded using this link (link is to version 0.3.4 - see the discussion in this thread for additional patches). Source code for the individual components in this module is also available. Alternately, here is how to get and install this file using wget:

cd /var/www/html/admin/modules
wget http://www.freepbx.org/trac/browser/contributed_modules/release/customcontexts-0.3.4.tgz?format=raw
mv customcontexts-0.3.4.tgz?format=raw customcontexts-0.3.4.tgz
tar -xzvf customcontexts-0.3.4.tgz
rm -f customcontexts-0.3.4.tgz

There have been some reports of people being unable to connect to freepbx.org - in that situation, you can try downloading from this unofficial repository but note that this is an older release and may (probably will) need to be updated or patched:

cd /var/www/html/admin/modules
wget http://www.zelie.com/~n3glv/asterisk/customcontexts-0.3.3.tgz
tar -xzvf customcontexts-0.3.3.tgz
rm -f customcontexts-0.3.3.tgz

If the current version is higher than 0.3.3 then substitute that version in all of the above lines. Then in FreePBX, click on the Tools tab, Module Admin, and Custom Contexts, select Install, click on Process, and then the red bar to complete installation.

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.

What This Module Is NOT Intended For

  • This module is not intended to provide an alternative way to access code that is found in, or might normally be placed in extensions_custom.conf. You probably want the DialplanInjection module if that is what you are trying to achieve.
  • It's also not intended to give you simplified access to existing features, applications, or destinations (e.g. from an IVR) - you probably want to use Misc. Applications and/or Misc. Destinations (or possibly a Custom Extension) for that.

Known Incompatibility

Please be aware that if you you have installed both this module and HUDlite on the same system, HUDlite will allow users to bypass any restrictions placed upon them by this module. Therefore, restricted users should not be given access to HUDlite.

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.

As an added bonus, I added a select list to the devices/extensions page to allow you to easily select any of your custom contexts to place the device in.

Version 0.1.1 - Now has optional Time Groups which allows you to name a set of times to enable the user to not only deny or allow access to certain dialplan contexts, but to control access to each context by time, date or day also.

Version 0.1.2 - Changes
Bugfixes- deleted routes, etc. now are removed.
Context tests for spaces and illegal chars.
Moved admin to tools to reduce confusion.
Added option to allow entire internal dialplan. (Useful for time limit on everything)
Made description for outbound-allroutes clearer that allowing overrides to allow all routes.

Version 0.1.3 - Made it obvious when allowing one include may allow another entire context.

Version 0.2.0 - Added priority feature to allow the user to control in what order the allowed contexts are included.

Version 0.2.1 - Added Duplicate Context option to easily copy an entire set of rules.

Version 0.2.2 - bugfix

Version 0.3.0 - New Features:
Allow or Deny based on pattern matching.
Failover Destination (one for regular extension, one for failed feature codes)

Bugfixes:
Adjusted Gui, Duplicate context, now duplicates the description too.

Version 0.3.1 - New Features:
Now prompts on delete. After duplicate you are editing new context.
It is now possible to rename contexts.

Version 0.3.2 - New Features:
Optional PIN to protect failover destination.
Contexts can now be used as destinations. An IVR menu, Time Condition, etc. can now send a caller into a custom context.

Version 0.3.3 -
New Feature: Added Set All option to quickly allow/deny all.
Fixed bug which caused routes to be denied after rename/sort/or delete other route.

Version 0.3.4 -
Fix for compatibility issues with FreePBX version 2.3.1.3.

Installation of Beta version

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 customcontexts. 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 Custom Contexts. Click on it, click install, then click process and the red bar as usual.

Usage Instructions

Most users will not need to do anything in the Custom Contexts Admin section (now found under the Tools tab) - that is for advanced users. When you "add" or "remove" contexts from the Admin, you are not really adding or removing anything, you are just telling the module where to find all of the includes to list. By default there are three includes which should be sufficient for most users: from-internal, from-internal-additional, and outbound-allroutes. So, skip the Custom Contexts Admin section until you feel comfortable making changes there.

The first thing that you will want to create is time groups, if you plan to use those. The reason for doing this first is so that they will become available in the drop down selections when you create your custom contexts. For each group you create, you can decide which times it should be available. You can define multiple times within one named group, and then each named group then becomes available along with allow/deny for each choice under a custom context (this will become clearer further down), so you can allow, deny, or choose your time group to allow only at specific times/dates/days.

One thing to bear in mind when creating time groups is that this module will not forcibly end calls in progress. So if, for example, you have "free" calling on a particular route from 9:00 PM to 7:00 AM, you probably don't want to set the end time right at 7:00 AM, because then someone could make a call at 6:59 and talk for several minutes into the non-free period.

Now, to actually create a Custom Context, you go to the Custom Contexts page, and add a context - note that the context name may NOT contain spaces. Then add a description (spaces are okay here) and submit.

We'll talk about Dial Rules later - in many cases you will want to leave the Dial Rules blank.

Once the context is created, you can edit it to allow or disallow the features and routes you want a particular extension (or group of extensions) to have access to. There is a "Set All" option to set all the features and routes to Allow or Deny - this is useful when you want to start out with all of the dropdowns in one state, so that you only need to change the exceptions. Then choose "Allow" or "Deny" for each application or route - for example, you may wish to allow all, except for the items you specifically wish to restrict (for example, you probably want to restrict ChanSpy and ZapBarge!). If you have created any time conditions, it will also be possible to select those, to allow a feature or route to be accessed only during certain times. If you have any Dial Rules, you can choose to "Allow Rules" (allow the feature or route only if a Dial Rules pattern is matched) or "Deny Rules" (deny the feature or route only if a Dial Rules pattern is matched).

Certain items are in bold red letters, such as "ENTIRE Basic Internal Dialplan" and "ALL OUTBOUND ROUTES." If you allow ALL OUTBOUND ROUTES, it will override the individual route selections in the following section. So if you want users of this context to have access to all outbound routes, you can just allow outbound-allroutes and ignore the individual route sections (leave them all set to "deny"). But if you want to select routes individually, then make sure that outbound-allroutes is set to "Deny". Of course, you could also use non-overlapping time conditions for outbound-allroutes and individual routes.

If you allow "ENTIRE Basic Internal Dialplan", then it overrides every other selection on the page. You would normally only use this with a time rule, to allow your unaltered dialplan to be used for a portion of the day. Allowing the "ENTIRE Basic Internal Dialplan" without using a time rule is usually pointless. If you want control over individual items, deny "ENTIRE Basic Internal Dialplan", and allow only what you want.

Associated with each item a "Priority" dropdown. All priorities are set to 50 by default (so you can easily make any item higher or lower in priority). The best use of these is in the Outbound Routes section - you WILL want to make sure that any Outbound Routes that you allow are ordered by priority, otherwise your outbound calls may not be routed as you expect. Normally you will want to mirror the priority of the existing routes - the easiest way to do that is add 50 to the number at the start of the route, so for example if you have a route called "outrt-001-Emergency" you could add 50 to the "001" and use 51 as the priority. But note that you do not have to mirror the default priority of routes, which could become useful in certain situations.

For example, let's suppose you have an emergency route that goes to a an emergency answering point in your local area, but you also have another emergency route that goes to an emergency answering point in a community where you have a remote office. You could create two emergency routes going to the two different answering points and let the one going to the local point be higher in priority normally, but create a custom context for your remote extensions and in that custom context, make their community's emergency answering point higher in priority.

One more note about priorities - you can hide the display of the priority dropdowns by clicking on "Hide Sort Option" at the top of any custom context page. BUT - if you click on the "Submit" button while you have the priorities hidden, all the priorities on that page will be reset to the default (50)! So use this option with care!!

Note: This option is no longer available as its purpose was to clean up the page when priorities were listed below each context. Now that the display was fixed, the "hide priorities" option was removed.

At the bottom of the page, you can select a Failover Destination and a Feature Code Failover Destination. The Failover Destination is used when the called number does not start with a * and does not match on any route, while the Feature Code Failover Destination is used when the called number begins with a * and does not match any feature code. Be careful here, because it's possible to send a caller to a destination that gives them access to destinations that you don't intend for them to be able to access. Either or both of the Failover Destinations can be PIN protected, that is, you can enter a numeric PIN to require authentication before continuing to the destination.

Regarding Dial Rules, these can be used when you want to further allow or restrict access based on the number dialed. For example, you could give an internal caller access to a particular route only if 911 was called, or if a local number was called, while restricting their ability to place other calls on the same route. It's also possible to use the | character to strip off initial digits. For example, if you had a dial plan that included something like 90210|1NXXNXXXXXX you could set an outbound route to "Allow Rules" and it would generally restrict access to that route, except for those callers that know that they must dial 90210 prior to the 1+area code+number.

Sometimes you will want to create a new custom context that is very similar to an existing custom context you have already created - perhaps you only want to modify one or two items in the new context. The easiest way to do that is to go into the existing context, then click on "Duplicate Context ..." at the top of the page. This will create a duplicate of the existing context that you can edit as you
wish.

Finally, you need to go to your Extensions page and select each extension for which you wish to use a custom context. On each individual extension page, you should now see a dropdown to allow you to select a custom context. This drop-down is simply a convenient way to fill in the correct context in the "context" textbox. When you click on a custom context, it replaces whatever is currently in the "context" textbox with your new selection - if you choose "Default", it resets the extension back to the default "from-internal" context. Don't forget to click "Submit", and then click the red bar when you are all finished making changes.

NOTE that if you disable or uninstall the Custom Contexts module, you MUST reset all the extensions back to the default "from-internal" context. If you delete a time group, anyone who had that time limitation becomes "Allow" with no time restrictions. If you add a new outbound route, by default that route is set as "Deny" in the Custom Contexts, so you should go into each context and set it to "Allow" (or use a time condition) where appropriate.

One more caveat. After you add an outbound route, it is not available until you reload.


Dialplan Injection

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.1.1) using wget:
 

cd /var/www/html/admin/modules
wget http://www.zelie.com/~n3glv/asterisk/dialplaninjection-0.1.1.tgz
tar -xzvf dialplaninjection-0.1.1.tgz
rm -f dialplaninjection-0.1.1.tgz
 
 

Description

This unofficial FreePBX module allows you to create short custom dial plan fragments. While such fragments can also be added to extensions-custom.conf, the advantage of creating them in this module is that the resulting dial plan fragment can be directly selected as a destination in modules that use destinations. Optionally, the dial plan fragment can also be accessed directly by calling an extension number. Just about anything that could be put into extensions_custom.conf can be placed in a Dialplan Injection.
 
 
Version history

Version 0.0.1: Initial version

Version 0.0.2:

  • Fixed extension bug
  • Allowed patterns in extension (allows a Dialplan Injection to be accessed by a group of extensions defined by a pattern)
  • Commands are one big text area now

Version 0.0.3:
  • Added ability to add line labels. Labels also become available as destinations for other modules.
  • Each direct dial injection is now in its own context to allow individual inclusion in other contexts.
  • Version now display correctly on screen.

Version 0.1.0:
  • Removed unique constraint on direct dial extension.
  • Added templates for most dialplan apps.

Version 0.1.1: Fixed a few templates and version display bug.
 
 
Installation of Beta version

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 dialplaninjection. 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 Dialplan Injection. Click on it, click install, then click process and the red bar as usual.
 
 
Usage Instructions

To create a Dialplan Injection, click on Dialplan Injection and then on "Add Injection" (if you are not already on that page).

Enter a short description for your Injection - this should contain letters and numbers only.

Optionally, you may enter an extension number for direct access, which will allow dialing this injection directly. You may leave the extension field blank if you only plan to access the injection indirectly (such as from an IVR menu choice) OR if you plan to use Misc. Applications to create one or more extensions (or feature codes) for entry point(s). The extension may be a pattern (such as would be allowed in a route dial plan) to match (for example) a range of extensions. Also, you may use a pipe | to strip the preceding digits, as would be allowed in a route dial plan pattern.

Under Destination, choose a destination for use when all the lines in your Dialplan Injection have executed. For example, you could select Core: Hangup if you simply plan to play a message to the caller and disconnect. Or, you could send a caller to an IVR to make another selection.

Click on "Submit" to create the Dialplan Injection. Do not click the Red Bar yet.

Now select the Injection you just created from the list of Injections at the right. When you bring it up, you should see a text box where you can enter the actual lines of your injection. Remember, at this point you are playing the role of computer programmer and if you write bad code, your Injection wont work as you intend. Garbage in, garbage out. So check what you write very carefully.

As with code you might write in an actual context, you can use line labels to allow for conditional or unconditional jumps, or to permit multiple entry points to your code (for example, you might write a routine that returns certain information about an extension - if entered at one point, it might give the information about the extension the user is calling from, whereas if entered at a different point, it might prompt the caller to enter an extension and then give the report about that extension). To use a label, simply enclose it in parenthesis and put a comma between it and the statement, like this:

(label1),NoOp(This is a line with a label)

.....

GotoIf(somecondition?label1)

Each label you use can be selected as an entry point from other applications (for example, in Misc. Applications you will see a radio button and dropdown for Dialplan Injections, and in that dropdown you'll be able to select any labeled statement as an entry point, in addition to the normal entry at the top of the code). For example, if your Dialplan Injection was named My Injection and contained the above code fragment, you'd be able to use "My Injection" as a destination, and also "My Injection-label1".

There's also a "New Command" box that contains some commonly used commands, in order to help you recall the syntax of these commands. You don't have to select anything here but if you do, whatever you select will be pasted into your code.

Remember to put Ringing on a line by itself (usually as the first line of the code) if you want your caller to hear a Ringing signal until the call is answered. Also, you need to use Answer on a line by itself before playing any significant information to the caller (any message not having to do with call progress) in order to comply with legal requirements and to make sure that billing commences at the proper point. Obviously this does not apply for injections that can only be reached by internal callers, or can only be reached after the call has already been answered (by an IVR, for example).

When you are finished writing your code, click on "Submit", and only now should you click the Red Bar to enable use of your Dialplan Injection.

There is one other point that needs to be mentioned: If you have also installed the Custom Contexts module, you can individually allow or deny each Dialplan Injection. Here is how to do that (please note that nothing in the next three paragraphs will make sense to you if you have never used the Custom Contexts module):

Click on the Tools tab, Custom Contexts Admin, and Add context. Put ext-injections in the Context field (this must be entered exactly as shown), and give it a description (e.g. "Dialplan Injections"). Submit the page and click on the Red Bar.

(Optional but recommended): Go back to Tools, Custom Contexts Admin, and click on the description you just created (e.g. "Dialplan Injections"). When the page comes up, give each of the injections a meaningful name, rather than the default ext-injection-number. Note that the numbers at the end of each default injection name match the numbers in angle brackets following each injection name on the Dialplan Injections page. At present the Custom Contexts Admin tool doesn't seem to pick up the "friendly" name of the Dialplan Injections automatically.

After doing the above, you can go to the Setup tab, Custom Contexts, and edit your contexts (this assumes you've already created some custom contexts) as follows: Deny ext-injections, which should now be in red text, unless you want the context to allow ALL Dialplan Injections. Then, allow only those injections you wish to allow in each custom context.
 
 
Examples

Here are some actual Dialplan Injections to give you an idea of how simple a Dialplan Injection can be:
 
 
Play Music On Hold from the default context to the caller for up to 9999 seconds:

SetMusicOnHold(default)
WaitMusicOnHold(9999)

 
 
Inform a caller that no 911 service is available on the line by playing an appropriate recording three times, separated by one second of silence (note this should never actually be used as a substitute for 911 service, it's just an example):

Playback(no-911-2&silence/1&no-911-2&silence/1&no-911-2,noanswer)

The ,noanswer means that if the call has not already been answered it will not be, since this is considered a call progress message (Playback, unlike some other methods of playing audio, defaults to answering the line and requires the ,noanswer appendage if you don't want the call answered).

In both of the above examples, you would probably use Core: Hangup as the Final Destination.
 
 
Before ringing a particular line, play a recording to the caller containing some sort of notice. Here we'll play one second of silence (optional, but useful if some of your callers are calling from a phone with a dial in the handset - it gives them time to get the phone to their ear), then the system recording that says "This call may be monitored or recorded":

Playback(silence/1&this-call-may-be-monitored-or-recorded)
Ringing

Then use Core: and the desired extension (or, if you prefer, a ring group) as the final destination. You can then use this Injection as a selection from your main IVR menu, so that callers that select this extension or department hear the recording first.

In a way this is a trivial example, because when creating a Ring Group you can specify an announcement to be played before ringing commences, and System Recordings lets you concatenate multiple recordings into one (so you don't really need to use a Dialplan Injection if that is all you want to do). BUT, suppose you want to play some audio that is dynamically generated by an AGI script, rather than system recordings? For example, you could call an AGI script that plays some information about current conditions (e.g. system status, the weather, or whatever you might be monitoring), then returns to an IVR as a final destination.
 
 
Inform caller that parking lot slot is empty (example pattern usage) - Let's say you have a parking lot for parked calls with eight slots, which can be numbered 901-908. If a caller tries to pick up a parked call and it's no longer there, you want to inform them of that fact. So, you would create a Dialplan Injection and use a pattern for the extension:

_90[1-8]

(Note: the underscore as the first character of a pattern is not required, as the module will insert it in the dialplan if it detects a pattern).

Then for the actual injection, simply play one second of silence, followed by an appropriate system recording:

Playback(silence/1&pbx-invalidpark,noanswer)

If there is a parked call, it takes precedence when someone dials the appropriate parking lot extension, otherwise the Dialplan Injection kicks in and plays the message to the caller.
 
 
Modified Speaking Clock routine with labels and multiple entry points - Finally, here's a more complex example - a modified Speaking Clock routine, that can give the time in either of two time zones (in this example, U.S. Eastern and U.S. Central time, but you can change these to any standard Unix time zones). This example uses labels, AND has two entry points (you can add more). We'll show the complete instructions to implement this:

1) Go to Dialplan Injections, Add Injection. Give it a description (e.g. "Speaking Clock") but do NOT give it an extension (with the code as shown you actually could add the extension for the Eastern Time Zone entry point, but for demonstration purposes we won't give it an extension here). Make the Destination Core: Hangup. Click Submit.

2) Re-Enter your new Injection, and paste the following code into the "Command" textbox:

(est),NoOp(Speaking Clock for Eastern Time Zone)
Set(TimeZn=EST5EDT)
goto(scstart)
(cst),NoOp(Speaking Clock for Central Time Zone)
Set(TimeZn=CST6CDT)
(scstart),Ringing
Set(FutureTime=$[${EPOCH} + 8])
Set(FutureTimeMod=$[${FutureTime} % 10])
Set(FutureTime=$[${FutureTime} - ${FutureTimeMod}])
Set(MaxConnectTime=$[${FutureTime} + 180])
(scringsomemore),Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
GotoIf($["${FutureTimeMod}" < "0"]?scanswer:scwaitasec)
(scwaitasec),wait(1)
goto(scringsomemore)
(scanswer),Answer
(scplayagain),Set(FutureTime=$[${FutureTime} + 10])
Set(FutureTimeMod=$[${FutureTime} % 60])
wait(1)
playback(at-tone-time-exactly)
SayUnixTime(${FutureTime},${TimeZn},IM)
GotoIf($["${FutureTimeMod}" = "0"]?scexactmin:scsaysecs)
(scexactmin),SayUnixTime(${FutureTime},${TimeZn},p)
goto(scwaittobeep)
(scsaysecs),playback(and)
SayUnixTime(${FutureTime},${TimeZn},S)
playback(seconds)
(scwaittobeep),Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
GotoIf($["${FutureTimeMod}" < "1"]?scplaybeep:scwaitsectobeep)
(scwaitsectobeep),wait(1)
goto(scwaittobeep)
(scplaybeep),playback(beep)
Set(FutureTimeMod=$[${MaxConnectTime} - ${EPOCH}])
GotoIf($["${FutureTimeMod}" < "1"]?scthatsall:scplayagain)
(scthatsall),GotoIf($["x${IVR_CONTEXT}" = "x"]?app-blackhole,hangup,1:${IVR_CONTEXT},return,1)

3) Click Submit after entering the above.

4) Now, because we want multiple entry points, go to Misc. Applications, Add Misc. Application. Give it a description (such as "Speaking Clock-Eastern") and a feature code number (an unused one, or you can use *60 if you have disabled FreePBX's default speaking clock under Feature Codes). For the Destination, select Dialplan Injection and in the dropdown select "Speaking Clock-est". Submit.

5) Repeat step 4, except make the description different (e.g. "Speaking Clock-Central" and assign a different feature code. In the dropdown, select "Speaking Clock-cst". Submit.

6) Click the red bar. Now you can use one extension or feature code to get the time in one time zone, and the other extension or feature code to get the time in the other.

Alternately, if you have also installed the Custom Contexts module, you could use the same feature code number in steps 4 and 5, but then set up custom contexts in such a way that any particular extension only gets access to one time zone or the other.
 
 
Module Author: naftali5

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
 
 

Description

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.
 
 

Installation of Beta version

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

Feature Panel

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.2) using wget:

cd /var/www/html/admin/modules
wget http://www.zelie.com/~n3glv/asterisk/featurepanel-0.0.2.tgz
tar -xzvf featurepanel-0.0.2.tgz
rm -f featurepanel-0.0.2.tgz
 
 

Description

This unofficial FreePBX module allows you to see the status of certain features on extensions that are normally activated/deactivated using *xx feature codes. The status of those features can be modified from within this module's web page.

Features that can be checked or modified currently include:

  • Call Forward All
  • Call Forward Busy
  • Call Forward No Answer/Unavailable
  • Call Waiting
  • DND (Do Not Disturb)
  • User Intercom

Note: This module can only be used to view or change settings that are set within FreePBX/Asterisk. Some features may be activated at the device level (IP phone or VoIP adapter) and this module cannot interact with those settings. If you want to be able to control these settings from this module, you should turn off these features in the device configuration settings of phones and VoIP adapters, so that they will be controlled by Asterisk and FreePBX only.

 
 

Version history

Version 0.0.1: Initial version

Version 0.0.2: Allows selecting external or non-standard extensions for feature settings
 
 

Installation of Beta version

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 featurepanel. 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 Feature Panel. Click on it, click install, then click process and the red bar as usual.

Module Author: naftali5