[Asterisk-Dev] Call control problems from Java

Miroslav Nachev miro at space-comm.com
Fri Oct 1 06:15:03 MST 2004


   Dear Zac,

   Let's start with your projects. I think that it is very good
starting point. Unfortunately from SF I can't see any Java files. Just
the patch.
   Do you have any CVS? If you haven't you can use our.
   For better communications you can send the letters to me and my
colleague Damian (damian at space-comm.com) using one common e-mail:
      JAsterisk at space-comm.com
   Say how can we help you?


   Best Regards,
   Miroslav Nachev
   
Hi Miroslav,

I'd *love* to have some help on this project but lets see if our goals are
in sync.

My overall goal is to develop a Java-based VXML/CCXML engine for Asterisk.
Achieving this requires that I have complete call control from Java.
Optimally, we could then do away with the Asterisk Dialplan entirely and do
everything via VXML/CCXML.  The AGI interface is OK but for my application I
need fine-grained event-driven processes where we can track each call from
setup to tear-down and everything in between.

I've started building a JTAPI-like framework that sits on top of JAsterisk
that handles all the events and provides a high-level framework for building
telephony apps.  But, as I described in my previous email, I'm dealing with
some nagging problems that I need to fix before I can complete this project.

You described the "module convention".  Is it the Asterisk application API
you're referring to (ex app_dial,app_meetme,...)?  If so, I think Jasterisk
may be able to do what you're talking about already (or with some minor
additions).  BTW, The version of JAsterisk i'm working on now allows you to
start the JVM from Asterisk or to start Asterisk from the JVM (which is the
way it's set up currently).

Anyway, lets explore some more and see if we can work together on this.

I hope I'm making sense -- it's 4am where I am.

Zac

-----Original Message-----
From: Miroslav Nachev [mailto:miro at space-comm.com]
Sent: Friday, October 01, 2004 1:10 AM
To: Asterisk Developers Mailing List (E-mail)
Subject: Re: [Asterisk-Dev] Call control problems from Java


   Dear Zac,

   This is Great. We have ideas to replace most of the Asterisk
Services (modules) with Java too, but we haven't time yet. But in case
that you are start this job we will help you.
   Because our idea was to use some Modules Convention which to
support independet language support what do you think to make first
some working plan and then to start working?
   We are ready to share this hard job with you. Please say how can we
help you?


   Best Regards,
   Miroslav Nachev

First the good news:  I've just released a Java (JNI) bridge to Asterisk
called, JAsterisk (ya I got a little creative with the name).  It's
available at (http://sourceforge.net/projects/jasterisk/) and is pre-alpha.
It's currently distributed as a patch on the 1.0.0 source release but I hope
to have a version available soon that doesn't require any modifications to
Asterisk code.

Anyway, almost all Asterisk functionality is available and working fine from
Java.  Almost...

I have some strange issues that I'm dealing with that hopefully won't seem
so strange to someone out there:

1.  Call comes in, channel is routed to the "Safi" (Safi Systems is my
company's name) application which simply fires a callback to the JNI
notifying a Jasterisk application of it's presence, and loops while waiting
for channel hangup (like the wait_for_hangup function in app_dial.c).  The
Jasterisk application then routes the call to "Jo Blo" at some address, by
executing the Asterisk "Dial" application in a new Java thread.  When Jo
answers the call, caller and callee are connected and everything seems to be
OK.  However, if Jo then tries to transfer the call (using '#' for Zaptel
or the 'Transfer' function for IAX channels), the caller and callee are
disconnected and the call dies. Why?  If the caller calls Jo Blo directly
(as per usual) instead of being routed through the Jasterisk app, the
transfer works fine.  Similar issues are noticed when parking redirected
calls.

2. pbx.c builtin functions "Transfer" and "Goto" don't work in Jasterisk
apps.  The channel structure's members are correctly updated but the
extension or context switch never happens.  What am I missing here?

This software is in it's very early stages and it's my goal to make it the
de-facto Java-->Asterisk interface.  I'm very open to suggestions and if a
better approach is revealed I'll happily adjust or rewrite the thing from
scratch.  Eventually I'd like to be able to forgo the Asterisk dialplan
entirely (except maybe for an exten => _.,1,Safi() catch-all),  and handle
all call routing from Java, perhaps using a JTAPI interface or similar.

Progress is encouraging so far -- I've already deployed some pretty complex
production IVR's using this package and they're all stable and running fine.
However, these call routing related issues have me a little worried that I
may have taken a wrong turn somewhere.

Any ideas or recommendations? TIA

Zac Wolfe
Safi Systems LLC
zacw at safisys.com




_______________________________________________
Asterisk-Dev mailing list
Asterisk-Dev at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-dev
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list