Hi Saul, Please see the inline comments.. On 25/03/2008, Sa?l Ibarra <saghul at gmail.com> wrote: > Hi Nanang! > > 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... Actually you don't need creating new thread for this. Just instantiate the wav player from main (or any) thread, then connect it to sound port/conference. > 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? Just disconnect the wav player from the sound port/conference (using pjmedia_snd_port_disconnect as in playfile.c). Again, no new thread needed, you can utilize the main thread for other purpose, since the connect & disconnect is 'not blocking'. Regards, nanang