Cisco VoiceXML supports continuous CNG tone detection during all phases of a call. While the application is listening for CNG tones, VoiceXML scripts are being loaded and executed to play prompts, record voice, process DTMF input, etc.
When the VoiceXML script is running, the application continuously listens for CNG tones. When CNG is detected, a CNG tone detection event is passed to the VoiceXML application which in turn generates the VoiceXML event com.cisco.fax.cng.
This event is specific to Cisco's VoiceXML implementation. The VoiceXML document has to define a catch event handler to process this fax event. It may choose to respond to the fax and send it through T.37 Store & Forward by a blind transfer invoked by <transfer dest=”fax://[dnis-to-match-dp]”
bridge=”false” cisco-mailtoaddress=”[email-id]”> in a block outside the catch event handler of
com.cisco.fax.cng.
Note Only a blind transfer and setting the bridge attribute to false (bridge=”FALSE'') allows the VoiceXML document to send the fax through T.37 Store and Forward.
Fax Mailto Addressing
Cisco VoiceXML allows full control of e-mail addresses by providing the cisco-mailtoaddress attribute in the <transfer> element and the $e$ macro in the MMoIP dial peer. The cisco-mailtoaddress variable in the transfer element replaces the $e$ in the mailto address. In the VoiceXML script, the e-mail address can be constructed in the cisco-mailtoadress attribute through one of the following:
• DNIS
• RDNIS
• A combination of DNIS and RDNIS
• A number generated during the session (for example, dtmf entry) for direct calling by the document.
• A string that represents a valid e-mail address.
The VoiceXML document defines an e-mail address through the cisco-mailtoaddress variable in the <transfer> element.
Note Make sure that you do not pass @domain again in the cisco-mailtoaddress attribute in the VoiceXML script if it is already configured in sessiontarget mailto in MMoIP dial peer.
The VoiceXML application maps the cisco-mailtoaddress attribute to the e-mail address only if the $e$ macro is configured in the MMoIP dial peer. By default, if the cisco-mailtoaddress variable is not specified in the transfer element, the VoiceXML application maps the DNIS to $e$. The attribute cisco-mailtoaddress is optional in the <transfer> element. If the attribute is not specified, the VoiceXML application maps the e-mail ID to DNIS. Cisco VoiceXML is also capable of setting the MMoIP session mail-to $e$ variable to DNIS, RDNIS, or a string that represents a valid e-mail address.
$e$ is capable of accepting any of the following e-mail addresses:
• user
• [email protected] (where 1234 is DNIS)
• [email protected] (where 5678 is RDNIS)
• [email protected] (where 12345678 is DNIS+RDNIS)
• FAX= [email protected] (T.33 subaddressing strings are also accepted.)
Note If $e$ is not specified in the session target mailto command, and the cisco-mailtoaddress attribute is specified in the transfer element of the fax detection document, then whatever is specified in the MMoIP dial peer takes precedence; the cisco-mailtoaddress attribute is ignored.
Example
This example shows a Cisco VoiceXML script (VoiceXML 2.0) used for CNG detection.
<?xml version="1.0"?>
<vxml version="2.0" base="tftp://audio directory path/"> <catch event="com.cisco.fax.cng">
<log>!!!!!!! Got com.cisco.fax.cng !!!!!! </log> <goto next="#transferToFax"/>
</catch>
<catch event="nomatch noinput">
<goto next="#transferToPhone"/> </catch>
<catch event="telephone.disconnect.transfer">
<log>!!!!!!! Got telephone.disconnect.transfer </log> </catch>
<catch event="telephone.disconnect.hangup">
<log>!!!!!!! Got telephone.disconnect.hangup </log> </catch>
<catch event="error.badfetch">
<log>!!!!!!! Got ERROR.BADFETCH !!!!!! </log> </catch>
<var name="phone_num"/> <var name="mydur"/>
<var name="defaultPhoneNum" expr="session.telephone.dnis"/> <var name="junkvar"/>
<form id="main">
<field name="get_phone_num" type="number"> <dtmf type="regex">...</dtmf>
<prompt bargein="true"> <audio src="audio/menu.au"/> </prompt>
<filled>
<assign name="phone_num" expr="get_phone_num"/>
<log>The number collected is <value expr="phone_num"/></log> <goto next="#transferToFax"/> </filled> </field> </form> <form id="transferToFax"> <block>
<assign name="phone_num" expr="5550112"/>
<log>Transferring to <value expr="phone_num"/></log> </block>
<transfer name="mycall" destexpr="'fax://'+ phone_num" bridge="false" connecttimeout="15s" maxtime="180s" cisco-longpound ="true" cisco-mailtoaddress="user name" >
<filled>
<assign name="mydur" expr="mycall$.duration"/>
<log>The value in mycall is <value expr="mycall"/></log> <log>Duration of call is <value expr="mydur"/></log> </filled>
</transfer> </form>
<form id="transferToPhone"> <block>
<assign name="phone_num" expr="5550112"/>
<log>Transferring to <value expr="phone_num"/></log> </block>
<transfer name="mycall" destexpr="'tel: '+ phone_num" bridge="true" connecttimeout="150s" maxtime="180s" cisco-longpound ="true" >
<filled>
<assign name="mydur" expr="mycall$.duration"/>
<log>The value in mycall is <value expr="mycall"/></log> <log>Duration of call is <value expr="mydur"/></log> </filled>
</transfer> </form>
<form id="transferToFax">
<property name="timeout" value="500s"/> <field name="get_phone_num" type="number">
<dtmf type="regex">...</dtmf> </field>
</form> </vxml>