On Fri, Oct 16, 2009 at 11:53 AM, Henry Huang <red.rain.se...@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:
http://wiki.freeswitch.org/wiki/Mod_commands

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

Reply via email to