[pjsip] How to hangup a call - the right way ??

Turnaev Eugeny turnaev at t72.ru
Wed May 21 08:10:09 EDT 2008


On Wednesday 21 May 2008 17:21:19 Benny Prijono wrote:

> 
> 
> > I have a debug listing of my app where call to
> >    status = py_pjsua.call_hangup(call_id, 0, None, None)
> > returned status => 0 but a call still alive and in active state.
> >
> > In my app right after   py_pjsua.call_hangup(...), approx 100 lines of python code later
> > app start a new call with call_make_call without waiting a callback to return that previous
> > call is disconnected. From time to time it happens that call_hangup returns 0 but a call keeps
> > living in active state .. state text EARLY.. and total duration increments. i can send my app log if it needed.
> >
> 
> There's no guarantee that call_hangup() will trigger DISCONNECTED
> callback to be called immediately. In the worst case, you'll get the
> callback up to 32 seconds after call_hangup(), if remote is not
> responding. In this case, the call duration will be kept incremented
> of course.
> 

Thanks for answers, 
i will use DNDEBUG :) 
32 seconds - well.. i already ended up 2 times with no calls available in pool (before set up 
cleaner of buggy calls),
both times - total_duration of some calls was > 1200 seconds... (
but unfortunably i did not dumped detailed information about calls at that time, but i bet calls was active 
and in EARLY state
)
So i would not say 
> There's no guarantee that call_hangup() will trigger DISCONNECTED
> callback to be called immediately.
i would say: There's no guarantee that call_hangup() will trigger DISCONNECTED at all.
one should keep trying to hangup untill it dies :)

> This has been discussed few times before, please see
> http://www.google.com/custom?q=Timed-out+trying+to+acquire+PJSUA&domains=pjsip.org&sitesearch=pjsip.org
> 
> Unfortunately we lost the list archive when we moved the mailing list
> late last year, but you can still get it from Google cache.
> 

I already googled with this and found nothing userfull.
What i am saying: i am sure 100% that my code do NOT enters
 py_pjsua.call_get_info()  2 times..
i have isolated every call to py_pjsua.call_get_info() with semaphore.

self.lock.acquire()
try:
	call_info = py_pjsua.call_get_info(self.current_call)
	... do some stuff
finally:
	self.lock.release()

So if i isolated every call to py_pjsua.call_get_info  
how can i came with
	pjsua_call.c Timed-out trying to acquire PJSUA mutex (possibly system has deadlocked) in pjsua_call_get_info()
message in log?
Maybe some other py_pjsua.* functions calling pjsua_call_get_info ?











More information about the pjsip mailing list