Questions and answers about IVR programming for Plum DEV
Moderators: admin , support
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Mon Oct 25, 2010 3:30 pm
Hi all,
What I am attempting to do is when a call comes in, prompt them for a choice of language (DTMF), based on that keypress have them transferred to an outside number. What I do know is that a "9" must be dialed to get an outside line.
Code: Select all
<?xml version="1.0"?>
<vxml version="2.1">
<property name="fetchaudio" value="recordings/FetchAudio.mp3"/>
<property name="voicename" value="Jill"/>
<var name="strLang" expr="'eng'"/>
<var name="strID" expr="session.id"/>
<var name="strANI" expr="session.telephone.ani"/>
<form id="frmWelcome">
<field name="langID">
<grammar>1{eng}|2{fre}</grammar>
<prompt bargein="true">
<audio src="recordings/525.mp3">
For English Press 1. Pour le français, appuyer sur le 2.
</audio>
</prompt>
<filled>
<assign name="strLang" expr="langID"/>
<if cond="strLang=='fre'">
<goto next="#frmFrench"/>
<else/>
<goto next="#frmEnglish"/>
</if>
</filled>
<noinput>
<reprompt/>
</noinput>
<nomatch>
<reprompt/>
</nomatch>
</field>
</form>
<form id="frmEnglish">
<block>
<transfer destexpr="915552125555"></transfer>
</block>
</form>
<form id="frmFrench">
<block>
<transfer destexpr="915552125555"></transfer>
</block>
</form>
<form id="frmHangUp">
<block>
<disconnect/>
<exit/>
</block>
</form>
<form id="frmError">
<block>
<prompt bargein="false">
Sorry, the system is experiencing difficulties and is unavailable at this time. Please try again later.
</prompt>
<disconnect/>
<exit/>
</block>
</form>
<catch event="error.badfetch">
<goto next="#frmError"/>
</catch>
</vxml>
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Mon Oct 25, 2010 4:10 pm
Hi,
Looking at your code, we noticed that inside of your <transfer> tags, you are attempting to insert a number in the "destexpr" attribute. However, for this <transfer>, you would instead want to use a "dest" attribute for your phone number (you would want to use the "destexpr" attribute if you already had an expression that yielded the phone number that you want to dial).
For more information, you can view the <transfer> tag attributes
here .
Please let us know if you need any further clarification.
Regards,
Plum Support
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Tue Oct 26, 2010 9:11 am
I changed the code to dest="#" but still no transfer. Is there anything that I have to check with the Plum system to ensure that outbound calls can be transferred. Could you provide an examle with the code that I have that will transfer to any number outside of the center where Plum exists?
Please let me know if you need any information from me.
Thanks in advance for your help.
Regards
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Tue Oct 26, 2010 9:41 am
Hi,
Looking at the transfer number in your tag, we noticed a couple of things:
1) You have placed your <transfer> tags inside of <block> tags. However, <transfer> tags can only be placed within <form> blocks, as shown here:
http://www.plumvoice.com/docs/dev/voice ... s:transfer
2) You have a 12-digit phone number listed within your <transfer> tags. For your number, you do not need the 9 at the beginning. So, for your <transfer> tag, you would input the phone number as so:
Hope this helps.
Regards,
Plum Support
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Tue Oct 26, 2010 12:23 pm
Hello all, Once again thank you for your help.
I made the changes suggested and I no longer generate errors but when the IVR gets to the <transfer> section there is dead air then hangs up. I will try to get ahold of the Plum logfiles to see what's going on. In the meantime, is there anything that would cause the transfer not to happen? I've included the update of the code:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.1">
<property name="fetchaudio" value="recordings/FetchAudio.mp3"/>
<property name="voicename" value="Jill"/>
<var name="strLang" expr="'eng'"/>
<var name="strID" expr="session.id"/>
<var name="strANI" expr="session.telephone.ani"/>
<form id="frmWelcome">
<field name="langID">
<grammar>1{eng}|2{fre}</grammar>
<prompt bargein="true">
<audio src="recordings/525.mp3">
For English Press 1. Pour le français, appuyer sur le 2.
</audio>
</prompt>
<filled>
<assign name="strLang" expr="langID"/>
<if cond="strLang=='fre'">
<goto next="#frmFrench"/>
<else/>
<goto next="#frmEnglish"/>
</if>
</filled>
<noinput>
<reprompt/>
</noinput>
<nomatch>
<reprompt/>
</nomatch>
</field>
</form>
<form id="frmFrench">
<transfer dest="15559426000"/>
</form>
<form id="frmEnglish">
<transfer dest="15559426001"/>
</form>
<form id="frmHangUp">
<block>
<disconnect/>
<exit/>
</block>
</form>
<form id="frmError">
<block>
<prompt bargein="false">
Sorry, the system is experiencing difficulties and is unavailable at this time. Please try again later.
</prompt>
<disconnect/>
<exit/>
</block>
</form>
<catch event="error.badfetch">
<goto next="#frmError"/>
</catch>
</vxml
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Tue Oct 26, 2010 2:49 pm
Hello all,
Here is a sample of the logfile generated by our Plum server, I hope this helps, stuck at the moment:
Code: Select all
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="voice">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="dtmf">
1{eng}|2{fre}
</grammar>
---------
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://plum.imi.ca/LJIK/recordings/525.mp3
Audio segment from the URL recordings/525.mp3 added to prompt queue
VXI::field_element - activating grammars for form = 'frmWelcome' formitem = 'langID'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Tue 26 Oct 2010 02:25:35 PM CDT:
dtmf input: 1
Found grammar match
hypothesis #0: eng (0.9990)
VXI::assign_element(name="strLang" expr = "langID")
VXI::queue_prompts()
Bridge Transfer: 12047843213
Tue 26 Oct 2010 02:25:45 PM CDT:
received event: connection.disconnect.hangup:
Disconnect
Disconnecting On Channel 2
Tue 26 Oct 2010 02:25:46 PM CDT:
Beginning of new thread - 2259348400
New session ID 000003;002;1288121146 for Channel 2
plumvp::ChannelThread: Channel 2: Enabling Call 228
plumvp::ChannelThread: About to call VXIplatformWaitForCall
Waiting For Calls on Channel 2
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 2
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Tue Oct 26, 2010 2:58 pm
Hi,
Looking at your call log, we found that we have been able to successfully transfer to 12047843213 using the following code.
transfer.php
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<form id="frmEnglish">
<transfer dest="tel:+12047843213" connecttimeout="60s"/>
</form>
</vxml>
How often are you experiencing this issue of not being able to transfer?
Regards,
Plum Support
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Wed Oct 27, 2010 9:23 am
Hello all,
Once again thank you for helping me on this problem. I have yet to get the script to transfer. I tried the code suggested in an external "transfer.php" page using a subdialog with no luck. I've tried it with the dest="#", dest="tel:+#" with no success. I have confirmed that there are definitely lines available for outbound dialing. When the IVR starts, I choose either "1" or "2" and I get dead air and then it hangs up. Any help on this matter would be greatly appreciated. In the meantime I will keep experimenting with code that I find on this board.
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Wed Oct 27, 2010 10:58 am
Hello again,
This is what I found when going through the call and error logs, I believe it has something to do with the error at the bottom. We attmpted to to a transfer to an extension internally:
Code: Select all
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://plum.imi.ca/LJIK/recordings/525.mp3
Audio segment from the URL recordings/525.mp3 added to prompt queue
VXI::field_element - activating grammars for form = 'frmWelcome' formitem = 'langID'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Wed 27 Oct 2010 10:33:03 AM CDT:
dtmf input: 1
Found grammar match
hypothesis #0: eng (0.9990)
VXI::assign_element(name="strLang" expr = "langID")
VXI::queue_prompts()
Bridge Transfer: tel:+12047843213;postd=7630
Wed 27 Oct 2010 10:33:14 AM CDT:
received event: connection.disconnect.hangup:
Disconnect
Disconnecting On Channel 16
Beginning of new thread - 2712230832
New session ID 000003;016;1288193594 for Channel 16
plumvp::ChannelThread: Channel 16: Enabling Call 239
plumvp::ChannelThread: About to call VXIplatformWaitForCall
Waiting For Calls on Channel 16
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 16
Error Log:
error no_ani 13 [27/Oct/2010:10:11:25 -0500] 3213 000003;013;1288191393 Blind Transfer Unsupported On ISDN
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Wed Oct 27, 2010 11:57 am
Hi,
About your transfer issue:
1) For your onsite system, you can only do bridge transfers, as opposed to blind transfers.
2) About your code, you will need to include that "9" in your <transfer> tag to get out to an outside line (we had initially mistaken you as a hosted developer).
So, the transfer would look like the following:
Code: Select all
<transfer dest="9,11234567890" type="bridge"/>
Below is a code example that demonstrates this:
transfer.php:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.1">
<property name="fetchaudio" value="recordings/FetchAudio.mp3"/>
<property name="voicename" value="Jill"/>
<var name="strLang" expr="'eng'"/>
<var name="strID" expr="session.id"/>
<var name="strANI" expr="session.telephone.ani"/>
<form id="frmWelcome">
<field name="langID">
<grammar>1{eng}|2{fre}</grammar>
<prompt bargein="true">
<audio src="recordings/525.mp3">
For English Press 1. Pour le français, appuyer sur le 2.
</audio>
</prompt>
<filled>
<assign name="strLang" expr="langID"/>
<if cond="strLang=='fre'">
<goto next="#frmFrench"/>
<else/>
<goto next="#frmEnglish"/>
</if>
</filled>
<noinput>
<reprompt/>
</noinput>
<nomatch>
<reprompt/>
</nomatch>
</field>
</form>
<form id="frmEnglish">
<block>
<transfer dest="9,15552125555" type="bridge"></transfer>
</block>
</form>
<form id="frmFrench">
<block>
<transfer dest="9,15552125555" type="bridge"></transfer>
</block>
</form>
<form id="frmHangUp">
<block>
<disconnect/>
<exit/>
</block>
</form>
<form id="frmError">
<block>
<prompt bargein="false">
Sorry, the system is experiencing difficulties and is unavailable at this time. Please try again later.
</prompt>
<disconnect/>
<exit/>
</block>
</form>
<catch event="error.badfetch">
<goto next="#frmError"/>
</catch>
</vxml>
Please let us know if you experience any further issues and sorry for any earlier confusion.
Regards,
Plum Support
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Wed Oct 27, 2010 3:55 pm
Hi all, thank you for the example and it makes sense that we have to dial 9 to get an outside line. I used the script example that you posted and it waited for the timeout, disconnected, and got the following in the call log:
Code: Select all
Wed 27 Oct 2010 03:50:46 PM CDT:
Call Start Event: ANII DNIS 3213 VURL /usr/local/plumvp/config/director.vxml
DocumentParser::FetchDocument()
DocumentParser::FetchDocument(/usr/local/plumvp/config/director.vxml)
Cache Miss: file:///usr/local/plumvp/config/director.vxml
Attempting to fetch file:///usr/local/plumvp/config/director.vxml
Click here to view saved VoiceXML script
VXI::var_element(name="ani" expr = "session.telephone.ani")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
VXI::var_element(name="id" expr = "session.id")
VXI::var_element(name="callee_type" expr = "session.telephone.callee_type")
VXI::var_element(name="ani" expr = "session.telephone.ani")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
VXI::var_element(name="id" expr = "session.id")
VXI::var_element(name="callee_type" expr = "session.telephone.callee_type")
http://plum.imi.ca/LJIK/start.vxml
DocumentParser::FetchDocument(http://plum.imi.ca/LJIK/start.vxml)
Cache Miss: http://plum.imi.ca/LJIK/start.vxml
Attempting to fetch http://plum.imi.ca/LJIK/start.vxml
Click here to view saved VoiceXML script
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="voice">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="dtmf">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="voice">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="dtmf">
1{eng}|2{fre}
</grammar>
---------
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://plum.imi.ca/LJIK/recordings/525.mp3
Audio segment from the URL recordings/525.mp3 added to prompt queue
VXI::field_element - activating grammars for form = 'frmWelcome' formitem = 'langID'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Wed 27 Oct 2010 03:50:54 PM CDT:
dtmf input: 1
Found grammar match
hypothesis #0: eng (0.9990)
VXI::assign_element(name="strLang" expr = "langID")
VXI::queue_prompts()
Bridge Transfer: 9,12679426000
Wed 27 Oct 2010 03:51:04 PM CDT:
received event: connection.disconnect.hangup:
Disconnect
Disconnecting On Channel 1
Beginning of new thread - 2281696176
New session ID 000003;001;1288212664 for Channel 1
plumvp::ChannelThread: Channel 1: Enabling Call 250
plumvp::ChannelThread: About to call VXIplatformWaitForCall
Waiting For Calls on Channel 1
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 1
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Wed Oct 27, 2010 4:16 pm
Hi,
Sorry, the <transfer> tags in the earlier code example were inside of <block> tags, instead of inside <form> tags.
Here's the corrected code:
transfer.php
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.1">
<property name="fetchaudio" value="recordings/FetchAudio.mp3"/>
<property name="voicename" value="Jill"/>
<var name="strLang" expr="'eng'"/>
<var name="strID" expr="session.id"/>
<var name="strANI" expr="session.telephone.ani"/>
<form id="frmWelcome">
<field name="langID">
<grammar>1{eng}|2{fre}</grammar>
<prompt bargein="true">
<audio src="recordings/525.mp3">
For English Press 1. Pour le français, appuyer sur le 2.
</audio>
</prompt>
<filled>
<assign name="strLang" expr="langID"/>
<if cond="strLang=='fre'">
<goto next="#frmFrench"/>
<else/>
<goto next="#frmEnglish"/>
</if>
</filled>
<noinput>
<reprompt/>
</noinput>
<nomatch>
<reprompt/>
</nomatch>
</field>
</form>
<form id="frmEnglish">
<transfer dest="9,15552125555" type="bridge" connecttimeout="60s"></transfer>
</form>
<form id="frmFrench">
<transfer dest="9,15552125555" type="bridge" connecttimeout="60s"></transfer>
</form>
<form id="frmHangUp">
<block>
<disconnect/>
<exit/>
</block>
</form>
<form id="frmError">
<block>
<prompt bargein="false">
Sorry, the system is experiencing difficulties and is unavailable at this time. Please try again later.
</prompt>
<disconnect/>
<exit/>
</block>
</form>
<catch event="error.badfetch">
<goto next="#frmError"/>
</catch>
</vxml>
Please let us know if this code is still giving you issues with transferring.
Regards,
Plum Support
HolyReality
Posts: 9 Joined: Mon Oct 25, 2010 3:25 pm
Post
by HolyReality » Thu Oct 28, 2010 7:33 am
Hello all,
I did try the previous code without the <block> tags but still was unable to transfer. Would it be safe to assume that this is a configuration problem with not being able to dial out on the ISDN lines? I really appreciate your effort and responses to this issue. I'm not sure where to go from here but I've included the latest call log so maybe there is something in there that will point us in the right direction. Please let me know if you can see anything in the log that stands out.
Code: Select all
Thu 28 Oct 2010 07:20:08 AM CDT:
Call Start Event: ANII DNIS 3213 VURL /usr/local/plumvp/config/director.vxml
DocumentParser::FetchDocument()
DocumentParser::FetchDocument(/usr/local/plumvp/config/director.vxml)
Cache Miss: file:///usr/local/plumvp/config/director.vxml
Attempting to fetch file:///usr/local/plumvp/config/director.vxml
Click here to view saved VoiceXML script
VXI::var_element(name="ani" expr = "session.telephone.ani")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
VXI::var_element(name="id" expr = "session.id")
VXI::var_element(name="callee_type" expr = "session.telephone.callee_type")
VXI::var_element(name="ani" expr = "session.telephone.ani")
VXI::var_element(name="dnis" expr = "session.telephone.dnis")
VXI::var_element(name="id" expr = "session.id")
VXI::var_element(name="callee_type" expr = "session.telephone.callee_type")
http://plum.imi.ca/LJIK/start.vxml
DocumentParser::FetchDocument(http://plum.imi.ca/LJIK/start.vxml)
Cache Miss: http://plum.imi.ca/LJIK/start.vxml
Attempting to fetch http://plum.imi.ca/LJIK/start.vxml
Click here to view saved VoiceXML script
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="voice">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="dtmf">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="voice">
1{eng}|2{fre}
</grammar>
---------
GrammarManager::CreateGrammarFromString():
---------
<?xml version='1.0'?>
<grammar xml:lang="en-us" mode="dtmf">
1{eng}|2{fre}
</grammar>
---------
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::var_element(name="strLang" expr = "'eng'")
VXI::var_element(name="strID" expr = "session.id")
VXI::var_element(name="strANI" expr = "session.telephone.ani")
VXI::queue_prompts()
bargein set to true
INPUTMODES set to "DTMF VOICE"
Cache Hit: http://plum.imi.ca/LJIK/recordings/525.mp3
Audio segment from the URL recordings/525.mp3 added to prompt queue
VXI::field_element - activating grammars for form = 'frmWelcome' formitem = 'langID'
VXI::do_recognition()
PromptManager::Play()
Newly queued prompts are now being played
Thu 28 Oct 2010 07:20:12 AM CDT:
dtmf input: 1
Found grammar match
hypothesis #0: eng (0.9990)
VXI::assign_element(name="strLang" expr = "langID")
VXI::queue_prompts()
Bridge Transfer: 9,12679426000
Thu 28 Oct 2010 07:20:22 AM CDT:
received event: connection.disconnect.hangup:
Disconnect
Disconnecting On Channel 12
Thu 28 Oct 2010 07:20:23 AM CDT:
Beginning of new thread - 2796149680
New session ID 000003;012;1288268423 for Channel 12
plumvp::ChannelThread: Channel 12: Enabling Call 256
plumvp::ChannelThread: About to call VXIplatformWaitForCall
Waiting For Calls on Channel 12
VXI::exit_element()
Call End Event
Ending session
Ending Session On Channel 12
support
Posts: 3632 Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:
Post
by support » Thu Oct 28, 2010 2:02 pm
Hi,
Yes, this now seems to be an issue that's outside of a coding problem.
Could you please open up a support ticket with our Plum Support Team by emailing them at
support@plumgroup.com ? Please note that you will need to include your 8-digit customer ID in the subject line of your e-mail. You can find your 8-digit customer ID on your support contract with Plum.
Regards,
Plum Support