that cpp file should be open in your editor along with your module<br>I will happily take any patches to it. The whole point of that file is only to give swig something to generate the modules from. It needs a lot of attention as the developer of mod_python is the only other person who uses it.<br>
<br>If you do not already have it, ask someone and we will give you full commit to that module and switch_cpp.<br><br>I sense some hostility in your remarks, I think you should look at that code too as part of what you have to implement to get your desired results.<br>
<br>BTW in regards to undocumented, it took us an hour to install mod_java when we were fixing this guy's last issue so you may consider making an install howto page for the wiki.<br><br><br><div class="gmail_quote">On Wed, Apr 9, 2008 at 2:40 PM, Damjan Jovanovic <<a href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">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>
</div> score=-103.879, required 6, autolearn=not spam, ALL_TRUSTED -1.80,<br>
AWL 0.52, BAYES_00 -2.60, USER_IN_WHITELIST -100.00)<br>
<div class="Ih2E3d">X-ECN Telecoms-MailScanner-From: <a href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com</a><br>
X-Spam-Status: No<br>
<br>
</div>After digging through my code for 2 hours, sticking debugging statements<br>
all over the show, and copying buffers before use (thinking they are<br>
maybe read-only after coming from the JVM), reading cryptic traces and<br>
useless cores, and finally stumbling across freeswitch.log, I saw that<br>
switch_cpp.cpp ingeniously assumes the buffer is at least 128 bytes long<br>
and since it is obviously smaller, filling it corrupts memory (which is<br>
also a SECURITY RISK).<br>
<br>
Make sure your dtmf_buf is at least 128 bytes long, possibly +1 for the<br>
NULL terminator, and possibly more just in case some other undocumented<br>
code makes another brilliant assumption like that.<br>
<br>
By the way, I'm in the process of rewriting mod_java, and the new one<br>
will most likely completely avoid swig and (by the looks of it)<br>
switch_cpp.<br>
<br>
Enjoy<br>
<font color="#888888">Damjan<br>
</font><div><div></div><div class="Wj3C7c"><br>
On Wed, 2008-04-09 at 08:03 -0700, jonathan augenstine wrote:<br>
> Is there any feedback on this issue?<br>
><br>
> On Mon, Apr 7, 2008 at 9:27 AM, jonathan augenstine<br>
> <<a href="mailto:jaugenstine@gmail.com">jaugenstine@gmail.com</a>> wrote:<br>
> public void run(String sessionUuid, String args)<br>
> {<br>
> freeswitch.console_log("notice", "INBOUND UUID: " +<br>
> sessionUuid + " ARGS: " + args + "\n");<br>
> JavaSession session = null;<br>
><br>
> try<br>
> {<br>
> session = new JavaSession(sessionUuid);<br>
><br>
> if(session == null) {<br>
> freeswitch.console_log("notice", "ERROR:<br>
> session is NULL\n");<br>
> return;<br>
> } else {<br>
> freeswitch.console_log("notice", "SUCCESS<br>
> creating session\n");<br>
> }<br>
><br>
> session.setAutoHangup(false);<br>
><br>
> byte[] dtmf_buf = new byte[20];<br>
> byte[] term_buf = new byte[4];<br>
><br>
> String raw_dnis =<br>
> session.getVariable("originate_caller_id_number");<br>
> String raw_ani =<br>
> session.getVariable("caller_id_number");<br>
><br>
> String leading = raw_ani.substring(0, 1);<br>
> String ani = null;<br>
> if(leading.startsWith("+")) {<br>
> // skip first digit<br>
> ani = raw_ani.substring(1);<br>
> } else {<br>
> // capture all digits<br>
> ani = raw_ani.substring(0);<br>
> }<br>
><br>
> freeswitch.console_log("notice", "INBOUND ANI: 00"<br>
> + ani + " DNIS: " + raw_dnis + "\n");<br>
><br>
> String destNumber = authorize("001" + ani);<br>
><br>
> if(destNumber == null) {<br>
> // handle as non-widget call<br>
> // collect DTMF of dial out phone number<br>
><br>
> freeswitch.console_log("notice",<br>
> "playAndGetDigits called next!!!\n");<br>
><br>
> int done = 0;<br>
> do {<br>
> dtmf_buf = new byte[20];<br>
> term_buf = new byte[4];<br>
><br>
> // dial number collection<br>
> session.playAndGetDigits(10, 20, 3, 30000,<br>
> "#", "/usr/local/freeswitch/sounds/DialNumber.wav",<br>
> "/usr/local/freeswitch/sounds/NotAsDialed.wav", dtmf_buf, "");<br>
><br>
><br>
><br>
> On Sun, Apr 6, 2008 at 11:05 PM, Damjan Jovanovic<br>
> <<a href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com</a>> wrote:<br>
> X-ECN Telecoms-MailScanner-Information: Contact ECN<br>
> Telecoms<br>
> X-ECN Telecoms-MailScanner: Found to be clean<br>
> X-ECN Telecoms-MailScanner-SpamCheck: not spam,<br>
> SpamAssassin (not cached,<br>
> score=-104.399, required 6, autolearn=not spam,<br>
> ALL_TRUSTED -1.80,<br>
> BAYES_00 -2.60, USER_IN_WHITELIST -100.00)<br>
> X-ECN Telecoms-MailScanner-From:<br>
> <a href="mailto:damjan@ecntelecoms.com">damjan@ecntelecoms.com</a><br>
> X-Spam-Status: No<br>
><br>
> Calling the playAndGetDigits() function is a bit<br>
> obscure in Java, some<br>
> args are input/output parameters. Post the code so I<br>
> can see how you're<br>
> trying to call it.<br>
><br>
> Bye<br>
> Damjan<br>
><br>
><br>
><br>
> On Sun, 2008-04-06 at 22:46 -0700, jonathan augenstine<br>
> wrote:<br>
> > Here is the bt full backtrace:<br>
> ><br>
> > (gdb) bt full<br>
> > #0 0x0088b402 in __kernel_vsyscall ()<br>
> > No symbol table info available.<br>
> > #1 0x00361fa0 in raise () from /lib/libc.so.6<br>
> > No symbol table info available.<br>
> > #2 0x003638b1 in abort () from /lib/libc.so.6<br>
> > No symbol table info available.<br>
> > #3 0x00398ebb in __libc_message ()<br>
> from /lib/libc.so.6<br>
> > No symbol table info available.<br>
> > #4 0x003a0f41 in _int_free () from /lib/libc.so.6<br>
> > No symbol table info available.<br>
> > #5 0x003a4580 in free () from /lib/libc.so.6<br>
> > No symbol table info available.<br>
> > #6 0x011e747c in os::free ()<br>
> ><br>
> from /usr/java/jdk1.5.0_12/jre/lib/i386/client/libjvm.so<br>
> > No symbol table info available.<br>
> > #7 0x010fd233 in jni_ReleaseByteArrayElements ()<br>
> ><br>
> from /usr/java/jdk1.5.0_12/jre/lib/i386/client/libjvm.so<br>
> > No symbol table info available.<br>
> > #8 0x009c1f5e in<br>
> ><br>
> Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits<br>
> > (jenv=0xad91cf90, jcls=0x6ce587c,<br>
> > jarg1=2949394128, jarg1_=0x6ce58a8, jarg2=10,<br>
> jarg3=20, jarg4=3,<br>
> > jarg5=30000, jarg6=0x6ce5894, jarg7=0x6ce5890,<br>
> > jarg8=0x6ce588c, jarg9=0x6ce5888,<br>
> jarg10=0x6ce5884)<br>
> > at /usr/java/jdk1.5.0_12/include/jni.h:1665<br>
> > jresult = <value optimized out><br>
> > arg6 = 0xb291c7a0 "#"<br>
> > arg7 = 0xb292d770<br>
> "/usr/local/freeswitch/sounds/DialNumber.wav"<br>
> > arg8 = 0xb292dab8<br>
> "/usr/local/freeswitch/sounds/NotAsDialed.wav"<br>
> > arg10 = 0xb2915838 ""<br>
> > result = 1<br>
> > #9 0x02d562dd in ?? ()<br>
> > No symbol table info available.<br>
> > #10 0xad91cf90 in ?? ()<br>
> > No symbol table info available.<br>
> > #11 0x06ce587c in ?? ()<br>
> > No symbol table info available.<br>
> > #12 0xafcc2ed0 in ?? ()<br>
> > No symbol table info available.<br>
> > #13 0x00000000 in ?? ()<br>
> > No symbol table info available.<br>
> ><br>
> ><br>
> > On Fri, Apr 4, 2008 at 9:59 PM, Michael Jerris<br>
> <<a href="mailto:mike@jerris.com">mike@jerris.com</a>><br>
> > wrote:<br>
> > Can you disable crash protection and get a<br>
> real backtrace of<br>
> > this?<br>
> ><br>
> > Mike<br>
> ><br>
> ><br>
> > On Apr 5, 2008, at 12:19 AM, jonathan<br>
> augenstine wrote:<br>
> ><br>
> > > Damjan,<br>
> > ><br>
> > > OK, the mod_java initialization problem is<br>
> resolved in the<br>
> > latest<br>
> > > version of the trunk. I am now back to<br>
> the initial problem<br>
> > I was<br>
> > > hoping this version would solve. When I<br>
> call<br>
> > playAndGetDigits() it<br>
> > > crashes Freeswitch. The console dump from<br>
> the<br>
> > playAndGetDigits call<br>
> > > to the crash is pasted below. What would<br>
> you suggest is the<br>
> > next<br>
> > > step to diagnose and fix this issue?<br>
> > ><br>
> > > Jonathan<br>
> > ><br>
> > ><br>
> > > Freeswitch console output:<br>
> > ><br>
> > > 2008-04-04 22:39:50 [NOTICE]<br>
> switch_cpp.cpp:509<br>
> > console_log()<br>
> > > playAndGetDigits called next!!!<br>
> > > 2008-04-04 22:39:50 [DEBUG]<br>
> switch_cpp.cpp:154 execute()<br>
> > > CoreSession::execute. app: sleep data:500<br>
> > > 2008-04-04 22:39:50 [DEBUG]<br>
> switch_ivr_play_say.c:1225<br>
> > > switch_play_and_get_digits()<br>
> > switch_play_and_get_digits(session, 10,<br>
> > > 20, 3, 30000,<br>
> ><br>
> #, /usr/local/freeswitch/sounds/DialNumber.wav, /usr/<br>
> > > local/freeswitch/sounds/NotAsDialed.wav,<br>
> digit_buffer, 128,<br>
> > > XXXXXXXXXX)<br>
> > > *** glibc detected *** ./freeswitch:<br>
> free(): invalid<br>
> > pointer:<br>
> > > 0x08cf29d0 ***<br>
> > > ======= Backtrace: =========<br>
> > > /lib/libc.so.6[0x3a0f41]<br>
> > > /lib/libc.so.6(cfree+0x90)[0x3a4580]<br>
> > > /lib/libc.so.6[0x3bae6f]<br>
> > > /lib/libc.so.6(tzset+0x3d)[0x3bb77d]<br>
> > > /lib/libc.so.6(strftime_l+0x46)[0x3c0006]<br>
> > > /lib/libc.so.6(strftime+0x3f)[0x3bff5f]<br>
> ><br>
> > /usr/local/freeswitch/lib/libfreeswitch.so.1(apr_strftime<br>
> > +0x85)<br>
> > > [0x19d395]<br>
> ><br>
> > /usr/local/freeswitch/lib/libfreeswitch.so.1(switch_strftime<br>
> > +0x39)<br>
> > > [0x13a139]<br>
> ><br>
> > /usr/local/freeswitch/lib/libfreeswitch.so.1(switch_log_printf+0x126)<br>
> > > [0x17f1f6]<br>
> ><br>
> > /usr/local/freeswitch/lib/libfreeswitch.so.<br>
> > > 1(switch_play_and_get_digits<br>
> +0x192)[0x175ad2]<br>
> ><br>
> > /usr/local/freeswitch/lib/libfreeswitch.so.<br>
> > ><br>
> 1(_ZN11CoreSession16playAndGetDigitsEiiiiPcS0_S0_S0_S0_<br>
> > +0xe2)<br>
> > > [0x188242]<br>
> > > /usr/local/freeswitch/mod/<br>
> > > mod_java<br>
> > > .so<br>
> > ><br>
> ><br>
> (Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1playAndGetDigits<br>
> > > +0x15d)[0xe46f3d]<br>
> ><br>
> ><br>
> ><br>
> _______________________________________________<br>
> > Freeswitch-dev mailing list<br>
> > <a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
> ><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>
> > _______________________________________________<br>
> > Freeswitch-dev mailing list<br>
> > <a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
> ><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>
><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>
><br>
><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>
<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>
</div></div></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