diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-15 21:04:34 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-15 21:04:34 +0000 |
commit | 602a8e74b2442cb371e7fdc235572745953338ac (patch) | |
tree | f39f3de7c5f67ba6dea50afeea26c65d73e1d654 /main/features.c | |
parent | 36ba567f703701abe0381d8032b6112a499d992e (diff) |
Add pickup event to AMI. Also, fix AMI documentation.
(closes issue #16431)
Reported by: syspert
Patches:
20100112__issue16431.diff.txt uploaded by tilghman (license 14)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240421 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/features.c')
-rw-r--r-- | main/features.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/features.c b/main/features.c index 68f2f858a..3e8255de6 100644 --- a/main/features.c +++ b/main/features.c @@ -4734,7 +4734,7 @@ static int find_channel_by_group(void *obj, void *arg, void *data, int flags) */ int ast_pickup_call(struct ast_channel *chan) { - struct ast_channel *cur; + struct ast_channel *cur, *chans[2] = { chan, }; struct ast_party_connected_line connected_caller; int res; const char *chan_name; @@ -4748,6 +4748,8 @@ int ast_pickup_call(struct ast_channel *chan) return -1; } + chans[1] = cur; + ast_channel_lock_both(cur, chan); cur_name = ast_strdupa(cur->name); @@ -4784,6 +4786,10 @@ int ast_pickup_call(struct ast_channel *chan) ast_stream_and_wait(cur, pickupsound, ""); } + /* If you want UniqueIDs, set channelvars in manager.conf to CHANNEL(uniqueid) */ + ast_manager_event_multichan(EVENT_FLAG_CALL, "Pickup", 2, chans, + "Channel: %s\r\nTargetChannel: %s\r\n", chan->name, cur->name); + cur = ast_channel_unref(cur); return res; |