Hi Nanang! On Mon, Mar 24, 2008 at 7:10 PM, Nanang Izzuddin <nanang.izzuddin at gmail.com> wrote: > Hi Saul, > > If the variables (of pjmedia ports) are local, it is impossible to > access them to stop the ring. > Furthermore, the caching pool will produce leak (not release-able). > And I think it is more efficient and easier to maintain only single > instance of pjmedia_endpt and pjmedia_snd_port for the whole > application (perhaps also the wav player port). > So yes, (member of) global variables should be better. > Thank you very much for your response :) I'll get into it as soon as possible, now I'm testing threads and stuff :) So, by using global variables my idea is to generate a thread with the player, and when other event occurs (caller hangs up or I answer) stop the ringing... One last question about the wav playing... how can I stop a file when it's playing? Looking to the playfile.c example I don' get i clear, because it gets input from stdin and then... it stops playing? Is there a function to do that or something? Thanks again for the help. Regards. -- Sa?l -- "Nunca subestimes el ancho de banda de un cami?n lleno de disketes." ---------------------------------------------------------------- http://www.saghul.net/