/* this is a remote hangup request */
sngss7_set_flag(sngss7_info, FLAG_REMOTE_REL);
-
+ftdm_channel_command(ftdmchan, FTDM_COMMAND_DISABLE_LOOP, NULL);
/* move the state of the channel to CANCEL to end the call */
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_TERMINATING);
if (siRelEvnt->causeDgn.causeVal.pres) {
ftdmchan->caller_data.hangup_cause = siRelEvnt->causeDgn.causeVal.val;
} else {
- SS7_ERROR("REL does not have a cause code!\n");
+ SS7_ERROR("REL does not have a cause ftdm_channel_command(ftdmchan, FTDM_COMMAND_DISABLE_LOOP, NULL);code!\n");
ftdmchan->caller_data.hangup_cause = 0;
}
break;
/**************************************************************************/
+ case FTDM_CHANNEL_STATE_IN_LOOP:
+
+ /* inform the core to unloop the channel*/
+ ftdm_channel_command(ftdmchan, FTDM_COMMAND_DISABLE_LOOP, NULL);
+
+ /* since we need to acknowledge the hang up set the flag for remote release */
+ sngss7_set_flag(sngss7_info, FLAG_REMOTE_REL);
+
+ /* go to hangup complete to send the RLC */
+ ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_HANGUP_COMPLETE);
+
+ /* save the call info for the RLC */
+ sngss7_info->suInstId = get_unique_id();
+ sngss7_info->spInstId = spInstId;
+
+ break;
+ /**************************************************************************/
default:
/* throw the reset flag */
/* switch to the IN_LOOP state */
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_IN_LOOP);
- /* store the sngss7 ids */
- if (suInstId == 0) {
- sngss7_info->suInstId = get_unique_id();
- } else {
- sngss7_info->suInstId = suInstId;
- }
- sngss7_info->spInstId = spInstId;
- sngss7_info->globalFlg = globalFlg;
-
/* unlock the channel again before we exit */
ftdm_mutex_unlock(ftdmchan->mutex);
sngss7_set_flag(sngss7_info, FLAG_RESET_TX_RSP);
/* go to DOWN */
- ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DOWN);
+ /*ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DOWN);*/
break;
/**********************************************************************/
ZSM_UNACCEPTABLE,
{FTDM_CHANNEL_STATE_IN_LOOP, FTDM_END},
{FTDM_CHANNEL_STATE_SUSPENDED, FTDM_CHANNEL_STATE_RESTART,
- FTDM_CHANNEL_STATE_COLLECT, FTDM_CHANNEL_STATE_DOWN, FTDM_END}
+ FTDM_CHANNEL_STATE_COLLECT, FTDM_CHANNEL_STATE_DOWN,
+ FTDM_CHANNEL_STATE_HANGUP_COMPLETE, FTDM_END}
},
{
ZSD_INBOUND,
ftdm_set_state_locked (ftdmchan, ftdmchan->last_state);
break;
/******************************************************************/
+ case (FTDM_CHANNEL_STATE_IN_LOOP):
+ /* we screwed up in a COT/CCR, remove the loop */
+ ftdm_channel_command(ftdmchan, FTDM_COMMAND_DISABLE_LOOP, NULL);
+
+ /* go to down */
+ ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DOWN);
+ break;
+ /******************************************************************/
default:
/* KONRAD: find out what the cause code should be */
ftdmchan->caller_data.hangup_cause = 41;