Replacement for freepbx php callback script

Introduction

The script could be of help if you use:

This is a modified version of the script distributed with freepbx and has no additional prerequisites

Version 0.3 contains minor modifications to work with freepbx 2.6 which are not backwards compatible. For freebpx 2.5 use version 0.2

Version 0.2 introduces the following changes

Instead of connecting to the manager interface or to the cli, this script by default outputs an asterisk call file. It can be configured to connect to the manager interface instead. PRIVACY: the call files are initially written to /tmp file system so anyone who has access to this can read the contents. On a dedicated server that should not be an issue. When complete the call files are moved to the asterisk outgoing directory /var/spool/asterisk/outgoing where asterisk picks them up automatically.

The following variables defined in amportal.conf control the behaviour:

#whether to dial the callback number with a prefix (e.g. if this is needed to select the outgoing trunk).
#Default is blank (no prefix)
CALLBACK_PREFIX=

#the callerid to use for the callback.
#Default is Callback
CALLBACK_CLI=Callback

#how many times to retry the callback
#Default is 2
CALLBACK_RETRY=2

#how much time in seconds to leave between callback attempts
#default is 15
CALLBACK_INTERVAL=15

#how long to wait in seconds for the callback to be answered
#Default is 20
CALLBACK_WAIT=20

#whether to archive asterisk call files (Yes or No)
#Default is No
CALLBACK_ARCHIVE=No

# Whether to use call files (file) or manager interface (api)
# Default is file
CALLBACK_METHOD=file

# Allowed list of incoming caller ids (comma separated). 
# If non-empty, and one of the indicated caller ids is contained in the incoming caller id 
# then the callback goes ahead. If non-empty but no match, then the callback is terminated.
# If empty (the default), then this parameter has no effect.
CALLBACK_ALLOWED=

Version 0.3 of the script has been tested with asterisk 1.6.2 and freepbx 2.6.

Version 0.2 of the script has been tested with asterisk 1.6.2 and freepbx 2.5.1.5.

The script has not been tested on asterisk 1.4 or trixbox, if anyone does use it on one of these platforms, please let me know the result.

As there were changes to the manager between asterisk 1.4 and 1.6 (in particular the need for originate permission in manager.conf in order to use the originate action whereas in 1.4 call permission was sufficient), if you do not need to make use of the features defined by the above variables, such as the dial prefix, you could use the original freepbx script after adding originate permission to manager.conf.

Obtaining and installing

Warning

The script is provided "as-is" without any kind of warranty. I'm happy to receive feedback and correct issues that are found in the script. Because the use of callback potentially opens up functions of your system which are normally reserved to internal users, it is important to thoroughly test your callback configuration.

Download

For freebpx 2.6

callback-0.3.tgz

The following files are not part of the install but are needed if you want to verify the gpg signature of the downloaded file:
GPG signature for callback-0.3.tgz
John Fawcett public key

For freebpx 2.5

callback-0.2.tgz

The following files are not part of the install but are needed if you want to verify the gpg signature of the downloaded file:
GPG signature for callback-0.2.tgz
John Fawcett public key

Installation

The following is an example for version 0.3, substitute 0.3 with 0.2 if you downloaded that version for freepbx 2.5

Contact

john at gufonero.com

Last Modified: Tuesday, 30-Mar-2010 03:46:41 CEST