<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The syntax is different, but the api is the same as lua:<div><br></div><div><blockquote type="cite"><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div class="gmail_quote"><div>So you need an API object in order to use it. I don't know the syntax 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></div></div></blockquote></div></div></div></blockquote><div><br></div>create the API object and use the execute method of it.</div><div><br></div><div>Mike</div><div><br></div><div><br></div><div><div><div>On Oct 21, 2009, at 5:44 AM, Henry Huang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I can't seem to find the right thing to use in mod_java to execute api commands, only api_after_bridge<div><br></div><div><br></div><div><div>2009-10-21 17:42:46.593094 [NOTICE] mod_sofia.c:1509 Pre-Answer sofia/internal/<a href="mailto:1688003@192.168.1.66">1688003@192.168.1.66</a>!</div>
<div>#</div><div># A fatal error has been detected by the Java Runtime Environment:</div><div>#</div><div># &nbsp;SIGSEGV (0xb) at pc=0x004e4480, pid=1927, tid=16116624</div><div>#</div><div># JRE version: 6.0_16-b01</div><div>
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode linux-x86 )</div><div># Problematic frame:</div><div># C &nbsp;[libc.so.6+0x6f480] &nbsp;strcpy+0x10</div><div>#</div><div># An error report file with more information is saved as:</div>
<div># /usr/local/freeswitch/bin/hs_err_pid1927.log</div><div><font class="Apple-style-span" color="#FF0000">2009-10-21 17:42:59.883729 [ERR] switch_core_session.c:1374 Invalid Application sched_api</font></div><div>2009-10-21 17:42:59.883729 [NOTICE] switch_core_session.c:1375 Hangup sofia/internal/<a href="mailto:1688003@192.168.1.66">1688003@192.168.1.66</a> [CS_EXECUTE] [DESTINATION_OUT_OF_ORDER]</div>
<div>#</div><div># If you would like to submit a bug report, please visit:</div><div># &nbsp; <a href="http://java.sun.com/webapps/bugreport/crash.jsp">http://java.sun.com/webapps/bugreport/crash.jsp</a></div><div># The crash happened outside the Java Virtual Machine in native code.</div>
<div># See problematic frame for where to report the bug.</div><div><br></div><br><div class="gmail_quote">On Sat, Oct 17, 2009 at 3:37 AM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br><div class="gmail_quote"><div class="im">On Fri, Oct 16, 2009 at 11:53 AM, Henry Huang <span dir="ltr">&lt;<a href="mailto:red.rain.seven@gmail.com" target="_blank">red.rain.seven@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
So how would you trigger it from a script dialplan? The only time it seemed to work is when I did setVariable("api_after_bridge", "sched_api blah blah blah");<br>but then it gets executed after the channel's been teared down. I 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 after the call gets bridged. <br><br></blockquote></div><div>api_after_bridge is a channel variable, so using setVariable works just 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 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 tools then it isn't a dial plan application. Make sure it's on the list:<br>

<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:<div class="im"><br><a href="http://wiki.freeswitch.org/wiki/Mod_commands" target="_blank">http://wiki.freeswitch.org/wiki/Mod_commands</a><br>

<br></div>dptools require a session object, api commands require an api object...<br><br>-MC<br></div></div><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></blockquote></div><br><br clear="all"><br>-- <br>Henry Huang<br>UniC Solution - Communication Unified<br>VoIP &amp; Open Source software Consultant<br>
</div>
_______________________________________________<br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br>http://www.freeswitch.org<br></blockquote></div><br></div></body></html>