Skip to content

Commit a24979a

Browse files
InterLinked1Friendly Automation
authored andcommitted
chan_dahdi: Fix broken operator mode clearing.
Currently, the operator services mode in DAHDI is broken and unusable. The actual operator recall functionality works properly; however, when the operator hangs up (which is the only way that such a call is allowed to end), both lines are permanently taken out of service until "dahdi restart" is run. This prevents this feature from being used. Operator mode is one of the few factors that can cause the general analog event handling in sig_analog not to be used. Several years back, much of the analog handling was moved from chan_dahdi to sig_analog. However, this was not done fully or consistently at the time, and when operator mode is active, sig_analog does not get used. Generally this is correct, but in the case of hangup it should be using sig_analog regardless of the operator mode; otherwise, the lines do not properly clear and they become unusable. This bug is fixed so the operator can now hang up and properly release the call. It is treated just like any other hangup. The operator mode functionality continues to work as it did before. ASTERISK-29993 #close Change-Id: Ib2e3ddb40d9c71e8801e0b4bb0a12e2b52f51d24
1 parent 4aa5416 commit a24979a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

channels/chan_dahdi.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6027,7 +6027,9 @@ static int dahdi_hangup(struct ast_channel *ast)
60276027

60286028
ast_mutex_lock(&p->lock);
60296029
p->exten[0] = '\0';
6030-
if (dahdi_analog_lib_handles(p->sig, p->radio, p->oprmode)) {
6030+
/* Always use sig_analog hangup handling for operator mode */
6031+
if (dahdi_analog_lib_handles(p->sig, p->radio, 0)) {
6032+
p->oprmode = 0;
60316033
dahdi_confmute(p, 0);
60326034
restore_gains(p);
60336035
p->ignoredtmf = 0;
@@ -7643,14 +7645,19 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
76437645
}
76447646
if (p->oprmode < 0)
76457647
{
7646-
if (p->oprmode != -1) break;
7648+
if (p->oprmode != -1) { /* Operator flash recall */
7649+
ast_verb(4, "Operator mode enabled on channel %d, holding line for channel %d\n", p->channel, p->oprpeer->channel);
7650+
break;
7651+
}
7652+
/* Otherwise, immediate recall */
76477653
if ((p->sig == SIG_FXOLS) || (p->sig == SIG_FXOKS) || (p->sig == SIG_FXOGS))
76487654
{
76497655
/* Make sure it starts ringing */
76507656
dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_RINGOFF);
76517657
dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_RING);
76527658
save_conference(p->oprpeer);
76537659
tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].dfd, DAHDI_TONE_RINGTONE);
7660+
ast_verb(4, "Operator recall, channel %d ringing back channel %d\n", p->oprpeer->channel, p->channel);
76547661
}
76557662
break;
76567663
}
@@ -7763,6 +7770,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
77637770
dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_RINGOFF);
77647771
tone_zone_play_tone(p->oprpeer->subs[SUB_REAL].dfd, -1);
77657772
restore_conference(p->oprpeer);
7773+
ast_debug(1, "Operator recall by channel %d for channel %d complete\n", p->oprpeer->channel, p->channel);
77667774
}
77677775
break;
77687776
}
@@ -7976,6 +7984,7 @@ static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
79767984
dahdi_set_hook(p->oprpeer->subs[SUB_REAL].dfd, DAHDI_RING);
79777985
save_conference(p);
79787986
tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_RINGTONE);
7987+
ast_verb(4, "Operator flash recall, channel %d ringing back channel %d\n", p->oprpeer->channel, p->channel);
79797988
}
79807989
}
79817990
break;

0 commit comments

Comments
 (0)