If I read this correctly you are hanging up the channel that you later wish to bridge to user/202. Why do you need to hangup? Perhaps you could describe a little more about the application? I'm sure we can help you iron out the details.<div>
<br></div><div>-MC<br><br><div class="gmail_quote">On Sun, Jan 23, 2011 at 12:48 PM, Erik Dekkers <span dir="ltr"><<a href="mailto:erik.dekkers@wvds.nl">erik.dekkers@wvds.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div style="font-family:Tahoma;direction:ltr;color:#000000;font-size:13px">
<div></div>
<div dir="ltr"><font color="#000000" size="2" face="Tahoma">Hey ppl,</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">At the moment im building a Javascript based IVR but im kind of stuck on a part.</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">The IVR should do this:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">- Answer session</font> (working)</div>
<div dir="ltr"><font size="2" face="tahoma">- Play some wav files (working)</font></div>
<div dir="ltr"><font size="2" face="tahoma">- Record a message to file (working)</font></div>
<div dir="ltr"><font size="2" face="tahoma">- Hang up the first session (working)</font></div>
<div dir="ltr"><font size="2" face="tahoma">- Call the second session (not working)</font></div>
<div dir="ltr"><font size="2" face="tahoma">- Play the previous recorded file (not working)</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">After I dial the second session, the console says "channel is hungup already". How should i do this?</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">Kind regards,</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">Erik Dekkers (wvds-nl on IRC)</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"> </div>
<div dir="ltr"><font size="2" face="tahoma">my script:</font></div>
<div dir="ltr"><font size="2" face="tahoma"></font> </div>
<div dir="ltr"><font size="2" face="tahoma">var allDigits = "";</font></div>
<div dir="ltr"><font size="2" face="tahoma">function on_dtmf(session, type, digits, arg)<br>
{<br>
if (digits.digit == "#") {<br>
return allDigits;<br>
}</font></div>
<div dir="ltr"><font size="2" face="tahoma"> if (digits.digit == "*") {<br>
return false; //stop the recording.<br>
}</font></div>
<div dir="ltr"><font size="2" face="tahoma"> console_log("digit: " + digits.digit + "\n");<br>
allDigits += digits.digit;<br>
return(allDigits);<br>
}</font></div>
<div dir="ltr"><font size="2" face="tahoma">session.answer();</font></div>
<div dir="ltr"><font size="2" face="tahoma">if (session.ready()) {<br>
allDigits = "";<br>
var rtn;</font></div>
<div dir="ltr"><font size="2" face="tahoma"> rtn = session.streamFile("/home/edekkers/sounds/10_spreek_in.wav", on_dtmf, "");</font></div>
<div dir="ltr"><font size="2" face="tahoma"> if (session.ready()) {<br>
var tmp_Filename = "/tmp/test.wav";</font></div>
<div dir="ltr"><font size="2" face="tahoma"> if (session.ready()) {<br>
rtn = session.recordFile(tmp_Filename, on_dtmf, "", 120);<br>
}</font></div>
<div dir="ltr"><font size="2" face="tahoma"> rtn = session.streamFile("/home/edekkers/sounds/11_bericht_is_ontvangen.wav", on_dtmf, "");</font></div>
<div dir="ltr"><font size="2" face="tahoma"> if (session.ready()) {<br>
session.hangup();<br>
}<br>
}<br>
}</font></div>
<div dir="ltr"><font size="2" face="tahoma">session.execute("bridge","user/202")<br>
if (session.ready()) {<br>
session.streamFile("/tmp/test.wav");<br>
}<br>
</font></div>
<div dir="ltr"><font size="2" face="tahoma"><font face="tahoma"></font></font> </div>
<div dir="ltr"><font size="2" face="tahoma"><font face="tahoma"></font> </font></div>
</div>
</div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>