]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip+CEL: Add missing ANSWER and PICKUP events to INVITE/w/replaces pickup.
authorWalter Doekes <walter+asterisk@wjd.nu>
Tue, 13 May 2014 14:34:31 +0000 (14:34 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Tue, 13 May 2014 14:34:31 +0000 (14:34 +0000)
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

channels/chan_sip.c

index 6fe8e6b38de640a6fc0f64fae5caf564c9d4d504..00ad21aff77964cdb8562b320d01fb7f11368d88 100644 (file)
@@ -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);