Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To create new scripts navigate to : Provision | Scripts


Overview

If you are not a programmer or at least a budding programmer you should now look the other way and pretend you never saw this page.

On the other hand if you think you are a dab hand at programming and want to do some really groovy stuff with your PBX then you have come to the right place.

Action Scripts allow you to write 'mini-programs' that actually extend your PBX's functionality. In fact all of the Call Routing within your Noojee PBX is done via Route Step Action Scripts, so you have the same level of power and control as the Noojee Developers do.

BE WARNED: Action Scripts are extremely powerful and can easily cause your WHOLE PBX TO CRASH.

So don't say you were not warned!

Hopefully you have packed an extra pair of undies, because you are going to need them. So lets get into it.

This page is only meant to be a mini-guide. Full documentation of Action Scripts is on the main Noojee Wiki at 04.1.10 Action Scripts.

What is a script

Essentially a Action Script is a small piece of code written in Java (NOT Javascript) that can be used to extend your Noojee PBX.

There are currently five (5) types of Action Scripts:

  • Route Step
  • Disposition Action
  • Screen Layouts Action
  • Utility
  • System Startup Action

Each Action Script type allows you to enhance a different aspect of your Noojee PBX.

Why use Action Scripts?

Action Scripts let you extend the core functionality of your Noojee PBX and perhaps more importantly let you connect your Noojee PBX with third party systems.

If you are looking at integration with third party systems you should also look at Noojee's Zapier integration. Zapier allows your Noojee PBX to integrate with over 700 other applications (e.g. Salesforce, Netsuite, Google Docs etc) with any programming.

You might want to validate an account no. captured via an IVR, lookup a customers outstanding balance, send a payment to a Credit Card gateway. The ability of Action Scripts is on limited by your imagination.

Route Steps

Creating your own Route Step Action Scripts allows you to add control to how a call is routed. I might want to request a user to enter a PIN and then use an Action Script to query an external DB to validate that PIN.

A Route Step also you can also provide a mini-UI which is displayed when your Route Step is used in a Call Route Step. The purpose of the mini-UI is to allow the user to select one or more parameters which are passed to your Route Step at run time.

Disposition Actions

Custom DAs can let you add advanced control logic around how a lead is processed. You might need to consult an external DB to see if a lead should be called again based on data entered by an agent.

Note: Noojee's Zapier integration allows you to trigger external actions as the result of a lead being dispositioned without having to right an Action Script.

Screen Layout Actions

Allow you to extend the Javascript you right in a Screen Layout to call into server side Java code. This can be necessary if you need to securely access a third party system and don't want access tokens exposed to Javascript. It also allows to take advantage of Java's more powerful programming constructs (not to mention the better error handling and compile errors rather than runtime errors).

Utility

A utility Action is a Java Class that can be used by any other Action type. This is really just a place to put common code.

System Startup Action

These actions are called whenever your PBX is restarted and allow you to do any startup processes such as scheduling recurring events.

Versions

To make your life easier Noojee PBX supports the concept of having multiple version of a given Route Scripts only one of which is designated as the 'Active' script. This allows you to start working on a script without affecting how your PBX is operating until you are ready to deploy the new version of you Script. 

You can create a new version of your script at any time by coping the context of your existing Script click the 'New' button under  the 'Script' tab and paste the original script. You can then start making changes which are saved to the new Script version.

Once you are happy with your Script you can make it active by selecting the version if the list of versions under the 'Script' tab and then selecting the 'Make Active' action and clicking the 'Apply' button.

Identifying and Fixing errors

As you code your Script the system will automatically compile the script in the background. Any errors will be marked on the applicable line in the left hand margin. Hover you mouse over the error indicator to see the details of the error. Once you fix the problem the error indicator will disappear. The error system will only ever show the first error in the script so start fixing errors at the top of the file first.