Two of the great features of the 3CX IP PBX are its ability to perform call recording and its ability to activate/deactivate call recording via the HTTP API. Most users are aware that call recording can be enabled per extension through the 3CX Admin Console. But, many users are not aware that through the use of the HTTP API you can take advantage of one-touch call record buttons on your IP phone. Here’s how…
One of the most popular lines of phones for the 3CX PBX is the Astra 5i series of phones. This family of phones is extremely flexible through its ability to allow the user to custom program soft keys on the handset via the phone’s web interface.
Enabling a user to have one touch call recording is as simple as adding 2 buttons to your Aastra IP phone.
Here’s how to do this for a v6 3CX box:
1. First, add a softkey of type XML
2. Give it a label of “Record On”
3. And a value of http://10.168.1.10:5481/update_extension.php?extnum=1000&pwd=1000&record_calls=1 (edited accordingly for your server parameters and extension info of course)
4. Next, add a softkey of type XML
5. Give it a label of “Record Off”
6. And a value of http://10.168.1.10:5481/update_extension.php?extnum=1000&pwd=1000&record_calls=0 (edited accordingly for your server parameters and extension info of course)
7. Save your settings
Now, you should have two softkeys on your Aastra handset LCD screen. One called “Record On” and one called “Record Off”. Simply pressing those keys will enable/disable call recording for your extension! Remember, this takes effect on the next phone call. In other words, you cannot enable/disable call recording mid-call.
You may notice one slight issue here. You see an error on the IP phone screen! This is because the Aastra phone is expecting to receive XML content back from the HTTP request it just posted. But, it does not receive any understandable content and so it displays an error. But, if you log into the admin console in 3CX you will see that call recording is being successfully enabled/disabled. So, this “error” is purely a phone issue related to the lack of content that is sent back to the phone. Well, we don’t like errors, so how can we fix this….
Well, the strategy is simple. We will add the appropriate XML output to the update_extension.php file. Ok, let’s begin….
1. Go here http://3cxblog.worksighted.com/2008/09/xml-applications-for-aastra-5xi-series.html and download my aastra.zip file. This file contains the core Aastra php/XML libraries that have been slightly modified to work with the v6 3CX system on Windows. Simply unzip and drop the aastra folder into C:\Program Files\3CX PhoneSystem\Data\Http\aastra (assuming your installation is setup in the default location).
2. You also need to edit httpd.conf to allow access to the new aastra subdirectory via http. You need to edit C:\Program Files\3CX PhoneSystem\Bin\Apache\conf\httpd.conf and add the following …
<Location /aastra>
Allow from all
</Location>
and save the file. You will need to restart the 3CX Apache service for that change to take effect!!
3. Now, make a copy of the file C:\Program Files\3CX PhoneSystem\Data\Http\update_extension.php before we modify it. Once you have done that, edit the file and add the following to the top up with the other includes.
include('aastra/include/aastracommon.php');
4. Now, locate the section of code beginning with
if(in_array($record_calls, array(1,0))) {
$ext->setRecordIn($record_calls);
We are going to add the following code WITHIN this if statement immediately below the line which is setting the recording value.
header("Content-Type: text/xml");
$output .= "<AastraIPPhoneTextScreen LockIn=\"No\" destroyOnExit=\"yes\">\n";
$output .= "<Title>Call Recording</Title>\n";
$output .= "<Text>Recording is set to: ".$record_calls."</Text>\n";
$output .= "</AastraIPPhoneTextScreen>\n";
header("Content-Length: ".strlen($output));
echo $output;
So, in the end, our code block should read as follows….
if(in_array($record_calls, array(1,0))) {
$ext->setRecordIn($record_calls);
header(“Content-Type: text/xml”);
$output .= “<AastraIPPhoneTextScreen LockIn=\”No\” destroyOnExit=\”yes\”>\n”;
$output .= “<Title>Call Recording</Title>\n”;
$output .= “<Text>Recording is set to: “.$record_calls.”</Text>\n”;
$output .= “</AastraIPPhoneTextScreen>\n”;
header(“Content-Length: “.strlen($output));
echo $output;
}
5. Save the file update_extension.php (no fears because you created a copy of the original right?)
That’s it! Now go press your call record buttons and you will get back a nicely formatted message on the center of the screen indicating whether or not you are recording your calls.
If you use a mix of phones….I would suggest adding a detection to make sure its an aastra phone making the request so as to send back the proper XML to the correct types of phones.
Happy 3CXing!!!
Best,
Mike



