Brekeke PBX Wiki

ARS Plug-in Installation and Setup

 

Steps to Create an ARS Plug-in

 

Step 1. Create a java class. You can use any name for your java package and class.

Step 2. Create a method in your class with the following format:

public static String plugin( String param )
or
public static boolean plugin( String param )

Although this example uses the function name “plugin”, you may use any function name you desire.

 


Installation and Setup

 

Compile your class and place it in the classpath

Place your compiled class file in exact directory structure of package name under the directory:

<Brekeke PBX install_directory> /webapps/pbx/WEB-INF/classes

 

For example:

class name = YourClass, package name = com.yourdomain

There are following two ways to place your class:

 

Way 1. Place “YourClass.class” under the directory:

<Brekeke PBX install_directory> /webapps/pbx/WEB-INF/classes/com/yourdomain

Way 2. Compress your class file into a jar file and place the jar file into

<Brekeke PBX install directory>/webapps/pbx/WEB-INF/lib

 

Configure Brekeke PBX to use the new plug-in

Step 1. Log into the Brekeke PBX Admintool.

Step 2. Navigate to ARS menu.

Step 3. Edit an existing route or create a New Route.

Step 4. Under Patterns > [Matching patterns], set the following fields:

[Plugin] field
Specify your plug-in class and method name including your package name.
For example: yourpackage.YourPluginClass.yourMethod

[Param] field
Set the parameter which will be passed to your plug-in. You can use the text strings specified using parenthesis ( ) in the fields (such as fields To, From, etc.) for setting the parameter.

(Example)

The variables for referring to those text strings enclosed in parenthesis in each field are:

[From] &f1, &f2 …. &f9
[To] &t1, &t2 …. &t9
[User] &u1,&u2 …. &u9

 

[Return] field
Boolean or String will be returned by the plug-in.

  • If your plug-in returns a boolean, [Return] field will not be used. When your plug-in returns true, this ARS pattern will be applied.
  • If your plug-in returns a String, you can set the matching condition using regular expressions in this field. If the condition is fulfilled, this ARS pattern will be applied.
  •  Variables (&p1, &p2, ….., &p9) can be used to refer to the text strings enclosed in parenthesis in [Return] field and these variables can be used in fields in Deploy Patterns.

 

 

Related Links:

 

Yes No
Suggest Edit