So the customer records a message, then hangs up. Then you want a separate call made to the technician. So the call made to the tech (which is user/202 I presume) is just another IVR? <div><br></div><div>From what I can see, you've got a one-legged call between the caller and the IVR, and you disconnect that when the caller is done recording his message. The "proper" thing to do would be to generate a new call (instead of attempting to bridge a non-existent call) to the tech. Check out this wiki page for the syntax:</div>
<div><a href="http://wiki.freeswitch.org/wiki/Session_originate">http://wiki.freeswitch.org/wiki/Session_originate</a></div><div><br></div><div>-MC</div><div><div><br><div class="gmail_quote">On Tue, Jan 25, 2011 at 12:57 AM, 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 lang="NL" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Michael,</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">It’s like this. I would like to let the customer records a message. Then a technician should get called and the previous recorded message should be played.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">So after the customer has records his message, the line should be hung up. Then a new call should be made from the IVR to the technician.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Regards,</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D">Erik</span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#1F497D"> </span></p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt">Van:</span></b><span lang="EN-US" style="font-size:10.0pt"> <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>] <b>Namens </b>Michael Collins<br>
<b>Verzonden:</b> maandag 24 januari 2011 21:14<br><b>Aan:</b> FreeSWITCH Users Help<br><b>Onderwerp:</b> Re: [Freeswitch-users] Javascript IVR session question</span></p><div><div></div><div class="h5"><p class="MsoNormal">
<span lang="EN-US"> </span></p><p class="MsoNormal">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.</p>
<div><p class="MsoNormal"> </p></div><div><p class="MsoNormal" style="margin-bottom:12.0pt">-MC</p><div><p class="MsoNormal">On Sun, Jan 23, 2011 at 12:48 PM, Erik Dekkers <<a href="mailto:erik.dekkers@wvds.nl" target="_blank">erik.dekkers@wvds.nl</a>> wrote:</p>
<div><div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">Hey ppl,</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">At the moment im building a Javascript based IVR but im kind of stuck on a part.</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">The IVR should do this:</span></p></div><div><p class="MsoNormal">
<span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">- Answer session (working)</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">- Play some wav files (working)</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">- Record a message to file (working)</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">- Hang up the first session (working)</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">- Call the second session (not working)</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">- Play the previous recorded file (not working)</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">After I dial the second session, the console says "channel is hungup already". How should i do this?</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">Kind regards,</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">Erik Dekkers (wvds-nl on IRC)</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal">
<span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">my script:</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">var allDigits = "";</span></p></div><div><p class="MsoNormal">
<span style="font-size:10.0pt;color:black">function on_dtmf(session, type, digits, arg)<br>{<br> if (digits.digit == "#") {<br> return allDigits;<br> }</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> if (digits.digit == "*") {<br>
return false; //stop the recording.<br> }</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> console_log("digit: " + digits.digit + "\n");<br> allDigits += digits.digit;<br>
return(allDigits);<br>}</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">session.answer();</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">if (session.ready()) {<br>
allDigits = "";<br> var rtn;</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> rtn = session.streamFile("/home/edekkers/sounds/10_spreek_in.wav", on_dtmf, "");</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> if (session.ready()) {<br> var tmp_Filename = "/tmp/test.wav";</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> if (session.ready()) {<br>
rtn = session.recordFile(tmp_Filename, on_dtmf, "", 120);<br> }</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> rtn = session.streamFile("/home/edekkers/sounds/11_bericht_is_ontvangen.wav", on_dtmf, "");</span></p>
</div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> if (session.ready()) {<br> session.hangup();<br> }<br> }<br>}</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black">session.execute("bridge","user/202")<br>
if (session.ready()) {<br> session.streamFile("/tmp/test.wav");<br>}</span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;color:black"> </span></p>
</div></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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></p></div><p class="MsoNormal"> </p></div></div></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></div>