Howto:Spoken Presence with VoiceMail XML Script: Difference between revisions

From innovaphone wiki
Jump to navigation Jump to search
m (New page: ==Summary== Some customers like to automatically transmit a memo to callers. In traditional PBX when a system phone or an operator calls a telephone, where the absence memo is enabled, o...)
 
 
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Summary==
==Summary==
Some customers like to automatically transmit a memo to callers.


In traditional PBX when a system phone or an operator calls a telephone, where the absence memo is enabled, on the display of the caller appears a short message like “in meeting until 14:00” or similar. The phone will ring anyway because the display information is just “add on” info and not all callers will see it.
“Spoken presence” means that you can take your smart phone and set an activity (busy, vacation, meeting, lunch etc.) and time (when you are back).
The disadvantage in those old fashioned PBX is on the one hand the limited number of messages (typically 10 different types) and on the other hand the fact that the memo is only visible for callers using a phone with display capabilities. If the caller uses an analogue or DECT phone, or if it is an external caller (e.g. calling via ISDN trunk), he will not see the memo.


A customer who would like such a feature, however without the described disadvantages, could do this by implementing the innovaphone absence memo.
This information will be replicated to the voicemail, so when your  number is called, the caller will get a spoken message when the person is back again. This is useful because you then always know what the person is doing and when he or she will be back again. This info is nice to have in a business context.


Here is how.
This script was tested with the ''Opticaller Client inputs'' but could be used without Opticaller also. Its only needed to send the right DTMF inputs.


==Applies To==
==Applies To==
This information applies to
This information applies to


* All V6 PBX platforms  
* All V9 PBX platforms  
Build v6 SR1 and later.


<!-- Keywords: enter keywords, foreign translations and/or synoyms not appearing in the article here for better search results -->
<!-- Keywords: enter keywords, foreign translations and/or synoyms not appearing in the article here for better search results -->
Line 19: Line 16:
==More Information==
==More Information==
===Problem Details===
===Problem Details===
The innovaphone absence memo allows a user to leave a voice absence memo. A caller will hear first the message, than the set will ring normally. The voice absence memo can be activated from any phone type(IP, Dect, analogue, SIP, third party). The absence memo is automatically played for any type of caller (IP, Dect, analogue, SIP, third party, external calls from trunk or tie lines).
To switch on the feature it is necessary to activate a call forward to the message center. Typically the call forward is unconditional, but it is possible to also activate a call forward on no response or on busy.
The behaviour is different depending on the call forward installed:


* Call forward unconditional: message is played, than sets rings
The ''Opticaller GSM client'' permits us to set the presence status using a defined softkey. Additionally it can send a DTMF value to the PBX, containing a ''time'' or ''date'', selected from the ''Opticaller GSM client''.
* Call forward no response: sets rings, message is played after time-out, then sets rings again.
 
* Call forward on busy: message is played, then caller will hear a busy tone. This also occurs if a call forward unconditional is active but the set called is busy.
This function should change the user ''presence status'' and ''note'' at the innovaphone PBX. Additionally it provides a voice prompt to people that try to reach this user afterwards, giving the time/date when he will be available and optionally(if configured) transfer the caller to a voicemail box.
 
Note: This script could be used even without the ''Opticaller Client'', the user only needs to call the spokenpresence VM object and dial the DTMF code manually.


===System Requirements===
===System Requirements===
The feature is based on an XML script typically installed on the compact flash. For freaks yes, it will work also on external Webdav sever.
 
In order to switch the feature on and off, the phone must be able to activate and clear a call forward.
The feature is based on a XML script, typically installed on the Compact Flash card of a device. Of course it will work also on external Webserver server.


===Installation===
===Installation===
Currently all calls passing through an XML script will not be released until the end of the call even if transferred. This is from a signaling point of view, not for the voice stream. So if a call has passed the innovaphone absence memo center you will always find two calls in the call monitor. Please note also that the PBX's voicemail script cannot be read from another innovaphone box. So either put your script on the PBX's local flash card or put it on your web server and have the PBX retrieve it from there.


