From: Richard Mudgett Date: Mon, 29 Oct 2012 19:26:52 +0000 (+0000) Subject: Fix the Park 'r' option when a channel parks itself. X-Git-Tag: 1.8.19.0-tc1~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f902cb2e9f82cf7da973cf636429a1fa05aa87c;p=thirdparty%2Fasterisk.git Fix the Park 'r' option when a channel parks itself. When a channel uses the Park appliation to park itself with the 'r' option, the channel hears music-on-hold instead of the requested ringing. * Added a missing check for the 'r' option when a channel parks itself. (closes issue ASTERISK-19382) Reported by: James Stocks Patches by: dsessions Review: https://reviewboard.asterisk.org/r/2148/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@375388 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/features.c b/main/features.c index 2b2ccb57e5..35f097a13f 100644 --- a/main/features.c +++ b/main/features.c @@ -1630,10 +1630,15 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, st } if (peer == chan) { /* pu->notquiteyet = 1 */ /* Wake up parking thread if we're really done */ - pu->hold_method = AST_CONTROL_HOLD; - ast_indicate_data(chan, AST_CONTROL_HOLD, - S_OR(pu->parkinglot->cfg.mohclass, NULL), - !ast_strlen_zero(pu->parkinglot->cfg.mohclass) ? strlen(pu->parkinglot->cfg.mohclass) + 1 : 0); + if (ast_test_flag(args, AST_PARK_OPT_RINGING)) { + pu->hold_method = AST_CONTROL_RINGING; + ast_indicate(chan, AST_CONTROL_RINGING); + } else { + pu->hold_method = AST_CONTROL_HOLD; + ast_indicate_data(chan, AST_CONTROL_HOLD, + S_OR(pu->parkinglot->cfg.mohclass, NULL), + !ast_strlen_zero(pu->parkinglot->cfg.mohclass) ? strlen(pu->parkinglot->cfg.mohclass) + 1 : 0); + } pu->notquiteyet = 0; pthread_kill(parking_thread, SIGURG); }