Anthony,<br><br>Thank you for the clarification. I am beginning to understand basic behavior and design. I am constrained by the fact that the customer wanted a Java solution. I have concluded (based on discussions with Brian West) that a good solution would be to wrap the event socket interface in Java. The customer requested that I prototype the app with mod_java first. 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. 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. The one last detail I have not worked out is how to bridge the second call to the parked call. I think this is the solution. Will execute("park", "") block or not?? 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 <<a href="mailto:anthmct@yahoo.com">anthmct@yahoo.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><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 href="http://www.freeswitch.org/" target="_blank">
http://www.freeswitch.org/</a></span><br><span>ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a></span><br><br>AIM: anthm<br><a href="mailto:MSN:anthony_minessale@hotmail.com" target="_blank">
MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/PAYPAL:<a href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a><br>IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net
</a> #freeswitch</div><div><br>FreeSWITCH Developer Conference<br><a href="mailto:sip:888@conference.freeswitch.org" target="_blank">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">
iax:guest@conference.freeswitch.org/888</a><br><a href="mailto:googletalk:conf+888@conference.freeswitch.org" target="_blank">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
<<a href="mailto:jaugenstine@gmail.com" target="_blank">jaugenstine@gmail.com</a>><br>To: <a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">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. 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" href="mailto:damjan@ecntelecoms.com" target="_blank">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>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>X-ECN Telecoms-MailScanner-From: <a rel="nofollow" href="mailto:damjan@ecntelecoms.com" target="_blank">
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>><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><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" href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>> ><br>> <a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>> ><br>> UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users
</a><br>> > <a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>><br>> Damjan<br>><br>><br>><br>> _______________________________________________
<br>> Freeswitch-users mailing list<br>> <a rel="nofollow" href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>> <a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>> UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users
</a><br>> <a rel="nofollow" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>><br></div></div>> _______________________________________________<br><div><div></div><div>> Freeswitch-users mailing list
<br>> <a rel="nofollow" href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>> <a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
</a><br>> UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>> <a rel="nofollow" href="http://www.freeswitch.org" target="_blank">
http://www.freeswitch.org</a><br><br>Damjan<br><br><br><br>_______________________________________________<br>Freeswitch-users mailing list<br><a rel="nofollow" href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">
Freeswitch-users@lists.freeswitch.org
</a><br><a rel="nofollow" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a rel="nofollow" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">
http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a rel="nofollow" href="http://www.freeswitch.org" target="_blank">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 href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ+" target="_blank"> Try it now.</a></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>