[pjsip] Question about stream.c

Michael Broughton Michael_Broughton at advanis.ca
Thu Feb 14 15:48:44 EST 2008

Benny Prijono wrote:
> On 2/14/08, Michael Broughton <Michael_Broughton at advanis.ca> wrote:
>>  > But soft deadlocking is very expensive in term of processing, as
>>  > everything that tries to lock PJSUA-LIB will be blocked while
>>  > PJSUA-LIB tries to acquire (and finally gives up) the locks. This
>>  > would block the application for at least 1 second for the best case, I
>>  > think.
>> What if acquire_call monitored a flag that indicates when the transport
>>  trying to shutdown? My own solution to ticket 460 sort-of worked that way.
> Sorry I don't get that, could you elaborate more?
> One thing for sure, if you maintain (m)any modifications in your local
> copy, you'll have a lot of pains for a long time. :) So lets try to
> find something that works for both of us.

Yes I am trying very hard to minimize my local changes.

The idea is to have pjmedia_stream_destroy flips a flag somewhere to 
indicate that it is attempting to destroy a stream. In my local patch, 
the flag is a member of the stream structure. Then the DTMF callback can 
check this flag while it is trying to acquire the call lock.

The benefit of this is that the DTMF callback can fail gracefully 
without waiting for a soft deadlock. The flag essentially gives it an 
early warning that a soft deadlock is going to occur.

Do you think it would be possible to do something like this without 
touching pjmedia? Could this be done in PJSUA? I have a feeling that 
this would be the only clean way to implement this.

Michael Broughton, Advanis

Unintended Recipient & Unauthorized Use of E-Mail:
This message and attachments may contain confidential or privileged
information that is intended only for the named recipient of this
e-mail. Any unauthorized use or distribution is not permitted. If you
have received this e-mail in error, deleting the e-mail and notifying
the sender would be appreciated. Thank you.

More information about the pjsip mailing list