this is an encapsulated event inside a container event. if you were framing this on the wire you would read the headers (everything up to the gap) the content-length of 625 tells you to read exactly that many bytes and content type text/event-plain now when you read 625 bytes you can continue to read on the wire for a new event. Meanwhile you url decode that payload and you have another event who also has a payload of 41 bytes. Now you can read these 41 bytes to get the payload which is the exact size of the message contained in the event. None of this matters to you if you use the ESL lib supplied with FS to read events into a scripting language. On Tue, Mar 22, 2011 at 6:45 AM, Iñaki Baz Castillo <ibc@aliax.net> wrote:
Hi, I'm trying to understand the following example in the doc:
http://wiki.freeswitch.org/wiki/Event_List
Upon job completion, server response ---------------------- Content-Length: 625 Content-Type: text/event-plain
Job-UUID: 7f4db78a-17d7-11dd-b7a0-db4edd065621 Job-Command: originate Job-Command-Arg: sofia/default/1005%20'%26park' Event-Name: BACKGROUND_JOB Core-UUID: 42bdf272-16e6-11dd-b7a0-db4edd065621 FreeSWITCH-Hostname: ser FreeSWITCH-IPv4: 192.168.1.104 FreeSWITCH-IPv6: 127.0.0.1 Event-Date-Local: 2008-05-02%2007%3A37%3A03 Event-Date-GMT: Thu,%2001%20May%202008%2023%3A37%3A03%20GMT Event-Date-timestamp: 1209685023894968 Event-Calling-File: mod_event_socket.c Event-Calling-Function: api_exec Event-Calling-Line-Number: 609 Content-Length: 41
+OK 7f4de4bc-17d7-11dd-b7a0-db4edd065621 ----------------------
What is the purpose of the first "Content-Length: 625"? Why not just send all the headers with no Content-Lenght? (just leave the second Content-Length:41 which is the length of the job uuid).
So what is the purpose of the first Content-Length? A parser doesn't need it at all as it can read headers until it finds "Content-Length" (so it reads N bytes more) or it finds a double \n\n (so event info is terminated).
Thanks for any clarification.
-- Iñaki Baz Castillo <ibc@aliax.net>
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900