<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">From xml_rpc, event_socket or the console you can execute the <br>command uuid_bridge &lt;a_uuid&gt; &lt;b_uuid&gt;<br><div><br>and yes park will block.<br><br>The correct approach would be to have an extension in your<br>dialplan so all inbound calls execute the "park" app then from<br>event socket or a C event consumer wait for the CHANNEL_PARK event<br>and control the channel externally.<br><br><br><br><br><br></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 &lt;jaugenstine@gmail.com&gt;<br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Tuesday, December 11, 2007 9:49:50 AM<br>Subject: Re: [Freeswitch-users] mod_java - usage question<br><br>
Anthony,<br><br>Thank you for the clarification.&nbsp; I am beginning to understand basic behavior and design.&nbsp; I am constrained by the fact that the customer wanted a Java solution.&nbsp; I have concluded (based on discussions with Brian West) that a good solution would be to wrap the event socket interface in Java.&nbsp; The customer requested that I prototype the app with mod_java first.&nbsp; I have concluded that the final app will probably be multiple apps using both event sockets and mod_java.
<br><br>Also, I was to resolve some issues during the process of trying to explain my dilemas to Damjan.&nbsp; I have a call flow, I just need to work out the method details.<br><br>Damjan, I realized the solution to my problem was to park the first incoming call.&nbsp; The one last detail I have not worked out is how to bridge the second call to the parked call.&nbsp; I think this is the solution.&nbsp; Will execute("park", "") block or not??&nbsp; Any hints would be nice.
<br><br>Thanks for all the help.<br><br>Jonathan<br><br><div class="gmail_quote">On Dec 11, 2007 6:27 AM, Anthony Minessale &lt;<a rel="nofollow" ymailto="mailto:anthmct@yahoo.com" target="_blank" href="mailto:anthmct@yahoo.com">anthmct@yahoo.com</a>&gt; 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><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.&nbsp; 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.&nbsp; <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>&nbsp;</div><div>Anthony Minessale II<br><br><span>FreeSWITCH <a rel="nofollow" target="_blank" href="http://www.freeswitch.org/">
http://www.freeswitch.org/</a></span><br><span>ClueCon <a rel="nofollow" target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br><a rel="nofollow" ymailto="mailto:MSN:anthony_minessale@hotmail.com" target="_blank" href="mailto:MSN:anthony_minessale@hotmail.com">
MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/PAYPAL:<a rel="nofollow" ymailto="mailto:anthony.minessale@gmail.com" target="_blank" href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a><br>IRC: <a rel="nofollow" target="_blank" href="http://irc.freenode.net">irc.freenode.net
</a> #freeswitch</div><div><br>FreeSWITCH Developer Conference<br><a rel="nofollow" ymailto="mailto:sip:888@conference.freeswitch.org" target="_blank" href="mailto:sip:888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a rel="nofollow" target="_blank" href="http://iax:guest@conference.freeswitch.org/888">
iax:guest@conference.freeswitch.org/888</a><br><a rel="nofollow" ymailto="mailto:googletalk:conf+888@conference.freeswitch.org" target="_blank" href="mailto:googletalk:conf+888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400</div><div><div></div><div class="Wj3C7c">
<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
 &lt;<a rel="nofollow" ymailto="mailto:jaugenstine@gmail.com" target="_blank" href="mailto:jaugenstine@gmail.com">jaugenstine@gmail.com</a>&gt;<br>To: <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>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.&nbsp; 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).&nbsp; 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 &lt;<a rel="nofollow" ymailto="mailto:damjan@ecntelecoms.com" target="_blank" href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com</a>&gt; 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>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> &nbsp; &nbsp; &nbsp; &nbsp;score=-
101.233, required 6, autolearn=not spam, ALL_TRUSTED -1.80,<br> &nbsp; &nbsp; &nbsp; &nbsp;AWL 3.17, BAYES_00 -2.60, USER_IN_WHITELIST -100.00)<br><div>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>On Mon, 2007-12-10 at 08:53 -0800, jonathan augenstine wrote:<br>&gt;<br>&gt;<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; On Mon, 2007-12-10 at 00:38 -0800, jonathan augenstine wrote:
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; I am trying to put together a prototype app for Freeswitch<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; using the<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; mod_java interface, I am hitting a deadend and I need some<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; guidance.<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; What I want to do is to answer an incoming call (endpoint<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; 1), play a<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; prompt to that call, and bridge that call to another<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; endpoint<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; (endpoint 2). &nbsp;After the second endpoint (endpoint 2)
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; disconnects, I<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; want to park that call, originate a call to another endpoint<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; (endpoint<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; 3), play a prompt to endpoint 3, and then bridge endpoint 3
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; to a new<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; endpoint (endpoint 4). &nbsp;After endpoint 4 hangs up, I want to<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; bridge<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; endpoint 1 and endpoint 3. &nbsp;Then main issue I keep running<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; into is
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; that in the dialplan and in mod_java, calls appear to block,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; so that<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; it has blocked me from a solution.<br>&gt;<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; How do calls "block"? Use a remote debugger and see where it
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; happens.<br>&gt;<br>&gt; If I run the following code:<br>&gt;<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session = new JavaSession(sessionUuid);<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; freeswitch.console_log("notice", "STARTED!!!\n");
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session.streamFile<br>&gt; ("/usr/local/freeswitch/sounds/intro.wav", 0);<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session.execute("bridge",<br>&gt; "sofia/gateway/[gatewayname]/3237773456");
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; freeswitch.console_log("notice", "COMPLETED!!!\n");<br>&gt;<br>&gt; I do not see the "COMPLETED!!!" console message until one of the<br>&gt; callers from the "bridge" hangs up. &nbsp;The
<br>&gt; 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><br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; My first question is, can you do this with the mod_java<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; interface? &nbsp;If<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; so, how? &nbsp;Secondly, if it is not possible then do you need
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; to use the<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; event_socket interface to accomplish this app? &nbsp;Thank you.<br>&gt;<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; When there is no other function that does the job, try the<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; execute()
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; method in mod_java. Event sockets can probably do the same,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; but I've<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; found them harder to work with (don't know if there are any<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; APIs that<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; make it easier), and since they cost 2 sockets and probably 1
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; thread per<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; call and if on the same machine double the number of context<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; switches,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; they are more resource intensive too.<br>&gt;<br>&gt; As illustrated above I am using the execute.
<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Best Regards,<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Jonathan<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; _______________________________________________<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Freeswitch-users mailing list
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; <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>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; <a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">

http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; 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>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; <a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; Damjan<br>&gt;<br>&gt;<br>&gt;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; _______________________________________________
<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; Freeswitch-users mailing list<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; <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>&gt; &nbsp; &nbsp; &nbsp; &nbsp; <a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">

http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; 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>&gt; &nbsp; &nbsp; &nbsp; &nbsp; <a rel="nofollow" target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>&gt;<br></div></div>&gt; _______________________________________________<br><div><div></div><div>&gt; Freeswitch-users mailing list
<br>&gt; <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>&gt; <a rel="nofollow" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
</a><br>&gt; 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>&gt; <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></div></div><div class="WgoR0d"><br>
      <hr size="1">Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ+"> Try it now.</a></div></div><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></blockquote></div><br>
</div><br></div></div><br>
      <hr size=1>Looking for last minute shopping deals? <a href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping"> 
Find them fast with Yahoo! Search.</a></body></html>