[Freeswitch-users] How to read RTP package?

Frankie Yiu yky1628 at yahoo.com
Thu Feb 10 12:34:31 MSK 2011

Here is the description of the project:

We want to build a system that would play a recorded message when a human or an 
answer machine picks up the phone(eventually for multiple of phone numbers).  
For a human, we want to play the message after the human speaks.  For answer 
machine, we want to wait for the beep.  To do this, we think that we have to get 
the RTP packets and determine when is the right timing to play the message.

Currently, we have code in C# to play a recorded message when someone picks up 
the phone.  Someone suggests me to try Media bugs but it is not working with the 
wrapper function for C# (swig code, because of the pointer to pointer type, 
unless I am wrong).  So as our test, we call a wrapper function from C# with a 
"session" information, and inside the C++ code, we initialize a media bug with 
a call back function for READ.  I got event for Media Bugs INIT and when Media 
Bugs CLOSE message but never got any READ event.

Here are my questions:
1) How can I get the READ event from Media bugs event?  It seems to me that when 
I call a routine to initialize(ADD) the Media bugs, I will get INIT and CLOSE 
event back right away event though we have not hung up the phone yet, and 
therefore we never got any READ events.

2) If I am calling a number from C# code, how can I pass the session information 
to C++ code? (as I mention earlier I have modified function inside 
freeswitch_wrap.cxx to have call back in C++ code, but this is not the proper 

3) Is there a way to have packet send back to C# (I think those type 
"SWIGTYPE_p_p_..." is not working properly for C#, am I correct?)
Thanks in advance.  Any help would be great!!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110210/deb50fc2/attachment-0001.html 

More information about the FreeSWITCH-users mailing list