summaryrefslogtreecommitdiff
path: root/channels/sig_analog.c
diff options
context:
space:
mode:
authorMatthew Nicholson <mnicholson@digium.com>2009-07-06 23:24:57 +0000
committerMatthew Nicholson <mnicholson@digium.com>2009-07-06 23:24:57 +0000
commit5e2a5d16b6252a2b6e226312808c1c089a53a821 (patch)
treefc79d80b2e1479a49c99b104758944ed5eca0d88 /channels/sig_analog.c
parent257e41e85bb0b78c1f1f37652fecc66b38b7171f (diff)
Add CEL transfer events to analog (chan_dahdi) transfers.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_analog.c')
-rw-r--r--channels/sig_analog.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 223d921a5..556a2443c 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -37,6 +37,7 @@
#include "asterisk/manager.h"
#include "asterisk/astdb.h"
#include "asterisk/features.h"
+#include "asterisk/cel.h"
#include "sig_analog.h"
@@ -508,6 +509,9 @@ static int analog_attempt_transfer(struct analog_pvt *p)
if (p->subs[ANALOG_SUB_THREEWAY].owner->_state == AST_STATE_RING) {
analog_play_tone(p, ANALOG_SUB_THREEWAY, ANALOG_TONE_RINGTONE);
}
+ if (!p->subs[ANALOG_SUB_THREEWAY].inthreeway) {
+ ast_cel_report_event(p->subs[ANALOG_SUB_THREEWAY].owner, AST_CEL_ATTENDEDTRANSFER, NULL, p->subs[ANALOG_SUB_THREEWAY].owner->linkedid, NULL);
+ }
if (ast_channel_masquerade(p->subs[ANALOG_SUB_THREEWAY].owner, ast_bridged_channel(p->subs[ANALOG_SUB_REAL].owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
ast_bridged_channel(p->subs[ANALOG_SUB_REAL].owner)->name, p->subs[ANALOG_SUB_THREEWAY].owner->name);
@@ -524,6 +528,7 @@ static int analog_attempt_transfer(struct analog_pvt *p)
if (p->subs[ANALOG_SUB_REAL].owner->_state == AST_STATE_RING) {
analog_play_tone(p, ANALOG_SUB_REAL, ANALOG_TONE_RINGTONE);
}
+ ast_cel_report_event(p->subs[ANALOG_SUB_THREEWAY].owner, AST_CEL_BLINDTRANSFER, NULL, p->subs[ANALOG_SUB_THREEWAY].owner->linkedid, NULL);
if (ast_channel_masquerade(p->subs[ANALOG_SUB_REAL].owner, ast_bridged_channel(p->subs[ANALOG_SUB_THREEWAY].owner))) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
ast_bridged_channel(p->subs[ANALOG_SUB_THREEWAY].owner)->name, p->subs[ANALOG_SUB_REAL].owner->name);
@@ -2338,9 +2343,6 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
} else if ((ast->pbx) || (ast->_state == AST_STATE_UP)) {
if (p->transfer) {
- /* In any case this isn't a threeway call anymore */
- p->subs[ANALOG_SUB_REAL].inthreeway = 0;
- p->subs[ANALOG_SUB_THREEWAY].inthreeway = 0;
/* Only attempt transfer if the phone is ringing; why transfer to busy tone eh? */
if (!p->transfertobusy && ast->_state == AST_STATE_BUSY) {
ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
@@ -2355,18 +2357,26 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
if (p->subs[ANALOG_SUB_THREEWAY].owner)
ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
} else if (res) {
+ /* this isn't a threeway call anymore */
+ p->subs[ANALOG_SUB_REAL].inthreeway = 0;
+ p->subs[ANALOG_SUB_THREEWAY].inthreeway = 0;
+
/* Don't actually hang up at this point */
if (p->subs[ANALOG_SUB_THREEWAY].owner)
ast_channel_unlock(&p->subs[ANALOG_SUB_THREEWAY].owner);
break;
}
}
+ /* this isn't a threeway call anymore */
+ p->subs[ANALOG_SUB_REAL].inthreeway = 0;
+ p->subs[ANALOG_SUB_THREEWAY].inthreeway = 0;
} else {
ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
if (p->subs[ANALOG_SUB_THREEWAY].owner)
ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
}
} else {
+ ast_cel_report_event(ast, AST_CEL_BLINDTRANSFER, NULL, ast->linkedid, NULL);
ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
/* Swap subs and dis-own channel */
analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);