VoiceXML Forum Community Message Board


Post New Topic  Post A Reply
my profile | register | search | faq | forum home
  next oldest topic   next newest topic
» VoiceXML Forum Community Message Board   » Development Tools   » catch event during record, if caller hang up

 - UBBFriend: Email this page to someone!    
Author Topic: catch event during record, if caller hang up
abchilla
Junior Member
Member # 3704

Rate Member
Icon 1 posted October 04, 2006 05:12 PM      Profile for abchilla   Email abchilla   Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi dear group,

i have a big issue problem. The thing is i have an application, where the caller can leave a message for somebody. now it is the way implemented, that he has to wait after telling the message or pressing a button. I want my Application to catch the event, if the caller has hung up. It works out that my servlet is called, if i do

<catch event="connection.disconnect.hangup">
<submit ext="/Servlet" enctype="multipart/form-data" method="post" namelist="message" fetchtimeout="5s"/>
</catch>

after caller has hung up during recording a message. The thing is now, that i dont have the spoken data of the caller, after he has hung up. i want to assign this to a variable called message.

how can i do this?

thanks

take care

ab

Posts: 9 | Registered: Aug 2006  |  IP: Logged
RaxitSheth
Member
Member # 3142

Member Rated:
4
Icon 1 posted October 05, 2006 11:32 AM      Profile for RaxitSheth   Author's Homepage   Email RaxitSheth   Send New Private Message       Edit/Delete Post   Reply With Quote 
Hi ,

<record ...>
...
...
<catch event="connection.disconnect.hangup">
<submit next="./voicemail_server.asp"/>
</catch>

...
...
</record>

you can handle "hangup/disconnect/ any event" in <record>

Ref: http://www.w3.org/TR/voicexml20/#dml2.3.6

read very next line and para after Figure 7 It will show you the very simillar example that you want,

--raxit
www.raxitsheth.blogspot.com

Posts: 34 | From: India | Registered: May 2005  |  IP: Logged
mheadd
Member
Member # 3181

Member Rated:
4
Icon 1 posted October 05, 2006 11:34 AM      Profile for mheadd   Author's Homepage   Email mheadd   Send New Private Message       Edit/Delete Post   Reply With Quote 
You need to catch the hangup event within the same form as the record element. So, for example:

code:
 
RIGHT WAY

<vxml version="2.0">
<form if="leaveMsg">

<catch event="connection.disconnect.hangup">
<submit next="./voicemail_server.jsp" namelist="msg"/>
</catch>

<record name="msg" beep="true" maxtime="10s" finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">
<prompt timeout="5s">
Record a message after the beep.
</prompt>
<noinput>
I didn't hear anything, please try again.
</noinput>
</record>
</form>
</vxml>


WRONG WAY

<vxml version="2.0">

<catch event="connection.disconnect.hangup">
<submit next="./voicemail_server.jsp" namelist="msg"/>
</catch>

<form if="leaveMsg">
<record name="msg" beep="true" maxtime="10s" finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">
<prompt timeout="5s">
Record a message after the beep.
</prompt>
<noinput>
I didn't hear anything, please try again.
</noinput>
</record>
</form>
</vxml>

The event handler needs to be in the same scope as the variable holding the recording.

Hope this helps.

--------------------
Mark
VoiceinGov.org
http://www.voiceingov.org

Posts: 55 | Registered: Jun 2005  |  IP: Logged
abchilla
Junior Member
Member # 3704

Rate Member
Icon 1 posted October 06, 2006 06:30 AM      Profile for abchilla   Email abchilla   Send New Private Message       Edit/Delete Post   Reply With Quote 
hi group,

thanx for your efforts. but this dont work.

my code is following

he connects my servlet, but the only parameter i get from the vxml browser is call_id . any idea???
code:
 
<form id="really_record_message">"

<catch event="connection.disconnect.hangup">
<assign name="message" expr="application.lastresult$.result" />
<submit next="/Servlet" enctype="multipart/form-data" method="post" namelist="call_id message" fetchtimeout="5s"/>
</catch>


<property name="timeout" value="3s" />


<record name="message_body" maxtime="120s" finalsilence="2s" dtmfterm="true" beep="false">


...



Posts: 9 | Registered: Aug 2006  |  IP: Logged
abchilla
Junior Member
Member # 3704

Rate Member
Icon 1 posted October 06, 2006 06:31 AM      Profile for abchilla   Email abchilla   Send New Private Message       Edit/Delete Post   Reply With Quote 
ups the assign tag is wrong in my posting. because i tried almost everything out, but the message was never sent.

it is <assign name="message" expr="message_body"/>

Posts: 9 | Registered: Aug 2006  |  IP: Logged
RaxitSheth
Member
Member # 3142

Member Rated:
4
Icon 1 posted October 06, 2006 12:28 PM      Profile for RaxitSheth   Author's Homepage   Email RaxitSheth   Send New Private Message       Edit/Delete Post   Reply With Quote 
It would not work because your recorded message is not going to your web-server,because you have not mentioned it in the namelist,

namelist bydefault submit all, but if you have explicitly provided some then it will submit only those. (refer submit and namelist in Spec)

<submit next="/Servlet" enctype="multipart/form-data" method="post" namelist="call_id message" fetchtimeout="5s"/>

Also one more question:

1. Are you finding trouble to catch the hangup event in <audio> or
2. are u finding trouble in submitting the file. ?

if you are not sure then you can just submit some unique variable (like some stiring) (instead of audiofile) to server which was ONLY caught by disoneect/hangup of <audio> and check serverside that this code is executed or not ?

also you can use some shadow variables set after submit to check the stuff.

Posts: 34 | From: India | Registered: May 2005  |  IP: Logged
abchilla
Junior Member
Member # 3704

Rate Member
Icon 1 posted October 09, 2006 11:29 AM      Profile for abchilla   Email abchilla   Send New Private Message       Edit/Delete Post   Reply With Quote 
hi group,

if i dont use any namelist, he wont give me anything to the servlet. i have to tell exactly what i need. this is the weird thing. And waht vxml also does ist, that he does not pass any variable, if it is null.

Posts: 9 | Registered: Aug 2006  |  IP: Logged
abchilla
Junior Member
Member # 3704

Rate Member
Icon 1 posted October 09, 2006 11:36 AM      Profile for abchilla   Email abchilla   Send New Private Message       Edit/Delete Post   Reply With Quote 
hi group,

if i dont use any namelist, he wont give me anything to the servlet. i have to tell exactly what i need. this is the weird thing. And waht vxml also does ist, that he does not pass any variable, if it is null.

Posts: 9 | Registered: Aug 2006  |  IP: Logged
RaxitSheth
Member
Member # 3142

Member Rated:
4
Icon 1 posted October 09, 2006 11:58 AM      Profile for RaxitSheth   Author's Homepage   Email RaxitSheth   Send New Private Message       Edit/Delete Post   Reply With Quote 
>if i dont use any namelist, he wont give me anything to the servlet

contact your platform Vendor...that's what i can suggest...also refer spec carefully.

--raxit sheth

Posts: 34 | From: India | Registered: May 2005  |  IP: Logged


All times are Eastern  
Post New Topic  Post A Reply Close Topic    Move Topic    Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:

Contact Us | VoiceXML Forum



Powered by Infopop Corporation
UBB.classicTM 6.3.1.2