[Freeswitch-dev] mod-java - initialization error
Damjan Jovanovic
damjan at ecntelecoms.com
Wed Apr 9 16:00:05 EDT 2008
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=-103.715, required 6, autolearn=not spam, ALL_TRUSTED -1.80,
AWL 0.68, BAYES_00 -2.60, USER_IN_WHITELIST -100.00)
X-ECN Telecoms-MailScanner-From: damjan at ecntelecoms.com
X-Spam-Status: No
On Fri, 2008-04-04 at 18:08 -0500, Anthony Minessale wrote:
> I fixed this issue in tree in latest trunk
>
> damjan I have a few suggestions for you:
>
> 1) in the scripts you have to say......
>
> session = new JavaSession(sessionUuid);
>
> maybe you can do this automatically when the script is invoked as an
> application.
Maybe.
>
> 2) you should add an api interface like spidermonkey and python have
> caled "java_run"
> then you could use the cli, xml-rpc and the event_socket to invoke
> standalone scripts in their own thread.
'Scripts' are for scripting languages...
> 3) The DTMF / event stuff is not fully exposed.
Yes I'll try to get that done too.
> When you set an event callback you can get an event or a DTMF obj
>
> When you get a DTMF the obj supplies duration as well as the digit
> that was dialed.
> When you get an event it's a structure similar to an email, jabber
> message etc with a type, headers and a body.
>
> so you should build a class around the switch_event_t.
>
> That way, you can parse, create and fire events.
>
> maybe we will make a c++ wrapper for that too so swig will do it for
> us.
I'm thinking of ditching swig. I don't know what it's like for other
languages, but for Java it's a disaster. I spent most of the time
writing mod_java just coercing swig to get it to generate working code,
and the Java -> Freeswitch interface still looks very foreign.
The application interface that runs an interpret for a given script
doesn't really work for languages like Java anyway. The current
implementation loads classes from disk on every call, and since each
class is loaded with a different classloader, classes won't share their
static data between invocations. I prefer what mod_mono did, that is, a
way to write native freeswitch modules in Java. That would also provide
a nice way to control object lifetimes, which mod_java currently doesn't
have.
Regards
Damjan
>
>
> On Fri, Apr 4, 2008 at 12:26 PM, jonathan augenstine
> <jaugenstine at gmail.com> wrote:
> Damjan,
>
> What I am trying to do is to implement a script that plays a
> prompt and collects digits. I am able to use streamFile and
> getDigits to accomplish this task but it produces an
> unacceptable experience, in that if experienced people use the
> system they want to start entering digits before the prompt
> completes and streamFile/getDigits will not support this
> behavior. I have tried using playAndGetDigits but that method
> crashes freeswitch on the older version. When I tried
> updating freeswitch I encountered the error noted below. If
> you can give me some guidance I will help trouble shoot the
> initialization problem. Thank you.
>
> Jonathan
>
> On Fri, Apr 4, 2008 at 5:54 AM, Damjan Jovanovic
> <damjan at 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=-102.277, required 6, autolearn=not spam,
> ALL_TRUSTED -1.80,
> AWL -0.48, USER_IN_WHITELIST -100.00)
> X-ECN Telecoms-MailScanner-From:
> damjan at ecntelecoms.com
> X-Spam-Status: No
>
>
> On Fri, 2008-04-04 at 00:38 -0700, jonathan augenstine
> wrote:
> > I have a mod-java script that is encountering an
> error on the latest
> > version from svn.
> >
> > The script runs successfully on build: FreeSwitch
> Version 1.0.pre3
> > (7616M)
> >
> > When I retrieve the latest version from svn (8019) I
> get the following
> > output from the console:
> >
> > 2008-04-04 02:03:15 [ERR] switch_cpp.cpp:146
> getVariable() session is
> > not initalized
> > 2008-04-04 02:03:15 [ERR] switch_cpp.cpp:146
> getVariable() session is
> > not initalized
> > 2008-04-04 02:03:15 [ERR] switch_cpp.cpp:153
> execute() session is not
> > initalized
> > 2008-04-04 02:03:15 [DEBUG] switch_cpp.cpp:98
> ~CoreSession()
> > CoreSession::~CoreSession desctructor
>
>
>
> Make sure the UUID is valid.
>
> Otherwise, whoever changed the semantics of the
> session API should also
> patch mod_java.
>
>
> > Java code that works on 7616 but fails on 8019:
> >
> > public void run(String sessionUuid, String args)
> > {
> > freeswitch.console_log("notice", "INBOUND
> UUID: " +
> > sessionUuid + " ARGS: " + args + "\n");
> > JavaSession session = null;
> >
> > try
> > {
> > session = new JavaSession(sessionUuid);
> >
> > session.setAutoHangup(false);
> >
> > String raw_dnis =
> > session.getVariable("originate_caller_id_number");
> > String raw_ani =
> session.getVariable("caller_id_number");
> >
> > Has something changed on the Java module. Do I need
> any new
> > additional initialization?
> >
> > Jonathan
> >
>
> > _______________________________________________
> > Freeswitch-dev mailing list
> > Freeswitch-dev at lists.freeswitch.org
> >
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> >
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> > http://www.freeswitch.org
>
> Bye
> Damjan
>
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> iax:guest at conference.freeswitch.org/888
> googletalk:conf+888 at conference.freeswitch.org
> pstn:213-799-1400
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
More information about the Freeswitch-dev
mailing list