[Asterisk-Dev] Call control problems from Java

Miroslav Nachev miro at space-comm.com
Fri Oct 1 01:10:09 MST 2004


   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