From: Walter Doekes Date: Tue, 13 May 2014 14:34:31 +0000 (+0000) Subject: chan_sip+CEL: Add missing ANSWER and PICKUP events to INVITE/w/replaces pickup. X-Git-Tag: 11.10.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adb50be36d95755d589bf2c2ae4ff0afdcb17753;p=thirdparty%2Fasterisk.git chan_sip+CEL: Add missing ANSWER and PICKUP events to INVITE/w/replaces pickup. When doing a "BLF-style call pickup" -- an INVITE with Replaces: header -- the CEL log would lack the ANSWER and PICKUP events. This patch adds the two missing events to the handle_invite_replaces() function. ASTERISK-22977 #close Review: https://reviewboard.asterisk.org/r/3073/ ........ Merged revisions 413832 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@413838 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 6fe8e6b38d..00ad21aff7 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -24932,7 +24932,15 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, st /* Answer the incoming call and set channel to UP state */ transmit_response_with_sdp(p, "200 OK", req, XMIT_RELIABLE, FALSE, FALSE); - ast_setstate(c, AST_STATE_UP); + /* Is this a call pickup? */ + if (earlyreplace || oneleggedreplace) { + /* Report pickup event, in this order: PICKUP, CHAN_UP, ANSWER */ + ast_cel_report_event(replacecall, AST_CEL_PICKUP, NULL, NULL, c); + ast_setstate(c, AST_STATE_UP); + ast_cel_report_event(c, AST_CEL_ANSWER, NULL, NULL, NULL); + } else { + ast_setstate(c, AST_STATE_UP); + } /* Stop music on hold and other generators */ ast_quiet_chan(replacecall);