[asterisk-commits] moy: branch moy/mfcr2 r154135 - /team/moy/mfcr2/channels/chan_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Nov 3 20:45:20 CST 2008
Author: moy
Date: Mon Nov 3 20:45:20 2008
New Revision: 154135
URL: http://svn.digium.com/view/asterisk?view=rev&rev=154135
Log:
handle alarm state more properly
Modified:
team/moy/mfcr2/channels/chan_dahdi.c
Modified: team/moy/mfcr2/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/moy/mfcr2/channels/chan_dahdi.c?view=diff&rev=154135&r1=154134&r2=154135
==============================================================================
--- team/moy/mfcr2/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2/channels/chan_dahdi.c Mon Nov 3 20:45:20 2008
@@ -1385,13 +1385,22 @@
ast_log(LOG_NOTICE, "New MFC/R2 call detected on chan %d.\n", openr2_chan_get_number(r2chan));
}
+static int get_alarms(struct dahdi_pvt *p);
+static void handle_alarms(struct dahdi_pvt *p, int alms);
static void dahdi_r2_on_hardware_alarm(openr2_chan_t *r2chan, int alarm)
{
+ int res;
struct dahdi_pvt *p = openr2_chan_get_client_data(r2chan);
ast_mutex_lock(&p->lock);
p->inalarm = alarm ? 1 : 0;
+ if (p->inalarm) {
+ res = get_alarms(p);
+ handle_alarms(p, res);
+ } else {
+ ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", p->channel);
+ manager_event(EVENT_FLAG_SYSTEM, "AlarmClear", "Channel: %d\r\n", p->channel);
+ }
ast_mutex_unlock(&p->lock);
- ast_log(LOG_WARNING, "Zap alarm on chan %d.\n", openr2_chan_get_number(r2chan));
}
static void dahdi_r2_on_os_error(openr2_chan_t *r2chan, int errorcode)
@@ -5274,6 +5283,10 @@
#endif
#ifdef HAVE_SS7
if (p->sig == SIG_SS7)
+ break;
+#endif
+#ifdef HAVE_OPENR2
+ if (p->sig == SIG_MFCR2)
break;
#endif
case DAHDI_EVENT_ONHOOK:
More information about the asterisk-commits
mailing list