Developer's Guide: Audio File Plug-in
This plug-in interface provides ways to process the audio files created by the call recording or voicemail features of Brekeke PBX. You need to use Java programming language to create your own plug-in. The following plug-ins are included in the product. You don’t need to develop plug-in when uploading to http server or moving files.
Steps to Create a Plug-in
1. Add the ondopbx.jar file to your classpath:
<Brekeke PBX install_dir>/webapps/pbx/WEB-INF/lib/ondopbx.jar
2. Create a JAVA class and implement the interface:
com.brekeke.pbx.media.plugin.RecordingPlugin.
Interface
Interface:
RecordingPlugin, RecordingPlugin_mt
*With Brekeke Multi-Tenant PBX, “RecordingPlugin_mt” will be used.
Package name:
com.brekeke.pbx.media.plugin
Method:
eventRecorded
Description:
This method is called when recording finishes and an audio file is created. An instance of the class will be created every time a message file is created.
Parameters:
tenant Tenant name (available only for Interface:RecordingPlugin_mt)
user User
uprop Properties related to the user
file File created
prop Properties of the file
type Type
TYPE_VOICEMAIL(0) Voicemail
TYPE_CONVERSATION_RECORDING(1) Recorded call
TYPE_NAME (2) Name
TYPE_GREETING1 (3) Personal Greeting
TYPE_GREETING2 (4) Alternative Greeting
Returns:
To delete the file, return false. To save the file, return true.
Sample
The following is a sample program which will upload the recorded calls to a FTP server. Nothing will be performed when voicemails are created.
(Please refer to other resources regarding the detailed codes for FTP)
package yourpackage;
import java.io.*; import java.util.*; import com.brekeke.pbx.media.plugin.RecordingPlugin_mt; public class YourRecordingPlugin implements RecordingPlugin { public boolean eventRecorded( String tenant, String user, Properties userProp, File file, Properties prop, int type) { if( type == TYPE_CONVERSATION_RECORDING ){ SampleFTPUploader.uploadToFtpServer( file ); return false; }else{ return true; } } }