deal with untimely pri messages that mess up the state machine
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@464 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
b794a13ded
commit
b518f8573d
|
@ -184,10 +184,11 @@ typedef enum {
|
||||||
ZAP_SIGEVENT_MISC,
|
ZAP_SIGEVENT_MISC,
|
||||||
ZAP_SIGEVENT_COLLECTED_DIGIT,
|
ZAP_SIGEVENT_COLLECTED_DIGIT,
|
||||||
ZAP_SIGEVENT_ADD_CALL,
|
ZAP_SIGEVENT_ADD_CALL,
|
||||||
|
ZAP_SIGEVENT_RESTART,
|
||||||
ZAP_SIGEVENT_INVALID
|
ZAP_SIGEVENT_INVALID
|
||||||
} zap_signal_event_t;
|
} zap_signal_event_t;
|
||||||
#define SIGNAL_STRINGS "START", "STOP", "TRANSFER", "ANSWER", "UP", "FLASH", "PROGRESS", \
|
#define SIGNAL_STRINGS "START", "STOP", "TRANSFER", "ANSWER", "UP", "FLASH", "PROGRESS", \
|
||||||
"PROGRESS_MEDIA", "NOTIFY", "TONE_DETECTED", "ALARM_TRAP", "ALARM_CLEAR", "MISC", "COLLECTED_DIGIT", "ADD_CALL", "INVALID"
|
"PROGRESS_MEDIA", "NOTIFY", "TONE_DETECTED", "ALARM_TRAP", "ALARM_CLEAR", "MISC", "COLLECTED_DIGIT", "ADD_CALL", "RESTART", "INVALID"
|
||||||
ZAP_STR2ENUM_P(zap_str2zap_signal_event, zap_signal_event2str, zap_signal_event_t)
|
ZAP_STR2ENUM_P(zap_str2zap_signal_event, zap_signal_event2str, zap_signal_event_t)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -150,10 +150,15 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen)
|
||||||
case Q931mes_RELEASE:
|
case Q931mes_RELEASE:
|
||||||
case Q931mes_RELEASE_COMPLETE:
|
case Q931mes_RELEASE_COMPLETE:
|
||||||
{
|
{
|
||||||
|
const char *what = gen->MesType == Q931mes_RELEASE ? "Release" : "Release Complete";
|
||||||
if (zchan) {
|
if (zchan) {
|
||||||
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
|
if (zchan->state == ZAP_CHANNEL_STATE_TERMINATING || zchan->state == ZAP_CHANNEL_STATE_HANGUP) {
|
||||||
|
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
|
||||||
|
} else {
|
||||||
|
zap_log(ZAP_LOG_DEBUG, "Ignoring %s on channel %d\n", what, chan_id);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
zap_log(ZAP_LOG_CRIT, "Received Release Complete with no matching channel %d\n", chan_id);
|
zap_log(ZAP_LOG_CRIT, "Received %s with no matching channel %d\n", what, chan_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -374,6 +379,8 @@ static __inline__ void state_advance(zap_channel_t *zchan)
|
||||||
if (zchan->last_state != ZAP_CHANNEL_STATE_HANGUP && zchan->last_state != ZAP_CHANNEL_STATE_DOWN) {
|
if (zchan->last_state != ZAP_CHANNEL_STATE_HANGUP && zchan->last_state != ZAP_CHANNEL_STATE_DOWN) {
|
||||||
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP);
|
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP);
|
||||||
} else {
|
} else {
|
||||||
|
sig.event_id = ZAP_SIGEVENT_RESTART;
|
||||||
|
status = isdn_data->sig_cb(&sig);
|
||||||
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
|
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue