<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">To accomplish what you are wanting with mod_java you would need a way to<br>invoke another thread outside of the call to assume control of the channels<br>rather than trying to do it from the call's thread.<br><br>In javascript there is a jsrun api command that will launch another script in<br>it's own thread with no calls in it. I assume the author of mod_java could extend it to do something similar so you could run a management app that listens for events and acts accordingly.<br><br>Also you could use the event_socket with a standalone java app to manage the <br>calls from a separate entity. <br><br>But by design the high level interfaces block on things like playback<br>and bridging but allow callbacks to be connected for things like read frame<br>and dtmf and message reception.
<br><br>You can always do it in C where you have full control and ability to<br>launch threads etc.<br><br><br><br><div> </div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org/</a></span><br><span>ClueCon <a target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br>MSN:anthony_minessale@hotmail.com<br>GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<br>IRC: irc.freenode.net #freeswitch</div><div><br>FreeSWITCH Developer Conference<br>sip:888@conference.freeswitch.org<br>iax:guest@conference.freeswitch.org/888<br>googletalk:conf+888@conference.freeswitch.org<br>pstn:213-799-1400</div><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: jonathan augenstine
<jaugenstine@gmail.com><br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Tuesday, December 11, 2007 12:58:55 AM<br>Subject: Re: [Freeswitch-users] mod_java - usage question<br><br>
Damjan,<br><br>What I want to do is the following:<br><br>incoming call<br>- play a prompt<br>- bridge incoming to endpoint 1<br>- endpoint 1 hangs up<br>- park the incoming call<br><br>originate call to endpoint 2<br>- play a prompt to endpoint 2
<br>- bridge endpoint 2 to endpoint 3<br>- endpoint 3 hangs up<br>- bridge incoming call to endpoint 2<br><br>The details on how to accomplish this with mod_java are eluding me. Every approach I have attempted I have encountered roadblocks of either hitting execute blocking what I need to do or not having the right info (what needs to be passed to originate or how to play a prompt to endpoint2 or bridge to endpoint 3). I am getting stuck on the details and cannot find the docs to clarify.
<br><br>Jonathan<br><br><br><div class="gmail_quote">On Dec 10, 2007 10:05 PM, Damjan Jovanovic <<a rel="nofollow" ymailto="mailto:damjan@ecntelecoms.com" target="_blank" href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">X-ECN Telecoms-MailScanner-Information: Contact ECN Telecoms<br>X-ECN Telecoms-MailScanner: Found to be clean<br>X-ECN Telecoms-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,<br></div> score=-
101.233, required 6, autolearn=not spam, ALL_TRUSTED -1.80,<br> AWL 3.17, BAYES_00 -2.60, USER_IN_WHITELIST -100.00)<br><div class="Ih2E3d">X-ECN Telecoms-MailScanner-From: <a rel="nofollow" ymailto="mailto:damjan@ecntelecoms.com" target="_blank" href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com
</a><br>X-Spam-Status: No<br><br></div><div><div></div><div class="Wj3C7c">On Mon, 2007-12-10 at 08:53 -0800, jonathan augenstine wrote:<br>><br>><br>><br>> On Mon, 2007-12-10 at 00:38 -0800, jonathan augenstine wrote:
<br>> > I am trying to put together a prototype app for Freeswitch<br>> using the<br>> > mod_java interface, I am hitting a deadend and I need some<br>> guidance.<br>> >
<br>> > What I want to do is to answer an incoming call (endpoint<br>> 1), play a<br>> > prompt to that call, and bridge that call to another<br>> endpoint<br>> > (endpoint 2). After the second endpoint (endpoint 2)
<br>> disconnects, I<br>> > want to park that call, originate a call to another endpoint<br>> (endpoint<br>> > 3), play a prompt to endpoint 3, and then bridge endpoint 3<br>
> to a new<br>> > endpoint (endpoint 4). After endpoint 4 hangs up, I want to<br>> bridge<br>> > endpoint 1 and endpoint 3. Then main issue I keep running<br>> into is
<br>> > that in the dialplan and in mod_java, calls appear to block,<br>> so that<br>> > it has blocked me from a solution.<br>><br>><br>> How do calls "block"? Use a remote debugger and see where it
<br>> happens.<br>><br>> If I run the following code:<br>><br>><br>> session = new JavaSession(sessionUuid);<br>> freeswitch.console_log("notice", "STARTED!!!\n");
<br>> session.streamFile<br>> ("/usr/local/freeswitch/sounds/intro.wav", 0);<br>> session.execute("bridge",<br>> "sofia/gateway/[gatewayname]/3237773456");
<br>> freeswitch.console_log("notice", "COMPLETED!!!\n");<br>><br>> I do not see the "COMPLETED!!!" console message until one of the<br>> callers from the "bridge" hangs up. The
<br>> session.execute("bridge",.....) call blocks.<br><br></div></div>session.execute() is supposed to block until the application finishes<br>running. I'm not sure why that's a problem, you only want to park the
<br>call after bridge is finished.<br><div><div></div><div class="Wj3C7c"><br>><br>> > My first question is, can you do this with the mod_java<br>> interface? If<br>> > so, how? Secondly, if it is not possible then do you need
<br>> to use the<br>> > event_socket interface to accomplish this app? Thank you.<br>><br>><br>> When there is no other function that does the job, try the<br>> execute()
<br>> method in mod_java. Event sockets can probably do the same,<br>> but I've<br>> found them harder to work with (don't know if there are any<br>> APIs that<br>> make it easier), and since they cost 2 sockets and probably 1
<br>> thread per<br>> call and if on the same machine double the number of context<br>> switches,<br>> they are more resource intensive too.<br>><br>> As illustrated above I am using the execute.
<br>><br>><br>><br>><br>> > Best Regards,<br>> > Jonathan<br>> ><br>> > _______________________________________________<br>> > Freeswitch-users mailing list
<br>> > <a rel="nofollow" ymailto="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>> ><br>> <a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>> ><br>> UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users
</a><br>> > <a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>><br>> Damjan<br>><br>><br>><br>> _______________________________________________
<br>> Freeswitch-users mailing list<br>> <a rel="nofollow" ymailto="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>> <a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>> UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users
</a><br>> <a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>><br></div></div>> _______________________________________________<br><div><div></div><div class="Wj3C7c">> Freeswitch-users mailing list
<br>> <a rel="nofollow" ymailto="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>> <a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
</a><br>> UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>> <a rel="nofollow" target="_blank" href="http://www.freeswitch.org">
http://www.freeswitch.org</a><br><br>Damjan<br><br><br><br>_______________________________________________<br>Freeswitch-users mailing list<br><a rel="nofollow" ymailto="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank" href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org
</a><br><a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">
http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></div></blockquote></div><br>
</div><br></div></div><br>
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a></body></html>