[Freeswitch-users] mod_java - usage question
Damjan Jovanovic
damjan at ecntelecoms.com
Tue Dec 11 01:05:28 EST 2007
X-ECN Telecoms-MailScanner-Information: Contact ECN Telecoms
X-ECN Telecoms-MailScanner: Found to be clean
X-ECN Telecoms-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,
score=-101.233, required 6, autolearn=not spam, ALL_TRUSTED -1.80,
AWL 3.17, BAYES_00 -2.60, USER_IN_WHITELIST -100.00)
X-ECN Telecoms-MailScanner-From: damjan at ecntelecoms.com
X-Spam-Status: No
On Mon, 2007-12-10 at 08:53 -0800, jonathan augenstine wrote:
>
>
>
> 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.
session.execute() is supposed to block until the application finishes
running. I'm not sure why that's a problem, you only want to park the
call after bridge is finished.
>
> > 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
>
> _______________________________________________
> 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
More information about the Freeswitch-users
mailing list