Anthony:<div><br></div><div>You are da man. Thank you. It's very kind of you to release me from endless trial :P<br><br><div class="gmail_quote">On Sat, Oct 24, 2009 at 1:47 AM, Chris Burns <span dir="ltr"><<a href="mailto:chris@cloudtel.com">chris@cloudtel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">poor bbhenry :)<br>
<br>
Added in r15207 please test and update docu if necessary:<br>
<a href="http://wiki.freeswitch.org/wiki/Variable_api_on_answer" target="_blank">http://wiki.freeswitch.org/wiki/Variable_api_on_answer</a><br>
<div><div></div><div class="h5"><br>
On October 23, 2009 11:02:07 am Anthony Minessale wrote:<br>
> it's probably related to escaping the data.<br>
> I was sick of watching you suffer so i added api_on_answer variable to<br>
> trunk.<br>
><br>
> On Fri, Oct 23, 2009 at 3:54 AM, Henry Huang<br>
<<a href="mailto:red.rain.seven@gmail.com">red.rain.seven@gmail.com</a>>wrote:<br>
> > Thanks to c6burns on IRC channel for the tip to use execute_on_answer in<br>
> > combination with eval, and of course everyone here that pointing me to<br>
> > the right direction.<br>
> > I was able to execute sched_api with eval, but not with the combination<br>
> > of execute_on_answer. The argument just don't get parsed as the eval<br>
> > argument. Here is the code:<br>
> ><br>
> > setVariable("execute_on_answer", "eval sched_api(+%ld none uuid_displace<br>
> > <some uuid> start<br>
> > /usr/local/freeswitch/sounds/en/us/callie/misc/8000/final.wav 20 mux)");<br>
> ><br>
> ><br>
> > Here is the log:<br>
> > 2009-10-23 16:17:53.633189 [DEBUG] switch_scheduler.c:214 Added task 2<br>
> > sched_api_function (none) to run at 1256285888<br>
> > EXECUTE sofia/internal/<a href="mailto:1688004@192.168.1.66">1688004@192.168.1.66</a> *eval(+OK *Added: 2<br>
> > )<br>
> ><br>
> > 2009-10-23 16:18:04.52701 [DEBUG] switch_channel.c:1927 sofia/internal/<br>
> > <a href="mailto:1688004@192.168.1.66">1688004@192.168.1.66</a> *execute on answer: eval(sched_api(+37 none<br>
> > uuid_displace 84d74f41-8668-4138-943f-f076e94046ad start<br>
> > /usr/local/freeswitch/sounds/en/us/callie/misc/8000/final.wav 20 mux))*<br>
> > EXECUTE sofia/internal/<a href="mailto:1688004@192.168.1.66">1688004@192.168.1.66</a> eval(sched_api(+37 none<br>
> > uuid_displace 84d74f41-8668-4138-943f-f076e94046ad start<br>
> > /usr/local/freeswitch/sounds/en/us/callie/misc/8000/final.wav 20 mux))<br>
> ><br>
> ><br>
> > The first part of the log is when I just do execute("eval",<br>
> > "${sched_api(+%ld none uuid_displace <some uuid> start<br>
> > /usr/local/freeswitch/sounds/en/us/callie/misc/8000/final.wav 20 mux)}");<br>
> > And I simple get a OK, and then later on the sched_api gets executed.<br>
> ><br>
> > However, on the excerpt of the second log. which I use the combination<br>
> > with execute_on_answer like specified in the yellow hight code above. It<br>
> > doesn't simply return a OK, instead it shows the whole blob of code. and<br>
> > does nothing later.<br>
> ><br>
> ><br>
> ><br>
> > On Thu, Oct 22, 2009 at 4:09 AM, Anthony Minessale <<br>
> ><br>
> > <a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>> wrote:<br>
> >> Yes you need an API object as described in other email.<br>
> >><br>
> >> Which line of code from java caused that segfault<br>
> >> It looks like a simple NULL string issue that we may want to hunt down.<br>
> >><br>
> >> On Wed, Oct 21, 2009 at 4:44 AM, Henry Huang<br>
<<a href="mailto:red.rain.seven@gmail.com">red.rain.seven@gmail.com</a>>wrote:<br>
> >>> I can't seem to find the right thing to use in mod_java to execute api<br>
> >>> commands, only api_after_bridge<br>
> >>><br>
> >>> 2009-10-21 17:42:46.593094 [NOTICE] mod_sofia.c:1509 Pre-Answer<br>
> >>> sofia/internal/<a href="mailto:1688003@192.168.1.66">1688003@192.168.1.66</a>!<br>
> >>> #<br>
> >>> # A fatal error has been detected by the Java Runtime Environment:<br>
> >>> #<br>
> >>> # SIGSEGV (0xb) at pc=0x004e4480, pid=1927, tid=16116624<br>
> >>> #<br>
> >>> # JRE version: 6.0_16-b01<br>
> >>> # Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode linux-x86 )<br>
> >>> # Problematic frame:<br>
> >>> # C [libc.so.6+0x6f480] strcpy+0x10<br>
> >>> #<br>
> >>> # An error report file with more information is saved as:<br>
> >>> # /usr/local/freeswitch/bin/hs_err_pid1927.log<br>
> >>> 2009-10-21 17:42:59.883729 [ERR] switch_core_session.c:1374 Invalid<br>
> >>> Application sched_api<br>
> >>> 2009-10-21 17:42:59.883729 [NOTICE] switch_core_session.c:1375 Hangup<br>
> >>> sofia/internal/<a href="mailto:1688003@192.168.1.66">1688003@192.168.1.66</a> [CS_EXECUTE]<br>
> >>> [DESTINATION_OUT_OF_ORDER]<br>
> >>> #<br>
> >>> # If you would like to submit a bug report, please visit:<br>
> >>> # <a href="http://java.sun.com/webapps/bugreport/crash.jsp" target="_blank">http://java.sun.com/webapps/bugreport/crash.jsp</a><br>
> >>> # The crash happened outside the Java Virtual Machine in native code.<br>
> >>> # See problematic frame for where to report the bug.<br>
> >>><br>
> >>> On Sat, Oct 17, 2009 at 3:37 AM, Michael Collins<br>
<<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>>wrote:<br>
> >>>> On Fri, Oct 16, 2009 at 11:53 AM, Henry Huang<br>
> >>>> <<a href="mailto:red.rain.seven@gmail.com">red.rain.seven@gmail.com</a><br>
> >>>><br>
> >>>> > wrote:<br>
> >>>>><br>
> >>>>> So how would you trigger it from a script dialplan? The only time it<br>
> >>>>> seemed to work is when I did setVariable("api_after_bridge",<br>
> >>>>> "sched_api blah blah blah");<br>
> >>>>> but then it gets executed after the channel's been teared down. I<br>
> >>>>> thought api_after_bridge means right after the call gets connected.<br>
> >>>>><br>
> >>>>> I need something to execute an api command right before or right<br>
> >>>>> after the call gets bridged.<br>
> >>>>><br>
> >>>>> api_after_bridge is a channel variable, so using setVariable works<br>
> >>>>> just<br>
> >>>><br>
> >>>> fine. If you need to sched_api is an API only. Check these out:<br>
> >>>> <a href="http://wiki.freeswitch.org/wiki/Mod_commands#Misc._Commands" target="_blank">http://wiki.freeswitch.org/wiki/Mod_commands#Misc._Commands</a><br>
> >>>><br>
> >>>> So you need an API object in order to use it. I don't know the syntax<br>
> >>>> for creating an api obj in Java but in Lua it goes like this:<br>
> >>>> api = freeswitch.API();<br>
> >>>> res = api:execute("sched_api","+300 none my_api my_api_args")<br>
> >>>><br>
> >>>> Remember, if the method you are using isn't found in the dial plan<br>
> >>>> tools then it isn't a dial plan application. Make sure it's on the<br>
> >>>> list: <a href="http://wiki.freeswitch.org/wiki/Mod_dptools" target="_blank">http://wiki.freeswitch.org/wiki/Mod_dptools</a><br>
> >>>><br>
> >>>> On the other hand, API commands are listed here:<br>
> >>>> <a href="http://wiki.freeswitch.org/wiki/Mod_commands" target="_blank">http://wiki.freeswitch.org/wiki/Mod_commands</a><br>
> >>>><br>
> >>>> dptools require a session object, api commands require an api<br>
> >>>> object...<br>
> >>>><br>
> >>>> -MC<br>
> >>>><br>
> >>>><br>
> >>>> _______________________________________________<br>
> >>>> FreeSWITCH-users mailing list<br>
> >>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> >>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> >>>> UNSUBSCRIBE:<br>
> >>>> <a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> >>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> >>><br>
> >>> --<br>
> >>> Henry Huang<br>
> >>> UniC Solution - Communication Unified<br>
> >>> VoIP & Open Source software Consultant<br>
> >>><br>
> >>> _______________________________________________<br>
> >>> FreeSWITCH-users mailing list<br>
> >>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> >>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> >>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-user" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-user</a><br>
</div></div>> >>>s <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<div class="im">> >><br>
> >> --<br>
> >> Anthony Minessale II<br>
> >><br>
> >> FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
> >> ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
> >> Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
> >><br>
> >> AIM: anthm<br>
</div>> >> <a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a> <<a href="mailto:MSN%253Aanthony_minessale@hotmail.com">MSN%3Aanthony_minessale@hotmail.com</a>><br>
> >> GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><PAYPAL%3Aanthony.minessa<br>
<div class="im">> >><a href="mailto:le@gmail.com">le@gmail.com</a>> IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
> >><br>
> >> FreeSWITCH Developer Conference<br>
</div>> >> <a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a> <<a href="mailto:sip%253A888@conference.freeswitch.org">sip%3A888@conference.freeswitch.org</a>><br>
<div class="im">> >> <a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:guest@conference.freeswitch.org/888</a><br>
</div>> >> <a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><googletalk%3Aconf%2B888@co<br>
<div class="im">> >><a href="http://nference.freeswitch.org" target="_blank">nference.freeswitch.org</a>> pstn:213-799-1400<br>
> >><br>
> >> _______________________________________________<br>
> >> FreeSWITCH-users mailing list<br>
> >> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> >> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> >> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> >> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> ><br>
> > --<br>
> > Henry Huang<br>
> > UniC Solution - Communication Unified<br>
> > VoIP & Open Source software Consultant<br>
> ><br>
> > _______________________________________________<br>
> > FreeSWITCH-users mailing list<br>
> > <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
<br>
</div><div><div></div><div class="h5">_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</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>Henry Huang<br>UniC Solution - Communication Unified<br>VoIP & Open Source software Consultant<br>
</div>