Unlock the dial operation lock on a failed dial
authorMatthew Jordan <mjordan@digium.com>
Sat, 10 Aug 2013 04:18:33 +0000 (04:18 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sat, 10 Aug 2013 04:18:33 +0000 (04:18 +0000)
If a dial operation fails, the pbx_outgoing_attempt routine will exit without
first having unlocked the outgoing dial lock. This would be a "bad thing".

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396521 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index ec96344..4db89f8 100644 (file)
@@ -9983,6 +9983,7 @@ static int pbx_outgoing_attempt(const char *type, struct ast_format_cap *cap, co
                        ast_cond_wait(&outgoing->cond, &outgoing->lock);
 
                        if (outgoing->dial_res != AST_DIAL_RESULT_ANSWERED) {
+                               ast_mutex_unlock(&outgoing->lock);
                                /* The dial operation failed. */
                                return -1;
                        }