Access to add and change pages is restricted. See: https://cwiki.apache.org/confluence/display/OFBIZ/Wiki+access

Skip to end of metadata
Go to start of metadata

 This HOWTO will attempt to explain how to integrate "Click-to-Call" functionality from Open For Business to an Asterisk Server running the Asterisk Manager API*.  *Note: REQUIRES Java JDK 1.5+*

Softphone

Tribox and most here are for those that have local lines and need hardware to hook pnone lines into the asterisk server. The other way is to use VIOP service that has Asterisk interface. this takes the place of the Tribox.

dedicated server

if your running a dedicated server with a 3gz cpu and 4gb memory you can run Asterisk as well.

Setting Up Asterisk 

Because of the process priority that Asterisk must take for quality voice transmission, you'll want to run Asterisk from its own box.  This makes TrixBox a perfect solution to accomplish this.  It is a Centos OS distribution with Asterisk and FreePBX built in.

Installing Asterisk 

The current version for TrixBox is 2.0, however the people at Nerd Vittles have written up a very easy to follow installation tutorial that took the TrixBox 1.2.3 iso and "Nerd Vittlized" it.  They also have a VMware/WindowXP version that makes the whole process simple for a testing or ultra small business use (1 or 2 phone lines).

 Once you've completed the Nerd Vittles installation tutorial, you'll need to set up credentials that OFBiz can use.

Setting Up Asterisk Manager API Credentials 

*Note we'll use 192.168.1.101 as the IP address of your Asterisk Server and 192.168.1.100 as the IP address of your OFBiz Server

  1. Open a Browser and enter the address of your asterisk server in the address bar (ie http://192.168.1.101)
  2. From the TrixBox welcome screen click "System Administration" (http://192.168.1.101/maint)
    1. User name should be "maint"
    2. Password is what you assigned in the Nerd Vittles tutorial
  3. Click the "FreePBX" link (http://192.168.1.101/admin)
  4. At the top of the page Click "Tools" (http://192.168.1.101/admin/config.php?type=tool)
  5. Under the System Administration Group Click "Asterisk API"
  6. On the right side of the screen Click "Add Manager"
  7. Complete the Form
    1. Enter the username (manager name)
    2. Enter the password (secret)
    3. Deny Everyone (0.0.0.0/0.0.0.0)
    4. Allow your Ofbiz Server (192.168.1.100/255.255.255.0)
    5. Check All the Boxes for both the Read and Write columns
    6. Submit Changes
    7. Click the Red Bar at the top to reload the settings

Now your Asterisk Server is setup and ready for OFBiz to send commands.

Setting Up OFBIZ 

Installing TrixBox component

This is currently OFBiz JIRA issue 640 (1/22/2007)

  1. Patch your OFBiz installation with trixbox.patch
    1. this will create a component in your hot-deploy directory (ofbizhome/hot-deploy/trixbox)
  2. create a lib folder in the trixbox component (ofbizhome/hot-deploy/trixbox/lib)
  3. Download the 4 jars into the lib folder (ofbizhome/hot-deploy/trixbox/lib/
    1. asterisk-java-0.3-m1.jar (285 kb)
    2. asterisk-jtapi-0.2.jar (46 kb)
    3. gjtapi-20060515.jar (610 kb)
    4. jtapi-1.3.1.jar (131 kb)

Setting Up Trixbox component

The setup is very simple.

  1. Locate /trixbox/config/trixbox.properties
  2. Change the following settings to match your Asterisk Manager API
    1. server - the location of your Asterisk Server either by domain name or IP address (ie 192.168.1.101)
    2. port - unless you changed this in your /etc/asterisk/manager.conf file on your Asterisk server leave this unchanged
    3. login - Manager name you assigned when setting up the Asterisk Manager API credentials
    4. secret - password you assigned when setting up the Asterisk Manager API credentials
    5. timeout - leave as is

Utilize the service - callOriginThenExtension

This is a service that invokes a simple-method and just needs a few parameters to initiate the click to dial call.  You can use your imagination on how to invoke it and pass the parameters (ie form, hyperlink, other services, etc).  Please be cautious of security though because you are likely giving OFBiz access to an outside line that someone could use. 

  1. originatingChannel
    1. This is the first channel to call.  Should be in the format of IAX2/[extension] or SIP/[extension].
      1. I will do some testing to see what format it needs to be in for the originatingChannel to be POTS number possibly something like ZAP/[outsideNumber]
  2. extension
    1. This is the second channel to call.  This is usually just the phone number.  Your dialplan in asterisk should determine how to handle this.
  3. priority
    1. I don't have all the details on what this does.  If not provided, the service will assume "1" which I believe takes top priority (ie call now)
  4. context
    1. This is the context that it will invoke from in the dial plan.  I haven't done much experimenting here yet.  This is likely where you'll want to implement security.
  5. actionTimeout
    1. The timeout in milliseconds for the action to complete, in this case I believe it is the cumulative time it takes for the first channel to answer and the second channel to respond
  • No labels