[Freeswitch-users] sched_api doesn't get launched
Michael Collins
msc at freeswitch.org
Fri Oct 16 12:37:20 PDT 2009
On Fri, Oct 16, 2009 at 11:53 AM, Henry Huang <red.rain.seven at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20091016/0f04db00/attachment-0002.html
More information about the FreeSWITCH-users
mailing list