dect
/
asterisk
Archived
13
0
Fork 0

Add some sense of link state. Don't make calls if link is down. Only reset if we're bringing the

link up for the first time.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47801 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
mattf 2006-11-17 18:26:33 +00:00
parent 40d3daf0ad
commit 6c02c77780
1 changed files with 13 additions and 1 deletions

View File

@ -426,6 +426,10 @@ struct zt_ss7 {
int linkstate[NUM_DCHANS];
int numchans;
int type;
enum {
LINKSET_STATE_DOWN = 0,
LINKSET_STATE_UP
} state;
struct ss7 *ss7;
struct zt_pvt *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
};
@ -8536,10 +8540,18 @@ static void *ss7_linkset(void *data)
switch (e->e) {
case SS7_EVENT_UP:
ast_verbose("--- SS7 Up ---\n");
ss7_reset_linkset(linkset);
if (linkset->state != LINKSET_STATE_UP)
ss7_reset_linkset(linkset);
linkset->state = LINKSET_STATE_UP;
break;
case SS7_EVENT_DOWN:
ast_verbose("--- SS7 Down ---\n");
linkset->state = LINKSET_STATE_DOWN;
for (i = 0; i < linkset->numchans; i++) {
struct zt_pvt *p = linkset->pvts[i];
if (p)
p->inalarm = 1;
}
break;
case MTP2_LINK_UP:
ast_log(LOG_DEBUG, "MTP2 link up\n");