From adb0ee2dcd669b491498c10a15709b9efc09564b Mon Sep 17 00:00:00 2001 From: Walter Doekes Date: Tue, 13 May 2014 14:32:25 +0000 Subject: [PATCH] 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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@413832 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 9d77722f09..5a4590128e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -22939,7 +22939,15 @@ static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, in /* 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);