[asterisk-commits] mattf: trunk r156874 - /trunk/channels/chan_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Nov 14 10:34:33 CST 2008
Author: mattf
Date: Fri Nov 14 10:34:33 2008
New Revision: 156874
URL: http://svn.digium.com/view/asterisk?view=rev&rev=156874
Log:
Remove some useless locking and make sure we hangup channels on a link when we get a GRS.
Modified:
trunk/channels/chan_dahdi.c
Modified: trunk/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=156874&r1=156873&r2=156874
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Fri Nov 14 10:34:33 2008
@@ -9422,6 +9422,20 @@
}
+static inline void ss7_hangup_cics(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc)
+{
+ int i;
+
+ for (i = 0; i < linkset->numchans; i++) {
+ if (linkset->pvts[i] && (linkset->pvts[i]->dpc == dpc && ((linkset->pvts[i]->cic >= startcic) && (linkset->pvts[i]->cic <= endcic)))) {
+ ast_mutex_lock(&linkset->pvts[i]->lock);
+ if (linkset->pvts[i]->owner)
+ linkset->pvts[i]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+ ast_mutex_unlock(&linkset->pvts[i]->lock);
+ }
+ }
+}
+
static inline void ss7_block_cics(struct dahdi_ss7 *linkset, int startcic, int endcic, unsigned int dpc, unsigned char state[], int block)
{
int i;
@@ -9715,15 +9729,11 @@
}
if (pollers[i].revents & POLLIN) {
- ast_mutex_lock(&linkset->lock);
res = ss7_read(ss7, pollers[i].fd);
- ast_mutex_unlock(&linkset->lock);
}
if (pollers[i].revents & POLLOUT) {
- ast_mutex_lock(&linkset->lock);
res = ss7_write(ss7, pollers[i].fd);
- ast_mutex_unlock(&linkset->lock);
if (res < 0) {
ast_debug(1, "Error in write %s\n", strerror(errno));
}
@@ -9816,6 +9826,7 @@
p = linkset->pvts[chanpos];
isup_gra(ss7, e->grs.startcic, e->grs.endcic, e->grs.opc);
ss7_block_cics(linkset, e->grs.startcic, e->grs.endcic, e->grs.opc, NULL, 0);
+ ss7_hangup_cics(linkset, e->grs.startcic, e->grs.endcic, e->grs.opc);
break;
case ISUP_EVENT_CQM:
ast_debug(1, "Got Circuit group query message from CICs %d to %d\n", e->cqm.startcic, e->cqm.endcic);
More information about the asterisk-commits
mailing list