[Freeswitch-users] mod_java - usage question

jonathan augenstine jaugenstine at gmail.com
Mon Dec 10 08:53:38 PST 2007


> On Mon, 2007-12-10 at 00:38 -0800, jonathan augenstine wrote:
> > I am trying to put together a prototype app for Freeswitch using the
> > mod_java interface, I am hitting a deadend and I need some guidance.
> >
> > What I want to do is to answer an incoming call (endpoint 1), play a
> > prompt to that call, and bridge that call to another endpoint
> > (endpoint 2).  After the second endpoint (endpoint 2) disconnects, I
> > want to park that call, originate a call to another endpoint (endpoint
> > 3), play a prompt to endpoint 3, and then bridge endpoint 3 to a new
> > endpoint (endpoint 4).  After endpoint 4 hangs up, I want to bridge
> > endpoint 1 and endpoint 3.  Then main issue I keep running into is
> > that in the dialplan and in mod_java, calls appear to block, so that
> > it has blocked me from a solution.
>
> How do calls "block"? Use a remote debugger and see where it happens.


If I run the following code:

            session = new JavaSession(sessionUuid);
            freeswitch.console_log("notice", "STARTED!!!\n");
            session.streamFile("/usr/local/freeswitch/sounds/intro.wav", 0);
            session.execute("bridge",
"sofia/gateway/[gatewayname]/3237773456");
            freeswitch.console_log("notice", "COMPLETED!!!\n");

I do not see the "COMPLETED!!!" console message until one of the callers
from the "bridge" hangs up.  The session.execute("bridge",.....) call
blocks.


>
> > My first question is, can you do this with the mod_java interface?  If
> > so, how?  Secondly, if it is not possible then do you need to use the
> > event_socket interface to accomplish this app?  Thank you.
>
> When there is no other function that does the job, try the execute()
> method in mod_java. Event sockets can probably do the same, but I've
> found them harder to work with (don't know if there are any APIs that
> make it easier), and since they cost 2 sockets and probably 1 thread per
> call and if on the same machine double the number of context switches,
> they are more resource intensive too.


As illustrated above I am using the execute.


>
>
> > Best Regards,
> > Jonathan
> >
> > _______________________________________________
> > Freeswitch-users mailing list
> > Freeswitch-users at lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
>
> Damjan
>
>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20071210/c5f38c3e/attachment-0002.html 


More information about the FreeSWITCH-users mailing list