|
Author
|
Topic: catch event during record, if caller hang up
|
abchilla
Junior Member
Member # 3704
Rate Member
|
posted October 04, 2006 05:12 PM
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
|
|
|
|
mheadd
Member
Member # 3181
Member Rated:
|
posted October 05, 2006 11:34 AM
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
|
posted October 06, 2006 06:30 AM
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
|
posted October 06, 2006 06:31 AM
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:
|
posted October 06, 2006 12:28 PM
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
|
posted October 09, 2006 11:29 AM
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
|
posted October 09, 2006 11:36 AM
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:
|
posted October 09, 2006 11:58 AM
>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
|
|