[Asterisk-Dev] ast realtime and ast_mutex_lock

Daniel Swarbrick asterisk at pressure.net.nz
Wed Sep 21 23:16:24 MST 2005


Having recently uploaded my Postgres driver for asterisk realtime to 
bugs.digium, I've been doing some testing of using SIP realtime, and 
found that the ast_mutex locking seems to cause problems. If for 
whatever reason a call cannot be connected, the lock doesn't seem to 
release, and no further calls can be placed. Also, if I ring an 
extension but hang up before it is answered, the other end keeps ringing.

My understanding of asterisk realtime is limited, so I'm not sure if I 
need these locks or not. I've taken them out and everything seems to 
work fine - calls hang up properly, and non-registered extensions divert 
to voicemail as specified in the dialplan.

How many threads are going to try to access my postgres realtime driver 
concurrently? Are locks necessary? I notice that the bundled 
res_config_odbc doesn't use locks at all, but I suspect ODBC creates a 
new connection handled for each request, with ODBC connection pooling 
happening somewhere in the background.



More information about the asterisk-dev mailing list