Extension:AsteriskDialNumber

What can this extension do?
The purpose of this extension is for intranet use. When a user is logged in with his username then a script on the Asterisk PBX can assign this username to a phone no. The asterisk PBX is then able to make a call from the phone no of the caller to the number between the tags. This way you can easily build up a phone directory with click to dial functions. (Example: We have modified the SQL2Wiki extension in a way that all numbers starting will e.g. "0" and a certain length will automatically be wrapped with these tags. Thus you can extract your phone directory from your (MySQL) database and have click2dial for all numbers)

Usage
Enable Tag in MediaWiki page e.g 01234 5678. For all logged in users this will generate a link to a Asterisk callback function via HTML, eg. All users who are not logged in, only see the plain number as shown between the tags.

The callback function on the asterisk server has to lookup the username, get the callback no of the logged and has to call this callback no. After picking up the phone the destination number shall be dialed. (there are several solutions available for that, e.g. in the Trixbox edition).

Download instructions
Please cut and paste the code found below and place it in. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
To install this extension, add the following to LocalSettings.php:

Configuration parameters
Please change the URL for your Asterisk server.

User rights
You can use it at your own risk. Please take care that you do not open free calls for registered users who are not allowed to. This extension therefore should only be used in an intranet environment.