Web Voice Mail v. 2.1

  1. Introduction

  2. Web Voice Mail package

  3. Target platform

  4. Web Voice Mail functionality

  5. Installation

  6. How applet uploads mp3 file to server

  7. Mp3 applet interface

    7.1 Public recording applet methods which are accessible outside of applet.

    7.2 JavaScript methods which are accessible from recording applet.

    7.3 Recording applet parameters.

  8. How to customize the input level indicator

  9. How to register the Web Voice Mail

  10. How to translate applet messages to the national languages

  11. Troubleshooting

Introduction

Web voice mail allows to send voice messages from web sites to any existing e-mail client software, even to free web based e-mail like Hotmail and Yahoo. The recipient receives the usual e-mail message with link to Mp3 audio file. He/she can download Mp3 file and listen it by any existing Mp3 playback program.

To voice message recording on the web voice mail page the audio recording applet is used. It records in Mp3 format.

Audio recording applet is developed in Java 1.1 and does not require the Java 1.3-1.5 plug-in installation.

To Mp3 encoding/decoding the LAME Mp3 audio codec is used.

TOP

Web Voice Mail package

1.Audio recording applet (RPAppletMp3.cab, RPAppletMp3.jar)

2.Sound capture/playback, LAME Mp3 encoding/decoding DLL (jaudioMp3.tar)

4.Server scripts (retrive.php, sendmail.php)

5.Web page example ( mail.php)

6.Documentation.

TOP

Target platform

 

Target OS Platform: Windows 98/NT/2000/ME/XP/2003, Mac OS X.

Target browsers:

- on the Windows : Microsoft Internet Explorer 4.0 and up, Netscape 7, FireFox, Mozilla, Opera.

- on the Mac : Safari, Opera.

Java versions: Microsoft Java 1.1 and Sun Java plug-in 1.4 -1.6.

Web Servers: Unix, Microsoft ( PHP support is required).

TOP

Web Voice Mail functionality

The idea of voice mail is very simple. Web voice mail application creates the text and voice messages and send them to web server via HTTP by POST method. On the server side the server scripts create usual e-mail message body with text message and with link to Mp3 file (voice message). Mp3 file is stored on the server. Server script passes the e-mail message body to Mail Transfer Agent, which send it to recepient. Recepient receives the e-mail message with text and link to Mp3 file and downloads Mp3 file.

To voice message recording the Mp3 audio recording applet is used. The functionality of recording applet is following:

1.Audio capture from sound card. The sampling frequencies are 8000Hz, 11025Hz, 16000Hz, 22050Hz, 32000Hz, 44100Hz.

2.LAME Mp3 audio encoding/decoding.

3.Playback of the recorded Mp3 file for sound quality and content evaluation.

4.Uploading of Mp3 file to web server via HTTP.

Demo version allows to record 20 sec only.

The Mp3 audio recording applet is developed in Java 1.1. So, the applet works with Microsoft Java 1.1 ( i.e. Recording applet works on the target browsers with default browser JVM installation) and with Java plug-in 1.3-1.5. The recording applet uses native methods for sound capture and LAME Mp3 encoding/decoding. They are developed in C++ and implemented as DLLs ( jaudioMp3Win.tar and jaudioMp3Mac.tar). The DLLs will be installed on the client computer if the applet is being used for the first time. The recording applet is digitally signed. For digitally signing the Thawte certificate is used.

TOP

Installation

  1. Make sure your Web server supports PHP and it's 'mail' function.

  2. Create on the server the directory /voicefiles and /mail in the root of the web server. For example: www.vimas.com/mail/ and www.vimas.com/voicefiles/ . Please, for begining, create these folders in the root of web server! After applet works properly, you may change the folders location. Note! It may be will require the changes in the server script.

  3. Make changes to the mail.php. You should correct the following parameters:
    $USERDIR="mail"; - the folder inside the voicefiles folder to store mp3 files
    $VoiceServerFolder = "/../voicefiles/"; - the path to 'voicefiles' folder
    $retrive="http://www.vimas.com/voice/test/mp3/retrive.php"; - the URL of server uploader script
    $appletCodebase="."; - path to applet's archive files. '.' means the same path as mail.php has
    To find out deeper information about $VoiceServerFolder and $USERDIR parametra settings please, read the How applet uploads mp3 file to server section.

  4. Make changes to the sendmail.php. You should correct the $FullPathToVoiceFileDir parameter:
    Example: $FullPathToVoiceFileDir="http://www.vimas.com/voicefiles/mail/";
    In all parametra you have to indicate your web domain instead of www.vimas.com.

  5. Put into /mail folder the following files:

  6. Server script must have the permission to save the voice files on the server. Please, check it. To set permissions use chmod 755 instruction . Your web server administrator can do it.

  7. To test Mp3 voice mail, open mail.php on the client computer.

