<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Yep, that seems to work. I believe the
issue is with POE::Filter::FSSocket. I’ll keep investigating.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>-MC<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Anthony Minessale<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, May 16, 2008 10:00
AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">freeswitch-users@lists.freeswitch.org</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Freeswitch-users]
Event socket: api vs. bgapi</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>BACKGROUND_JOB event
should fall under all<br>
<br>
If it's the inbound socket connection you should only have to do it once.<br>
<br>
telnet to the event socket and auth and do<br>
<br>
events all<cr><br>
<cr><br>
<br>
then try <br>
<br>
bgapi show channels<cr><br>
<cr><br>
<br>
<br>
<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Fri, May 16, 2008 at 11:31 AM, Michael S Collins <<a
href="mailto:mercutio.viz@gmail.com">mercutio.viz@gmail.com</a>> wrote:<o:p></o:p></span></font></p>
<div bgcolor="#FFFFFF">
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>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.<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thanks,<o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>MC<br>
<br>
Sent from my iPhone<o:p></o:p></span></font></p>
</div>
<div>
<div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
On May 16, 2008, at 6:13 AM, "Anthony Minessale" <<a
href="mailto:anthony.minessale@gmail.com" target="_blank">anthony.minessale@gmail.com</a>>
wrote:<o:p></o:p></span></font></p>
</div>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>when you do bgapi you
actually have to subscribe to the background job event to get the results.<br>
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.<br>
<br>
The bgapi returns a job-uuid that you need to save and use it to tie the
background_job event to the original request.<br>
<br>
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.<br>
<br>
Also to further complicate things, bgapi is an event socket command only so it
cannot be used from cli xml-rpc etc.<br>
BUT, there is actually a *bgapi* FSAPI command you can execute to run any FSAPI
in the same fashion.<br>
<br>
so raw event socket command<br>
api bgapi show channels<br>
<br>
is the same as raw event socket command<br>
<br>
bgapi show channels<br>
<br>
but, you can also say "bgapi show channels" from the
cli/xml-rpc/dialplan etc as well.<br>
<br>
<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Fri, May 16, 2008 at 1:08 AM, <st1:PersonName w:st="on">Michael Collins</st1:PersonName>
<<a href="mailto:mcollins@fcnetwork.com" target="_blank"></a><a
href="mailto:mcollins@fcnetwork.com" target="_blank">mcollins@fcnetwork.com</a>>
wrote:<o:p></o:p></span></font></p>
<div link=blue vlink=purple>
<div>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>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?</span></font><o:p></o:p></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font><o:p></o:p></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>-MC</span></font><o:p></o:p></p>
<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'> </span></font><o:p></o:p></p>
<div style='border:none;border-left:solid windowtext 1.5pt;padding:0in 0in 0in 4.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center>
</span></font></div>
<p><b><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
font-weight:bold'>From:</span></font></b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'> <a
href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank"></a><a
href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org"
target="_blank"></a><a
href="mailto:freeswitch-users-bounces@lists.freeswitch.org" target="_blank">freeswitch-users-bounces@lists.freeswitch.org</a>]
<b><span style='font-weight:bold'>On Behalf Of </span></b><st1:PersonName
w:st="on">Michael Collins</st1:PersonName><br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, May 15, 2008 4:59
PM<br>
<b><span style='font-weight:bold'>To:</span></b> <a
href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank"></a><a
href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a><br>
<b><span style='font-weight:bold'>Subject:</span></b> [Freeswitch-users] Event
socket: api vs. bgapi</span></font><o:p></o:p></p>
</div>
<div>
<div>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Question:</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Are
there compelling reasons *<b><span style='font-weight:bold'>not</span></b>* 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.</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thanks,</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>MC</span></font><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank"></a><a
href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target="_blank"></a><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"></a><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"></a><a
href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank"></a><a
href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/" target="_blank"></a><a
href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com" target="_blank">MSN:</a><a
href="mailto:anthony_minessale@hotmail.com" target="_blank">anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com"
target="_blank">PAYPAL:</a><a href="mailto:anthony.minessale@gmail.com"
target="_blank">anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
#freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org" target="_blank">sip:</a><a
href="mailto:888@conference.freeswitch.org" target="_blank">888@conference.freeswitch.org</a><br>
<a href="http://iax:guest@conference.freeswitch.org/888" target="_blank">iax:</a><a
href="mailto:guest@conference.freeswitch.org" target="_blank">guest@conference.freeswitch.org</a>/888<br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org"
target="_blank">googletalk:</a><a
href="mailto:conf+888@conference.freeswitch.org" target="_blank">conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400 <o:p></o:p></span></font></p>
</div>
</blockquote>
<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org" target="_blank">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"></a><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><o:p></o:p></span></font></p>
</div>
</blockquote>
</div>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><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><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
<a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400 <o:p></o:p></span></font></p>
</div>
</div>
</body>
</html>