mod_java - usage question
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. 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. Best Regards, Jonathan
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.184, required 6, autolearn=not spam, ALL_TRUSTED -1.80, AWL 3.21, BAYES_00 -2.60, USER_IN_WHITELIST -100.00) X-ECN Telecoms-MailScanner-From: damjan@ecntelecoms.com X-Spam-Status: No 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.
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.
Best Regards, Jonathan
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@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
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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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@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@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@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@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
Damjan, What I want to do is the following: incoming call - play a prompt - bridge incoming to endpoint 1 - endpoint 1 hangs up - park the incoming call originate call to endpoint 2 - play a prompt to endpoint 2 - bridge endpoint 2 to endpoint 3 - endpoint 3 hangs up - bridge incoming call to endpoint 2 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. Jonathan On Dec 10, 2007 10:05 PM, Damjan Jovanovic <damjan@ecntelecoms.com> wrote:
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@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@lists.freeswitch.org > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-users
Damjan
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-users
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Damjan Jovanovic
-
jonathan augenstine