Note! you can put applet and dll files in the other folders then mentioned above, but you must keep in mind the following:

TOP

How applet uploads mp3 file to server

Please, read the following attentively before you'll try to make any changes to your configuration!

Applet uploads mp3 files to server by using HTTP POST method. On the server side the retrive.php server script receives mp3 file. If the file is too long, applet devides it on parts and uploads each part separately. The size of each part in bytes is defined by BlockSize applet parameter.

Example: <PARAM NAME = "BlockSize" VALUE = "20480">

Applet uploads voice file in the folder, defined by VoiceServerFolder and UserServerFolder parameters like http://www.yourhost.com/mail/VoiceServerFolder/UserServerFolder/, where /mail/ is the folder that contains retrive.php.

VoiceServerFolder applet parameter defines folder reletively folder which contains retrive.php.

UserServerFolder applet parameter defines folder which is in the VoiceServerFolder.

Please, read two examples of defining VoiceServerFolder parameter.

Example 1.

Files on server:
http://yourserver.com/mail/mail.php
http://yourserver.com/mail/retrive.php
http://yourserver.com/voicefiles - main folder for voice files

So, you should define such applet parameters:
<PARAM NAME = "VoiceServerFolder" VALUE = "/../voicefiles/">
<PARAM NAME = "UserServerFolder" VALUE = "mail">
So, voice files would be written in
http://yourserver.com/mail/../voicefiles/mail/ directory, that is the same to
http://yourserver.com/voicefiles/mail/

Example 2.

Files on server:
http://yourserver.com/mail/mp3recorder/mail.php
http://yourserver.com/mail/mp3recorder/retrive.php
http://yourserver.com/music/voicefiles - folder for voice files

You should define such applet parameters:
<PARAM NAME = "VoiceServerFolder" VALUE = "/../../music/voicefiles/">
<PARAM NAME = "UserServerFolder" VALUE = "smth">
So, voice files would be written in
http://yourserver.com/mail/mp3recorder/../../music/voicefiles/smth/ directory, that is the same to
http://yourserver.com/music/voicefiles/smth/

Example 3.

Files on server:
http://yourserver.com/mail/mp3recorder/mail.php
http://yourserver.com/mail/mp3recorder/retrive.php
http://yourserver.com/music/voicefiles - folder for voice files

If you don't want to make folder inside voicefiles directory, you should define such parameters:
<PARAM NAME = "VoiceServerFolder" VALUE = "/../../music/">
<PARAM NAME = "UserServerFolder" VALUE = "voicefiles">
So, voice files would be written in
http://yourserver.com/mail/mp3recorder/../../music/voicefiles/ directory, that is the same to
http://yourserver.com/music/voicefiles/

By default, you should put your mail.php file and retrive.php file in the same directory on server, but you can also put them into different directories. To make that you should define VoiceServerFolder parameters in mail.php and retrive.php separately. In mail.php you should define VoiceServerFolder according to the place of mail.php, in retrive.php you should define VoiceServerFolder accoreding to the place of retrive.php. Please look through the examples to understand more.

Example 4.

Files on server:
http://yourserver.com/mail/mp3recorder/mail.php
http://yourserver.com/retrive/retrive.php http://yourserver.com/music/voicefiles - folder for voice files

You should define such applet parameters:
<PARAM NAME = "VoiceServerFolder" VALUE = "/../../music/voicefiles/">
<PARAM NAME = "UserServerFolder" VALUE = "smth">
In retrive.php you should replace lines below i
f(isset($_POST["VoiceServerFolder"])) $VoiceLocal = $_POST["VoiceServerFolder"];
else $VoiceLocal="/../voicefiles/";
by
$VoiceLocal ="/../music/voicefiles/";
So, voice files would be written by retrive.php to
http://yourserver.com/mail/../music/voicefiles/smth/ directory, that is the same to
http://yourserver.com/music/voicefiles/smth/
And applet'll read them from
http://yourserver.com/mail/mp3recorder/../../music/voicefiles/smth/ directory, that is the same to
http://yourserver.com/music/voicefiles/smth/

Example 5.

Files on server:
http://yourserver.com/mail/mp3recorder/mail.php
http://yourserver.com/script/retrive.php http://yourserver.com/voicefiles - folder for voice files

If you don't want to make folder inside voicefiles directory, you should define such parameters
<PARAM NAME = "VoiceServerFolder" VALUE = "/../../">
<PARAM NAME = "UserServerFolder" VALUE = "voicefiles">
In retrive.php you should replace lines below
if(isset($_POST["VoiceServerFolder"])) $VoiceLocal = $_POST["VoiceServerFolder"];
else $VoiceLocal="/../voicefiles/";
by
$VoiceLocal ="/../";
So, voice files would be written by retrive.php to
http://yourserver.com/retrive/../voicefiles/ directory, that is the same to
http://yourserver.com/voicefiles/ And applet'll read them from
http://yourserver.com/mail/mp3recorder/../../voicefiles/ directory, that is the same to
http://yourserver.com/voicefiles/

