OpenERP integration with FreePBX using Click2Dial from Akretion

Does anyone know how to manually modify the Asterisk dialplan (obviously not in extensions.conf) to automatically call a script upon the reception of an external phone call?

This should be located in the context dedicated to the reception of external phone calls, and insert an extension that will execute the AGI function with the location of the script (/usr/local/bin/ as the parameter. To work correctly, this extension must be placed before the Dial() function which rings the IP phone of the user.

We use device/user mode in FreePBX 1.818.210.58-1

Following the instructions here , we have everything working except where/how to call up the script from the asterisk dial plan for incoming calls - (calling up the ‘agi_callerid…’ command manually as described in the instructions, communicates perfectly between OpenERP and Asterisk).

We tried the following in the extensions_custom.conf for one of our extensions/users but it does not appear to work:
exten => 321,1,AGI(/usr/local/bin/

Much obliged for any input.

Did you manage this? If no I could help

Two easy steps:

  1. at the end of the the file /etc/extensions_custom.conf add some asterisk dial plan like this:

    exten => s,1,AGI(/usr/local/bin/
    exten => s,n, …etc…

  2. In FreePBX, Admin, Custom Destination, set a destination with:
    “cid-name-timeout,s,1” (without the quotes)
    Add your own description and notes. You can then use this destination anywhere within the GUI to handle a call.