The actual script files uses G711 codec and must be modified to accept all types of coders. An updated version will follow, please contact us for this newer version.
The installation is based on two steps, the first is to copy the right files and the second one is to set up the innovaphone PBX. Here is how:
 
Connect the CF as a network drive using the normal explorer option.
 
Make a new directory in your CF (ie. spokenpresence).
 
Copy all XML files and the sound files ([[Howto:Spoken_Presence_with_VoiceMail_XML_Script#Download|Download]])in this directory.
 
Now create a new voicemail object (ie. ''Vm_SpokenPresence'') in your PBX and assign this object a number (i.e. ''830''). This number will be the access code for the innovaphone Spoken Presence (the number to set the presence status and define the VoicePrompts). Insert the path of your previously created directory and the name of the XML File in the Script URL (spoken_presence.XML).
Example: http://172.16.0.10/DRIVE/CF0/spokenpresence/spoken_presence.xml
 
In the example the created directory is spokenpresence (like the XML file name).
 
Next, we need to create a second voicemail object (ie. Vm_SpokenPrompts) and give it a number (i.e. ''831''). This object is the CFU destination of the first script in case that presence is set. It provides the ''presence status'' voice prompts and additionally can transfer the call to a voicemail box. Insert the path of your previously created directory and the name of the XML file in the Script URL (spoken_prompts.XML).
Example: http://172.16.0.10/DRIVE/CF0/spokenpresence/spoken_prompts.xml
 
Then we have to edit the ''spoken_presence.xml'' file and set the number of the ''Vm_SpokenPrompts'' voicemail object created before. We insert this in the line shown below:
 
<syntaxhighlight lang="html5">
<!-- Insert value with number of spoken_prompts.xml vm object below Ex:831-->
<assign out="$spokenprompt" value="831"/>
</syntaxhighlight>
 
Finally we have optionally the possibility to transfer the call to the users voicemail box, instead of disconnecting the call after the voice prompt. For this we need to edit the ''spoken_prompts.xml'' and insert two values at the end of the script:
 
* $vmnumber - Here we insert as value the innovaphone voicemail object number(change the 0).
* $vmredirect - Here we insert as value the name of a Dummy User Object we should create (change the vm_spoken_vmredirect).
 
<syntaxhighlight lang="html5">
 
  <!--Transfer to Innovaphone Voicemail after Prompt
    Change $vmnumber value to the Innovaphone VM Box number and $vm_redirect value to the name of the VM Dummy User Object created
-->
<assign out="$vmbox" value=""/>
<assign out="$vmnumber" value="0"/>
<assign out="$vm_redirect" value="vm_spoken_vmredirect"/>
<switch var="$vmnumber">
<case not-equal="0">
<lib-strcat out-string="$vmbox" string="$vmnumber" string2="$leg2"/>
<pbx-upd-obj name="$vm_redirect" type="cfu" value="$vmbox"/>
<pbx-xfer name="$vm_redirect" />
<pbx-upd-obj name="$vm_redirect" type="cfu" value=""/>
</case>
</switch>
<pbx-disc/>
</syntaxhighlight>


===Feature description for user===
===Feature description for user===
Call the innovaphone absence memo center in order to record an absence memo. You will hear the message “recording” followed by a “beep”; now your message will be recorded. You can modify and call your message box however many times you want. However please note that each new message will substitute (clear) the previous.


To check your recorded message, switch on a call forward unconditional to the innovaphone absence memo center and call your own number. You will hear your recorded message, at the end of the message you will hear the busy tone. Your absence memo is now switched on. A caller will hear your message and then your extension will ring normally and the caller hears the call control tone. You clear your call forward to the innovaphone absence memo center in order to switch off the feature.
* To use this manually we must call the ''Spoken VM'' object. The call will be connected in silence and then the user should dial the DTMF code to set the presence ''type'', plus the time/date info. In total it will be a 7 digit code.


Please note that the length of your message is limited to 10 seconds (but can be extended if required) and that this feature can be activated on all the phone sets in a PBX.
Codes:


===Installation===
100 - Clear Presence
The installation is based on two steps, the first is to copy the right files and the second one is to set up the innovaphone PBX. Here is how:
 
101 - Set Away (time)
 
102 - Set Busy (time)
 
103 - Set Lunch (time)
 
104 - Set meeting (time)
 
105 - Set vacation (date)
 
7 digit input to be accepted (code + Time hh:mm / Date mm:dd). Example: Set away = 1011900
 
101 Set Away state, 19:00 will be the time. Note/Voice Prompt: I'm away until 19:00.
 
To clear presence should be 100XXXX (X any digit, ie: 1000000).
 
* The use this with the Opticaller client, we should configure the presence keys with the codes as follows:
 
Set Clear Presence
 
[[Image:Spoken_Presence_with_VoiceMail_XML_Script_4.png]]
 
Set Away Presence with Time
 
[[Image:Spoken_Presence_with_VoiceMail_XML_Script_1.png]]


Connect the CF as a network drive using the normal explorer option.
Set Vacation Presence with Date


Make a new directory in your CF.  
[[Image:Spoken_Presence_with_VoiceMail_XML_Script_3.png]]


Copy the XML file and the sound files ([[Howto:Absence_Memo_with_VoiceMail_XML_Script#Download|Download]])in this directory (means: copy all the files of the innovaphone absence memo center in this directory).
Final


Now open a new voicemail object in your PBX. Please note that you will not require a VM license or a registration license for this object (means: this feature is for free). Give a number to this object. This number will be the access code for the innovaphone absence memo center (the number for recording a memo and the number for the call forwarding). Insert the path of your previously created directory and the name of the XML File in the Script URL (AWM.XML).
[[Image:Spoken_Presence_with_VoiceMail_XML_Script_2.png]]
Example: http://172.16.0.10/DRIVE/CF0/AWN/AWM.xml


In the example the created directory is AWN (like the XML file name).
Note: We can create more codes with new activities easily. Edit the ''VoicePrompts'' and notes.
Now your job is done and the feature is switched on.


===Known Problems===
===Known Problems===
The code of the XML is quite simple and can easily be modified.
Please note that all the XML commands and even the structure is well described in the file “schema” which you will find in every innovaphone Voice-Mail installation or in the section [[Howto:Absence_memo#Related_Files|Related Files]].


<code xml>
* When calling to the ''spoken_presence.xml'' VM object, it's important to send 7 digits. The call will be not disconnected until 7 digits have been dialled.
<!-- this line indicates technical parameter -->
 
<?xml version="1.0" encoding="utf-8" ?>
* When setting the presence status, the call must come from the same User as the one where the presence is changed. For example if we call using Opticaller we are using mobility to reach the VM object number. This way the caller name it's the PBX user we want to set the presence status.
 
* When setting the date on the Opticaller client, it asks the user to insert the year but that value it's not send by DTMF to the PBX. As a result, that value will be not set on the presence status. Opticaller should do a small fix to send the year too by DTMF.


<!-- each innovaphone VM script file requires this header, just a remark  -->
* When setting the Redirection to the innovaphone Voicemail box and the called user doesn't have VM box, the caller receives a voice message saying that. However the call it's not disconnected, but the calling user must disconnect the call manually.
<voicemail>
    <!-- this line indicates where the routine “main” is starting (*) -->
    <function define="Main">
        <!-- get info from the call -->
        <pbx-getcallinfo out-cgpn="$cgpn" out-cdpn="$cdpn" out-leg2="$leg2" />
        <!-- check if call came direct form a PBX member -->
        <pbx-finduser-e164 e164="$leg2" out-cn="$cn" />
        <!-- if the call came trough a call forward then -->
        <if cond="$cn"> 
              <!-- go to the routine witch is playing  the message -->
              <call name="Play" />
        </if>
        <!-- if not -->
        <while notcond="$cn">
            <!-- check that the caller is a PBX user -->
            <pbx-finduser-e164 e164="$cgpn" out-cn="$cn" />
            <!-- and if yes -->
            <if cond="$cn">
                <!-- go to the recording routine -->
                <call name="Record" />
            </if>
            <pbx-disc/>
        </while>
    <!-- (*) end of routine main -->
    </function>
<!-- =======================Record==================================== -->   
    <!-- this is the recording routine -->
    <function define="Record">
          <!-- load the voice file “en_registrazione.g729” (contains the message “recording”) -->
          <store-get root="" name="en_registrazione.g729" out-url="$ctrl"/>
          <!-- play it to the caller -->
          <pbx-prompt url="$ctrl"/>
          <!-- load the file “beep” -->
          <store-get root="" name="beep.g729" out-url="$ctrl"/>
          <!-- play it to the caller -->
          <pbx-prompt url="$ctrl"/>
          <!-- load the string $user with the extension (if the calling -->
          <!-- extension is 1234 the file with the message will be 1234.G711a). -->
          <lib-strcat string="$cgpn" string2=".G711a" out-string="$user"/>
          <!-- read the schema file to understand everything -->
          <store-get root="" name="$user" out-url="$file"/>
          <!-- record in the file. Note that here is the limit of the 10 -->
          <!-- seconds; if you want more just modify the value -->       
          <pbx-record url="$file" sec="10"/>
    </function>
<!-- =======================Play==================================== --> 
    <function define="Play">
          <!-- prepare the string for the file -->
          <lib-strcat string="$leg2" string2=".G711a" out-string="$user"/>
          <!-- if you have called the extension 1234 the string 1234.G711a is prepared -->
          <store-get root="" name="$user" out-url="$file"/>
          <!-- play the file to the caller -->
          <pbx-prompt url="$file"/>
          <!-- transfer the call to the originally called extension -->
          <pbx-fwd e164="$leg2" out-cause="$cause"/>
          <switch var="$cause">
              <!-- if it was not o.k. (user busy or something else) then -->
              <case not-equal="0">
                    <!--  play a “beep” -->
                    <store-get root="" name="beep.g729" out-url="$ctrl"/>
                    <pbx-prompt url="$ctrl"/>
                    <!-- and disconnect -->
                    <pbx-disc/>     
              </case>
          </switch>
      </function>
</voicemail>
</code>


== Download ==
== Download ==
*[http://download.innovaphone.com/ice/wiki-src#absencememo http://download.innovaphone.com/ice/wiki-src#absencememo] - download the complete file package of scripts and files described in this article.
*[http://wiki.innovaphone.com/index.php?title=Howto:Wiki_Sources#spokepre Download] the complete file package of scripts and files described in this article.





Latest revision as of 12:47, 10 May 2023

Summary

“Spoken presence” means that you can take your smart phone and set an activity (busy, vacation, meeting, lunch etc.) and time (when you are back).

This information will be replicated to the voicemail, so when your number is called, the caller will get a spoken message when the person is back again. This is useful because you then always know what the person is doing and when he or she will be back again. This info is nice to have in a business context.

This script was tested with the Opticaller Client inputs but could be used without Opticaller also. Its only needed to send the right DTMF inputs.

Applies To

This information applies to

  • All V9 PBX platforms


More Information

Problem Details

The Opticaller GSM client permits us to set the presence status using a defined softkey. Additionally it can send a DTMF value to the PBX, containing a time or date, selected from the Opticaller GSM client.

This function should change the user presence status and note at the innovaphone PBX. Additionally it provides a voice prompt to people that try to reach this user afterwards, giving the time/date when he will be available and optionally(if configured) transfer the caller to a voicemail box.

Note: This script could be used even without the Opticaller Client, the user only needs to call the spokenpresence VM object and dial the DTMF code manually.

System Requirements

The feature is based on a XML script, typically installed on the Compact Flash card of a device. Of course it will work also on external Webserver server.

Installation

The installation is based on two steps, the first is to copy the right files and the second one is to set up the innovaphone PBX. Here is how:

Connect the CF as a network drive using the normal explorer option.

Make a new directory in your CF (ie. spokenpresence).

Copy all XML files and the sound files (Download)in this directory.

Now create a new voicemail object (ie. Vm_SpokenPresence) in your PBX and assign this object a number (i.e. 830). This number will be the access code for the innovaphone Spoken Presence (the number to set the presence status and define the VoicePrompts). Insert the path of your previously created directory and the name of the XML File in the Script URL (spoken_presence.XML).

Example: http://172.16.0.10/DRIVE/CF0/spokenpresence/spoken_presence.xml 

In the example the created directory is spokenpresence (like the XML file name).

Next, we need to create a second voicemail object (ie. Vm_SpokenPrompts) and give it a number (i.e. 831). This object is the CFU destination of the first script in case that presence is set. It provides the presence status voice prompts and additionally can transfer the call to a voicemail box. Insert the path of your previously created directory and the name of the XML file in the Script URL (spoken_prompts.XML).

Example: http://172.16.0.10/DRIVE/CF0/spokenpresence/spoken_prompts.xml 

Then we have to edit the spoken_presence.xml file and set the number of the Vm_SpokenPrompts voicemail object created before. We insert this in the line shown below:

 <!-- Insert value with number of spoken_prompts.xml vm object below Ex:831-->
		<assign out="$spokenprompt" value="831"/>

Finally we have optionally the possibility to transfer the call to the users voicemail box, instead of disconnecting the call after the voice prompt. For this we need to edit the spoken_prompts.xml and insert two values at the end of the script:

  • $vmnumber - Here we insert as value the innovaphone voicemail object number(change the 0).
  • $vmredirect - Here we insert as value the name of a Dummy User Object we should create (change the vm_spoken_vmredirect).
	   <!--Transfer to Innovaphone Voicemail after Prompt 
		    Change $vmnumber value to the Innovaphone VM Box number and $vm_redirect value to the name of the VM Dummy User Object created
		-->
		<assign out="$vmbox" value=""/>
		<assign out="$vmnumber" value="0"/>
		<assign out="$vm_redirect" value="vm_spoken_vmredirect"/>
		
		<switch var="$vmnumber">
			<case not-equal="0">
				<lib-strcat out-string="$vmbox" string="$vmnumber" string2="$leg2"/>
				<pbx-upd-obj name="$vm_redirect" type="cfu" value="$vmbox"/>
				<pbx-xfer name="$vm_redirect" />
				<pbx-upd-obj name="$vm_redirect" type="cfu" value=""/>
			</case>
			
		</switch>
		
		<pbx-disc/>

Feature description for user

  • To use this manually we must call the Spoken VM object. The call will be connected in silence and then the user should dial the DTMF code to set the presence type, plus the time/date info. In total it will be a 7 digit code.

Codes:

100 - Clear Presence

101 - Set Away (time)

102 - Set Busy (time)

103 - Set Lunch (time)

104 - Set meeting (time)

105 - Set vacation (date)

7 digit input to be accepted (code + Time hh:mm / Date mm:dd). Example: Set away = 1011900

101 Set Away state, 19:00 will be the time. Note/Voice Prompt: I'm away until 19:00.

To clear presence should be 100XXXX (X any digit, ie: 1000000).

  • The use this with the Opticaller client, we should configure the presence keys with the codes as follows:

Set Clear Presence

Spoken Presence with VoiceMail XML Script 4.png

Set Away Presence with Time

Spoken Presence with VoiceMail XML Script 1.png

Set Vacation Presence with Date

Spoken Presence with VoiceMail XML Script 3.png

Final

Spoken Presence with VoiceMail XML Script 2.png

Note: We can create more codes with new activities easily. Edit the VoicePrompts and notes.

Known Problems

  • When calling to the spoken_presence.xml VM object, it's important to send 7 digits. The call will be not disconnected until 7 digits have been dialled.
  • When setting the presence status, the call must come from the same User as the one where the presence is changed. For example if we call using Opticaller we are using mobility to reach the VM object number. This way the caller name it's the PBX user we want to set the presence status.
  • When setting the date on the Opticaller client, it asks the user to insert the year but that value it's not send by DTMF to the PBX. As a result, that value will be not set on the presence status. Opticaller should do a small fix to send the year too by DTMF.
  • When setting the Redirection to the innovaphone Voicemail box and the called user doesn't have VM box, the caller receives a voice message saying that. However the call it's not disconnected, but the calling user must disconnect the call manually.

Download

  • Download the complete file package of scripts and files described in this article.