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/get_cid_name_timeout.sh) 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 http://www.akretion.com/open-source-contributions/openerp-asterisk-voip-connector , 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:
[from-sip-external]
exten => 321,1,AGI(/usr/local/bin/get_cid_name_timeout.sh)

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:

    [cid-name-timeout]
    exten => s,1,AGI(/usr/local/bin/get_cid_name_timeout.sh)
    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.