summaryrefslogtreecommitdiff
path: root/channels/sig_analog.c
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2009-09-10 20:18:30 +0000
committerJeff Peeler <jpeeler@digium.com>2009-09-10 20:18:30 +0000
commit5561ba19aa8ebb0be8a74f291ebaf0805f8cbf29 (patch)
tree2b76e5de87fa0b1b44b0530ab9a3485a1af9b9a4 /channels/sig_analog.c
parent1fc7fb024126ee65ccd6de46e7d9280451cd64ea (diff)
Stop caller id transmission when offhook event detected.
This fixes the problem that would occur if an analog phone was picked up while the caller id was being sent. The caller id before sent the whole spill even after pickup and is now corrected. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_analog.c')
-rw-r--r--channels/sig_analog.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 398b5f170..e822fc339 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -771,6 +771,15 @@ static int analog_check_confirmanswer(struct analog_pvt *p)
return 0;
}
+static void analog_cancel_cidspill(struct analog_pvt *p)
+{
+ if (!p->calls->cancel_cidspill) {
+ return;
+ }
+
+ p->calls->cancel_cidspill(p->chan_pvt);
+}
+
static int analog_set_linear_mode(struct analog_pvt *p, int index, int linear_mode)
{
if (p->calls->set_linear_mode) {
@@ -2541,6 +2550,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
/* Make sure it stops ringing */
analog_off_hook(p);
ast_debug(1, "channel %d answered\n", p->channel);
+ analog_cancel_cidspill(p);
analog_set_dialing(p, 0);
p->callwaitcas = 0;
if (analog_check_confirmanswer(p)) {
@@ -2662,6 +2672,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
}
if (ast->rings > p->cidrings) {
+ analog_cancel_cidspill(p);
p->callwaitcas = 0;
}
p->subs[index].f.frametype = AST_FRAME_CONTROL;
@@ -3187,6 +3198,7 @@ int analog_handle_init_event(struct analog_pvt *i, int event)
if (res && (errno == EBUSY)) {
break;
}
+ analog_cancel_cidspill(i);
if (i->immediate) {
analog_set_echocanceller(i, 1);
/* The channel is immediately up. Start right away */