TOP

Mp3 recording applet interface

Controls:

To control the Mp3 recording applet it has a few methods which can be accessible from outside, in particular from JavaScript and Java. These methods allow to implement the following controls:

The controls interact with the recording applet via JavaScript. JavaScript methods call the corresponding Java methods from applet.

TOP

Table 1: Public recording applet methods which are accessible outside of applet

Applet methods

Applet action

RECORD_RP( )

Start the recording/encoding of audio data

PLAYBACK_RP ( )

Start the playback from client PC

PAUSE_RP ( )

Record/Playback pause

STOP_RP ( )

Stop the record/playback

UPLOAD_RP( String filename )

Uploads audio file from client PC to web server. Server script program is responsible for file receiving

WEBPLAY_RP( String filename )

Playback the recorded audio file from the server.

SAVE_RP ( Srting path, String filename )

Save the recorded audio file on the client computer.

OPEN_RP ( String path, String filename )

Open the audio file from the client computer.

DELETE_RP( )

Delete the audio files from the client computer which was recorded during current session.

TOP

Table 2: JavaScript methods which are accessible from recording applet

Applet methods

Applet action

SetStatus_RP( s, num)

Applet sends status message to JavaScript
s – message,
num – message number in the Table 6.

SetTimer_RP( s )

Applet sends current recording/playback time to JavaScript

confirmRecord( s,num )

Confirm re-recording
s – message,
num – message number in the Table 6.

addName( s )

Adds audio file name to list of files for listening from web server.

report_RP( s )

Pop-up message

TOP

Table 3: Recording applet parameters

Applet parameter name

Parameter value

Parameter description

"ServerScript"

e.g. "http://www.vimas.com/voicefiles/retrive.php"

Server script URL

"VoiceServerFolder"

e.g. "/../voicefiles/"

URL of directory in which the audio files are stored. URL is necessary to playback from server.

"Sampling_frequency"

See table 4, 1st column

Audio sampling frequency

"Bitrate"

See table 4.

In the table 4 available bitrates are defined at each sampling frequency. Bitrate is in kbps.

"TimeLimit "

1...N

N – is maximal recording time in seconds. See Table 4.

"Registration"

a) “Demo”

b) Name of file with registration key. For example, “RegKey.txt”

a) Applet works as demo, the maximal recording time is 20 sec. If Registration parameter is absent, applet works as demo, too.
b) The registration key file you will receive after licensing. File must be located on the server in the same directory with applet.

"OverRecord"

“true/false”

True – over recording is available without warning message.
False (or parameter is absent) - over recording is available with warning message only.

"BgColor"

Color number. E.g.. “FFFFF”

Applet window background color.

"BlockSize"

E.g. 1024

Applet uploads audiofile block by block. This parameter defines the size of block in bytes.

"InterfaceType"

JS

For Web Voice Mail it should be always JS. Other values are not available.

"UserServerFolder"

e.g. "mail"

Defines the subfolder which is in the VoiceServerFolder.

"indicatorWidth"

e.g. 330

Defines the horizontal size of input level indicator, in pixels.

"backgroudColor", "indicatorLevel1", "ndicatorLevel2", "indicatorLevel3"

e.g. "c0c0c0", "4664f0", "28c814", "f03250"

Colors of input level indicator components. Please, see How to customize the input level indicator

 

Table 4. Available Bitrates.

Sampling frequencies, Hz

Bitrates, kbps

8000

16, 24, 32, 40, 48, 56

11025

16, 24, 32, 40, 48, 56, 64, 80

16000

16, 24, 32, 40, 48, 56, 64, 80, 96, 112

22050

16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160

32000

32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224

44100

32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320

Recommended sampling frequency is 11025 Hz, bitrate is 24 or 32 kbps.

If you use 24kbps bitrate, the 20 sec message has audio file size – 60K.

TOP

How to customize the input level indicator

You can customize the horizontal and vertical sizes of the indicator and it colors ( "backgroudColor", "indicatorLevel1", " indicatorLevel2", "indicatorLevel13") according to your web page style.

Fig.1

The colors can be set as applet parameters. For example:

<PARAM NAME = "backgroudColor" value = "c0c0c0">
<PARAM NAME = "indicatorLevel1" value = "4664f0">
<PARAM NAME = "indicatorLevel2" value = "28c814">
<PARAM NAME = "indicatorLevel3" value = "f03250">

The sizes of input level indicator you can set as applet window width and height - WIDTH and HEIGHT

