diff options
author | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-04 21:10:58 +0000 |
---|---|---|
committer | rmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-04 21:10:58 +0000 |
commit | baf4c0a6fea6b28acb858887941fc4ec48584cc2 (patch) | |
tree | 9a24c9ea35fc7210f8aa5df2524c56a634703ed5 /channels/sig_analog.c | |
parent | 01363d99063c17d8f1a77b4d8a938576db9e9341 (diff) |
The inalarm flag is not passed up from the sig_analog and sig_pri submodules.
The CLI "dahdi show channel" command was not correctly reporting the
InAlarm status.
The inalarm flag is now consistently passed between chan_dahdi and
submodules.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@261007 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/sig_analog.c')
-rw-r--r-- | channels/sig_analog.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 5fe5ac3f0..53804a6f4 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -760,11 +760,19 @@ static void analog_set_cadence(struct analog_pvt *p, struct ast_channel *chan) } } -static void analog_set_dialing(struct analog_pvt *p, int flag) +static void analog_set_dialing(struct analog_pvt *p, int is_dialing) { - p->dialing = flag; + p->dialing = is_dialing; if (p->calls->set_dialing) { - return p->calls->set_dialing(p->chan_pvt, flag); + return p->calls->set_dialing(p->chan_pvt, is_dialing); + } +} + +static void analog_set_alarm(struct analog_pvt *p, int in_alarm) +{ + p->inalarm = in_alarm; + if (p->calls->set_alarm) { + return p->calls->set_alarm(p->chan_pvt, in_alarm); } } @@ -2202,7 +2210,7 @@ static void *__analog_ss_thread(void *data) if (res == 1) { if (ev == ANALOG_EVENT_NOALARM) { - p->inalarm = 0; + analog_set_alarm(p, 0); } if (p->cid_signalling == CID_SIG_V23_JP) { if (ev == ANALOG_EVENT_RINGBEGIN) { @@ -2291,7 +2299,7 @@ static void *__analog_ss_thread(void *data) if (res == 1 || res == 2) { if (ev == ANALOG_EVENT_NOALARM) { - p->inalarm = 0; + analog_set_alarm(p, 0); } else if (ev == ANALOG_EVENT_POLARITY && p->hanguponpolarityswitch && p->polarity == POLARITY_REV) { ast_debug(1, "Hanging up due to polarity reversal on channel %d while detecting callerid\n", p->channel); p->polarity = POLARITY_IDLE; @@ -2507,7 +2515,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ } break; case ANALOG_EVENT_ALARM: - p->inalarm = 1; + analog_set_alarm(p, 1); analog_get_and_handle_alarms(p); case ANALOG_EVENT_ONHOOK: @@ -2803,7 +2811,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_ case ANALOG_EVENT_RINGERON: break; case ANALOG_EVENT_NOALARM: - p->inalarm = 0; + analog_set_alarm(p, 0); if (!p->unknown_alarm) { ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", p->channel); manager_event(EVENT_FLAG_SYSTEM, "AlarmClear", @@ -3403,7 +3411,7 @@ void *analog_handle_init_event(struct analog_pvt *i, int event) } break; case ANALOG_EVENT_NOALARM: - i->inalarm = 0; + analog_set_alarm(i, 0); if (!i->unknown_alarm) { ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", i->channel); manager_event(EVENT_FLAG_SYSTEM, "AlarmClear", @@ -3413,7 +3421,7 @@ void *analog_handle_init_event(struct analog_pvt *i, int event) } break; case ANALOG_EVENT_ALARM: - i->inalarm = 1; + analog_set_alarm(i, 1); analog_get_and_handle_alarms(i); /* fall thru intentionally */ |