it&#39;s not a serialized event. it&#39;s actually the output of the command in question.<br><br>The correct way to deal with it is to subscribe to the BACKGROUND_JOB event and <br>use the Job-UUID header to match the packet to the uuid given as a response to the submission of the request.<br>
When a match exists the body of that event will be the output generated by the API call.<br><br><br><div class="gmail_quote">On Mon, Apr 28, 2008 at 5:45 PM, Juan Jose Comellas &lt;<a href="mailto:juanjo@comellas.org">juanjo@comellas.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Whenever a call to a command is made using bgapi, a BACKGROUND_JOB<br>
event is sent by FreeSWITCH when the command is completed. A<br>
BACKGROUND_JOB event looks like this:<br>
<br>
-------------- cut --------------<br>
Content-Length: 614<br>
Content-Type: text/event-plain<br>
<br>
Job-UUID: d19f2410-1548-11dd-9eeb-0d886880e312<br>
Job-Command: originate<br>
Job-Command-Arg: sofia/default/user2.comellas%40192.168.1.40%3A5061%202001<br>
Event-Name: BACKGROUND_JOB<br>
Core-UUID: f17f3284-1543-11dd-9eeb-0d886880e312<br>
FreeSWITCH-Hostname: comellas<br>
FreeSWITCH-IPv4: <a href="http://192.168.1.38" target="_blank">192.168.1.38</a><br>
FreeSWITCH-IPv6: <a href="http://127.0.0.1" target="_blank">127.0.0.1</a><br>
Event-Date-Local: 2008-04-28%2014%3A30%3A47<br>
Event-Date-GMT: Mon,%2028%20Apr%202008%2017%3A30%3A47%20GMT<br>
Event-Date-timestamp: 1209403847575107<br>
Event-Calling-File: mod_event_socket.c<br>
Event-Calling-Function: api_exec<br>
Event-Calling-Line-Number: 602<br>
Content-Length: 41<br>
<br>
+OK d19f45e4-1548-11dd-9eeb-0d886880e312<br>
-------------- cut --------------<br>
<br>
&gt;From what MikeJ told me over IRC, the body of a BACKGROUND_JOB message<br>
is actually a serialized event containing the response to the original<br>
command. The problem is that the content-type of the message is the<br>
same as that used by any normal event. This makes it difficult to have<br>
a generic parser, because we have to analyze the body of the message<br>
to determine whether we are dealing with a normal event or a<br>
BACKGROUND_JOB. The other problem I see is that the body containing<br>
the serialized event does not have a content-type of its own.<br>
<br>
An example of a message with the above mentioned problems addressed<br>
could look like this:<br>
<br>
-------------- cut --------------<br>
Content-Length: 643<br>
Content-Type: text/background-response-wrapper-plain<br>
<br>
Job-UUID: d19f2410-1548-11dd-9eeb-0d886880e312<br>
Job-Command: originate<br>
Job-Command-Arg: sofia/default/user2.comellas%40192.168.1.40%3A5061%202001<br>
Event-Name: BACKGROUND_JOB<br>
Core-UUID: f17f3284-1543-11dd-9eeb-0d886880e312<br>
FreeSWITCH-Hostname: comellas<br>
FreeSWITCH-IPv4: <a href="http://192.168.1.38" target="_blank">192.168.1.38</a><br>
FreeSWITCH-IPv6: <a href="http://127.0.0.1" target="_blank">127.0.0.1</a><br>
Event-Date-Local: 2008-04-28%2014%3A30%3A47<br>
Event-Date-GMT: Mon,%2028%20Apr%202008%2017%3A30%3A47%20GMT<br>
Event-Date-timestamp: 1209403847575107<br>
Event-Calling-File: mod_event_socket.c<br>
Event-Calling-Function: api_exec<br>
Event-Calling-Line-Number: 602<br>
Content-Type: api/background-response<br>
Content-Length: 41<br>
<br>
+OK d19f45e4-1548-11dd-9eeb-0d886880e312<br>
-------------- cut --------------<br>
<br>
What do you think? Is a change similar to what I propose feasible?<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><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