[Freeswitch-users] Event socket: api vs. bgapi
Michael Collins
mcollins at fcnetwork.com
Fri May 16 11:56:23 PDT 2008
I probably should have mentioned what I was using beforehand! :-)
Anyway, I'll get all this stuff doc'd.
-MC
________________________________
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of
Anthony Minessale
Sent: Friday, May 16, 2008 11:40 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Event socket: api vs. bgapi
yes that module is out of date.
see the FreeSWITCH::Client in tree for mine
On Fri, May 16, 2008 at 1:09 PM, Michael Collins
<mcollins at fcnetwork.com> wrote:
Yep, that seems to work. I believe the issue is with
POE::Filter::FSSocket. I'll keep investigating.
-MC
________________________________
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of
Anthony Minessale
Sent: Friday, May 16, 2008 10:00 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Event socket: api vs. bgapi
BACKGROUND_JOB event should fall under all
If it's the inbound socket connection you should only have to do it
once.
telnet to the event socket and auth and do
events all<cr>
<cr>
then try
bgapi show channels<cr>
<cr>
On Fri, May 16, 2008 at 11:31 AM, Michael S Collins
<mercutio.viz at gmail.com> wrote:
Thanks. I'll get this on the wiki right away. Clarification questions:
does one need to subscribe to the background job just once per session
in order to receive all subsequent bgapi events? Also, is it the case
that subscribing to "events plain all" does not include bgapi events?
I'm testing and it looks like that's the case but I want to confirm.
Thanks,
MC
Sent from my iPhone
On May 16, 2008, at 6:13 AM, "Anthony Minessale"
<anthony.minessale at gmail.com> wrote:
when you do bgapi you actually have to subscribe to the
background job event to get the results.
Since it's an async operation, the command is executed in it's
own thread and when the results are collected they are put in the
event's body.
The bgapi returns a job-uuid that you need to save and use it to
tie the background_job event to the original request.
The decision to use api vs bgapi is weather or not you want to
get the results right away or not. So usually show channels etc is a
case where you want to do it in the foreground.
Also to further complicate things, bgapi is an event socket
command only so it cannot be used from cli xml-rpc etc.
BUT, there is actually a *bgapi* FSAPI command you can execute
to run any FSAPI in the same fashion.
so raw event socket command
api bgapi show channels
is the same as raw event socket command
bgapi show channels
but, you can also say "bgapi show channels" from the
cli/xml-rpc/dialplan etc as well.
On Fri, May 16, 2008 at 1:08 AM, Michael Collins <
<mailto:mcollins at fcnetwork.com> mcollins at fcnetwork.com> wrote:
Followup question: I can use api to send "show channels" or "oz
list" but when I use bgapi to send those commands I don't get anything
back from the event socket. Any thoughts?
-MC
________________________________
From: <mailto:freeswitch-users-bounces at lists.freeswitch.org>
freeswitch-users-bounces at lists.freeswitch.org [mailto:
<mailto:freeswitch-users-bounces at lists.freeswitch.org>
freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Michael
Collins
Sent: Thursday, May 15, 2008 4:59 PM
To: <mailto:freeswitch-users at lists.freeswitch.org>
freeswitch-users at lists.freeswitch.org
Subject: [Freeswitch-users] Event socket: api vs. bgapi
Question:
Are there compelling reasons *not* to use api for simple
commands like "show channels" or "oz list"? Since api is blocking and
bgapi is non-blocking I just wondered if there are recommendations for
when to use each one. I can definitely see why you'd use bgapi for an
"originate" command. I didn't see anything on the wiki that discussed
when to use api vs. bgapi so I'll be happy to write up a blurb on the
recommended use of each one.
Thanks,
MC
_______________________________________________
Freeswitch-users mailing list
<mailto:Freeswitch-users at lists.freeswitch.org>
Freeswitch-users at lists.freeswitch.org
<http://lists.freeswitch.org/mailman/listinfo/freeswitch-users>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:
<http://lists.freeswitch.org/mailman/options/freeswitch-users>
http://lists.freeswitch.org/mailman/options/freeswitch-users
<http://www.freeswitch.org> http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH <http://www.freeswitch.org/>
http://www.freeswitch.org/
ClueCon <http://www.cluecon.com/> http://www.cluecon.com/
AIM: anthm
MSN: <mailto:MSN%3Aanthony_minessale at hotmail.com>
anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:
<mailto:PAYPAL%3Aanthony.minessale at gmail.com>
anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip: <mailto:sip%3A888 at conference.freeswitch.org>
888 at conference.freeswitch.org
iax: <http://iax:guest@conference.freeswitch.org/888>
guest at conference.freeswitch.org/888
googletalk:
<mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
conf+888 at conference.freeswitch.org
pstn:213-799-1400
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:
<http://lists.freeswitch.org/mailman/options/freeswitch-users>
http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
AIM: anthm
MSN:anthony_minessale at hotmail.com
<mailto:MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
<mailto:PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
<mailto:sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
AIM: anthm
MSN:anthony_minessale at hotmail.com
<mailto:MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
<mailto:PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
<mailto:sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org
<mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080516/393861fb/attachment-0002.html
More information about the FreeSWITCH-users
mailing list