[pjsip] Soft Deadlock in pjsua_call_hangup?

Thomas Janu janu at sympalog.de
Tue Dec 20 09:20:50 EST 2016

Hi list,

I have a problem using pjsip (pjproject-2.3 release) via the pjsua2 cpp api:

Having implemented my own media port for transferring the data to and 
from one of our systems (spoken dialog system), it happens that the 
dialog management says to hang up a call. This of course happens in the 
media callbacks (since that's where the communication with the dialog 
system happens). Calling hangup() from this thread sometimes(!) leads to:

  pjsua_call.c !.Timed-out trying to acquire dialog mutex (possibly 
system has deadlocked) in pjsua_call_hangup().

Afterwards, the software crashes, so most likely something goes wrong 
with deletion of the call object.
Is there any sort of locking I need to be doing in order to successfully 
hang up from a media callback? Do I need to defer the hangup to another 
thread altogether? I don't use any application mutexes, so according to 
https://trac.pjsip.org/repos/wiki/PJSUA_Locks I should not need to do 
anything there.

Any hints?


More information about the pjsip mailing list