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:
parent
40d3daf0ad
commit
6c02c77780
|
@ -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");
|
||||
|
|
Reference in New Issue