From 46963bc8b5c4a0e25fe6c8426ebba40a4e8a698f Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Thu, 12 Feb 2009 20:34:36 +0000 Subject: [PATCH] Fix ParkedCall event information for From field in the case of a blind transfer If the parker information can not be obtained from the peer, try and see if the BLINDTRANSFER channel variable has been set. Previously, a blind transfer to the ParkAndAnnounce app would return nothing for the From. Closes AST-189 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175294 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- res/res_features.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/res/res_features.c b/res/res_features.c index 317b99b5f7..7fadaa61a1 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -421,7 +421,8 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in { struct ast_context *con; int parkingnum_copy; - + const char *event_from; + /* Get a valid space if not already done */ if (pu == NULL) pu = park_space_reserve(chan); @@ -487,6 +488,12 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in if (option_verbose > 1) ast_verbose(VERBOSE_PREFIX_2 "Parked %s on %d@%s. Will timeout back to extension [%s] %s, %d in %d seconds\n", pu->chan->name, pu->parkingnum, parking_con, pu->context, pu->exten, pu->priority, (pu->parkingtime/1000)); + if (peer) { + event_from = peer->name; + } else { + event_from = pbx_builtin_getvar_helper(chan, "BLINDTRANSFER"); + } + manager_event(EVENT_FLAG_CALL, "ParkedCall", "Exten: %s\r\n" "Channel: %s\r\n" @@ -494,7 +501,7 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, in "Timeout: %ld\r\n" "CallerID: %s\r\n" "CallerIDName: %s\r\n", - pu->parkingexten, pu->chan->name, peer ? peer->name : "", + pu->parkingexten, pu->chan->name, event_from ? event_from : "", (long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL), S_OR(pu->chan->cid.cid_num, ""), S_OR(pu->chan->cid.cid_name, "") -- 2.47.2