I fixed this issue in tree in latest trunk<br><br>damjan I have a few suggestions for you:<br><br>1) in the scripts you have to say......<br><br>session = new JavaSession(sessionUuid);<br><br>maybe you can do this automatically when the script is invoked as an application.<br>
<br><br>2) you should add an api interface like spidermonkey and python have caled &quot;java_run&quot;<br>then you could use the cli, xml-rpc and the event_socket to invoke standalone scripts in their own thread.<br><br>
3) The DTMF / event stuff is not fully exposed. <br>When you set an event callback you can get an event or a DTMF obj<br><br>When you get a DTMF the obj supplies duration as well as the digit that was dialed.<br>
When you get an event it&#39;s a structure similar to an email, jabber message etc with a type, headers and a body.<br><br>so you should build a class around the switch_event_t.<br><br>That way, you can parse, create and fire events.<br>
<br>maybe we will make a c++ wrapper for that too so swig will do it for us.<br><br><br><br><div class="gmail_quote">On Fri, Apr 4, 2008 at 12:26 PM, jonathan augenstine &lt;<a href="mailto:jaugenstine@gmail.com">jaugenstine@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Damjan,<br><br>What I am trying to do is to implement a script that plays a prompt and collects digits.&nbsp; 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.&nbsp; I have tried using playAndGetDigits but that method crashes freeswitch on the older version.&nbsp; When I tried updating freeswitch I encountered the error noted below.&nbsp; If you can give me some guidance I will help trouble shoot the initialization problem.&nbsp; Thank you.<br>
<font color="#888888">
<br>Jonathan<br><br></font><div class="gmail_quote"><div class="Ih2E3d">On Fri, Apr 4, 2008 at 5:54 AM, Damjan Jovanovic &lt;<a href="mailto:damjan@ecntelecoms.com" target="_blank">damjan@ecntelecoms.com</a>&gt; wrote:<br>
</div><div><div></div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
X-ECN Telecoms-MailScanner-Information: Contact ECN Telecoms<br>
X-ECN Telecoms-MailScanner: Found to be clean<br>
X-ECN Telecoms-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;score=-102.277, required 6, autolearn=not spam, ALL_TRUSTED -1.80,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;AWL -0.48, USER_IN_WHITELIST -100.00)<br>
X-ECN Telecoms-MailScanner-From: <a href="mailto:damjan@ecntelecoms.com" target="_blank">damjan@ecntelecoms.com</a><br>
X-Spam-Status: No<br>
<div><br>
<br>
On Fri, 2008-04-04 at 00:38 -0700, jonathan augenstine wrote:<br>
&gt; I have a mod-java script that is encountering an error on the latest<br>
&gt; version from svn.<br>
&gt;<br>
&gt; The script runs successfully on build: FreeSwitch Version 1.0.pre3<br>
&gt; (7616M)<br>
&gt;<br>
&gt; When I retrieve the latest version from svn (8019) I get the following<br>
&gt; output from the console:<br>
&gt;<br>
&gt; 2008-04-04 02:03:15 [ERR] switch_cpp.cpp:146 getVariable() session is<br>
&gt; not initalized<br>
&gt; 2008-04-04 02:03:15 [ERR] switch_cpp.cpp:146 getVariable() session is<br>
&gt; not initalized<br>
&gt; 2008-04-04 02:03:15 [ERR] switch_cpp.cpp:153 execute() session is not<br>
&gt; initalized<br>
&gt; 2008-04-04 02:03:15 [DEBUG] switch_cpp.cpp:98 ~CoreSession()<br>
&gt; CoreSession::~CoreSession desctructor<br>
<br>
<br>
</div>Make sure the UUID is valid.<br>
<br>
Otherwise, whoever changed the semantics of the session API should also<br>
patch mod_java.<br>
<div><br>
<br>
&gt; Java code that works on 7616 but fails on 8019:<br>
&gt;<br>
&gt; &nbsp; &nbsp; public void run(String sessionUuid, String args)<br>
&gt; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; freeswitch.console_log(&quot;notice&quot;, &quot;INBOUND UUID: &quot; +<br>
&gt; sessionUuid + &quot; ARGS: &quot; + args + &quot;\n&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; JavaSession session = null;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; try<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session = new JavaSession(sessionUuid);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session.setAutoHangup(false);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String raw_dnis =<br>
&gt; session.getVariable(&quot;originate_caller_id_number&quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String raw_ani = session.getVariable(&quot;caller_id_number&quot;);<br>
&gt;<br>
&gt; Has something changed on the Java module. &nbsp;Do I need any new<br>
&gt; additional initialization?<br>
&gt;<br>
&gt; Jonathan<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; Freeswitch-dev mailing list<br>
&gt; <a href="mailto:Freeswitch-dev@lists.freeswitch.org" target="_blank">Freeswitch-dev@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
Bye<br>
Damjan<br>
<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org" target="_blank">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div></div></div><br>
<br>_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400