public Boolean Register(TSIP_Action.TSIP_ActionConfig actionConfig)
        {
            if (this.Stack == null || !this.Stack.IsValid)
            {
                TSK_Debug.Error("Invalid stack");
                return(false);
            }

            if (!this.Stack.IsRunning)
            {
                TSK_Debug.Error("Stack not running");
                return(false);
            }

            TSIP_Action action = new TSIP_Action(TSIP_Action.tsip_action_type_t.tsip_atype_register);

            action.AddConfig(actionConfig);
            TSIP_Dialog dialog;

            if ((dialog = this.Stack.LayerDialog.FindDialogBySessionId(this.Id)) == null)
            {
                dialog = this.Stack.LayerDialog.CreateDialog(TSIP_Dialog.tsip_dialog_type_t.REGISTER, this);
            }

            if (dialog == null)
            {
                TSK_Debug.Error("Failed to create new dialog");
                return(false);
            }

            return(dialog.ExecuteAction((Int32)action.Type, null, action));
        }
        public Boolean Register(TSIP_Action.TSIP_ActionConfig actionConfig)
        {
            if (this.Stack == null || !this.Stack.IsValid)
            {
                TSK_Debug.Error("Invalid stack");
                return false;
            }

            if (!this.Stack.IsRunning)
            {
                TSK_Debug.Error("Stack not running");
                return false;
            }

            TSIP_Action action = new TSIP_Action(TSIP_Action.tsip_action_type_t.tsip_atype_register);
            action.AddConfig(actionConfig);
            TSIP_Dialog dialog;

            if ((dialog = this.Stack.LayerDialog.FindDialogBySessionId(this.Id)) == null)
            {
                dialog = this.Stack.LayerDialog.CreateDialog(TSIP_Dialog.tsip_dialog_type_t.REGISTER, this);
            }

            if (dialog == null)
            {
                TSK_Debug.Error("Failed to create new dialog");
                return false;
            }

            return dialog.ExecuteAction((Int32)action.Type, null, action);
        }
Example #3
0
 internal Boolean HangUp(TSIP_Action action)
 {
     if (mState == tsip_dialog_state_t.Established)
     {
         return(this.ExecuteAction((int)TSIP_Action.tsip_action_type_t.tsip_atype_hangup, null, action));
     }
     else
     {
         return(this.ExecuteAction((int)TSIP_Action.tsip_action_type_t.tsip_atype_cancel, null, action));
     }
 }
Example #4
0
        public Boolean ExecuteAction(Int32 fsmActionId, TSIP_Message message, TSIP_Action action)
        {
            if (this.StateMachine != null)
            {
                return(this.StateMachine.ExecuteAction(fsmActionId, this, message, this, message, action));
            }

            TSK_Debug.Error("Invalid FSM");

            return(false);
        }
        //--------------------------------------------------------
        //				== STATE MACHINE BEGIN ==
        //--------------------------------------------------------

        /// <summary>
        /// Started -> (REGISTER) -> InProgress
        /// </summary>
        /// <param name="parameters"></param>
        /// <returns></returns>
        private Boolean Started_2_InProgress_X_oRegister(params Object[] parameters)
        {
            TSIP_Action action = (parameters[2] as TSIP_Action);

            base.mRunning      = true;
            base.CurrentAction = action;

            /* alert the user */
            base.Signal(TSIP_EventDialog.tsip_dialog_event_type_t.Connecting, "Dialog connecting");

            return(this.SendRegister(true));
        }
Example #6
0
 internal Boolean Shutdown(TSIP_Action action)
 {
     return(this.ExecuteAction((int)TSIP_Action.tsip_action_type_t.tsip_atype_shutdown, null, action));
 }