diff --git a/channels/sig_pri.c b/channels/sig_pri.c index f0a15d7ede031ab105457c96c61eab466529679f..093d8ad83aa22f5cf08c912c24cee60725af564e 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -5121,7 +5121,6 @@ static int sig_pri_handle_hold(struct sig_pri_span *pri, pri_event *ev) int retval; int chanpos_old; int chanpos_new; - struct ast_channel *bridged; struct ast_channel *owner; chanpos_old = pri_find_principle_by_call(pri, ev->hold.call); @@ -5142,9 +5141,11 @@ static int sig_pri_handle_hold(struct sig_pri_span *pri, pri_event *ev) if (!owner) { goto done_with_private; } - bridged = ast_bridged_channel(owner); - if (!bridged) { - /* Cannot hold a call that is not bridged. */ + if (pri->pvts[chanpos_old]->call_level != SIG_PRI_CALL_LEVEL_CONNECT) { + /* + * Make things simple. Don't allow placing a call on hold that + * is not connected. + */ goto done_with_owner; } chanpos_new = pri_find_empty_nobch(pri); diff --git a/main/channel.c b/main/channel.c index 39edcd143620e696f476a7935e56e3e47398f05f..3812fa9c21ea1b66df0d3a7ad7546218ef4d1654 100644 --- a/main/channel.c +++ b/main/channel.c @@ -3413,6 +3413,8 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd) case AST_CONTROL_CONNECTED_LINE: case AST_CONTROL_REDIRECTING: case AST_CONTROL_UPDATE_RTP_PEER: + case AST_CONTROL_HOLD: + case AST_CONTROL_UNHOLD: case -1: /* Unimportant */ break;