diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 823c4a3c7d..f30ea54f8b 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1353,7 +1353,8 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s res = x; } } - ast_mutex_unlock(&iaxsl[x]); + if (res && !return_locked) + ast_mutex_unlock(&iaxsl[x]); } for (x=TRUNK_CALL_START;(res < 1) && (x= NEW_ALLOW)) {