Howto:Voicemail message duration: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- voicemail duration -->
==Applies To==
==Applies To==
This information applies to
This information applies to


PBX V11 or higher.
V11r1 and up
 
<!-- Keywords: enter keywords, foreign translations and/or synoyms not appearing in the article here for better search results -->


==More Information==
==More Information==
Line 11: Line 10:


===Problem Details===
===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.
The [https://www.innovaphone.com/xsd/vm.htm Voicemail XML documentation] 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.
Anyhow, we have a command that provide the generated file size during the recording phase. The idea is to calculate the duration based on the file size.
 
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:
The new code must be added to the original email.xml just after the statement:


<code xml>
<syntaxhighlight lang="html5">
<store-getstat root="" name="$vm" out-size="$size" out-error="$error"/>
<store-getstat root="" name="$vm" out-size="$size" out-error="$error"/>
</code>
</syntaxhighlight>


Code to add:
Code to add:


<code xml>
<syntaxhighlight lang="html5">
<!-- #### start custom code #### -->
<!-- #### start custom code #### -->
<!-- try to calculate message duration in seconds -->
<!-- try to calculate message duration in seconds -->
Line 56: Line 53:
</switch>
</switch>
<!-- #### end custom code #### -->
<!-- #### end custom code #### -->
</code>
</syntaxhighlight>




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


<code xml>
<syntaxhighlight lang="html5">
<!-- add custom body -->
<!-- add custom body -->
<assign out="$body" value="$message_duration"/>
<assign out="$body" value="$message_duration"/>
</code>
</syntaxhighlight>


Now you must change the final "exec url" command to include the email body.
Now you must change the final "exec url" command to include the email body.
Line 72: Line 69:
The original code can be identified from the comment  
The original code can be identified from the comment  


<code xml>
<syntaxhighlight lang="html5">
<!--Now send the email-->
<!--Now send the email-->
...
...
<exec url="mailto:$to?from=$from&amp;subject=$subject&amp;subject=$cgpn&amp;srv=$server&amp;usr=$user&amp;pwd=$password&amp;file=$file" out-error="$exec-err"/>
<exec url="mailto:$to?from=$from&amp;subject=$subject&amp;subject=$cgpn&amp;srv=$server&amp;usr=$user&amp;pwd=$password&amp;file=$file" out-error="$exec-err"/>
</code>
</syntaxhighlight>


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


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


==Related Articles==
==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
* [[Howto:Send_Email_MWI_Notification_From_The_innovaphone_Voicemail]]
 
* [[Howto:V13_Create_a_second_Voicemail]]
If you don't want change the original voicemail service you can create a second custom one following the informtions below.
* [[Howto:V13_Access_Voicemail_Files]]
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




[[Category:Howto|{{PAGENAME}}]]
[[Category:Howto|{{PAGENAME}}]]

Latest revision as of 12:52, 10 May 2023

Applies To

This information applies to

V11r1 and up

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 doesn't provide any special command to get the message duration.

Anyhow, we have a command that provide the generated file size during the recording phase. The idea is to 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:

<!-- #### start custom code #### -->
<!-- try to calculate message duration in seconds -->
<!-- pass the size in byte -->
<switch var="$size">
  <case less-equal="40000">
    <!-- if a message is less than 40Kb the message is probably less than 5 seconds -->
    <assign out="$message_duration" value="message duration less than 5 seconds "/>
  </case>
  <case less-equal="64000">
    <!-- if a message is less than 64Kb the message is maximum 8 seconds -->
    <assign out="$message_duration" value="message duration of 5 - 8 seconds "/>
  </case>
  <case less-equal="80000">
    <!-- if a message is less than 80Kb the message is maximum 10 seconds -->
    <assign out="$message_duration" value="message duration of 8 - 10 seconds "/>
  </case>
  <case less-equal="96000">
    <!-- if a message is less than 96Kb the message is maximum 12 seconds -->
    <assign out="$message_duration" value="message duration of 10 - 12 seconds "/>				
  </case>
  <case less-equal="120000">
    <!-- if a message is less than 120Kb the message is maximum 15 seconds --> 
    <assign out="$message_duration" value="message duration of 12 - 15 seconds "/>				
  </case>
  <case greater="120000">
    <!-- if a message is greater than 120Kb the message is more than 15 seconds -->
    <assign out="$message_duration" value="message duration greater than 15 seconds "/>
  </case>
</switch>
<!-- #### end custom code #### -->


The information obtained can be inserted in the email body.

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

<!-- add custom body -->
<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

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

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

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

Related Articles