summaryrefslogtreecommitdiff
path: root/apps/app_directed_pickup.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2009-04-03 22:41:46 +0000
committerMark Michelson <mmichelson@digium.com>2009-04-03 22:41:46 +0000
commit6f53ed4c6707b30078ed4863e27facb7b454b600 (patch)
tree2e466f746a2e29094d6dcc3c6f2577f4dd85f4c0 /apps/app_directed_pickup.c
parent3525e37e633b8b7bcf59262fbab21c16afadfa35 (diff)
This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be introduced in a later commit. chan_skinny has code added to it here, but according to user pj, the support on chan_skinny is not working as of now. This will be fixed in a later commit. A special thanks goes out to bugtracker user gareth for getting the ball rolling and providing the initial support for this work. Without his initial work on this, this would not have been nearly as painless as it was. This functionality has been tested by Digium's product quality department, as well as a customer site running thousands of calls every day. In addition, many many many many bugtracker users have tested this, too. (closes issue #8824) Reported by: gareth Review: http://reviewboard.digium.com/r/201 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_directed_pickup.c')
-rw-r--r--apps/app_directed_pickup.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c
index 605d11faf..cfba99fce 100644
--- a/apps/app_directed_pickup.c
+++ b/apps/app_directed_pickup.c
@@ -40,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk/features.h"
+#include "asterisk/callerid.h"
#define PICKUPMARK "PICKUPMARK"
@@ -91,9 +92,21 @@ static const char *app2 = "PickupChan";
static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
{
int res = 0;
+ struct ast_party_connected_line connected_caller;
ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
+ connected_caller = target->connected;
+ connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+ ast_channel_update_connected_line(chan, &connected_caller);
+
+ ast_channel_lock(chan);
+ ast_connected_line_copy_from_caller(&connected_caller, &chan->cid);
+ ast_channel_unlock(chan);
+ connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+ ast_channel_queue_connected_line_update(chan, &connected_caller);
+ ast_party_connected_line_free(&connected_caller);
+
if ((res = ast_answer(chan))) {
ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);
return -1;