On Wed, Aug 6, 2008 at 10:12 AM, Pedro Gon?alves <pedro.pandre at gmail.com>wrote: > > This then begs the question, what are you doing in your > > on_media_state()? You're asking why the stream is not destroyed upon > > subsequent offer/answer. Well then do you destroy the stream when > > you've got subsequent offer/answer? Since you're not using PJSUA-LIB, > > everything related to media is under your control. > on_media_state doesn't seem to exist. You're talking about > on_state_changed or on_media_update? > Yeah, I mean on_media_update(). Sorry. > > > > pjmedia_snd_port_disconnect(my_snd_port); > > pj_thread_sleep(100); > > pjmedia_snd_port_destroy(my_snd_port); > > > > > > What is this for? Surely having sleep() in the callback is not a good > > idea. > I am using because it is being used that way in the samples, that you > told me to see. Example: Sure. But in the samples, these are done when application quits, so it can afford to sleep anytime it wants. We can't do this in the callback. And probably you shouldn't close the sound device there in the first place, and rather only open/close the sound device during the start and end of the call. Cheers Benny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080806/50a9c446/attachment.html