Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

 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+*

Note
titleSoftphone

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.

Note
titlededicated 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.

...

  1. Open a Browser and enter the address of your asterisk server in the address bar (ie http://192.168.1.101)
  2.  From 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

...

  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)

...

  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

...

    1. - unless you changed this in your /etc/asterisk/manager.conf file on your Asterisk server leave this unchanged
    2. login

...

    1. - Manager name you assigned when setting up the Asterisk Manager API credentials
    2. secret

...

    1. - password you assigned when setting up the Asterisk Manager API credentials
    2. timeout

...

    1. - 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. Wiki MarkupThis 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