diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 69dd562bbe9908d452ce37f711a8b2e71542937d..931b8c6b8fda66481aa4b35267aa06b488880018 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -2625,6 +2625,12 @@ static int my_off_hook(void *pvt) return dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_OFFHOOK); } +static void my_set_needringing(void *pvt, int value) +{ + struct dahdi_pvt *p = pvt; + p->subs[SUB_REAL].needringing = value; +} + static int my_start(void *pvt) { struct dahdi_pvt *p = pvt; @@ -3129,6 +3135,7 @@ static struct analog_callback dahdi_analog_callbacks = .confmute = my_confmute, .set_pulsedial = my_set_pulsedial, .get_orig_dialstring = my_get_orig_dialstring, + .set_needringing = my_set_needringing, }; static struct dahdi_pvt *round_robin[32]; @@ -7599,6 +7606,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast) p->subs[idx].f.frametype = AST_FRAME_CONTROL; p->subs[idx].f.subclass.integer = AST_CONTROL_ANSWER; /* Make sure it stops ringing */ + p->subs[SUB_REAL].needringing = 0; dahdi_set_hook(p->subs[idx].dfd, DAHDI_OFFHOOK); ast_debug(1, "channel %d answered\n", p->channel); if (p->cidspill) { diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 34935ef33378650dd8cac7c9b148ba610f665c3d..5fe5ac3f0ee718be8d7051d07cfd9d66a528eace 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -519,6 +519,13 @@ static int analog_off_hook(struct analog_pvt *p) return -1; } +static void analog_set_needringing(struct analog_pvt *p, int value) +{ + if (p->calls->set_needringing) { + return p->calls->set_needringing(p->chan_pvt, value); + } +} + static int analog_dsp_set_digitmode(struct analog_pvt *p, enum analog_dsp_digitmode mode) { if (p->calls->dsp_set_digitmode) { @@ -2662,6 +2669,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ p->subs[index].f.frametype = AST_FRAME_CONTROL; p->subs[index].f.subclass.integer = AST_CONTROL_ANSWER; /* Make sure it stops ringing */ + analog_set_needringing(p, 0); analog_off_hook(p); ast_debug(1, "channel %d answered\n", p->channel); analog_cancel_cidspill(p); diff --git a/channels/sig_analog.h b/channels/sig_analog.h index 57fc5c1f2bd439246542c7473052b86d8dc19ef5..e6c07286bedb7ef20a2428954695adc52026e2d6 100644 --- a/channels/sig_analog.h +++ b/channels/sig_analog.h @@ -144,6 +144,7 @@ struct analog_callback { int (* const on_hook)(void *pvt); /*! \brief Set channel off hook */ int (* const off_hook)(void *pvt); + void (* const set_needringing)(void *pvt, int value); /* We're assuming that we're going to only wink on ANALOG_SUB_REAL - even though in the code there's an argument to the index * function */ int (* const wink)(void *pvt, enum analog_sub sub);