READ_STREAM and WRITE_STREAM give you muxed stream of both directions at once by buffering it.<br><br>READ_REPLACE and WRITE_REPLACE give you the packets as they happen in that particular direction with added capability that you can write new data into the frame to take it&#39;s place.<br>
<br>The format in a media bug is always raw signed linear.<br><br>datalen is the size in bytes of the decoded payload.<br><br>g711 decodes to 320 bytes per 20ms packet<br>g722 decodes to twice that, 640, since it&#39;s 16lhz audio.<br>
<br><br><br><div class="gmail_quote">On Thu, Oct 1, 2009 at 4:45 AM, Leon de Rooij <span dir="ltr">&lt;<a href="mailto:leon@scarlet-internet.nl">leon@scarlet-internet.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
I&#39;m trying to make a legal intercept module. My first attempt was to<br>
get the raw RTP packets from switch_frame_t, but they don&#39;t seem to be<br>
available. My second attempt is to get the raw pcm data from the<br>
frames, which seems to work. I still have a few questions though:<br>
<br>
- On setting the mediabug (switch_core_media_bug_add), I can pass an<br>
enum. Is there a difference between SMBF_BOTH (0) or SMBF_READ_STREAM<br>
| SMBF_WRITE_STREAM (1+2=3) ?<br>
<br>
- In the callback function passed to the bug, what does each of the<br>
following switch_abc_type_t mean ? At first I assumed that READ and<br>
WRITE state the direction of the media, but some recording functions<br>
only use the READ so that can&#39;t be true.<br>
<br>
SWITCH_ABC_TYPE_INIT<br>
SWITCH_ABC_TYPE_READ_PING<br>
SWITCH_ABC_TYPE_CLOSE<br>
SWITCH_ABC_TYPE_READ<br>
SWITCH_ABC_TYPE_WRITE<br>
SWITCH_ABC_TYPE_READ_REPLACE<br>
SWITCH_ABC_TYPE_WRITE_REPLACE<br>
<br>
- When the callback function is called with SWITCH_ABC_TYPE_READ, I&#39;m<br>
doing a switch_core_media_bug_read to copy all media to a<br>
switch_frame_t. To then get the raw data, I see in many examples that<br>
the size of the frame is retrieved by &quot;(switch_size_t) frame.datalen /<br>
2&quot;. Why the division by two ?<br>
<br>
- I thought that frame.data contained a un-encoded version of the RTP<br>
packet, but the datalen seems to differ when I&#39;m calling in over g711<br>
or g722. What format is frame.data ?<br>
<br>
Thanks a lot !<br>
<br>
regards,<br>
<br>
Leon<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>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</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<br>