mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-03 22:57:16 +00:00
Fixed case
S UP - Place Call - relay down - Hangup - relay up - Confirm Call hangsup up properly and unblock is set. Fixed unexpeced reset condidtions.
This commit is contained in:
parent
5b8af78a89
commit
96068d901d
@ -325,6 +325,7 @@ handle_glare:
|
|||||||
/* throw the TX reset flag */
|
/* throw the TX reset flag */
|
||||||
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
||||||
sngss7_info->ckt_flags=0;
|
sngss7_info->ckt_flags=0;
|
||||||
|
sngss7_set_ckt_flag (sngss7_info, FLAG_REMOTE_REL);
|
||||||
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
||||||
|
|
||||||
/* go to RESTART */
|
/* go to RESTART */
|
||||||
@ -398,6 +399,7 @@ ftdm_status_t handle_con_sta(uint32_t suInstId, uint32_t spInstId, uint32_t circ
|
|||||||
/* throw the TX reset flag */
|
/* throw the TX reset flag */
|
||||||
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
||||||
sngss7_info->ckt_flags=0;
|
sngss7_info->ckt_flags=0;
|
||||||
|
sngss7_set_ckt_flag (sngss7_info, FLAG_REMOTE_REL);
|
||||||
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
||||||
|
|
||||||
/* go to RESTART */
|
/* go to RESTART */
|
||||||
@ -664,6 +666,7 @@ ftdm_status_t handle_con_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circ
|
|||||||
/* throw the TX reset flag */
|
/* throw the TX reset flag */
|
||||||
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
||||||
sngss7_info->ckt_flags=0;
|
sngss7_info->ckt_flags=0;
|
||||||
|
sngss7_set_ckt_flag (sngss7_info, FLAG_REMOTE_REL);
|
||||||
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
||||||
|
|
||||||
/* go to RESTART */
|
/* go to RESTART */
|
||||||
@ -788,11 +791,15 @@ ftdm_status_t handle_rel_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circ
|
|||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
default:
|
default:
|
||||||
|
|
||||||
/* throw the reset flag */
|
/* throw the TX reset flag */
|
||||||
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_RX);
|
if (!sngss7_tx_reset_status_pending(sngss7_info)) {
|
||||||
|
sngss7_info->ckt_flags=0;
|
||||||
|
sngss7_set_ckt_flag (sngss7_info, FLAG_REMOTE_REL);
|
||||||
|
sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
|
||||||
|
|
||||||
/* set the state to RESTART */
|
/* go to RESTART */
|
||||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RESTART);
|
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RESTART);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
} /* switch (ftdmchan->state) */
|
} /* switch (ftdmchan->state) */
|
||||||
@ -1836,6 +1843,7 @@ ftdm_status_t handle_rsc_req(uint32_t suInstId, uint32_t spInstId, uint32_t circ
|
|||||||
default:
|
default:
|
||||||
|
|
||||||
/* set the state of the channel to restart...the rest is done by the chan monitor */
|
/* set the state of the channel to restart...the rest is done by the chan monitor */
|
||||||
|
sngss7_set_ckt_flag(sngss7_info, FLAG_REMOTE_REL);
|
||||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RESTART);
|
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RESTART);
|
||||||
break;
|
break;
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -588,7 +588,11 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan)
|
|||||||
int state_flag = 1;
|
int state_flag = 1;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
SS7_DEBUG_CHAN(ftdmchan, "ftmod_sangoma_ss7 processing state %s\n", ftdm_channel_state2str (ftdmchan->state));
|
SS7_DEBUG_CHAN(ftdmchan, "ftmod_sangoma_ss7 processing state %s: ckt=0x%X, blk=0x%X\n",
|
||||||
|
ftdm_channel_state2str (ftdmchan->state),
|
||||||
|
sngss7_info->ckt_flags,
|
||||||
|
sngss7_info->blk_flags);
|
||||||
|
|
||||||
|
|
||||||
/*check what state we are supposed to be in */
|
/*check what state we are supposed to be in */
|
||||||
switch (ftdmchan->state) {
|
switch (ftdmchan->state) {
|
||||||
@ -863,6 +867,9 @@ ftdm_status_t ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_ckt_flag (sngss7_info, FLAG_REMOTE_REL)) {
|
if (sngss7_test_ckt_flag (sngss7_info, FLAG_REMOTE_REL)) {
|
||||||
|
|
||||||
|
sngss7_clear_ckt_flag (sngss7_info, FLAG_LOCAL_REL);
|
||||||
|
|
||||||
/* check if this hangup is from a tx RSC */
|
/* check if this hangup is from a tx RSC */
|
||||||
if (sngss7_test_ckt_flag (sngss7_info, FLAG_RESET_TX)) {
|
if (sngss7_test_ckt_flag (sngss7_info, FLAG_RESET_TX)) {
|
||||||
if (!sngss7_test_ckt_flag(sngss7_info, FLAG_RESET_SENT)) {
|
if (!sngss7_test_ckt_flag(sngss7_info, FLAG_RESET_SENT)) {
|
||||||
|
@ -2135,12 +2135,12 @@ ftdm_status_t check_for_reconfig_flag(ftdm_span_t *ftdmspan)
|
|||||||
|
|
||||||
/* check if the interface is paused or resumed */
|
/* check if the interface is paused or resumed */
|
||||||
if (sngss7_test_flag(sngss7_intf, SNGSS7_PAUSED)) {
|
if (sngss7_test_flag(sngss7_intf, SNGSS7_PAUSED)) {
|
||||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "ISUP intf %d is PAUSED\n", sngss7_intf->id);
|
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Circuit set to PAUSED %s\n"," ");
|
||||||
/* throw the pause flag */
|
/* throw the pause flag */
|
||||||
sngss7_clear_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
|
sngss7_clear_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
|
||||||
sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
|
sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
|
||||||
} else {
|
} else {
|
||||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "ISUP intf %d is RESUMED\n", sngss7_intf->id);
|
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Circuit set to RESUMED %s\n"," ");
|
||||||
/* throw the resume flag */
|
/* throw the resume flag */
|
||||||
sngss7_clear_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
|
sngss7_clear_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
|
||||||
sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
|
sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
|
||||||
@ -2152,7 +2152,7 @@ ftdm_status_t check_for_reconfig_flag(ftdm_span_t *ftdmspan)
|
|||||||
Reset the circuit CONFIGURED flag so that RESUME will reconfigure
|
Reset the circuit CONFIGURED flag so that RESUME will reconfigure
|
||||||
this circuit. */
|
this circuit. */
|
||||||
sngss7_info->circuit->flags &= ~SNGSS7_CONFIGURED;
|
sngss7_info->circuit->flags &= ~SNGSS7_CONFIGURED;
|
||||||
SS7_ERROR("Failed to read isup ckt = %d status\n", sngss7_info->circuit->id);
|
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR,"Failed to read isup ckt = %d status\n", sngss7_info->circuit->id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2161,6 +2161,8 @@ ftdm_status_t check_for_reconfig_flag(ftdm_span_t *ftdmspan)
|
|||||||
bits_cd = (state & (SNG_BIT_C + SNG_BIT_D)) >> 2;
|
bits_cd = (state & (SNG_BIT_C + SNG_BIT_D)) >> 2;
|
||||||
bits_ef = (state & (SNG_BIT_E + SNG_BIT_F)) >> 4;
|
bits_ef = (state & (SNG_BIT_E + SNG_BIT_F)) >> 4;
|
||||||
|
|
||||||
|
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Circuit state=0x%X ab=0x%X cd=0x%X ef=0x%X\n",state,bits_ab,bits_cd,bits_ef);
|
||||||
|
|
||||||
if (bits_cd == 0x0) {
|
if (bits_cd == 0x0) {
|
||||||
/* check if circuit is UCIC or transient */
|
/* check if circuit is UCIC or transient */
|
||||||
if (bits_ab == 0x3) {
|
if (bits_ab == 0x3) {
|
||||||
@ -2196,7 +2198,20 @@ ftdm_status_t check_for_reconfig_flag(ftdm_span_t *ftdmspan)
|
|||||||
ftdm_mutex_unlock(ftdmchan->mutex);
|
ftdm_mutex_unlock(ftdmchan->mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} /* if (bits_ab == 0x3) */
|
} else { /* if (bits_ab == 0x3) */
|
||||||
|
/* The stack status is not blocked. However this is possible if
|
||||||
|
the circuit state was UP. So even though Master sent out the BLO
|
||||||
|
the status command is not showing it.
|
||||||
|
|
||||||
|
As a kudge. We will try to send out an UBL even though the status
|
||||||
|
indicates that there is no BLO. */
|
||||||
|
if (!sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_TX)) {
|
||||||
|
sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_UNBLK_TX);
|
||||||
|
|
||||||
|
/* set the channel to suspended state */
|
||||||
|
SS7_STATE_CHANGE(ftdmchan, FTDM_CHANNEL_STATE_SUSPENDED);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* check the maintenance block status in bits A and B */
|
/* check the maintenance block status in bits A and B */
|
||||||
switch (bits_ab) {
|
switch (bits_ab) {
|
||||||
@ -2206,11 +2221,17 @@ ftdm_status_t check_for_reconfig_flag(ftdm_span_t *ftdmspan)
|
|||||||
break;
|
break;
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
case (1):
|
case (1):
|
||||||
/* locally blocked: Therefore we need to state machine to send an unblock */
|
/* The stack status is Blocked. Check if the block was sent
|
||||||
sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_UNBLK_TX);
|
by user via console. If the block was not sent by user then, it
|
||||||
|
was sent out by Master due to relay down.
|
||||||
|
Therefore send out the unblock to clear it */
|
||||||
|
if (!sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_TX)) {
|
||||||
|
sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_UNBLK_TX);
|
||||||
|
|
||||||
|
/* set the channel to suspended state */
|
||||||
|
SS7_STATE_CHANGE(ftdmchan, FTDM_CHANNEL_STATE_SUSPENDED);
|
||||||
|
}
|
||||||
|
|
||||||
/* set the channel to suspended state */
|
|
||||||
SS7_STATE_CHANGE(ftdmchan, FTDM_CHANNEL_STATE_SUSPENDED);
|
|
||||||
break;
|
break;
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
case (2):
|
case (2):
|
||||||
@ -2276,7 +2297,7 @@ ftdm_status_t check_for_reconfig_flag(ftdm_span_t *ftdmspan)
|
|||||||
/* clear the re-config flag ... no matter what */
|
/* clear the re-config flag ... no matter what */
|
||||||
sngss7_clear_ckt_flag(sngss7_info, FLAG_CKT_RECONFIG);
|
sngss7_clear_ckt_flag(sngss7_info, FLAG_CKT_RECONFIG);
|
||||||
|
|
||||||
} /* if ((sngss7_test_ckt_flag(sngss7_info, FLAG_CKT_RECONFIG)) */
|
}
|
||||||
} /* for (x = 1; x < (span->chan_count + 1); x++) */
|
} /* for (x = 1; x < (span->chan_count + 1); x++) */
|
||||||
|
|
||||||
return FTDM_SUCCESS;
|
return FTDM_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user