Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 107959) +++ channels/chan_sip.c (working copy) @@ -2250,6 +2250,7 @@ } #define sip_pvt_lock(x) ast_mutex_lock(&x->pvt_lock) +#define sip_pvt_trylock(x) ast_mutex_trylock(&x->pvt_lock) #define sip_pvt_unlock(x) ast_mutex_unlock(&x->pvt_lock) /*! @@ -18332,7 +18333,13 @@ get back to this point every millisecond or less) */ for (dialog = dialoglist; dialog; dialog = dialog->next) { - sip_pvt_lock(dialog); + if (sip_pvt_trylock(dialog)) { + dialoglist_unlock(); + usleep(1); + dialoglist_lock(); + goto restartsearch; + } + /* Check RTP timeouts and kill calls if we have a timeout set and do not get RTP */ check_rtp_timeout(dialog, t); /* If we have sessions that needs to be destroyed, do it now */