git-svn-id: http://svn.openzap.org/svn/openzap/trunk@433 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2008-04-01 18:53:25 +00:00
parent 426d2a767f
commit 56aa60cb20
3 changed files with 31 additions and 9 deletions

View File

@ -304,13 +304,14 @@ typedef enum {
ZAP_CHANNEL_STATE_UP,
ZAP_CHANNEL_STATE_IDLE,
ZAP_CHANNEL_STATE_TERMINATING,
ZAP_CHANNEL_STATE_CANCEL,
ZAP_CHANNEL_STATE_HANGUP,
ZAP_CHANNEL_STATE_HANGUP_COMPLETE,
ZAP_CHANNEL_STATE_INVALID
} zap_channel_state_t;
#define CHANNEL_STATE_STRINGS "DOWN", "HOLD", "SUSPENDED", "DIALTONE", "COLLECT", \
"RING", "BUSY", "ATTN", "GENRING", "DIALING", "GET_CALLERID", "CALLWAITING", \
"RESTART", "PROGRESS", "PROGRESS_MEDIA", "UP", "IDLE", "TERMINATING", "HANGUP", "HANGUP_COMPLETE", "INVALID"
"RESTART", "PROGRESS", "PROGRESS_MEDIA", "UP", "IDLE", "TERMINATING", "CANCEL", "HANGUP", "HANGUP_COMPLETE", "INVALID"
ZAP_STR2ENUM_P(zap_str2zap_channel_state, zap_channel_state2str, zap_channel_state_t)
typedef enum {

View File

@ -174,7 +174,7 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen)
zchan->caller_data.hangup_cause = cause->Value;
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING);
} else {
zap_log(ZAP_LOG_CRIT, "Received Diconnect with no matching channel %d\n", chan_id);
zap_log(ZAP_LOG_CRIT, "Received Disconnect with no matching channel %d\n", chan_id);
}
}
break;

View File

@ -264,7 +264,7 @@ static void handle_call_start_nack(zap_span_t *span, ss7bc_connection_t *mcon, s
if ((zchan = find_zchan(span, event, 1))) {
assert(!zap_test_flag(zchan, ZAP_CHANNEL_OUTBOUND));
zchan->caller_data.hangup_cause = event->release_cause;
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING);
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_CANCEL);
}
}
@ -279,14 +279,15 @@ static void handle_call_stop(zap_span_t *span, ss7bc_connection_t *mcon, ss7bc_e
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING);
} else {
zap_log(ZAP_LOG_CRIT, "STOP CANT FIND A CHAN %d:%d\n", event->span+1,event->chan+1);
}
ss7bc_exec_command(mcon,
event->span,
event->chan,
0,
SIGBOOST_EVENT_CALL_STOPPED_ACK,
0);
}
}
@ -573,12 +574,32 @@ static __inline__ void state_advance(zap_channel_t *zchan)
}
}
break;
case ZAP_CHANNEL_STATE_CANCEL:
{
sig.event_id = ZAP_SIGEVENT_STOP;
status = ss7_boost_data->signal_cb(&sig);
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
ss7bc_exec_command(mcon,
zchan->physical_span_id-1,
zchan->physical_chan_id-1,
0,
SIGBOOST_EVENT_CALL_START_NACK_ACK,
0);
}
break;
case ZAP_CHANNEL_STATE_TERMINATING:
{
sig.event_id = ZAP_SIGEVENT_STOP;
status = ss7_boost_data->signal_cb(&sig);
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
ss7bc_exec_command(mcon,
zchan->physical_span_id-1,
zchan->physical_chan_id-1,
0,
SIGBOOST_EVENT_CALL_STOPPED_ACK,
0);
}
break;
default:
break;
}