Thanks to c6burns on IRC channel for the tip to use execute_on_answer in combination with eval, and of course everyone here that pointing me to the right direction.
Yes you need an API object as described in other email.
Which line of code from java caused that segfault
It looks like a simple NULL string issue that we may want to hunt down.Anthony Minessale IIOn Wed, Oct 21, 2009 at 4:44 AM, Henry Huang <red.rain.seven@gmail.com> wrote:
I can't seem to find the right thing to use in mod_java to execute api commands, only api_after_bridge2009-10-21 17:42:46.593094 [NOTICE] mod_sofia.c:1509 Pre-Answer sofia/internal/1688003@192.168.1.66!## A fatal error has been detected by the Java Runtime Environment:## SIGSEGV (0xb) at pc=0x004e4480, pid=1927, tid=16116624## JRE version: 6.0_16-b01# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode linux-x86 )# Problematic frame:# C [libc.so.6+0x6f480] strcpy+0x10## An error report file with more information is saved as:# /usr/local/freeswitch/bin/hs_err_pid1927.log2009-10-21 17:42:59.883729 [ERR] switch_core_session.c:1374 Invalid Application sched_api2009-10-21 17:42:59.883729 [NOTICE] switch_core_session.c:1375 Hangup sofia/internal/1688003@192.168.1.66 [CS_EXECUTE] [DESTINATION_OUT_OF_ORDER]## If you would like to submit a bug report, please visit:# The crash happened outside the Java Virtual Machine in native code.# See problematic frame for where to report the bug.On Sat, Oct 17, 2009 at 3:37 AM, Michael Collins <msc@freeswitch.org> wrote:
On Fri, Oct 16, 2009 at 11:53 AM, Henry Huang <red.rain.seven@gmail.com> wrote:
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");
but then it gets executed after the channel's been teared down. I thought api_after_bridge means right after the call gets connected.
I need something to execute an api command right before or right after the call gets bridged.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:
http://wiki.freeswitch.org/wiki/Mod_commands#Misc._Commands
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:
api = freeswitch.API();
res = api:execute("sched_api","+300 none my_api my_api_args")
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:
http://wiki.freeswitch.org/wiki/Mod_dptools
On the other hand, API commands are listed here:dptools require a session object, api commands require an api object...
-MC
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale@hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org
pstn:213-799-1400
_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org