Howto:Voicemail message duration

From innovaphone wiki
Revision as of 14:34, 25 August 2020 by D.giordano (talk | contribs)
Jump to navigation Jump to search

Applies To

This information applies to

PBX V11 or higher.


More Information

The current email.xml file, used by the system to send emails, doesn't provide information about message duration. This information could be useful to identify easily the very short messages recorded by mistake.

Problem Details

The Voicemail XML documentation (available here https://www.innovaphone.com/xsd/vm.htm) doesn't provide any special command to get the message duration.

Anyhow we have a command ables to provide the file size generated during the recording phase.

The idea is calculate the duration based on the file size.

The new code must be added to the original email.xml just after the statement:

<store-getstat root="" name="$vm" out-size="$size" out-error="$error"/>

Code to add:

<switch var="$size">

 <case less-equal="40000">
   <assign out="$message_duration" value="message duration less than 5 seconds "/>
 </case>
 <case less-equal="64000">
   <assign out="$message_duration" value="message duration of 5 - 8 seconds "/>
 </case>
 <case less-equal="80000">
   <assign out="$message_duration" value="message duration of 8 - 10 seconds "/>
 </case>
 <case less-equal="96000">
   <assign out="$message_duration" value="message duration of 10 - 12 seconds "/>				
 </case>
 <case less-equal="120000">
   <assign out="$message_duration" value="message duration of 12 - 15 seconds "/>				
 </case>
 <case greater="120000">
   <assign out="$message_duration" value="message duration greater than 15 seconds "/>
 </case>

</switch>


The information obtained can be inserted in the email body.

To add information in body append the code below to the previous one:

<assign out="$body" value="$message_duration"/>

Now you must change the final "exec url" command to include the email body.

The original code can be identified from the comment

... <exec url="mailto:$to?from=$from&subject=$subject&subject=$cgpn&srv=$server&usr=$user&pwd=$password&file=$file" out-error="$exec-err"/>

The new one must contains the body=$body option as below:

<exec url="mailto:$to?from=$from&body=$body&subject=$subject&subject=$cgpn&srv=$server&usr=$user&pwd=$password&file=$file" out-error="$exec-err"/>

Related Articles

More informations about email parameters can be found here: http://wiki.innovaphone.com/index.php?title=Howto:Send_Email_MWI_Notification_From_The_innovaphone_Voicemail

If you don't want change the original voicemail service you can create a second custom one following the informtions below. Create a second Voicemail: http://wiki.innovaphone.com/index.php?title=Howto:V13_Create_a_second_Voicemail Use your own voicemail files with the voicemail-App in custom mode: http://wiki.innovaphone.com/index.php?title=Howto:V13_Access_Voicemail_Files