If these applet parameters are absent, applet uses default parameters. They are the same as in the example.

TOP

How to register the Web Voice Mail

To register Web Voice Mail you have to register the Mp3 audio recording applet only.

The Mp3 audio recording applet can be used as demo or full functional applet. To use applets as demo applet, you must add to applet parameters the following parameter ( it is added in the example):

<PARAM NAME = "Registration" VALUE = "Demo">

Applet also works as demo if "Registration" parameter is absent.

In demo mode the applets will work with limited to 20 sec recording (playback) time.

It is single difference between demo and full functional applet mode.

To use Web Voice Mail as full functional you must :

TOP

How to translate applet messages to the national languages

Applet passes to setStatus_RP( s, num,) and confirmRecord( s, num) JavaScript functions messages and their numbers. So, you can process the number and take message from table of messages in other languages. See messages in table 6a, 6b and 6c.

Table 6a. Status messages

Number of message

Description

0

Initialized

1

Loading audio module

2

Recording voice message

3

Paused. Press again for continue

4

Stopped

5

Playing voice message

6

Uploading voice message

7

Uploaded

8

Connection to server

9

Buffering

10

Playing voice message from server

100

Blank

Table 6b. Information messages

Number of message

Description

11

You must record the voice message before playing

12

You must record the voice message before send it

13

Please, enter the file name

14

A file name must not contain any of the following characters: \\n \\ / . , : * ? \" < > | ! @ # $ % ^ & +<

15

Please, select the voice file

16

You are about to overwrite the voice message that you have recorded. Are you sure?

Table 6c. Error messages

Number of message

Description

-1

Unknown Error

-2

No sound card detect

-3

Audio module could not be loaded

-4

Voice message could not be uploaded

-5

Incorrect IP address

-6

Please check ServerScript parameter

-7

Please check VoiceUrlContext parameter

-8

Please check key file on the server

-9

License is expired

TOP

Troubleshooting

I can not record the audio message

1. You push the “Record” button but recording applet does not record the sound. Alert window with “Error.

Object does not support this property or method” message appears.

Reasons:

a) Probably, the recording applet is not downloaded from the server to the client machine. For successful downloading the RPAppletMp3.cab and RPAppletMp3.jar must be located on the server in the same directory with web page which calls the applet ( mail.php). The RPAppletMp3.cab and RPAppletMp3.jar can be placed also in the other directory, but in the recording applet call in the CODEBASE must be indicated the full path to RPAppletMp3.cab and RPAppletMp3.jar: For instanse: CODEBASE=http://yourserver.com/mail/

At first, please, create the directories as in the documentation and examples is recommended. Then, when applet works properly, you can re-create directories as you want, correspondingly to your web application.

b) Please, check if the jaudioMp3.tar is installed on your computer. It is installed automatically when you use the applet for the first time. On the server the jaudioMp3Win.tar and jaudioMp3Mac.tar must be located in the same directory with RPAppletMp3.cab and RPAppletMp3.jar. Probably, you were wrong and jaudioMp3.tar and jaudioMp3Mac.tar are located in the other directory.

  1. If audio recording still does not work, please, copy the Java console content and send to support: info@vimas.com .You can find the Java console in the Internet Explorer browser in the View menu at the bottom (cup of coffee icon). If you do not see the Java console there, please, in the menu go to Tools->Internet option ->Advanced and choose in the Microsoft VM section the “Java console enabled”. In the Netscape 7 browser you can see the Java console in the Tools->Web Development.

I can not upload the audio file to server

1. You recorded the audio message and can playback it from your local computer succesfully. You entered the name of file and push the “Send” button, in the status line you see “Uploading audio message...”, but after uploading the alert window appears with “Your message could not be uploaded” message.

Reasons:

a) Server script retrive.php is written in PHP, so be sure your web server support the PHP.

b) Check the /mail and /voicefiles directories. In the example they are in the root of the web server.

c) Check the $retrive parameter in mail.php. Be sure that path to retrive.php is correct.

d) Be sure if server script has write access to the /voicefiles directory.

I can record and send message, recepient receives e-mail message, but cannot listen the voice message.

Reasons:
a) the link to mp3 file is broken
b) web server does not allow you download mp3 file

Check the $FullPathToVoiceFileDir parameter in sendmail.php file. It should have FULL path to mp3 files directory, including subdirectory of voicefiles folder (if your configuration needs that).
Make sure your file exists on server and then try to downolad it directly from web-browser. If you cannot, contact your server administrator to solve this problem;

I can record and send message but recepient does not receive e-mail message.

Reasons:
a) there are no MTA available to your web server
b)mail function in PHP is not configured

Try to make simple PHP script that sends e-mail message. Make sure it works, if it is not, contact your server administrator and ask him to configure mail function in PHP

TOP