- Remove all references to SMC complier (replaced by our own FSM implementation).
- Change the win32 network transport to correctly handle "WSAECONNRESET" error (DGRAMS only).
This commit is contained in:
parent
9c98f2a38d
commit
efefb2782f
Binary file not shown.
|
@ -516,9 +516,15 @@ void *tnet_transport_mainthread(void *param)
|
|||
/* Receive the waiting data. */
|
||||
if(WSARecv(active_socket->fd, &wsaBuffer, 1, &readCount, &flags, 0, 0) == SOCKET_ERROR)
|
||||
{
|
||||
if(WSAGetLastError() == WSAEWOULDBLOCK)
|
||||
ret = WSAGetLastError();
|
||||
if(ret == WSAEWOULDBLOCK)
|
||||
{
|
||||
TSK_DEBUG_INFO("WSAEWOULDBLOCK error for READ operation");
|
||||
TSK_DEBUG_WARN("WSAEWOULDBLOCK error for READ operation");
|
||||
}
|
||||
else if(ret == WSAECONNRESET && TNET_SOCKET_TYPE_IS_DGRAM(transport->master->type))
|
||||
{ /* For DGRAM ==> The sent packet gernerated "ICMP Destination/Port unreachable" result. */
|
||||
TSK_FREE(wsaBuffer.buf);
|
||||
continue; // ignore and retry.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -50,21 +50,12 @@ TSIP_BEGIN_DECLS
|
|||
#define TSIP_DIALOG_GET_STATE(self) TSIP_DIALOG(self)->state
|
||||
#define TSIP_DIALOG_GET_STACK(self) TSIP_STACK(TSIP_DIALOG(self)->stack)
|
||||
|
||||
#define TSIP_DIALOG_SYNC_BEGIN(self) tsk_safeobj_lock(TSIP_DIALOG(self))
|
||||
#define TSIP_DIALOG_SYNC_END(self) tsk_safeobj_unlock(TSIP_DIALOG(self))
|
||||
|
||||
#define DIALOG_TIMER_CANCEL(TX) \
|
||||
tsk_timer_manager_cancel(TSIP_DIALOG_GET_STACK(self)->timer_mgr, self->timer##TX.id)
|
||||
|
||||
#define TSIP_DIALOG_TIMER_SCHEDULE(name, TX) \
|
||||
self->timer##TX.id = tsk_timer_manager_schedule(TSIP_DIALOG_GET_STACK(self)->timer_mgr, TSK_TIME_S_2_MS(self->timer##TX.timeout), TSK_TIMER_CALLBACK(tsip_dialog_##name##_timer_callback), self)
|
||||
|
||||
//#define TSIP_DIALOG_ALERT_USER(self, code, reason_phrase, incoming, type) \
|
||||
// tsip_stack_alert(TSIP_DIALOG(self)->stack, /*tsip_operation_get_id(TSIP_DIALOG(self)->operation)*/0, code, reason_phrase, incoming, type)
|
||||
|
||||
//#define DIALOG_REMOVE_SCHEDULE() \
|
||||
// tsk_timer_manager_schedule(TSIP_DIALOG_GET_STACK(self)->timer_mgr, 0, TSK_TIMER_CALLBACK(tsip_dialog_remove_callback), self)
|
||||
|
||||
#define TSIP_DIALOG_EXPIRES_DEFAULT 3600
|
||||
|
||||
typedef enum tsip_dialog_state_e
|
||||
|
@ -142,8 +133,6 @@ typedef struct tsip_dialog_s
|
|||
tsip_challenges_L_t *challenges;
|
||||
|
||||
tsip_dialog_event_callback callback;
|
||||
|
||||
TSK_DECLARE_SAFEOBJ; // FIXME
|
||||
}
|
||||
tsip_dialog_t;
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
|
||||
#include "tinysip_config.h"
|
||||
#include "tinysip/dialogs/tsip_dialog.h"
|
||||
#include "tinysip/smc/tsip_dialog_message_sm.h"
|
||||
|
||||
#include "tsk_fsm.h"
|
||||
|
||||
TSIP_BEGIN_DECLS
|
||||
|
||||
|
@ -44,7 +45,7 @@ typedef struct tsip_dialog_message
|
|||
{
|
||||
TSIP_DECLARE_DIALOG;
|
||||
|
||||
struct tsip_dialog_messageContext _fsm;
|
||||
tsk_fsm_t *fsm;
|
||||
|
||||
tsip_message_t *msg;
|
||||
|
||||
|
@ -55,18 +56,6 @@ tsip_dialog_message_t;
|
|||
//int tsip_dialog_message_send(tsip_dialog_message_t *self);
|
||||
//int tsip_dialog_message_recv(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
|
||||
void tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Sending_2_Sending_X_1xx(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Sending_2_Terminated_X_2xx(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Sending_2_Sending_X_401_407_421_494(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Sending_2_Terminated_X_300_to_699(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Sending_2_Terminated_X_cancel(tsip_dialog_message_t *self);
|
||||
void tsip_dialog_message_Receiving_2_Terminated_X_accept(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Receiving_2_Terminated_X_reject(tsip_dialog_message_t *self, const tsip_message_t *message);
|
||||
void tsip_dialog_message_Any_2_Terminated_X_transportError(tsip_dialog_message_t *self);
|
||||
void tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self);
|
||||
|
||||
|
||||
TINYSIP_GEXTERN const void *tsip_dialog_message_def_t;
|
||||
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_dialog_message.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_DIALOG_MESSAGE_SM
|
||||
#define _H_TSIP_DIALOG_MESSAGE_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_dialog_message;
|
||||
struct tsip_dialog_messageContext;
|
||||
|
||||
struct tsip_dialog_messageState
|
||||
{
|
||||
void(*Entry)(struct tsip_dialog_messageContext*);
|
||||
|
||||
void(*sm_1xx)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_2xx)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_300_to_699)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_401_407_421_494)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_accept)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_cancel)(struct tsip_dialog_messageContext*);
|
||||
void(*sm_error)(struct tsip_dialog_messageContext*);
|
||||
void(*sm_receiveMESSAGE)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_reject)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_sendMESSAGE)(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
void(*sm_transportError)(struct tsip_dialog_messageContext*);
|
||||
|
||||
void(*Default)(struct tsip_dialog_messageContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_dialog_messageState tsip_dialog_message_Started;
|
||||
extern const struct tsip_dialog_messageState tsip_dialog_message_Sending;
|
||||
extern const struct tsip_dialog_messageState tsip_dialog_message_Receiving;
|
||||
extern const struct tsip_dialog_messageState tsip_dialog_message_Terminated;
|
||||
|
||||
struct tsip_dialog_messageContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_dialog_message)
|
||||
struct tsip_dialog_message *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_dialog_messageContext_Init(struct tsip_dialog_messageContext*, struct tsip_dialog_message*);
|
||||
extern void tsip_dialog_messageContext_EnterStartState(struct tsip_dialog_messageContext*);
|
||||
extern void tsip_dialog_messageContext_sm_1xx(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_2xx(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_300_to_699(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_401_407_421_494(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_accept(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_cancel(struct tsip_dialog_messageContext*);
|
||||
extern void tsip_dialog_messageContext_sm_error(struct tsip_dialog_messageContext*);
|
||||
extern void tsip_dialog_messageContext_sm_receiveMESSAGE(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_reject(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_sendMESSAGE(struct tsip_dialog_messageContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_messageContext_sm_transportError(struct tsip_dialog_messageContext*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_dialog_register.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_DIALOG_REGISTER_SM
|
||||
#define _H_TSIP_DIALOG_REGISTER_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_dialog_register;
|
||||
struct tsip_dialog_registerContext;
|
||||
|
||||
struct tsip_dialog_registerState
|
||||
{
|
||||
void(*Entry)(struct tsip_dialog_registerContext*);
|
||||
|
||||
void(*sm_1xx)(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
void(*sm_2xx)(struct tsip_dialog_registerContext*, int, const tsip_message_t*);
|
||||
void(*sm_300_to_699)(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
void(*sm_401_407_421_494)(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
void(*sm_423)(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
void(*sm_cancel)(struct tsip_dialog_registerContext*);
|
||||
void(*sm_error)(struct tsip_dialog_registerContext*);
|
||||
void(*sm_hangup)(struct tsip_dialog_registerContext*);
|
||||
void(*sm_refresh)(struct tsip_dialog_registerContext*);
|
||||
void(*sm_send)(struct tsip_dialog_registerContext*);
|
||||
void(*sm_transportError)(struct tsip_dialog_registerContext*);
|
||||
void(*sm_unregister)(struct tsip_dialog_registerContext*);
|
||||
|
||||
void(*Default)(struct tsip_dialog_registerContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_dialog_registerState tsip_dialog_register_Started;
|
||||
extern const struct tsip_dialog_registerState tsip_dialog_register_Trying;
|
||||
extern const struct tsip_dialog_registerState tsip_dialog_register_Connected;
|
||||
extern const struct tsip_dialog_registerState tsip_dialog_register_Terminated;
|
||||
|
||||
struct tsip_dialog_registerContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_dialog_register)
|
||||
struct tsip_dialog_register *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_dialog_registerContext_Init(struct tsip_dialog_registerContext*, struct tsip_dialog_register*);
|
||||
extern void tsip_dialog_registerContext_EnterStartState(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_1xx(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_registerContext_sm_2xx(struct tsip_dialog_registerContext*, int, const tsip_message_t*);
|
||||
extern void tsip_dialog_registerContext_sm_300_to_699(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_registerContext_sm_401_407_421_494(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_registerContext_sm_423(struct tsip_dialog_registerContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_registerContext_sm_cancel(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_error(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_hangup(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_refresh(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_send(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_transportError(struct tsip_dialog_registerContext*);
|
||||
extern void tsip_dialog_registerContext_sm_unregister(struct tsip_dialog_registerContext*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_dialog_subscribe.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_DIALOG_SUBSCRIBE_SM
|
||||
#define _H_TSIP_DIALOG_SUBSCRIBE_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_dialog_subscribe;
|
||||
struct tsip_dialog_subscribeContext;
|
||||
|
||||
struct tsip_dialog_subscribeState
|
||||
{
|
||||
void(*Entry)(struct tsip_dialog_subscribeContext*);
|
||||
|
||||
void(*sm_1xx)(struct tsip_dialog_subscribeContext*, const tsip_message_t*);
|
||||
void(*sm_2xx)(struct tsip_dialog_subscribeContext*, int, const tsip_response_t*);
|
||||
void(*sm_300_to_699)(struct tsip_dialog_subscribeContext*, const tsip_response_t*);
|
||||
void(*sm_401_407_421_494)(struct tsip_dialog_subscribeContext*, const tsip_response_t*);
|
||||
void(*sm_423)(struct tsip_dialog_subscribeContext*, const tsip_response_t*);
|
||||
void(*sm_NOTIFY)(struct tsip_dialog_subscribeContext*, int, const tsip_request_t*);
|
||||
void(*sm_cancel)(struct tsip_dialog_subscribeContext*);
|
||||
void(*sm_error)(struct tsip_dialog_subscribeContext*);
|
||||
void(*sm_hangup)(struct tsip_dialog_subscribeContext*);
|
||||
void(*sm_refresh)(struct tsip_dialog_subscribeContext*);
|
||||
void(*sm_send)(struct tsip_dialog_subscribeContext*);
|
||||
void(*sm_transportError)(struct tsip_dialog_subscribeContext*);
|
||||
void(*sm_unsubscribe)(struct tsip_dialog_subscribeContext*);
|
||||
|
||||
void(*Default)(struct tsip_dialog_subscribeContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Started;
|
||||
extern const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Trying;
|
||||
extern const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Connected;
|
||||
extern const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Terminated;
|
||||
|
||||
struct tsip_dialog_subscribeContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_dialog_subscribe)
|
||||
struct tsip_dialog_subscribe *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_dialog_subscribeContext_Init(struct tsip_dialog_subscribeContext*, struct tsip_dialog_subscribe*);
|
||||
extern void tsip_dialog_subscribeContext_EnterStartState(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_1xx(struct tsip_dialog_subscribeContext*, const tsip_message_t*);
|
||||
extern void tsip_dialog_subscribeContext_sm_2xx(struct tsip_dialog_subscribeContext*, int, const tsip_response_t*);
|
||||
extern void tsip_dialog_subscribeContext_sm_300_to_699(struct tsip_dialog_subscribeContext*, const tsip_response_t*);
|
||||
extern void tsip_dialog_subscribeContext_sm_401_407_421_494(struct tsip_dialog_subscribeContext*, const tsip_response_t*);
|
||||
extern void tsip_dialog_subscribeContext_sm_423(struct tsip_dialog_subscribeContext*, const tsip_response_t*);
|
||||
extern void tsip_dialog_subscribeContext_sm_NOTIFY(struct tsip_dialog_subscribeContext*, int, const tsip_request_t*);
|
||||
extern void tsip_dialog_subscribeContext_sm_cancel(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_error(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_hangup(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_refresh(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_send(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_transportError(struct tsip_dialog_subscribeContext*);
|
||||
extern void tsip_dialog_subscribeContext_sm_unsubscribe(struct tsip_dialog_subscribeContext*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_ict.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_TRANSAC_ICT_SM
|
||||
#define _H_TSIP_TRANSAC_ICT_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_transac_ict;
|
||||
struct tsip_transac_ictContext;
|
||||
|
||||
struct tsip_transac_ictState
|
||||
{
|
||||
|
||||
|
||||
void(*Default)(struct tsip_transac_ictContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_transac_ictState tsip_transac_ict_Started;
|
||||
|
||||
struct tsip_transac_ictContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_transac_ict)
|
||||
struct tsip_transac_ict *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_transac_ictContext_Init(struct tsip_transac_ictContext*, struct tsip_transac_ict*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_ist.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_TRANSAC_IST_SM
|
||||
#define _H_TSIP_TRANSAC_IST_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_transac_ist;
|
||||
struct tsip_transac_istContext;
|
||||
|
||||
struct tsip_transac_istState
|
||||
{
|
||||
|
||||
|
||||
void(*Default)(struct tsip_transac_istContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_transac_istState tsip_transac_ist_Started;
|
||||
|
||||
struct tsip_transac_istContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_transac_ist)
|
||||
struct tsip_transac_ist *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_transac_istContext_Init(struct tsip_transac_istContext*, struct tsip_transac_ist*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_nict.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_TRANSAC_NICT_SM
|
||||
#define _H_TSIP_TRANSAC_NICT_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_transac_nict;
|
||||
struct tsip_transac_nictContext;
|
||||
|
||||
struct tsip_transac_nictState
|
||||
{
|
||||
void(*Entry)(struct tsip_transac_nictContext*);
|
||||
|
||||
void(*sm_1xx)(struct tsip_transac_nictContext*, const tsip_message_t*);
|
||||
void(*sm_200_to_699)(struct tsip_transac_nictContext*, const tsip_message_t*);
|
||||
void(*sm_send)(struct tsip_transac_nictContext*);
|
||||
void(*sm_timerE)(struct tsip_transac_nictContext*);
|
||||
void(*sm_timerF)(struct tsip_transac_nictContext*);
|
||||
void(*sm_timerK)(struct tsip_transac_nictContext*);
|
||||
void(*sm_transportError)(struct tsip_transac_nictContext*);
|
||||
|
||||
void(*Default)(struct tsip_transac_nictContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_transac_nictState tsip_transac_nict_Started;
|
||||
extern const struct tsip_transac_nictState tsip_transac_nict_Trying;
|
||||
extern const struct tsip_transac_nictState tsip_transac_nict_Proceeding;
|
||||
extern const struct tsip_transac_nictState tsip_transac_nict_Completed;
|
||||
extern const struct tsip_transac_nictState tsip_transac_nict_Terminated;
|
||||
|
||||
struct tsip_transac_nictContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_transac_nict)
|
||||
struct tsip_transac_nict *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_transac_nictContext_Init(struct tsip_transac_nictContext*, struct tsip_transac_nict*);
|
||||
extern void tsip_transac_nictContext_EnterStartState(struct tsip_transac_nictContext*);
|
||||
extern void tsip_transac_nictContext_sm_1xx(struct tsip_transac_nictContext*, const tsip_message_t*);
|
||||
extern void tsip_transac_nictContext_sm_200_to_699(struct tsip_transac_nictContext*, const tsip_message_t*);
|
||||
extern void tsip_transac_nictContext_sm_send(struct tsip_transac_nictContext*);
|
||||
extern void tsip_transac_nictContext_sm_timerE(struct tsip_transac_nictContext*);
|
||||
extern void tsip_transac_nictContext_sm_timerF(struct tsip_transac_nictContext*);
|
||||
extern void tsip_transac_nictContext_sm_timerK(struct tsip_transac_nictContext*);
|
||||
extern void tsip_transac_nictContext_sm_transportError(struct tsip_transac_nictContext*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_nist.sm
|
||||
*/
|
||||
|
||||
#ifndef _H_TSIP_TRANSAC_NIST_SM
|
||||
#define _H_TSIP_TRANSAC_NIST_SM
|
||||
|
||||
#include <statemap.h>
|
||||
|
||||
|
||||
struct tsip_transac_nist;
|
||||
struct tsip_transac_nistContext;
|
||||
|
||||
struct tsip_transac_nistState
|
||||
{
|
||||
void(*Entry)(struct tsip_transac_nistContext*);
|
||||
|
||||
void(*sm_request)(struct tsip_transac_nistContext*, const tsip_request_t*);
|
||||
void(*sm_send_1xx)(struct tsip_transac_nistContext*, const tsip_response_t*);
|
||||
void(*sm_send_200_to_699)(struct tsip_transac_nistContext*, const tsip_response_t*);
|
||||
void(*sm_timerJ)(struct tsip_transac_nistContext*);
|
||||
void(*sm_transportError)(struct tsip_transac_nistContext*);
|
||||
|
||||
void(*Default)(struct tsip_transac_nistContext*);
|
||||
|
||||
STATE_MEMBERS
|
||||
};
|
||||
|
||||
extern const struct tsip_transac_nistState tsip_transac_nist_Started;
|
||||
extern const struct tsip_transac_nistState tsip_transac_nist_Trying;
|
||||
extern const struct tsip_transac_nistState tsip_transac_nist_Proceeding;
|
||||
extern const struct tsip_transac_nistState tsip_transac_nist_Completed;
|
||||
extern const struct tsip_transac_nistState tsip_transac_nist_Terminated;
|
||||
|
||||
struct tsip_transac_nistContext
|
||||
{
|
||||
FSM_MEMBERS(tsip_transac_nist)
|
||||
struct tsip_transac_nist *_owner;
|
||||
};
|
||||
|
||||
extern void tsip_transac_nistContext_Init(struct tsip_transac_nistContext*, struct tsip_transac_nist*);
|
||||
extern void tsip_transac_nistContext_EnterStartState(struct tsip_transac_nistContext*);
|
||||
extern void tsip_transac_nistContext_sm_request(struct tsip_transac_nistContext*, const tsip_request_t*);
|
||||
extern void tsip_transac_nistContext_sm_send_1xx(struct tsip_transac_nistContext*, const tsip_response_t*);
|
||||
extern void tsip_transac_nistContext_sm_send_200_to_699(struct tsip_transac_nistContext*, const tsip_response_t*);
|
||||
extern void tsip_transac_nistContext_sm_timerJ(struct tsip_transac_nistContext*);
|
||||
extern void tsip_transac_nistContext_sm_transportError(struct tsip_transac_nistContext*);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -57,10 +57,6 @@ TSIP_BEGIN_DECLS
|
|||
#define TRANSAC_TIMER_CANCEL(TX) \
|
||||
tsk_timer_manager_cancel((tsk_timer_manager_handle_t*)TSIP_TRANSAC(self)->timer_mgr, self->timer##TX.id)
|
||||
|
||||
#define TRANSAC_REMOVE_SCHEDULE() \
|
||||
tsk_timer_manager_schedule((tsk_timer_manager_handle_t*)TSIP_TRANSAC(self)->timer_mgr, 0, TSK_TIMER_CALLBACK(tsip_transac_remove_callback), self)
|
||||
|
||||
|
||||
typedef enum tsip_transac_event_type_e
|
||||
{
|
||||
tsip_transac_incoming_msg,
|
||||
|
@ -122,8 +118,6 @@ typedef struct tsip_transac_s
|
|||
char* callid;
|
||||
|
||||
tsip_transac_event_callback callback;
|
||||
|
||||
TSK_DECLARE_SAFEOBJ;
|
||||
}
|
||||
tsip_transac_t;
|
||||
|
||||
|
@ -138,7 +132,7 @@ int tsip_transac_deinit(tsip_transac_t *self);
|
|||
int tsip_transac_start(tsip_transac_t *self, const tsip_request_t* request);
|
||||
int tsip_transac_send(tsip_transac_t *self, const char *branch, const tsip_message_t *msg);
|
||||
int tsip_transac_cmp(const tsip_transac_t *t1, const tsip_transac_t *t2);
|
||||
int tsip_transac_remove_callback(const tsip_transac_t* self, tsk_timer_id_t timer_id);
|
||||
int tsip_transac_remove(const tsip_transac_t* self);
|
||||
|
||||
TSIP_END_DECLS
|
||||
|
||||
|
|
|
@ -31,20 +31,21 @@
|
|||
#define TINYSIP_TRANSAC_ICT_H
|
||||
|
||||
#include "tinysip_config.h"
|
||||
#include "tinysip/smc/tsip_transac_ict_sm.h"
|
||||
#include "tinysip/transactions/tsip_transac.h"
|
||||
|
||||
#include "tsk_fsm.h"
|
||||
|
||||
TSIP_BEGIN_DECLS
|
||||
|
||||
typedef struct tsip_transac_ict
|
||||
{
|
||||
TSIP_DECLARE_TRANSAC;
|
||||
|
||||
struct tsip_transac_ictContext _fsm; /**< The state machine context. */
|
||||
tsk_fsm_t *fsm;
|
||||
}
|
||||
tsip_transac_ict_t;
|
||||
|
||||
void tsip_transac_ict_init(tsip_transac_ict_t *self);
|
||||
int tsip_transac_ict_init(tsip_transac_ict_t *self);
|
||||
|
||||
TSIP_END_DECLS
|
||||
|
||||
|
|
|
@ -31,20 +31,21 @@
|
|||
#define TINYSIP_TRANSAC_IST_H
|
||||
|
||||
#include "tinysip_config.h"
|
||||
#include "tinysip/smc/tsip_transac_ist_sm.h"
|
||||
#include "tinysip/transactions/tsip_transac.h"
|
||||
|
||||
#include "tsk_fsm.h"
|
||||
|
||||
TSIP_BEGIN_DECLS
|
||||
|
||||
typedef struct tsip_transac_ist
|
||||
{
|
||||
TSIP_DECLARE_TRANSAC;
|
||||
|
||||
struct tsip_transac_istContext _fsm; /**< The state machine context. */
|
||||
tsk_fsm_t *fsm;
|
||||
}
|
||||
tsip_transac_ist_t;
|
||||
|
||||
void tsip_transac_ist_init(tsip_transac_ist_t *self);
|
||||
int tsip_transac_ist_init(tsip_transac_ist_t *self);
|
||||
|
||||
TSIP_END_DECLS
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "tinysip/transactions/tsip_transac.h"
|
||||
#include "tinysip/tsip_message.h"
|
||||
|
||||
#include "tinysip/smc/tsip_transac_nict_sm.h"
|
||||
#include "tsk_fsm.h"
|
||||
|
||||
TSIP_BEGIN_DECLS
|
||||
|
||||
|
@ -47,7 +47,7 @@ typedef struct tsip_transac_nict
|
|||
{
|
||||
TSIP_DECLARE_TRANSAC;
|
||||
|
||||
struct tsip_transac_nictContext _fsm; /**< The state machine context. */
|
||||
tsk_fsm_t *fsm;
|
||||
|
||||
tsip_request_t* request;
|
||||
tsip_timer_t timerE;
|
||||
|
@ -56,25 +56,7 @@ typedef struct tsip_transac_nict
|
|||
}
|
||||
tsip_transac_nict_t;
|
||||
|
||||
void tsip_transac_nict_init(tsip_transac_nict_t *self);
|
||||
int tsip_transac_nict_start(tsip_transac_nict_t *self, const tsip_request_t* request);
|
||||
void tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self);
|
||||
|
||||
void tsip_transac_nict_Started_2_Trying_X_send(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Trying_2_Trying_X_timerE(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Trying_2_Terminated_X_timerF(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Trying_2_Terminated_X_transportError(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Trying_2_Proceedding_X_1xx(tsip_transac_nict_t *self, const tsip_message_t* msg);
|
||||
void tsip_transac_nict_Trying_2_Completed_X_200_to_699(tsip_transac_nict_t *self, const tsip_message_t* msg);
|
||||
void tsip_transac_nict_Trying_2_Trying_X_unknown(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Proceeding_2_Terminated_X_timerF(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Proceeding_2_Terminated_X_transportError(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(tsip_transac_nict_t *self, const tsip_message_t* msg);
|
||||
void tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(tsip_transac_nict_t *self, const tsip_message_t* msg);
|
||||
void tsip_transac_nict_Completed_2_Terminated_X_timerK(tsip_transac_nict_t *self);
|
||||
void tsip_transac_nict_Any_2_Terminated_X_transportError(tsip_transac_nict_t *self);
|
||||
|
||||
|
||||
TINYSIP_GEXTERN const void *tsip_transac_nict_def_t;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "tinysip/transactions/tsip_transac.h"
|
||||
#include "tinysip/tsip_message.h"
|
||||
|
||||
#include "tinysip/smc/tsip_transac_nist_sm.h"
|
||||
#include "tsk_fsm.h"
|
||||
|
||||
TSIP_BEGIN_DECLS
|
||||
|
||||
|
@ -47,28 +47,15 @@ typedef struct tsip_transac_nist
|
|||
{
|
||||
TSIP_DECLARE_TRANSAC;
|
||||
|
||||
struct tsip_transac_nistContext _fsm; /**< The state machine context. */
|
||||
tsk_fsm_t *fsm;
|
||||
|
||||
tsip_response_t* lastResponse;
|
||||
tsip_timer_t timerJ;
|
||||
}
|
||||
tsip_transac_nist_t;
|
||||
|
||||
void tsip_transac_nist_init(tsip_transac_nist_t *self);
|
||||
int tsip_transac_nist_start(tsip_transac_nist_t *self, const tsip_request_t* request);
|
||||
|
||||
void tsip_transac_nist_Started_2_Trying_X_request(tsip_transac_nist_t *self, const tsip_request_t* request);
|
||||
void tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(tsip_transac_nist_t *self, const tsip_response_t* response);
|
||||
void tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(tsip_transac_nist_t *self, const tsip_response_t* response);
|
||||
void tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(tsip_transac_nist_t *self, const tsip_response_t* response);
|
||||
void tsip_transac_nist_Proceeding_2_Proceeding_X_request(tsip_transac_nist_t *self, const tsip_request_t* request);
|
||||
void tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(tsip_transac_nist_t *self, const tsip_response_t* response);
|
||||
void tsip_transac_nist_Completed_2_Completed_X_request(tsip_transac_nist_t *self, const tsip_request_t* request);
|
||||
void tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(tsip_transac_nist_t *self);
|
||||
void tsip_transac_nist_Any_2_Terminated_X_transportError(tsip_transac_nist_t *self);
|
||||
|
||||
void tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self);
|
||||
|
||||
TINYSIP_GEXTERN const void *tsip_transac_nist_def_t;
|
||||
|
||||
TSIP_END_DECLS
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
@echo off
|
||||
|
||||
REM SMC (The State Machine Compiler)
|
||||
REM For more information about SMC: http://smc.sourceforge.net/
|
||||
|
||||
set TSIP_SMC_SRC=%DOUBANGO_HOME%\tinySIP\source\smc
|
||||
set TSIP_SMC_SRC_TMP=%TSIP_SMC_SRC%\tmp
|
||||
set TSIP_SMC_INC=%DOUBANGO_HOME%\tinySIP\include\tinysip\smc
|
||||
set TSIP_SMC_SM=%DOUBANGO_HOME%\tinySIP\smc
|
||||
set TSIP_SMC_GRAPH=%DOUBANGO_HOME%\tinySIP\graph
|
||||
|
||||
set DOT_DIR="C:\Program Files\Graphviz2.24\bin"
|
||||
|
||||
set TOOLS=%DOUBANGO_HOME%\thirdparties\win32\tools
|
||||
|
||||
MKDIR %TSIP_SMC_SRC_TMP%
|
||||
|
||||
FOR /f %%i IN ('dir /b %TSIP_SMC_SM%\*.sm') DO (
|
||||
java -jar %DOUBANGO_HOME%\SMC_6_0_0\Smc.jar -c -d %TSIP_SMC_SRC_TMP% -headerd %TSIP_SMC_INC% %TSIP_SMC_SM%\%%i
|
||||
%TOOLS%\BatchSubstitute.bat "C:\Projects\Doubango\tinySIP\include\tinysip\smc\" "tinysip/smc/" %TSIP_SMC_SRC_TMP%\%%~ni_sm.c > %TSIP_SMC_SRC%\%%~ni_sm.c
|
||||
|
||||
:: java -jar %DOUBANGO_HOME%\SMC_6_0_0\Smc.jar -graph -glevel 2 -d %TSIP_SMC_GRAPH% %TSIP_SMC_SM%\%%i
|
||||
:: %DOT_DIR%\dot -Tpng -o %TSIP_SMC_GRAPH%\%%~ni_sm.png %TSIP_SMC_GRAPH%\%%~ni_sm.dot
|
||||
)
|
||||
RMDIR /S /Q %TSIP_SMC_SRC_TMP%
|
|
@ -1,145 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_dialog_message.sm.
|
||||
* @brief SIP dialog MESSAGE.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
%}
|
||||
|
||||
|
||||
%class tsip_dialog_message
|
||||
%header "tinysip/dialogs/tsip_dialog_message.h"
|
||||
%header "tinysip/tsip_message.h"
|
||||
%start tsip_dialog_message::Started
|
||||
%include "tsk_debug.h"
|
||||
|
||||
%map tsip_dialog_message
|
||||
%%
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Started
|
||||
{
|
||||
sm_sendMESSAGE(msg: const tsip_message_t*)
|
||||
Sending
|
||||
{
|
||||
Started_2_Sending_X_sendMESSAGE(msg);
|
||||
}
|
||||
sm_receiveMESSAGE(msg: const tsip_message_t*)
|
||||
Receiving
|
||||
{
|
||||
Started_2_Receiving_X_recvMESSAGE(msg);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Sending
|
||||
{
|
||||
sm_1xx(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Sending_2_Sending_X_1xx(msg);
|
||||
}
|
||||
|
||||
sm_2xx(msg: const tsip_message_t*)
|
||||
Terminated
|
||||
{
|
||||
Sending_2_Terminated_X_2xx(msg);
|
||||
}
|
||||
|
||||
sm_401_407_421_494(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Sending_2_Sending_X_401_407_421_494(msg);
|
||||
}
|
||||
|
||||
sm_300_to_699(msg: const tsip_message_t*)
|
||||
Terminated
|
||||
{
|
||||
Sending_2_Terminated_X_300_to_699(msg);
|
||||
}
|
||||
|
||||
sm_cancel()
|
||||
Terminated
|
||||
{
|
||||
Sending_2_Terminated_X_cancel();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Receiving
|
||||
{
|
||||
sm_accept(msg: const tsip_message_t*)
|
||||
Terminated
|
||||
{
|
||||
Receiving_2_Terminated_X_accept(msg);
|
||||
}
|
||||
|
||||
sm_reject(msg: const tsip_message_t*)
|
||||
Terminated
|
||||
{
|
||||
Receiving_2_Terminated_X_reject(msg);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Terminated
|
||||
Entry
|
||||
{
|
||||
OnTerminated();
|
||||
}
|
||||
{
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Default
|
||||
{
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Any_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
sm_error()
|
||||
Terminated
|
||||
{
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
%%
|
|
@ -1,204 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_dialog_register.sm.
|
||||
* @brief SIP dialog REGISTER.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
//#define tsip_dialog_register_TSIP_DIALOG_BEGIN_TRANSIT(self) TSIP_DIALOG_BEGIN_TRANSIT(self)
|
||||
//#define tsip_dialog_register_TSIP_DIALOG_END_TRANSIT(self) TSIP_DIALOG_END_TRANSIT(self)
|
||||
%}
|
||||
|
||||
|
||||
%class tsip_dialog_register
|
||||
%header "tinysip/dialogs/tsip_dialog_register.h"
|
||||
%header "tinysip/tsip_message.h"
|
||||
%start tsip_dialog_register::Started
|
||||
%include "tsk_debug.h"
|
||||
|
||||
%map tsip_dialog_register
|
||||
%%
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Started
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_send()
|
||||
Trying
|
||||
{
|
||||
Started_2_Trying_X_send();
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Trying
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_1xx(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_1xx(msg);
|
||||
}
|
||||
|
||||
sm_2xx(unregistering: int, msg: const tsip_message_t*) [unregistering]
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_2xx(msg);
|
||||
}
|
||||
|
||||
sm_2xx(unregistering: int, msg: const tsip_message_t*) [!unregistering]
|
||||
Connected
|
||||
{
|
||||
Trying_2_Connected_X_2xx(msg);
|
||||
}
|
||||
|
||||
sm_401_407_421_494(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_401_407_421_494(msg);
|
||||
}
|
||||
|
||||
sm_423(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_423(msg);
|
||||
}
|
||||
|
||||
sm_300_to_699(msg: const tsip_message_t*)
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_300_to_699(msg);
|
||||
}
|
||||
|
||||
sm_cancel()
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_cancel();
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Connected
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_unregister()
|
||||
Trying
|
||||
{
|
||||
Connected_2_Trying_X_unregister();
|
||||
}
|
||||
|
||||
sm_refresh()
|
||||
Trying
|
||||
{
|
||||
Connected_2_Trying_X_refresh();
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Terminated
|
||||
Entry
|
||||
{
|
||||
OnTerminated();
|
||||
}
|
||||
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Default
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_hangup()
|
||||
Trying
|
||||
{
|
||||
Any_2_Trying_X_hangup();
|
||||
}
|
||||
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Any_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
sm_error()
|
||||
Terminated
|
||||
{
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
%%
|
|
@ -1,219 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_dialog_subscribe.sm.
|
||||
* @brief SIP dialog SUBSCRIBE (RFC 2543).
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
%}
|
||||
|
||||
|
||||
%class tsip_dialog_subscribe
|
||||
%header "tinysip/dialogs/tsip_dialog_subscribe.h"
|
||||
%header "tinysip/tsip_message.h"
|
||||
%start tsip_dialog_subscribe::Started
|
||||
%include "tsk_debug.h"
|
||||
|
||||
%map tsip_dialog_subscribe
|
||||
%%
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Started
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_send()
|
||||
Trying
|
||||
{
|
||||
Started_2_Trying_X_send();
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Trying
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_1xx(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_1xx(msg);
|
||||
}
|
||||
|
||||
sm_2xx(unsubscribeing: int, response: const tsip_response_t*) [unsubscribeing]
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_2xx(response);
|
||||
}
|
||||
|
||||
sm_2xx(unsubscribeing: int, response: const tsip_response_t*) [!unsubscribeing]
|
||||
Connected
|
||||
{
|
||||
Trying_2_Connected_X_2xx(response);
|
||||
}
|
||||
|
||||
sm_401_407_421_494(response: const tsip_response_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_401_407_421_494(response);
|
||||
}
|
||||
|
||||
sm_423(response: const tsip_response_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_423(response);
|
||||
}
|
||||
|
||||
sm_300_to_699(response: const tsip_response_t*)
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_300_to_699(response);
|
||||
}
|
||||
|
||||
sm_cancel()
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_cancel();
|
||||
}
|
||||
sm_NOTIFY(sterminated: int, request: const tsip_request_t*)
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_NOTIFY(request);
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Connected
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_unsubscribe()
|
||||
Trying
|
||||
{
|
||||
Connected_2_Trying_X_unsubscribe();
|
||||
}
|
||||
|
||||
sm_refresh()
|
||||
Trying
|
||||
{
|
||||
Connected_2_Trying_X_refresh();
|
||||
}
|
||||
|
||||
sm_NOTIFY(sterminated: int, request: const tsip_request_t*)[!sterminated]
|
||||
nil
|
||||
{
|
||||
Connected_2_Connected_X_NOTIFY(request);
|
||||
}
|
||||
|
||||
sm_NOTIFY(sterminated: int, request: const tsip_request_t*)[sterminated]
|
||||
Terminated
|
||||
{
|
||||
Connected_2_Terminated_X_NOTIFY(request);
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Terminated
|
||||
Entry
|
||||
{
|
||||
OnTerminated();
|
||||
}
|
||||
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Default
|
||||
Entry
|
||||
{
|
||||
}
|
||||
Exit
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_hangup()
|
||||
Trying
|
||||
{
|
||||
Any_2_Trying_X_hangup();
|
||||
}
|
||||
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Any_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
sm_error()
|
||||
Terminated
|
||||
{
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
%%
|
|
@ -1,48 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_ict.c
|
||||
* @brief SIP INVITE Client Transaction as per RFC 3261 subclause 17.1.1.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
%}
|
||||
|
||||
%class tsip_transac_ict
|
||||
%header "tinysip/transactions/tsip_transac_ict.h"
|
||||
%start tsip_transac_ict::Started
|
||||
|
||||
%map tsip_transac_ict
|
||||
%%
|
||||
|
||||
//------------------------
|
||||
//
|
||||
Started
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
%%
|
|
@ -1,48 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_ist.sm
|
||||
* @brief SIP INVITE Server Transaction as per RFC 3261 subclause 17.2.1.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
%}
|
||||
|
||||
%class tsip_transac_ist
|
||||
%header "tinysip/transactions/tsip_transac_ist.h"
|
||||
%start tsip_transac_ist::Started
|
||||
|
||||
%map tsip_transac_ist
|
||||
%%
|
||||
|
||||
//------------------------
|
||||
//
|
||||
Started
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
%%
|
|
@ -1,173 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_nict.sm
|
||||
* @brief SIP Non-INVITE Client Transaction as per RFC 3261 subcaluse 17.1.2.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
%}
|
||||
|
||||
|
||||
%class tsip_transac_nict
|
||||
%header "tinysip/transactions/tsip_transac_nict.h"
|
||||
%header "tinysip/tsip_message.h"
|
||||
%start tsip_transac_nict::Started
|
||||
|
||||
%map tsip_transac_nict
|
||||
%%
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Started
|
||||
Entry
|
||||
{
|
||||
|
||||
}
|
||||
{
|
||||
sm_send()
|
||||
Trying
|
||||
{
|
||||
Started_2_Trying_X_send();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Trying
|
||||
Entry
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_timerE()
|
||||
nil
|
||||
{
|
||||
Trying_2_Trying_X_timerE();
|
||||
}
|
||||
|
||||
sm_timerF()
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_timerF();
|
||||
}
|
||||
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Trying_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
sm_1xx(msg: const tsip_message_t*)
|
||||
Proceeding
|
||||
{
|
||||
Trying_2_Proceedding_X_1xx(msg);
|
||||
}
|
||||
|
||||
sm_200_to_699(msg: const tsip_message_t*)
|
||||
Completed
|
||||
{
|
||||
Trying_2_Completed_X_200_to_699(msg);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Proceeding
|
||||
Entry
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_timerE()
|
||||
nil
|
||||
{
|
||||
Proceeding_2_Proceeding_X_timerE();
|
||||
}
|
||||
|
||||
sm_timerF()
|
||||
Terminated
|
||||
{
|
||||
Proceeding_2_Terminated_X_timerF();
|
||||
}
|
||||
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Proceeding_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
sm_1xx(msg: const tsip_message_t*)
|
||||
nil
|
||||
{
|
||||
Proceeding_2_Proceeding_X_1xx(msg);
|
||||
}
|
||||
|
||||
sm_200_to_699(msg: const tsip_message_t*)
|
||||
Completed
|
||||
{
|
||||
Proceeding_2_Completed_X_200_to_699(msg);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Completed
|
||||
Entry
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_timerK()
|
||||
Terminated
|
||||
{
|
||||
Completed_2_Terminated_X_timerK();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Terminated
|
||||
Entry
|
||||
{
|
||||
OnTerminated();
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Default
|
||||
{
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Any_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
%%
|
|
@ -1,154 +0,0 @@
|
|||
%{
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_nist.sm
|
||||
* @brief SIP Non-INVITE Server Transaction as per RFC 3261 subclause 17.2.2.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
%}
|
||||
|
||||
%class tsip_transac_nist
|
||||
%header "tinysip/transactions/tsip_transac_nist.h"
|
||||
%header "tinysip/tsip_message.h"
|
||||
%start tsip_transac_nist::Started
|
||||
|
||||
%map tsip_transac_nist
|
||||
%%
|
||||
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Started
|
||||
Entry
|
||||
{
|
||||
|
||||
}
|
||||
{
|
||||
sm_request(request: const tsip_request_t*)
|
||||
Trying
|
||||
{
|
||||
Started_2_Trying_X_request(request);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Trying
|
||||
Entry
|
||||
{
|
||||
|
||||
}
|
||||
{
|
||||
sm_send_1xx(response: const tsip_response_t*)
|
||||
Proceeding
|
||||
{
|
||||
Trying_2_Proceeding_X_send_1xx(response);
|
||||
}
|
||||
|
||||
sm_send_200_to_699(response: const tsip_response_t*)
|
||||
Completed
|
||||
{
|
||||
Trying_2_Completed_X_send_200_to_699(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Proceeding
|
||||
Entry
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_send_1xx(response: const tsip_response_t*)
|
||||
nil
|
||||
{
|
||||
Proceeding_2_Proceeding_X_send_1xx(response);
|
||||
}
|
||||
|
||||
sm_send_200_to_699(response: const tsip_response_t*)
|
||||
Completed
|
||||
{
|
||||
Proceeding_2_Completed_X_send_200_to_699(response);
|
||||
}
|
||||
|
||||
sm_request(request: const tsip_request_t*)
|
||||
nil
|
||||
{
|
||||
Proceeding_2_Proceeding_X_request(request);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Completed
|
||||
Entry
|
||||
{
|
||||
}
|
||||
{
|
||||
sm_request(request: const tsip_request_t*)
|
||||
nil
|
||||
{
|
||||
Completed_2_Completed_X_request(request);
|
||||
}
|
||||
|
||||
sm_timerJ()
|
||||
Terminated
|
||||
{
|
||||
Completed_2_Terminated_X_tirmerJ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Terminated
|
||||
Entry
|
||||
{
|
||||
OnTerminated();
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------
|
||||
//------------------------
|
||||
Default
|
||||
{
|
||||
sm_transportError()
|
||||
Terminated
|
||||
{
|
||||
Any_2_Terminated_X_transportError();
|
||||
}
|
||||
|
||||
Default
|
||||
nil
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
%%
|
|
@ -688,8 +688,6 @@ int tsip_dialog_init(tsip_dialog_t *self, tsip_dialog_type_t type, tsip_stack_ha
|
|||
return -2;
|
||||
}
|
||||
|
||||
tsk_safeobj_init(self);
|
||||
|
||||
self->state = tsip_initial;
|
||||
self->type = type;
|
||||
self->stack = tsk_object_ref(stack);
|
||||
|
@ -793,7 +791,6 @@ int tsip_dialog_deinit(tsip_dialog_t *self)
|
|||
TSK_OBJECT_SAFE_FREE(self->challenges);
|
||||
|
||||
self->initialized = 0;
|
||||
tsk_safeobj_deinit(self);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -42,14 +42,57 @@
|
|||
tsip_dialog_messageContext_sm_error(&TSIP_DIALOG_MESSAGE(self)->_fsm); \
|
||||
TSIP_DIALOG_SYNC_END(self);
|
||||
|
||||
/* ======================== internal functions ======================== */
|
||||
int send_message(tsip_dialog_message_t *self);
|
||||
int send_response(tsip_dialog_message_t *self, short status, const char* phrase, const tsip_request_t *request);
|
||||
int tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self);
|
||||
|
||||
/* ======================== transitions ======================== */
|
||||
int tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(va_list *app);
|
||||
int tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(va_list *app);
|
||||
int tsip_dialog_message_Sending_2_Sending_X_1xx(va_list *app);
|
||||
int tsip_dialog_message_Sending_2_Terminated_X_2xx(va_list *app);
|
||||
int tsip_dialog_message_Sending_2_Sending_X_401_407_421_494(va_list *app);
|
||||
int tsip_dialog_message_Sending_2_Terminated_X_300_to_699(va_list *app);
|
||||
int tsip_dialog_message_Sending_2_Terminated_X_cancel(va_list *app);
|
||||
int tsip_dialog_message_Receiving_2_Terminated_X_accept(va_list *app);
|
||||
int tsip_dialog_message_Receiving_2_Terminated_X_reject(va_list *app);
|
||||
int tsip_dialog_message_Any_2_Terminated_X_transportError(va_list *app);
|
||||
int tsip_dialog_message_Any_2_Terminated_X_Error(va_list *app);
|
||||
|
||||
/* ======================== conds ======================== */
|
||||
|
||||
/* ======================== actions ======================== */
|
||||
typedef enum _fsm_action_e
|
||||
{
|
||||
_fsm_action_sendMESSAGE,
|
||||
_fsm_action_receiveMESSAGE,
|
||||
_fsm_action_1xx,
|
||||
_fsm_action_2xx,
|
||||
_fsm_action_401_407_421_494,
|
||||
_fsm_action_300_to_699,
|
||||
_fsm_action_cancel,
|
||||
_fsm_action_accept,
|
||||
_fsm_action_reject,
|
||||
_fsm_action_transporterror,
|
||||
_fsm_action_error,
|
||||
}
|
||||
_fsm_action_t;
|
||||
|
||||
/* ======================== states ======================== */
|
||||
typedef enum _fsm_state_e
|
||||
{
|
||||
_fsm_state_Started,
|
||||
_fsm_state_Sending,
|
||||
_fsm_state_Receiving,
|
||||
_fsm_state_Terminated
|
||||
}
|
||||
_fsm_state_t;
|
||||
|
||||
|
||||
int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_dialog_event_type_t type, const tsip_message_t *msg)
|
||||
{
|
||||
TSIP_DIALOG_SYNC_BEGIN(self);
|
||||
int ret = -1;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
|
@ -62,26 +105,26 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
|
|||
short status_code = TSIP_RESPONSE_CODE(msg);
|
||||
if(status_code <=199)
|
||||
{
|
||||
tsip_dialog_messageContext_sm_1xx(&TSIP_DIALOG_MESSAGE(self)->_fsm, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_1xx, self, msg, self, msg);
|
||||
}
|
||||
else if(status_code<=299)
|
||||
{
|
||||
tsip_dialog_messageContext_sm_2xx(&TSIP_DIALOG_MESSAGE(self)->_fsm, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_2xx, self, msg, self, msg);
|
||||
}
|
||||
else if(status_code == 401 || status_code == 407 || status_code == 421 || status_code == 494)
|
||||
{
|
||||
tsip_dialog_messageContext_sm_401_407_421_494(&TSIP_DIALOG_MESSAGE(self)->_fsm, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_401_407_421_494, self, msg, self, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Alert User
|
||||
TSIP_DIALOG_MESSAGE_SIGNAL_ERROR(self);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_error, self, msg, self, msg);
|
||||
TSK_DEBUG_WARN("Not supported status code: %d", status_code);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tsip_dialog_messageContext_sm_receiveMESSAGE(&TSIP_DIALOG_MESSAGE(self)->_fsm, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_receiveMESSAGE, self, msg, self, msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -89,7 +132,7 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
|
|||
|
||||
case tsip_dialog_canceled:
|
||||
{
|
||||
tsip_dialog_messageContext_sm_cancel(&TSIP_DIALOG_MESSAGE(self)->_fsm);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_cancel, self, msg, self, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -98,27 +141,69 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
|
|||
case tsip_dialog_error:
|
||||
case tsip_dialog_transport_error:
|
||||
{
|
||||
tsip_dialog_messageContext_sm_transportError(&TSIP_DIALOG_MESSAGE(self)->_fsm);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_transporterror, self, msg, self, msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TSIP_DIALOG_SYNC_END(self);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void tsip_dialog_message_init(tsip_dialog_message_t *self)
|
||||
int tsip_dialog_message_init(tsip_dialog_message_t *self)
|
||||
{
|
||||
/* Initialize the state machine.
|
||||
*/
|
||||
tsip_dialog_messageContext_Init(&self->_fsm, self);
|
||||
/* Initialize the state machine. */
|
||||
tsk_fsm_set(self->fsm,
|
||||
|
||||
/*=======================
|
||||
* === Started ===
|
||||
*/
|
||||
// Started -> (send) -> Sending
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_sendMESSAGE, _fsm_state_Sending, tsip_dialog_message_Started_2_Sending_X_sendMESSAGE, "tsip_dialog_message_Started_2_Sending_X_sendMESSAGE"),
|
||||
// Started -> (receive) -> Receiving
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_receiveMESSAGE, _fsm_state_Receiving, tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE, "tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE"),
|
||||
// Started -> (Any) -> Started
|
||||
TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_dialog_message_Started_2_Started_X_any"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Sending ===
|
||||
*/
|
||||
// Sending -> (1xx) -> Sending
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_1xx, _fsm_state_Sending, tsip_dialog_message_Sending_2_Sending_X_1xx, "tsip_dialog_message_Sending_2_Sending_X_1xx"),
|
||||
// Sending -> (2xx) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_2xx, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_2xx, "tsip_dialog_message_Sending_2_Terminated_X_2xx"),
|
||||
// Sending -> (401/407/421/494) -> Sending
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_401_407_421_494, _fsm_state_Sending, tsip_dialog_message_Sending_2_Sending_X_401_407_421_494, "tsip_dialog_message_Sending_2_Sending_X_401_407_421_494"),
|
||||
// Sending -> (300_to_699) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_300_to_699, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_300_to_699, "tsip_dialog_message_Sending_2_Terminated_X_300_to_699"),
|
||||
// Sending -> (cancel) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Sending, _fsm_action_cancel, _fsm_state_Terminated, tsip_dialog_message_Sending_2_Terminated_X_cancel, "tsip_dialog_message_Sending_2_Terminated_X_cancel"),
|
||||
// Sending -> (Any) -> Sending
|
||||
TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Sending, "tsip_dialog_message_Sending_2_Sending_X_any"),
|
||||
|
||||
/*=======================
|
||||
* === Receiving ===
|
||||
*/
|
||||
// Receiving -> (accept) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_accept, _fsm_state_Terminated, tsip_dialog_message_Receiving_2_Terminated_X_accept, "tsip_dialog_message_Receiving_2_Terminated_X_accept"),
|
||||
// Receiving -> (rejected) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Receiving, _fsm_action_reject, _fsm_state_Terminated, tsip_dialog_message_Receiving_2_Terminated_X_reject, "tsip_dialog_message_Receiving_2_Terminated_X_reject"),
|
||||
// Receiving -> (Any) -> Receiving
|
||||
TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Receiving, "tsip_dialog_message_Receiving_2_Receiving_X_any"),
|
||||
|
||||
/*=======================
|
||||
* === Any ===
|
||||
*/
|
||||
// Any -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_dialog_message_Any_2_Terminated_X_transportError, "tsip_dialog_message_Any_2_Terminated_X_transportError"),
|
||||
// Any -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_dialog_message_Any_2_Terminated_X_Error, "tsip_dialog_message_Any_2_Terminated_X_Error"),
|
||||
|
||||
TSK_FSM_ADD_NULL());
|
||||
|
||||
TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK(tsip_dialog_message_event_callback);
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUG)
|
||||
setDebugFlag(&(self->_fsm), DEBUG_STATE_MACHINE);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,6 +228,129 @@ int tsip_dialog_message_recv(tsip_dialog_message_t *self, const tsip_message_t *
|
|||
return ret;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------
|
||||
// == STATE MACHINE BEGIN ==
|
||||
//--------------------------------------------------------
|
||||
|
||||
|
||||
/* Started -> (sendMESSAGE) -> Sending
|
||||
*/
|
||||
int tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Started -> (recvMESSAGE) -> Receiving
|
||||
*/
|
||||
int tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
|
||||
|
||||
return send_response(self, 200, "OK", request);
|
||||
}
|
||||
|
||||
/* Sending -> (1xx) -> Sending
|
||||
*/
|
||||
int tsip_dialog_message_Sending_2_Sending_X_1xx(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sending -> (2xx) -> Sending
|
||||
*/
|
||||
int tsip_dialog_message_Sending_2_Terminated_X_2xx(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sending -> (401/407/421/494) -> Sending
|
||||
*/
|
||||
int tsip_dialog_message_Sending_2_Sending_X_401_407_421_494(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sending -> (300 to 699) -> Terminated
|
||||
*/
|
||||
int tsip_dialog_message_Sending_2_Terminated_X_300_to_699(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sending -> (cancel) -> Terminated
|
||||
*/
|
||||
int tsip_dialog_message_Sending_2_Terminated_X_cancel(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Receiving -> (accept) -> Terminated
|
||||
*/
|
||||
int tsip_dialog_message_Receiving_2_Terminated_X_accept(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Receiving -> (reject) -> Terminated
|
||||
*/
|
||||
int tsip_dialog_message_Receiving_2_Terminated_X_reject(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Any -> (transport error) -> Terminated
|
||||
*/
|
||||
int tsip_dialog_message_Any_2_Terminated_X_transportError(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Any -> (error) -> Terminated
|
||||
*/
|
||||
int tsip_dialog_message_Any_2_Terminated_X_Error(va_list *app)
|
||||
{
|
||||
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// == STATE MACHINE END ==
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
int send_response(tsip_dialog_message_t *self, short status, const char* phrase, const tsip_request_t *request)
|
||||
{
|
||||
tsip_response_t *response;
|
||||
|
@ -165,62 +373,12 @@ int send_response(tsip_dialog_message_t *self, short status, const char* phrase,
|
|||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------
|
||||
// == STATE MACHINE BEGIN ==
|
||||
//--------------------------------------------------------
|
||||
|
||||
|
||||
void tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
int tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self)
|
||||
{
|
||||
}
|
||||
TSK_DEBUG_INFO("=== MESSAGE Dialog terminated ===");
|
||||
|
||||
void tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
send_response(self, 200, "OK", message);
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Sending_2_Sending_X_1xx(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Sending_2_Terminated_X_2xx(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Sending_2_Sending_X_401_407_421_494(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Sending_2_Terminated_X_300_to_699(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Sending_2_Terminated_X_cancel(tsip_dialog_message_t *self)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Receiving_2_Terminated_X_accept(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Receiving_2_Terminated_X_reject(tsip_dialog_message_t *self, const tsip_message_t *message)
|
||||
{
|
||||
}
|
||||
|
||||
void tsip_dialog_message_Any_2_Terminated_X_transportError(tsip_dialog_message_t *self)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// == STATE MACHINE END ==
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
|
||||
void tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self)
|
||||
{
|
||||
/* Remove from the dialog layer. */
|
||||
return tsip_dialog_remove(TSIP_DIALOG(self));
|
||||
}
|
||||
|
||||
|
||||
|
@ -255,6 +413,11 @@ static void* tsip_dialog_message_create(void * self, va_list * app)
|
|||
tsip_stack_handle_t *stack = va_arg(*app, tsip_stack_handle_t *);
|
||||
tsip_operation_handle_t *operation = va_arg(*app, tsip_operation_handle_t *);
|
||||
|
||||
/* create FSM */
|
||||
dialog->fsm = TSK_FSM_CREATE(_fsm_state_Started, _fsm_state_Terminated);
|
||||
dialog->fsm->debug = DEBUG_STATE_MACHINE;
|
||||
tsk_fsm_set_callback_terminated(dialog->fsm, TSK_FSM_ONTERMINATED(tsip_dialog_message_OnTerminated), (const void*)dialog);
|
||||
|
||||
/* Initialize base class */
|
||||
tsip_dialog_init(TSIP_DIALOG(self), tsip_dialog_message, stack, 0, operation);
|
||||
|
||||
|
@ -269,6 +432,9 @@ static void* tsip_dialog_message_destroy(void * self)
|
|||
tsip_dialog_message_t *dialog = self;
|
||||
if(dialog)
|
||||
{
|
||||
/* FSM */
|
||||
TSK_OBJECT_SAFE_FREE(dialog->fsm);
|
||||
|
||||
/* DeInitialize base class */
|
||||
tsip_dialog_deinit(TSIP_DIALOG(self));
|
||||
}
|
||||
|
|
|
@ -663,9 +663,7 @@ int tsip_dialog_register_OnTerminated(tsip_dialog_register_t *self)
|
|||
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_terminated, 700, "Dialog terminated.");
|
||||
|
||||
/* Remove from the dialog layer. */
|
||||
tsip_dialog_remove(TSIP_DIALOG(self));
|
||||
|
||||
return 0;
|
||||
return tsip_dialog_remove(TSIP_DIALOG(self));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ int tsip_dialog_subscribe_event_callback(const tsip_dialog_subscribe_t *self, ts
|
|||
else
|
||||
{
|
||||
// Alert User
|
||||
ret = tsk_fsm_act((self)->fsm, _fsm_action_error, self, msg, self, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_error, self, msg, self, msg);
|
||||
TSK_DEBUG_WARN("Not supported status code: %d", TSIP_RESPONSE_CODE(msg));
|
||||
}
|
||||
}
|
||||
|
@ -661,9 +661,7 @@ int tsip_dialog_subscribe_OnTerminated(tsip_dialog_subscribe_t *self)
|
|||
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_subscribe_terminated, 700, "Dialog terminated.");
|
||||
|
||||
/* Remove from the dialog layer. */
|
||||
tsip_dialog_remove(TSIP_DIALOG(self));
|
||||
|
||||
return 0;
|
||||
return tsip_dialog_remove(TSIP_DIALOG(self));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,502 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_dialog_message.sm
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_dialog_message.sm.
|
||||
* @brief SIP dialog MESSAGE.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include "tinysip/dialogs/tsip_dialog_message.h"
|
||||
#include "tsk_debug.h"
|
||||
#include "tinysip/smc/tsip_dialog_message_sm.h"
|
||||
|
||||
#define getOwner(fsm) \
|
||||
(fsm)->_owner
|
||||
|
||||
#define POPULATE_STATE(state) \
|
||||
state##_Entry, \
|
||||
state##_sm_1xx, \
|
||||
state##_sm_2xx, \
|
||||
state##_sm_300_to_699, \
|
||||
state##_sm_401_407_421_494, \
|
||||
state##_sm_accept, \
|
||||
state##_sm_cancel, \
|
||||
state##_sm_error, \
|
||||
state##_sm_receiveMESSAGE, \
|
||||
state##_sm_reject, \
|
||||
state##_sm_sendMESSAGE, \
|
||||
state##_sm_transportError, \
|
||||
state##_Default
|
||||
|
||||
#define ENTRY_STATE(state) \
|
||||
if ((state)->Entry != NULL) { \
|
||||
(state)->Entry(fsm); \
|
||||
}
|
||||
|
||||
#define EXIT_STATE(state)
|
||||
|
||||
static void tsip_dialog_messageState_sm_1xx(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_2xx(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_300_to_699(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_401_407_421_494(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_accept(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_cancel(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_error(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_receiveMESSAGE(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_reject(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_sendMESSAGE(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_sm_transportError(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_dialog_messageState_Default(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
State_Default(fsm);
|
||||
}
|
||||
|
||||
#define tsip_dialog_message_Started_sm_1xx tsip_dialog_messageState_sm_1xx
|
||||
#define tsip_dialog_message_Started_sm_2xx tsip_dialog_messageState_sm_2xx
|
||||
#define tsip_dialog_message_Started_sm_300_to_699 tsip_dialog_messageState_sm_300_to_699
|
||||
#define tsip_dialog_message_Started_sm_401_407_421_494 tsip_dialog_messageState_sm_401_407_421_494
|
||||
#define tsip_dialog_message_Started_sm_accept tsip_dialog_messageState_sm_accept
|
||||
#define tsip_dialog_message_Started_sm_cancel tsip_dialog_messageState_sm_cancel
|
||||
#define tsip_dialog_message_Started_sm_error tsip_dialog_messageState_sm_error
|
||||
#define tsip_dialog_message_Started_sm_receiveMESSAGE tsip_dialog_messageState_sm_receiveMESSAGE
|
||||
#define tsip_dialog_message_Started_sm_reject tsip_dialog_messageState_sm_reject
|
||||
#define tsip_dialog_message_Started_sm_sendMESSAGE tsip_dialog_messageState_sm_sendMESSAGE
|
||||
#define tsip_dialog_message_Started_sm_transportError tsip_dialog_messageState_sm_transportError
|
||||
#define tsip_dialog_message_Started_Default tsip_dialog_messageState_Default
|
||||
#define tsip_dialog_message_Started_Entry NULL
|
||||
#define tsip_dialog_message_Started_Exit NULL
|
||||
#define tsip_dialog_message_Sending_sm_1xx tsip_dialog_messageState_sm_1xx
|
||||
#define tsip_dialog_message_Sending_sm_2xx tsip_dialog_messageState_sm_2xx
|
||||
#define tsip_dialog_message_Sending_sm_300_to_699 tsip_dialog_messageState_sm_300_to_699
|
||||
#define tsip_dialog_message_Sending_sm_401_407_421_494 tsip_dialog_messageState_sm_401_407_421_494
|
||||
#define tsip_dialog_message_Sending_sm_accept tsip_dialog_messageState_sm_accept
|
||||
#define tsip_dialog_message_Sending_sm_cancel tsip_dialog_messageState_sm_cancel
|
||||
#define tsip_dialog_message_Sending_sm_error tsip_dialog_messageState_sm_error
|
||||
#define tsip_dialog_message_Sending_sm_receiveMESSAGE tsip_dialog_messageState_sm_receiveMESSAGE
|
||||
#define tsip_dialog_message_Sending_sm_reject tsip_dialog_messageState_sm_reject
|
||||
#define tsip_dialog_message_Sending_sm_sendMESSAGE tsip_dialog_messageState_sm_sendMESSAGE
|
||||
#define tsip_dialog_message_Sending_sm_transportError tsip_dialog_messageState_sm_transportError
|
||||
#define tsip_dialog_message_Sending_Default tsip_dialog_messageState_Default
|
||||
#define tsip_dialog_message_Sending_Entry NULL
|
||||
#define tsip_dialog_message_Sending_Exit NULL
|
||||
#define tsip_dialog_message_Receiving_sm_1xx tsip_dialog_messageState_sm_1xx
|
||||
#define tsip_dialog_message_Receiving_sm_2xx tsip_dialog_messageState_sm_2xx
|
||||
#define tsip_dialog_message_Receiving_sm_300_to_699 tsip_dialog_messageState_sm_300_to_699
|
||||
#define tsip_dialog_message_Receiving_sm_401_407_421_494 tsip_dialog_messageState_sm_401_407_421_494
|
||||
#define tsip_dialog_message_Receiving_sm_accept tsip_dialog_messageState_sm_accept
|
||||
#define tsip_dialog_message_Receiving_sm_cancel tsip_dialog_messageState_sm_cancel
|
||||
#define tsip_dialog_message_Receiving_sm_error tsip_dialog_messageState_sm_error
|
||||
#define tsip_dialog_message_Receiving_sm_receiveMESSAGE tsip_dialog_messageState_sm_receiveMESSAGE
|
||||
#define tsip_dialog_message_Receiving_sm_reject tsip_dialog_messageState_sm_reject
|
||||
#define tsip_dialog_message_Receiving_sm_sendMESSAGE tsip_dialog_messageState_sm_sendMESSAGE
|
||||
#define tsip_dialog_message_Receiving_sm_transportError tsip_dialog_messageState_sm_transportError
|
||||
#define tsip_dialog_message_Receiving_Default tsip_dialog_messageState_Default
|
||||
#define tsip_dialog_message_Receiving_Entry NULL
|
||||
#define tsip_dialog_message_Receiving_Exit NULL
|
||||
#define tsip_dialog_message_Terminated_sm_1xx tsip_dialog_messageState_sm_1xx
|
||||
#define tsip_dialog_message_Terminated_sm_2xx tsip_dialog_messageState_sm_2xx
|
||||
#define tsip_dialog_message_Terminated_sm_300_to_699 tsip_dialog_messageState_sm_300_to_699
|
||||
#define tsip_dialog_message_Terminated_sm_401_407_421_494 tsip_dialog_messageState_sm_401_407_421_494
|
||||
#define tsip_dialog_message_Terminated_sm_accept tsip_dialog_messageState_sm_accept
|
||||
#define tsip_dialog_message_Terminated_sm_cancel tsip_dialog_messageState_sm_cancel
|
||||
#define tsip_dialog_message_Terminated_sm_error tsip_dialog_messageState_sm_error
|
||||
#define tsip_dialog_message_Terminated_sm_receiveMESSAGE tsip_dialog_messageState_sm_receiveMESSAGE
|
||||
#define tsip_dialog_message_Terminated_sm_reject tsip_dialog_messageState_sm_reject
|
||||
#define tsip_dialog_message_Terminated_sm_sendMESSAGE tsip_dialog_messageState_sm_sendMESSAGE
|
||||
#define tsip_dialog_message_Terminated_sm_transportError tsip_dialog_messageState_sm_transportError
|
||||
#define tsip_dialog_message_Terminated_Default tsip_dialog_messageState_Default
|
||||
#define tsip_dialog_message_Terminated_Entry NULL
|
||||
#define tsip_dialog_message_Terminated_Exit NULL
|
||||
#define tsip_dialog_message_DefaultState_sm_1xx tsip_dialog_messageState_sm_1xx
|
||||
#define tsip_dialog_message_DefaultState_sm_2xx tsip_dialog_messageState_sm_2xx
|
||||
#define tsip_dialog_message_DefaultState_sm_300_to_699 tsip_dialog_messageState_sm_300_to_699
|
||||
#define tsip_dialog_message_DefaultState_sm_401_407_421_494 tsip_dialog_messageState_sm_401_407_421_494
|
||||
#define tsip_dialog_message_DefaultState_sm_accept tsip_dialog_messageState_sm_accept
|
||||
#define tsip_dialog_message_DefaultState_sm_cancel tsip_dialog_messageState_sm_cancel
|
||||
#define tsip_dialog_message_DefaultState_sm_error tsip_dialog_messageState_sm_error
|
||||
#define tsip_dialog_message_DefaultState_sm_receiveMESSAGE tsip_dialog_messageState_sm_receiveMESSAGE
|
||||
#define tsip_dialog_message_DefaultState_sm_reject tsip_dialog_messageState_sm_reject
|
||||
#define tsip_dialog_message_DefaultState_sm_sendMESSAGE tsip_dialog_messageState_sm_sendMESSAGE
|
||||
#define tsip_dialog_message_DefaultState_sm_transportError tsip_dialog_messageState_sm_transportError
|
||||
|
||||
#undef tsip_dialog_message_Started_sm_transportError
|
||||
#define tsip_dialog_message_Started_sm_transportError tsip_dialog_message_DefaultState_sm_transportError
|
||||
#undef tsip_dialog_message_Sending_sm_transportError
|
||||
#define tsip_dialog_message_Sending_sm_transportError tsip_dialog_message_DefaultState_sm_transportError
|
||||
#undef tsip_dialog_message_Receiving_sm_transportError
|
||||
#define tsip_dialog_message_Receiving_sm_transportError tsip_dialog_message_DefaultState_sm_transportError
|
||||
#undef tsip_dialog_message_Terminated_sm_transportError
|
||||
#define tsip_dialog_message_Terminated_sm_transportError tsip_dialog_message_DefaultState_sm_transportError
|
||||
#undef tsip_dialog_message_DefaultState_sm_transportError
|
||||
static void tsip_dialog_message_DefaultState_sm_transportError(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Any_2_Terminated_X_transportError(ctxt);
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Started_sm_error
|
||||
#define tsip_dialog_message_Started_sm_error tsip_dialog_message_DefaultState_sm_error
|
||||
#undef tsip_dialog_message_Sending_sm_error
|
||||
#define tsip_dialog_message_Sending_sm_error tsip_dialog_message_DefaultState_sm_error
|
||||
#undef tsip_dialog_message_Receiving_sm_error
|
||||
#define tsip_dialog_message_Receiving_sm_error tsip_dialog_message_DefaultState_sm_error
|
||||
#undef tsip_dialog_message_Terminated_sm_error
|
||||
#define tsip_dialog_message_Terminated_sm_error tsip_dialog_message_DefaultState_sm_error
|
||||
#undef tsip_dialog_message_DefaultState_sm_error
|
||||
static void tsip_dialog_message_DefaultState_sm_error(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Started_Default
|
||||
#define tsip_dialog_message_Started_Default tsip_dialog_message_DefaultState_Default
|
||||
#undef tsip_dialog_message_Sending_Default
|
||||
#define tsip_dialog_message_Sending_Default tsip_dialog_message_DefaultState_Default
|
||||
#undef tsip_dialog_message_Receiving_Default
|
||||
#define tsip_dialog_message_Receiving_Default tsip_dialog_message_DefaultState_Default
|
||||
#undef tsip_dialog_message_Terminated_Default
|
||||
#define tsip_dialog_message_Terminated_Default tsip_dialog_message_DefaultState_Default
|
||||
#undef tsip_dialog_message_DefaultState_Default
|
||||
static void tsip_dialog_message_DefaultState_Default(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Started_sm_receiveMESSAGE
|
||||
static void tsip_dialog_message_Started_sm_receiveMESSAGE(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(ctxt, msg);
|
||||
setState(fsm, &tsip_dialog_message_Receiving);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Started_sm_sendMESSAGE
|
||||
static void tsip_dialog_message_Started_sm_sendMESSAGE(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(ctxt, msg);
|
||||
setState(fsm, &tsip_dialog_message_Sending);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_dialog_messageState tsip_dialog_message_Started = { POPULATE_STATE(tsip_dialog_message_Started), "tsip_dialog_message_Started", 0 };
|
||||
|
||||
#undef tsip_dialog_message_Sending_sm_1xx
|
||||
static void tsip_dialog_message_Sending_sm_1xx(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
const struct tsip_dialog_messageState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Sending_2_Sending_X_1xx(ctxt, msg);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Sending_sm_2xx
|
||||
static void tsip_dialog_message_Sending_sm_2xx(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Sending_2_Terminated_X_2xx(ctxt, msg);
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Sending_sm_300_to_699
|
||||
static void tsip_dialog_message_Sending_sm_300_to_699(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Sending_2_Terminated_X_300_to_699(ctxt, msg);
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Sending_sm_401_407_421_494
|
||||
static void tsip_dialog_message_Sending_sm_401_407_421_494(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
const struct tsip_dialog_messageState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Sending_2_Sending_X_401_407_421_494(ctxt, msg);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Sending_sm_cancel
|
||||
static void tsip_dialog_message_Sending_sm_cancel(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Sending_2_Terminated_X_cancel(ctxt);
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_dialog_messageState tsip_dialog_message_Sending = { POPULATE_STATE(tsip_dialog_message_Sending), "tsip_dialog_message_Sending", 1 };
|
||||
|
||||
#undef tsip_dialog_message_Receiving_sm_accept
|
||||
static void tsip_dialog_message_Receiving_sm_accept(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Receiving_2_Terminated_X_accept(ctxt, msg);
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Receiving_sm_reject
|
||||
static void tsip_dialog_message_Receiving_sm_reject(struct tsip_dialog_messageContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_dialog_message* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_dialog_message_Receiving_2_Terminated_X_reject(ctxt, msg);
|
||||
setState(fsm, &tsip_dialog_message_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_dialog_messageState tsip_dialog_message_Receiving = { POPULATE_STATE(tsip_dialog_message_Receiving), "tsip_dialog_message_Receiving", 2 };
|
||||
|
||||
#undef tsip_dialog_message_Terminated_Entry
|
||||
void tsip_dialog_message_Terminated_Entry(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
struct tsip_dialog_message *ctxt = getOwner(fsm);
|
||||
|
||||
tsip_dialog_message_OnTerminated(ctxt);
|
||||
}
|
||||
|
||||
#undef tsip_dialog_message_Terminated_Default
|
||||
static void tsip_dialog_message_Terminated_Default(struct tsip_dialog_messageContext *fsm)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const struct tsip_dialog_messageState tsip_dialog_message_Terminated = { POPULATE_STATE(tsip_dialog_message_Terminated), "tsip_dialog_message_Terminated", 3 };
|
||||
|
||||
void tsip_dialog_messageContext_Init(struct tsip_dialog_messageContext* fsm, struct tsip_dialog_message* owner)
|
||||
{
|
||||
FSM_INIT(fsm, &tsip_dialog_message_Started);
|
||||
fsm->_owner = owner;
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_EnterStartState(struct tsip_dialog_messageContext* fsm)
|
||||
{
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_1xx(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_1xx");
|
||||
state->sm_1xx(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_2xx(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_2xx");
|
||||
state->sm_2xx(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_300_to_699(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_300_to_699");
|
||||
state->sm_300_to_699(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_401_407_421_494(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_401_407_421_494");
|
||||
state->sm_401_407_421_494(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_accept(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_accept");
|
||||
state->sm_accept(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_cancel(struct tsip_dialog_messageContext* fsm)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_cancel");
|
||||
state->sm_cancel(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_error(struct tsip_dialog_messageContext* fsm)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_error");
|
||||
state->sm_error(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_receiveMESSAGE(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_receiveMESSAGE");
|
||||
state->sm_receiveMESSAGE(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_reject(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_reject");
|
||||
state->sm_reject(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_sendMESSAGE(struct tsip_dialog_messageContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_sendMESSAGE");
|
||||
state->sm_sendMESSAGE(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_dialog_messageContext_sm_transportError(struct tsip_dialog_messageContext* fsm)
|
||||
{
|
||||
const struct tsip_dialog_messageState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_transportError");
|
||||
state->sm_transportError(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,574 +0,0 @@
|
|||
///*
|
||||
// * ex: set ro:
|
||||
// * DO NOT EDIT.
|
||||
// * generated by smc (http://smc.sourceforge.net/)
|
||||
// * from file : tsip_dialog_register.sm
|
||||
// */
|
||||
//
|
||||
//
|
||||
///*
|
||||
//* Copyright (C) 2009 Mamadou Diop.
|
||||
//*
|
||||
//* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
//*
|
||||
//* This file is part of Open Source Doubango Framework.
|
||||
//*
|
||||
//* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
//* it under the terms of the GNU General Public License as published by
|
||||
//* the Free Software Foundation, either version 3 of the License, or
|
||||
//* (at your option) any later version.
|
||||
//*
|
||||
//* DOUBANGO is distributed in the hope that it will be useful,
|
||||
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
//* GNU General Public License for more details.
|
||||
//*
|
||||
//* You should have received a copy of the GNU General Public License
|
||||
//* along with DOUBANGO.
|
||||
//*
|
||||
//*/
|
||||
//
|
||||
///**@file tsip_dialog_register.sm.
|
||||
// * @brief SIP dialog REGISTER.
|
||||
// *
|
||||
// * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
// *
|
||||
// * @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
// */
|
||||
//
|
||||
////#define tsip_dialog_register_TSIP_DIALOG_BEGIN_TRANSIT(self) TSIP_DIALOG_BEGIN_TRANSIT(self)
|
||||
////#define tsip_dialog_register_TSIP_DIALOG_END_TRANSIT(self) TSIP_DIALOG_END_TRANSIT(self)
|
||||
//
|
||||
//
|
||||
//#include <assert.h>
|
||||
//#include "tinysip/dialogs/tsip_dialog_register.h"
|
||||
//#include "tsk_debug.h"
|
||||
//#include "tinysip/smc/tsip_dialog_register_sm.h"
|
||||
//
|
||||
//#define getOwner(fsm) \
|
||||
// (fsm)->_owner
|
||||
//
|
||||
//#define POPULATE_STATE(state) \
|
||||
// state##_Entry, \
|
||||
// state##_sm_1xx, \
|
||||
// state##_sm_2xx, \
|
||||
// state##_sm_300_to_699, \
|
||||
// state##_sm_401_407_421_494, \
|
||||
// state##_sm_423, \
|
||||
// state##_sm_cancel, \
|
||||
// state##_sm_error, \
|
||||
// state##_sm_hangup, \
|
||||
// state##_sm_refresh, \
|
||||
// state##_sm_send, \
|
||||
// state##_sm_transportError, \
|
||||
// state##_sm_unregister, \
|
||||
// state##_Default
|
||||
//
|
||||
//#define ENTRY_STATE(state) \
|
||||
// if ((state)->Entry != NULL) { \
|
||||
// (state)->Entry(fsm); \
|
||||
// }
|
||||
//
|
||||
//#define EXIT_STATE(state)
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_1xx(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_2xx(struct tsip_dialog_registerContext *fsm, int unregistering, const tsip_message_t* msg)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_300_to_699(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_401_407_421_494(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_423(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_cancel(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_error(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_hangup(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_refresh(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_send(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_transportError(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_sm_unregister(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_registerState_Default(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// State_Default(fsm);
|
||||
//}
|
||||
//
|
||||
//#define tsip_dialog_register_Started_sm_1xx tsip_dialog_registerState_sm_1xx
|
||||
//#define tsip_dialog_register_Started_sm_2xx tsip_dialog_registerState_sm_2xx
|
||||
//#define tsip_dialog_register_Started_sm_300_to_699 tsip_dialog_registerState_sm_300_to_699
|
||||
//#define tsip_dialog_register_Started_sm_401_407_421_494 tsip_dialog_registerState_sm_401_407_421_494
|
||||
//#define tsip_dialog_register_Started_sm_423 tsip_dialog_registerState_sm_423
|
||||
//#define tsip_dialog_register_Started_sm_cancel tsip_dialog_registerState_sm_cancel
|
||||
//#define tsip_dialog_register_Started_sm_error tsip_dialog_registerState_sm_error
|
||||
//#define tsip_dialog_register_Started_sm_hangup tsip_dialog_registerState_sm_hangup
|
||||
//#define tsip_dialog_register_Started_sm_refresh tsip_dialog_registerState_sm_refresh
|
||||
//#define tsip_dialog_register_Started_sm_send tsip_dialog_registerState_sm_send
|
||||
//#define tsip_dialog_register_Started_sm_transportError tsip_dialog_registerState_sm_transportError
|
||||
//#define tsip_dialog_register_Started_sm_unregister tsip_dialog_registerState_sm_unregister
|
||||
//#define tsip_dialog_register_Started_Default tsip_dialog_registerState_Default
|
||||
//#define tsip_dialog_register_Started_Entry NULL
|
||||
//#define tsip_dialog_register_Started_Exit NULL
|
||||
//#define tsip_dialog_register_Trying_sm_1xx tsip_dialog_registerState_sm_1xx
|
||||
//#define tsip_dialog_register_Trying_sm_2xx tsip_dialog_registerState_sm_2xx
|
||||
//#define tsip_dialog_register_Trying_sm_300_to_699 tsip_dialog_registerState_sm_300_to_699
|
||||
//#define tsip_dialog_register_Trying_sm_401_407_421_494 tsip_dialog_registerState_sm_401_407_421_494
|
||||
//#define tsip_dialog_register_Trying_sm_423 tsip_dialog_registerState_sm_423
|
||||
//#define tsip_dialog_register_Trying_sm_cancel tsip_dialog_registerState_sm_cancel
|
||||
//#define tsip_dialog_register_Trying_sm_error tsip_dialog_registerState_sm_error
|
||||
//#define tsip_dialog_register_Trying_sm_hangup tsip_dialog_registerState_sm_hangup
|
||||
//#define tsip_dialog_register_Trying_sm_refresh tsip_dialog_registerState_sm_refresh
|
||||
//#define tsip_dialog_register_Trying_sm_send tsip_dialog_registerState_sm_send
|
||||
//#define tsip_dialog_register_Trying_sm_transportError tsip_dialog_registerState_sm_transportError
|
||||
//#define tsip_dialog_register_Trying_sm_unregister tsip_dialog_registerState_sm_unregister
|
||||
//#define tsip_dialog_register_Trying_Default tsip_dialog_registerState_Default
|
||||
//#define tsip_dialog_register_Trying_Entry NULL
|
||||
//#define tsip_dialog_register_Trying_Exit NULL
|
||||
//#define tsip_dialog_register_Connected_sm_1xx tsip_dialog_registerState_sm_1xx
|
||||
//#define tsip_dialog_register_Connected_sm_2xx tsip_dialog_registerState_sm_2xx
|
||||
//#define tsip_dialog_register_Connected_sm_300_to_699 tsip_dialog_registerState_sm_300_to_699
|
||||
//#define tsip_dialog_register_Connected_sm_401_407_421_494 tsip_dialog_registerState_sm_401_407_421_494
|
||||
//#define tsip_dialog_register_Connected_sm_423 tsip_dialog_registerState_sm_423
|
||||
//#define tsip_dialog_register_Connected_sm_cancel tsip_dialog_registerState_sm_cancel
|
||||
//#define tsip_dialog_register_Connected_sm_error tsip_dialog_registerState_sm_error
|
||||
//#define tsip_dialog_register_Connected_sm_hangup tsip_dialog_registerState_sm_hangup
|
||||
//#define tsip_dialog_register_Connected_sm_refresh tsip_dialog_registerState_sm_refresh
|
||||
//#define tsip_dialog_register_Connected_sm_send tsip_dialog_registerState_sm_send
|
||||
//#define tsip_dialog_register_Connected_sm_transportError tsip_dialog_registerState_sm_transportError
|
||||
//#define tsip_dialog_register_Connected_sm_unregister tsip_dialog_registerState_sm_unregister
|
||||
//#define tsip_dialog_register_Connected_Default tsip_dialog_registerState_Default
|
||||
//#define tsip_dialog_register_Connected_Entry NULL
|
||||
//#define tsip_dialog_register_Connected_Exit NULL
|
||||
//#define tsip_dialog_register_Terminated_sm_1xx tsip_dialog_registerState_sm_1xx
|
||||
//#define tsip_dialog_register_Terminated_sm_2xx tsip_dialog_registerState_sm_2xx
|
||||
//#define tsip_dialog_register_Terminated_sm_300_to_699 tsip_dialog_registerState_sm_300_to_699
|
||||
//#define tsip_dialog_register_Terminated_sm_401_407_421_494 tsip_dialog_registerState_sm_401_407_421_494
|
||||
//#define tsip_dialog_register_Terminated_sm_423 tsip_dialog_registerState_sm_423
|
||||
//#define tsip_dialog_register_Terminated_sm_cancel tsip_dialog_registerState_sm_cancel
|
||||
//#define tsip_dialog_register_Terminated_sm_error tsip_dialog_registerState_sm_error
|
||||
//#define tsip_dialog_register_Terminated_sm_hangup tsip_dialog_registerState_sm_hangup
|
||||
//#define tsip_dialog_register_Terminated_sm_refresh tsip_dialog_registerState_sm_refresh
|
||||
//#define tsip_dialog_register_Terminated_sm_send tsip_dialog_registerState_sm_send
|
||||
//#define tsip_dialog_register_Terminated_sm_transportError tsip_dialog_registerState_sm_transportError
|
||||
//#define tsip_dialog_register_Terminated_sm_unregister tsip_dialog_registerState_sm_unregister
|
||||
//#define tsip_dialog_register_Terminated_Default tsip_dialog_registerState_Default
|
||||
//#define tsip_dialog_register_Terminated_Entry NULL
|
||||
//#define tsip_dialog_register_Terminated_Exit NULL
|
||||
//#define tsip_dialog_register_DefaultState_sm_1xx tsip_dialog_registerState_sm_1xx
|
||||
//#define tsip_dialog_register_DefaultState_sm_2xx tsip_dialog_registerState_sm_2xx
|
||||
//#define tsip_dialog_register_DefaultState_sm_300_to_699 tsip_dialog_registerState_sm_300_to_699
|
||||
//#define tsip_dialog_register_DefaultState_sm_401_407_421_494 tsip_dialog_registerState_sm_401_407_421_494
|
||||
//#define tsip_dialog_register_DefaultState_sm_423 tsip_dialog_registerState_sm_423
|
||||
//#define tsip_dialog_register_DefaultState_sm_cancel tsip_dialog_registerState_sm_cancel
|
||||
//#define tsip_dialog_register_DefaultState_sm_error tsip_dialog_registerState_sm_error
|
||||
//#define tsip_dialog_register_DefaultState_sm_hangup tsip_dialog_registerState_sm_hangup
|
||||
//#define tsip_dialog_register_DefaultState_sm_refresh tsip_dialog_registerState_sm_refresh
|
||||
//#define tsip_dialog_register_DefaultState_sm_send tsip_dialog_registerState_sm_send
|
||||
//#define tsip_dialog_register_DefaultState_sm_transportError tsip_dialog_registerState_sm_transportError
|
||||
//#define tsip_dialog_register_DefaultState_sm_unregister tsip_dialog_registerState_sm_unregister
|
||||
//
|
||||
//#undef tsip_dialog_register_Started_sm_hangup
|
||||
//#define tsip_dialog_register_Started_sm_hangup tsip_dialog_register_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_register_Trying_sm_hangup
|
||||
//#define tsip_dialog_register_Trying_sm_hangup tsip_dialog_register_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_register_Connected_sm_hangup
|
||||
//#define tsip_dialog_register_Connected_sm_hangup tsip_dialog_register_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_register_Terminated_sm_hangup
|
||||
//#define tsip_dialog_register_Terminated_sm_hangup tsip_dialog_register_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_register_DefaultState_sm_hangup
|
||||
//static void tsip_dialog_register_DefaultState_sm_hangup(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Any_2_Trying_X_hangup(ctxt);
|
||||
// setState(fsm, &tsip_dialog_register_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Started_sm_transportError
|
||||
//#define tsip_dialog_register_Started_sm_transportError tsip_dialog_register_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_register_Trying_sm_transportError
|
||||
//#define tsip_dialog_register_Trying_sm_transportError tsip_dialog_register_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_register_Connected_sm_transportError
|
||||
//#define tsip_dialog_register_Connected_sm_transportError tsip_dialog_register_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_register_Terminated_sm_transportError
|
||||
//#define tsip_dialog_register_Terminated_sm_transportError tsip_dialog_register_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_register_DefaultState_sm_transportError
|
||||
//static void tsip_dialog_register_DefaultState_sm_transportError(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Any_2_Terminated_X_transportError(ctxt);
|
||||
// setState(fsm, &tsip_dialog_register_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Started_sm_error
|
||||
//#define tsip_dialog_register_Started_sm_error tsip_dialog_register_DefaultState_sm_error
|
||||
//#undef tsip_dialog_register_Trying_sm_error
|
||||
//#define tsip_dialog_register_Trying_sm_error tsip_dialog_register_DefaultState_sm_error
|
||||
//#undef tsip_dialog_register_Connected_sm_error
|
||||
//#define tsip_dialog_register_Connected_sm_error tsip_dialog_register_DefaultState_sm_error
|
||||
//#undef tsip_dialog_register_Terminated_sm_error
|
||||
//#define tsip_dialog_register_Terminated_sm_error tsip_dialog_register_DefaultState_sm_error
|
||||
//#undef tsip_dialog_register_DefaultState_sm_error
|
||||
//static void tsip_dialog_register_DefaultState_sm_error(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// setState(fsm, &tsip_dialog_register_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Started_Default
|
||||
//#define tsip_dialog_register_Started_Default tsip_dialog_register_DefaultState_Default
|
||||
//#undef tsip_dialog_register_Trying_Default
|
||||
//#define tsip_dialog_register_Trying_Default tsip_dialog_register_DefaultState_Default
|
||||
//#undef tsip_dialog_register_Connected_Default
|
||||
//#define tsip_dialog_register_Connected_Default tsip_dialog_register_DefaultState_Default
|
||||
//#undef tsip_dialog_register_Terminated_Default
|
||||
//#define tsip_dialog_register_Terminated_Default tsip_dialog_register_DefaultState_Default
|
||||
//#undef tsip_dialog_register_DefaultState_Default
|
||||
//static void tsip_dialog_register_DefaultState_Default(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Started_Default
|
||||
//static void tsip_dialog_register_Started_Default(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Started_sm_send
|
||||
//static void tsip_dialog_register_Started_sm_send(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Started_2_Trying_X_send(ctxt);
|
||||
// setState(fsm, &tsip_dialog_register_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_registerState tsip_dialog_register_Started = { POPULATE_STATE(tsip_dialog_register_Started), "tsip_dialog_register_Started", 0 };
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_Default
|
||||
//static void tsip_dialog_register_Trying_Default(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_sm_1xx
|
||||
//static void tsip_dialog_register_Trying_sm_1xx(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_registerState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Trying_X_1xx(ctxt, msg);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_sm_2xx
|
||||
//static void tsip_dialog_register_Trying_sm_2xx(struct tsip_dialog_registerContext *fsm, int unregistering, const tsip_message_t* msg)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// if (!unregistering) {
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Connected_X_2xx(ctxt, msg);
|
||||
// setState(fsm, &tsip_dialog_register_Connected);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
// }
|
||||
// else if (unregistering) {
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Terminated_X_2xx(ctxt, msg);
|
||||
// setState(fsm, &tsip_dialog_register_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
// } else {
|
||||
// tsip_dialog_register_DefaultState_sm_2xx(fsm, unregistering, msg);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_sm_300_to_699
|
||||
//static void tsip_dialog_register_Trying_sm_300_to_699(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Terminated_X_300_to_699(ctxt, msg);
|
||||
// setState(fsm, &tsip_dialog_register_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_sm_401_407_421_494
|
||||
//static void tsip_dialog_register_Trying_sm_401_407_421_494(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_registerState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Trying_X_401_407_421_494(ctxt, msg);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_sm_423
|
||||
//static void tsip_dialog_register_Trying_sm_423(struct tsip_dialog_registerContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_registerState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Trying_X_423(ctxt, msg);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Trying_sm_cancel
|
||||
//static void tsip_dialog_register_Trying_sm_cancel(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Trying_2_Terminated_X_cancel(ctxt);
|
||||
// setState(fsm, &tsip_dialog_register_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_registerState tsip_dialog_register_Trying = { POPULATE_STATE(tsip_dialog_register_Trying), "tsip_dialog_register_Trying", 1 };
|
||||
//
|
||||
//#undef tsip_dialog_register_Connected_Default
|
||||
//static void tsip_dialog_register_Connected_Default(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Connected_sm_refresh
|
||||
//static void tsip_dialog_register_Connected_sm_refresh(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Connected_2_Trying_X_refresh(ctxt);
|
||||
// setState(fsm, &tsip_dialog_register_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Connected_sm_unregister
|
||||
//static void tsip_dialog_register_Connected_sm_unregister(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_register_Connected_2_Trying_X_unregister(ctxt);
|
||||
// setState(fsm, &tsip_dialog_register_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_registerState tsip_dialog_register_Connected = { POPULATE_STATE(tsip_dialog_register_Connected), "tsip_dialog_register_Connected", 2 };
|
||||
//
|
||||
//#undef tsip_dialog_register_Terminated_Entry
|
||||
//void tsip_dialog_register_Terminated_Entry(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_register *ctxt = getOwner(fsm);
|
||||
//
|
||||
// tsip_dialog_register_OnTerminated(ctxt);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_register_Terminated_Default
|
||||
//static void tsip_dialog_register_Terminated_Default(struct tsip_dialog_registerContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_registerState tsip_dialog_register_Terminated = { POPULATE_STATE(tsip_dialog_register_Terminated), "tsip_dialog_register_Terminated", 3 };
|
||||
//
|
||||
//void tsip_dialog_registerContext_Init(struct tsip_dialog_registerContext* fsm, struct tsip_dialog_register* owner)
|
||||
//{
|
||||
// FSM_INIT(fsm, &tsip_dialog_register_Started);
|
||||
// fsm->_owner = owner;
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_EnterStartState(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_1xx(struct tsip_dialog_registerContext* fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_1xx");
|
||||
// state->sm_1xx(fsm, msg);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_2xx(struct tsip_dialog_registerContext* fsm, int unregistering, const tsip_message_t* msg)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_2xx");
|
||||
// state->sm_2xx(fsm, unregistering, msg);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_300_to_699(struct tsip_dialog_registerContext* fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_300_to_699");
|
||||
// state->sm_300_to_699(fsm, msg);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_401_407_421_494(struct tsip_dialog_registerContext* fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_401_407_421_494");
|
||||
// state->sm_401_407_421_494(fsm, msg);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_423(struct tsip_dialog_registerContext* fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_423");
|
||||
// state->sm_423(fsm, msg);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_cancel(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_cancel");
|
||||
// state->sm_cancel(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_error(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_error");
|
||||
// state->sm_error(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_hangup(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_hangup");
|
||||
// state->sm_hangup(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_refresh(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_refresh");
|
||||
// state->sm_refresh(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_send(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_send");
|
||||
// state->sm_send(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_transportError(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_transportError");
|
||||
// state->sm_transportError(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_registerContext_sm_unregister(struct tsip_dialog_registerContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_registerState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_unregister");
|
||||
// state->sm_unregister(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
///*
|
||||
// * Local variables:
|
||||
// * buffer-read-only: t
|
||||
// * End:
|
||||
// */
|
|
@ -1,627 +0,0 @@
|
|||
///*
|
||||
// * ex: set ro:
|
||||
// * DO NOT EDIT.
|
||||
// * generated by smc (http://smc.sourceforge.net/)
|
||||
// * from file : tsip_dialog_subscribe.sm
|
||||
// */
|
||||
//
|
||||
//
|
||||
///*
|
||||
//* Copyright (C) 2009 Mamadou Diop.
|
||||
//*
|
||||
//* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
//*
|
||||
//* This file is part of Open Source Doubango Framework.
|
||||
//*
|
||||
//* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
//* it under the terms of the GNU General Public License as published by
|
||||
//* the Free Software Foundation, either version 3 of the License, or
|
||||
//* (at your option) any later version.
|
||||
//*
|
||||
//* DOUBANGO is distributed in the hope that it will be useful,
|
||||
//* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
//* GNU General Public License for more details.
|
||||
//*
|
||||
//* You should have received a copy of the GNU General Public License
|
||||
//* along with DOUBANGO.
|
||||
//*
|
||||
//*/
|
||||
//
|
||||
///**@file tsip_dialog_subscribe.sm.
|
||||
// * @brief SIP dialog SUBSCRIBE (RFC 2543).
|
||||
// *
|
||||
// * @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
// *
|
||||
// * @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
// */
|
||||
//
|
||||
//
|
||||
//
|
||||
//#include <assert.h>
|
||||
//#include "tinysip/dialogs/tsip_dialog_subscribe.h"
|
||||
//#include "tsk_debug.h"
|
||||
//#include "tinySIP/smc/tsip_dialog_subscribe_sm.h"
|
||||
//
|
||||
//#define getOwner(fsm) \
|
||||
// (fsm)->_owner
|
||||
//
|
||||
//#define POPULATE_STATE(state) \
|
||||
// state##_Entry, \
|
||||
// state##_sm_1xx, \
|
||||
// state##_sm_2xx, \
|
||||
// state##_sm_300_to_699, \
|
||||
// state##_sm_401_407_421_494, \
|
||||
// state##_sm_423, \
|
||||
// state##_sm_NOTIFY, \
|
||||
// state##_sm_cancel, \
|
||||
// state##_sm_error, \
|
||||
// state##_sm_hangup, \
|
||||
// state##_sm_refresh, \
|
||||
// state##_sm_send, \
|
||||
// state##_sm_transportError, \
|
||||
// state##_sm_unsubscribe, \
|
||||
// state##_Default
|
||||
//
|
||||
//#define ENTRY_STATE(state) \
|
||||
// if ((state)->Entry != NULL) { \
|
||||
// (state)->Entry(fsm); \
|
||||
// }
|
||||
//
|
||||
//#define EXIT_STATE(state)
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_1xx(struct tsip_dialog_subscribeContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_2xx(struct tsip_dialog_subscribeContext *fsm, int unsubscribeing, const tsip_response_t* response)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_300_to_699(struct tsip_dialog_subscribeContext *fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_401_407_421_494(struct tsip_dialog_subscribeContext *fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_423(struct tsip_dialog_subscribeContext *fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_NOTIFY(struct tsip_dialog_subscribeContext *fsm, int sterminated, const tsip_request_t* request)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_cancel(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_error(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_hangup(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_refresh(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_send(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_transportError(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_sm_unsubscribe(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// getState(fsm)->Default(fsm);
|
||||
//}
|
||||
//
|
||||
//static void tsip_dialog_subscribeState_Default(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// State_Default(fsm);
|
||||
//}
|
||||
//
|
||||
//#define tsip_dialog_subscribe_Started_sm_1xx tsip_dialog_subscribeState_sm_1xx
|
||||
//#define tsip_dialog_subscribe_Started_sm_2xx tsip_dialog_subscribeState_sm_2xx
|
||||
//#define tsip_dialog_subscribe_Started_sm_300_to_699 tsip_dialog_subscribeState_sm_300_to_699
|
||||
//#define tsip_dialog_subscribe_Started_sm_401_407_421_494 tsip_dialog_subscribeState_sm_401_407_421_494
|
||||
//#define tsip_dialog_subscribe_Started_sm_423 tsip_dialog_subscribeState_sm_423
|
||||
//#define tsip_dialog_subscribe_Started_sm_NOTIFY tsip_dialog_subscribeState_sm_NOTIFY
|
||||
//#define tsip_dialog_subscribe_Started_sm_cancel tsip_dialog_subscribeState_sm_cancel
|
||||
//#define tsip_dialog_subscribe_Started_sm_error tsip_dialog_subscribeState_sm_error
|
||||
//#define tsip_dialog_subscribe_Started_sm_hangup tsip_dialog_subscribeState_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Started_sm_refresh tsip_dialog_subscribeState_sm_refresh
|
||||
//#define tsip_dialog_subscribe_Started_sm_send tsip_dialog_subscribeState_sm_send
|
||||
//#define tsip_dialog_subscribe_Started_sm_transportError tsip_dialog_subscribeState_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Started_sm_unsubscribe tsip_dialog_subscribeState_sm_unsubscribe
|
||||
//#define tsip_dialog_subscribe_Started_Default tsip_dialog_subscribeState_Default
|
||||
//#define tsip_dialog_subscribe_Started_Entry NULL
|
||||
//#define tsip_dialog_subscribe_Started_Exit NULL
|
||||
//#define tsip_dialog_subscribe_Trying_sm_1xx tsip_dialog_subscribeState_sm_1xx
|
||||
//#define tsip_dialog_subscribe_Trying_sm_2xx tsip_dialog_subscribeState_sm_2xx
|
||||
//#define tsip_dialog_subscribe_Trying_sm_300_to_699 tsip_dialog_subscribeState_sm_300_to_699
|
||||
//#define tsip_dialog_subscribe_Trying_sm_401_407_421_494 tsip_dialog_subscribeState_sm_401_407_421_494
|
||||
//#define tsip_dialog_subscribe_Trying_sm_423 tsip_dialog_subscribeState_sm_423
|
||||
//#define tsip_dialog_subscribe_Trying_sm_NOTIFY tsip_dialog_subscribeState_sm_NOTIFY
|
||||
//#define tsip_dialog_subscribe_Trying_sm_cancel tsip_dialog_subscribeState_sm_cancel
|
||||
//#define tsip_dialog_subscribe_Trying_sm_error tsip_dialog_subscribeState_sm_error
|
||||
//#define tsip_dialog_subscribe_Trying_sm_hangup tsip_dialog_subscribeState_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Trying_sm_refresh tsip_dialog_subscribeState_sm_refresh
|
||||
//#define tsip_dialog_subscribe_Trying_sm_send tsip_dialog_subscribeState_sm_send
|
||||
//#define tsip_dialog_subscribe_Trying_sm_transportError tsip_dialog_subscribeState_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Trying_sm_unsubscribe tsip_dialog_subscribeState_sm_unsubscribe
|
||||
//#define tsip_dialog_subscribe_Trying_Default tsip_dialog_subscribeState_Default
|
||||
//#define tsip_dialog_subscribe_Trying_Entry NULL
|
||||
//#define tsip_dialog_subscribe_Trying_Exit NULL
|
||||
//#define tsip_dialog_subscribe_Connected_sm_1xx tsip_dialog_subscribeState_sm_1xx
|
||||
//#define tsip_dialog_subscribe_Connected_sm_2xx tsip_dialog_subscribeState_sm_2xx
|
||||
//#define tsip_dialog_subscribe_Connected_sm_300_to_699 tsip_dialog_subscribeState_sm_300_to_699
|
||||
//#define tsip_dialog_subscribe_Connected_sm_401_407_421_494 tsip_dialog_subscribeState_sm_401_407_421_494
|
||||
//#define tsip_dialog_subscribe_Connected_sm_423 tsip_dialog_subscribeState_sm_423
|
||||
//#define tsip_dialog_subscribe_Connected_sm_NOTIFY tsip_dialog_subscribeState_sm_NOTIFY
|
||||
//#define tsip_dialog_subscribe_Connected_sm_cancel tsip_dialog_subscribeState_sm_cancel
|
||||
//#define tsip_dialog_subscribe_Connected_sm_error tsip_dialog_subscribeState_sm_error
|
||||
//#define tsip_dialog_subscribe_Connected_sm_hangup tsip_dialog_subscribeState_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Connected_sm_refresh tsip_dialog_subscribeState_sm_refresh
|
||||
//#define tsip_dialog_subscribe_Connected_sm_send tsip_dialog_subscribeState_sm_send
|
||||
//#define tsip_dialog_subscribe_Connected_sm_transportError tsip_dialog_subscribeState_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Connected_sm_unsubscribe tsip_dialog_subscribeState_sm_unsubscribe
|
||||
//#define tsip_dialog_subscribe_Connected_Default tsip_dialog_subscribeState_Default
|
||||
//#define tsip_dialog_subscribe_Connected_Entry NULL
|
||||
//#define tsip_dialog_subscribe_Connected_Exit NULL
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_1xx tsip_dialog_subscribeState_sm_1xx
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_2xx tsip_dialog_subscribeState_sm_2xx
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_300_to_699 tsip_dialog_subscribeState_sm_300_to_699
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_401_407_421_494 tsip_dialog_subscribeState_sm_401_407_421_494
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_423 tsip_dialog_subscribeState_sm_423
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_NOTIFY tsip_dialog_subscribeState_sm_NOTIFY
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_cancel tsip_dialog_subscribeState_sm_cancel
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_error tsip_dialog_subscribeState_sm_error
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_hangup tsip_dialog_subscribeState_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_refresh tsip_dialog_subscribeState_sm_refresh
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_send tsip_dialog_subscribeState_sm_send
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_transportError tsip_dialog_subscribeState_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_unsubscribe tsip_dialog_subscribeState_sm_unsubscribe
|
||||
//#define tsip_dialog_subscribe_Terminated_Default tsip_dialog_subscribeState_Default
|
||||
//#define tsip_dialog_subscribe_Terminated_Entry NULL
|
||||
//#define tsip_dialog_subscribe_Terminated_Exit NULL
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_1xx tsip_dialog_subscribeState_sm_1xx
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_2xx tsip_dialog_subscribeState_sm_2xx
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_300_to_699 tsip_dialog_subscribeState_sm_300_to_699
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_401_407_421_494 tsip_dialog_subscribeState_sm_401_407_421_494
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_423 tsip_dialog_subscribeState_sm_423
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_NOTIFY tsip_dialog_subscribeState_sm_NOTIFY
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_cancel tsip_dialog_subscribeState_sm_cancel
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_error tsip_dialog_subscribeState_sm_error
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_hangup tsip_dialog_subscribeState_sm_hangup
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_refresh tsip_dialog_subscribeState_sm_refresh
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_send tsip_dialog_subscribeState_sm_send
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_transportError tsip_dialog_subscribeState_sm_transportError
|
||||
//#define tsip_dialog_subscribe_DefaultState_sm_unsubscribe tsip_dialog_subscribeState_sm_unsubscribe
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Started_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Started_sm_hangup tsip_dialog_subscribe_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Trying_sm_hangup tsip_dialog_subscribe_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_subscribe_Connected_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Connected_sm_hangup tsip_dialog_subscribe_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_subscribe_Terminated_sm_hangup
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_hangup tsip_dialog_subscribe_DefaultState_sm_hangup
|
||||
//#undef tsip_dialog_subscribe_DefaultState_sm_hangup
|
||||
//static void tsip_dialog_subscribe_DefaultState_sm_hangup(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Any_2_Trying_X_hangup(ctxt);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Started_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Started_sm_transportError tsip_dialog_subscribe_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Trying_sm_transportError tsip_dialog_subscribe_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_subscribe_Connected_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Connected_sm_transportError tsip_dialog_subscribe_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_subscribe_Terminated_sm_transportError
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_transportError tsip_dialog_subscribe_DefaultState_sm_transportError
|
||||
//#undef tsip_dialog_subscribe_DefaultState_sm_transportError
|
||||
//static void tsip_dialog_subscribe_DefaultState_sm_transportError(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Any_2_Terminated_X_transportError(ctxt);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Started_sm_error
|
||||
//#define tsip_dialog_subscribe_Started_sm_error tsip_dialog_subscribe_DefaultState_sm_error
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_error
|
||||
//#define tsip_dialog_subscribe_Trying_sm_error tsip_dialog_subscribe_DefaultState_sm_error
|
||||
//#undef tsip_dialog_subscribe_Connected_sm_error
|
||||
//#define tsip_dialog_subscribe_Connected_sm_error tsip_dialog_subscribe_DefaultState_sm_error
|
||||
//#undef tsip_dialog_subscribe_Terminated_sm_error
|
||||
//#define tsip_dialog_subscribe_Terminated_sm_error tsip_dialog_subscribe_DefaultState_sm_error
|
||||
//#undef tsip_dialog_subscribe_DefaultState_sm_error
|
||||
//static void tsip_dialog_subscribe_DefaultState_sm_error(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// setState(fsm, &tsip_dialog_subscribe_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Started_Default
|
||||
//#define tsip_dialog_subscribe_Started_Default tsip_dialog_subscribe_DefaultState_Default
|
||||
//#undef tsip_dialog_subscribe_Trying_Default
|
||||
//#define tsip_dialog_subscribe_Trying_Default tsip_dialog_subscribe_DefaultState_Default
|
||||
//#undef tsip_dialog_subscribe_Connected_Default
|
||||
//#define tsip_dialog_subscribe_Connected_Default tsip_dialog_subscribe_DefaultState_Default
|
||||
//#undef tsip_dialog_subscribe_Terminated_Default
|
||||
//#define tsip_dialog_subscribe_Terminated_Default tsip_dialog_subscribe_DefaultState_Default
|
||||
//#undef tsip_dialog_subscribe_DefaultState_Default
|
||||
//static void tsip_dialog_subscribe_DefaultState_Default(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Started_Default
|
||||
//static void tsip_dialog_subscribe_Started_Default(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Started_sm_send
|
||||
//static void tsip_dialog_subscribe_Started_sm_send(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Started_2_Trying_X_send(ctxt);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Started = { POPULATE_STATE(tsip_dialog_subscribe_Started), "tsip_dialog_subscribe_Started", 0 };
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_Default
|
||||
//static void tsip_dialog_subscribe_Trying_Default(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_1xx
|
||||
//static void tsip_dialog_subscribe_Trying_sm_1xx(struct tsip_dialog_subscribeContext *fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_subscribeState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Trying_X_1xx(ctxt, msg);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_2xx
|
||||
//static void tsip_dialog_subscribe_Trying_sm_2xx(struct tsip_dialog_subscribeContext *fsm, int unsubscribeing, const tsip_response_t* response)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// if (unsubscribeing) {
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Terminated_X_2xx(ctxt, response);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
// }
|
||||
// else if (!unsubscribeing) {
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Connected_X_2xx(ctxt, response);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Connected);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
// } else {
|
||||
// tsip_dialog_subscribe_DefaultState_sm_2xx(fsm, unsubscribeing, response);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_300_to_699
|
||||
//static void tsip_dialog_subscribe_Trying_sm_300_to_699(struct tsip_dialog_subscribeContext *fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699(ctxt, response);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_401_407_421_494
|
||||
//static void tsip_dialog_subscribe_Trying_sm_401_407_421_494(struct tsip_dialog_subscribeContext *fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_subscribeState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494(ctxt, response);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_423
|
||||
//static void tsip_dialog_subscribe_Trying_sm_423(struct tsip_dialog_subscribeContext *fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_subscribeState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Trying_X_423(ctxt, response);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_NOTIFY
|
||||
//static void tsip_dialog_subscribe_Trying_sm_NOTIFY(struct tsip_dialog_subscribeContext *fsm, int sterminated, const tsip_request_t* request)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
// const struct tsip_dialog_subscribeState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY(ctxt, request);
|
||||
// setState(fsm, EndStateName);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Trying_sm_cancel
|
||||
//static void tsip_dialog_subscribe_Trying_sm_cancel(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Trying_2_Terminated_X_cancel(ctxt);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Trying = { POPULATE_STATE(tsip_dialog_subscribe_Trying), "tsip_dialog_subscribe_Trying", 1 };
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Connected_Default
|
||||
//static void tsip_dialog_subscribe_Connected_Default(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Connected_sm_NOTIFY
|
||||
//static void tsip_dialog_subscribe_Connected_sm_NOTIFY(struct tsip_dialog_subscribeContext *fsm, int sterminated, const tsip_request_t* request)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// if (!sterminated) {
|
||||
// const struct tsip_dialog_subscribeState* EndStateName = getState(fsm);
|
||||
//
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY(ctxt, request);
|
||||
// setState(fsm, EndStateName);
|
||||
// }
|
||||
// else if (sterminated) {
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY(ctxt, request);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Terminated);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
// } else {
|
||||
// tsip_dialog_subscribe_DefaultState_sm_NOTIFY(fsm, sterminated, request);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Connected_sm_refresh
|
||||
//static void tsip_dialog_subscribe_Connected_sm_refresh(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Connected_2_Trying_X_refresh(ctxt);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Connected_sm_unsubscribe
|
||||
//static void tsip_dialog_subscribe_Connected_sm_unsubscribe(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe* ctxt = getOwner(fsm);
|
||||
//
|
||||
// EXIT_STATE(getState(fsm));
|
||||
// clearState(fsm);
|
||||
// tsip_dialog_subscribe_Connected_2_Trying_X_unsubscribe(ctxt);
|
||||
// setState(fsm, &tsip_dialog_subscribe_Trying);
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Connected = { POPULATE_STATE(tsip_dialog_subscribe_Connected), "tsip_dialog_subscribe_Connected", 2 };
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Terminated_Entry
|
||||
//void tsip_dialog_subscribe_Terminated_Entry(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
// struct tsip_dialog_subscribe *ctxt = getOwner(fsm);
|
||||
//
|
||||
// tsip_dialog_subscribe_OnTerminated(ctxt);
|
||||
//}
|
||||
//
|
||||
//#undef tsip_dialog_subscribe_Terminated_Default
|
||||
//static void tsip_dialog_subscribe_Terminated_Default(struct tsip_dialog_subscribeContext *fsm)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//const struct tsip_dialog_subscribeState tsip_dialog_subscribe_Terminated = { POPULATE_STATE(tsip_dialog_subscribe_Terminated), "tsip_dialog_subscribe_Terminated", 3 };
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_Init(struct tsip_dialog_subscribeContext* fsm, struct tsip_dialog_subscribe* owner)
|
||||
//{
|
||||
// FSM_INIT(fsm, &tsip_dialog_subscribe_Started);
|
||||
// fsm->_owner = owner;
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_EnterStartState(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// ENTRY_STATE(getState(fsm));
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_1xx(struct tsip_dialog_subscribeContext* fsm, const tsip_message_t* msg)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_1xx");
|
||||
// state->sm_1xx(fsm, msg);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_2xx(struct tsip_dialog_subscribeContext* fsm, int unsubscribeing, const tsip_response_t* response)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_2xx");
|
||||
// state->sm_2xx(fsm, unsubscribeing, response);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_300_to_699(struct tsip_dialog_subscribeContext* fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_300_to_699");
|
||||
// state->sm_300_to_699(fsm, response);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_401_407_421_494(struct tsip_dialog_subscribeContext* fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_401_407_421_494");
|
||||
// state->sm_401_407_421_494(fsm, response);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_423(struct tsip_dialog_subscribeContext* fsm, const tsip_response_t* response)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_423");
|
||||
// state->sm_423(fsm, response);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_NOTIFY(struct tsip_dialog_subscribeContext* fsm, int sterminated, const tsip_request_t* request)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_NOTIFY");
|
||||
// state->sm_NOTIFY(fsm, sterminated, request);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_cancel(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_cancel");
|
||||
// state->sm_cancel(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_error(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_error");
|
||||
// state->sm_error(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_hangup(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_hangup");
|
||||
// state->sm_hangup(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_refresh(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_refresh");
|
||||
// state->sm_refresh(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_send(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_send");
|
||||
// state->sm_send(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_transportError(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_transportError");
|
||||
// state->sm_transportError(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
//void tsip_dialog_subscribeContext_sm_unsubscribe(struct tsip_dialog_subscribeContext* fsm)
|
||||
//{
|
||||
// const struct tsip_dialog_subscribeState* state = getState(fsm);
|
||||
//
|
||||
// assert(state != NULL);
|
||||
// setTransition(fsm, "sm_unsubscribe");
|
||||
// state->sm_unsubscribe(fsm);
|
||||
// setTransition(fsm, NULL);
|
||||
//}
|
||||
//
|
||||
///*
|
||||
// * Local variables:
|
||||
// * buffer-read-only: t
|
||||
// * End:
|
||||
// */
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_ict.sm
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_ict.c
|
||||
* @brief SIP INVITE Client Transaction as per RFC 3261 subclause 17.1.1.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include "tinysip/transactions/tsip_transac_ict.h"
|
||||
#include "tinysip/smc/tsip_transac_ict_sm.h"
|
||||
|
||||
#define getOwner(fsm) \
|
||||
(fsm)->_owner
|
||||
|
||||
#define POPULATE_STATE(state) \
|
||||
state##_Default
|
||||
|
||||
#define ENTRY_STATE(state)
|
||||
|
||||
#define EXIT_STATE(state)
|
||||
|
||||
static void tsip_transac_ictState_Default(struct tsip_transac_ictContext *fsm)
|
||||
{
|
||||
State_Default(fsm);
|
||||
}
|
||||
|
||||
#define tsip_transac_ict_Started_Default tsip_transac_ictState_Default
|
||||
#define tsip_transac_ict_Started_Entry NULL
|
||||
#define tsip_transac_ict_Started_Exit NULL
|
||||
|
||||
const struct tsip_transac_ictState tsip_transac_ict_Started = { POPULATE_STATE(tsip_transac_ict_Started), "tsip_transac_ict_Started", 0 };
|
||||
|
||||
void tsip_transac_ictContext_Init(struct tsip_transac_ictContext* fsm, struct tsip_transac_ict* owner)
|
||||
{
|
||||
FSM_INIT(fsm, &tsip_transac_ict_Started);
|
||||
fsm->_owner = owner;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_ist.sm
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_ist.sm
|
||||
* @brief SIP INVITE Server Transaction as per RFC 3261 subclause 17.2.1.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include "tinysip/transactions/tsip_transac_ist.h"
|
||||
#include "tinysip/smc/tsip_transac_ist_sm.h"
|
||||
|
||||
#define getOwner(fsm) \
|
||||
(fsm)->_owner
|
||||
|
||||
#define POPULATE_STATE(state) \
|
||||
state##_Default
|
||||
|
||||
#define ENTRY_STATE(state)
|
||||
|
||||
#define EXIT_STATE(state)
|
||||
|
||||
static void tsip_transac_istState_Default(struct tsip_transac_istContext *fsm)
|
||||
{
|
||||
State_Default(fsm);
|
||||
}
|
||||
|
||||
#define tsip_transac_ist_Started_Default tsip_transac_istState_Default
|
||||
#define tsip_transac_ist_Started_Entry NULL
|
||||
#define tsip_transac_ist_Started_Exit NULL
|
||||
|
||||
const struct tsip_transac_istState tsip_transac_ist_Started = { POPULATE_STATE(tsip_transac_ist_Started), "tsip_transac_ist_Started", 0 };
|
||||
|
||||
void tsip_transac_istContext_Init(struct tsip_transac_istContext* fsm, struct tsip_transac_ist* owner)
|
||||
{
|
||||
FSM_INIT(fsm, &tsip_transac_ist_Started);
|
||||
fsm->_owner = owner;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,445 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_nict.sm
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_nict.sm
|
||||
* @brief SIP Non-INVITE Client Transaction as per RFC 3261 subcaluse 17.1.2.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include "tinysip/transactions/tsip_transac_nict.h"
|
||||
#include "tinysip/smc/tsip_transac_nict_sm.h"
|
||||
|
||||
#define getOwner(fsm) \
|
||||
(fsm)->_owner
|
||||
|
||||
#define POPULATE_STATE(state) \
|
||||
state##_Entry, \
|
||||
state##_sm_1xx, \
|
||||
state##_sm_200_to_699, \
|
||||
state##_sm_send, \
|
||||
state##_sm_timerE, \
|
||||
state##_sm_timerF, \
|
||||
state##_sm_timerK, \
|
||||
state##_sm_transportError, \
|
||||
state##_Default
|
||||
|
||||
#define ENTRY_STATE(state) \
|
||||
if ((state)->Entry != NULL) { \
|
||||
(state)->Entry(fsm); \
|
||||
}
|
||||
|
||||
#define EXIT_STATE(state)
|
||||
|
||||
static void tsip_transac_nictState_sm_1xx(struct tsip_transac_nictContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_sm_200_to_699(struct tsip_transac_nictContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_sm_send(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_sm_timerE(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_sm_timerF(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_sm_timerK(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_sm_transportError(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nictState_Default(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
State_Default(fsm);
|
||||
}
|
||||
|
||||
#define tsip_transac_nict_Started_sm_1xx tsip_transac_nictState_sm_1xx
|
||||
#define tsip_transac_nict_Started_sm_200_to_699 tsip_transac_nictState_sm_200_to_699
|
||||
#define tsip_transac_nict_Started_sm_send tsip_transac_nictState_sm_send
|
||||
#define tsip_transac_nict_Started_sm_timerE tsip_transac_nictState_sm_timerE
|
||||
#define tsip_transac_nict_Started_sm_timerF tsip_transac_nictState_sm_timerF
|
||||
#define tsip_transac_nict_Started_sm_timerK tsip_transac_nictState_sm_timerK
|
||||
#define tsip_transac_nict_Started_sm_transportError tsip_transac_nictState_sm_transportError
|
||||
#define tsip_transac_nict_Started_Default tsip_transac_nictState_Default
|
||||
#define tsip_transac_nict_Started_Entry NULL
|
||||
#define tsip_transac_nict_Started_Exit NULL
|
||||
#define tsip_transac_nict_Trying_sm_1xx tsip_transac_nictState_sm_1xx
|
||||
#define tsip_transac_nict_Trying_sm_200_to_699 tsip_transac_nictState_sm_200_to_699
|
||||
#define tsip_transac_nict_Trying_sm_send tsip_transac_nictState_sm_send
|
||||
#define tsip_transac_nict_Trying_sm_timerE tsip_transac_nictState_sm_timerE
|
||||
#define tsip_transac_nict_Trying_sm_timerF tsip_transac_nictState_sm_timerF
|
||||
#define tsip_transac_nict_Trying_sm_timerK tsip_transac_nictState_sm_timerK
|
||||
#define tsip_transac_nict_Trying_sm_transportError tsip_transac_nictState_sm_transportError
|
||||
#define tsip_transac_nict_Trying_Default tsip_transac_nictState_Default
|
||||
#define tsip_transac_nict_Trying_Entry NULL
|
||||
#define tsip_transac_nict_Trying_Exit NULL
|
||||
#define tsip_transac_nict_Proceeding_sm_1xx tsip_transac_nictState_sm_1xx
|
||||
#define tsip_transac_nict_Proceeding_sm_200_to_699 tsip_transac_nictState_sm_200_to_699
|
||||
#define tsip_transac_nict_Proceeding_sm_send tsip_transac_nictState_sm_send
|
||||
#define tsip_transac_nict_Proceeding_sm_timerE tsip_transac_nictState_sm_timerE
|
||||
#define tsip_transac_nict_Proceeding_sm_timerF tsip_transac_nictState_sm_timerF
|
||||
#define tsip_transac_nict_Proceeding_sm_timerK tsip_transac_nictState_sm_timerK
|
||||
#define tsip_transac_nict_Proceeding_sm_transportError tsip_transac_nictState_sm_transportError
|
||||
#define tsip_transac_nict_Proceeding_Default tsip_transac_nictState_Default
|
||||
#define tsip_transac_nict_Proceeding_Entry NULL
|
||||
#define tsip_transac_nict_Proceeding_Exit NULL
|
||||
#define tsip_transac_nict_Completed_sm_1xx tsip_transac_nictState_sm_1xx
|
||||
#define tsip_transac_nict_Completed_sm_200_to_699 tsip_transac_nictState_sm_200_to_699
|
||||
#define tsip_transac_nict_Completed_sm_send tsip_transac_nictState_sm_send
|
||||
#define tsip_transac_nict_Completed_sm_timerE tsip_transac_nictState_sm_timerE
|
||||
#define tsip_transac_nict_Completed_sm_timerF tsip_transac_nictState_sm_timerF
|
||||
#define tsip_transac_nict_Completed_sm_timerK tsip_transac_nictState_sm_timerK
|
||||
#define tsip_transac_nict_Completed_sm_transportError tsip_transac_nictState_sm_transportError
|
||||
#define tsip_transac_nict_Completed_Default tsip_transac_nictState_Default
|
||||
#define tsip_transac_nict_Completed_Entry NULL
|
||||
#define tsip_transac_nict_Completed_Exit NULL
|
||||
#define tsip_transac_nict_Terminated_sm_1xx tsip_transac_nictState_sm_1xx
|
||||
#define tsip_transac_nict_Terminated_sm_200_to_699 tsip_transac_nictState_sm_200_to_699
|
||||
#define tsip_transac_nict_Terminated_sm_send tsip_transac_nictState_sm_send
|
||||
#define tsip_transac_nict_Terminated_sm_timerE tsip_transac_nictState_sm_timerE
|
||||
#define tsip_transac_nict_Terminated_sm_timerF tsip_transac_nictState_sm_timerF
|
||||
#define tsip_transac_nict_Terminated_sm_timerK tsip_transac_nictState_sm_timerK
|
||||
#define tsip_transac_nict_Terminated_sm_transportError tsip_transac_nictState_sm_transportError
|
||||
#define tsip_transac_nict_Terminated_Default tsip_transac_nictState_Default
|
||||
#define tsip_transac_nict_Terminated_Entry NULL
|
||||
#define tsip_transac_nict_Terminated_Exit NULL
|
||||
#define tsip_transac_nict_DefaultState_sm_1xx tsip_transac_nictState_sm_1xx
|
||||
#define tsip_transac_nict_DefaultState_sm_200_to_699 tsip_transac_nictState_sm_200_to_699
|
||||
#define tsip_transac_nict_DefaultState_sm_send tsip_transac_nictState_sm_send
|
||||
#define tsip_transac_nict_DefaultState_sm_timerE tsip_transac_nictState_sm_timerE
|
||||
#define tsip_transac_nict_DefaultState_sm_timerF tsip_transac_nictState_sm_timerF
|
||||
#define tsip_transac_nict_DefaultState_sm_timerK tsip_transac_nictState_sm_timerK
|
||||
#define tsip_transac_nict_DefaultState_sm_transportError tsip_transac_nictState_sm_transportError
|
||||
|
||||
#undef tsip_transac_nict_Started_sm_transportError
|
||||
#define tsip_transac_nict_Started_sm_transportError tsip_transac_nict_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nict_Trying_sm_transportError
|
||||
#define tsip_transac_nict_Trying_sm_transportError tsip_transac_nict_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nict_Proceeding_sm_transportError
|
||||
#define tsip_transac_nict_Proceeding_sm_transportError tsip_transac_nict_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nict_Completed_sm_transportError
|
||||
#define tsip_transac_nict_Completed_sm_transportError tsip_transac_nict_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nict_Terminated_sm_transportError
|
||||
#define tsip_transac_nict_Terminated_sm_transportError tsip_transac_nict_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nict_DefaultState_sm_transportError
|
||||
static void tsip_transac_nict_DefaultState_sm_transportError(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Any_2_Terminated_X_transportError(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Started_Default
|
||||
#define tsip_transac_nict_Started_Default tsip_transac_nict_DefaultState_Default
|
||||
#undef tsip_transac_nict_Trying_Default
|
||||
#define tsip_transac_nict_Trying_Default tsip_transac_nict_DefaultState_Default
|
||||
#undef tsip_transac_nict_Proceeding_Default
|
||||
#define tsip_transac_nict_Proceeding_Default tsip_transac_nict_DefaultState_Default
|
||||
#undef tsip_transac_nict_Completed_Default
|
||||
#define tsip_transac_nict_Completed_Default tsip_transac_nict_DefaultState_Default
|
||||
#undef tsip_transac_nict_Terminated_Default
|
||||
#define tsip_transac_nict_Terminated_Default tsip_transac_nict_DefaultState_Default
|
||||
#undef tsip_transac_nict_DefaultState_Default
|
||||
static void tsip_transac_nict_DefaultState_Default(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Started_sm_send
|
||||
static void tsip_transac_nict_Started_sm_send(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Started_2_Trying_X_send(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Trying);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nictState tsip_transac_nict_Started = { POPULATE_STATE(tsip_transac_nict_Started), "tsip_transac_nict_Started", 0 };
|
||||
|
||||
#undef tsip_transac_nict_Trying_sm_1xx
|
||||
static void tsip_transac_nict_Trying_sm_1xx(struct tsip_transac_nictContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Trying_2_Proceedding_X_1xx(ctxt, msg);
|
||||
setState(fsm, &tsip_transac_nict_Proceeding);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Trying_sm_200_to_699
|
||||
static void tsip_transac_nict_Trying_sm_200_to_699(struct tsip_transac_nictContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Trying_2_Completed_X_200_to_699(ctxt, msg);
|
||||
setState(fsm, &tsip_transac_nict_Completed);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Trying_sm_timerE
|
||||
static void tsip_transac_nict_Trying_sm_timerE(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
const struct tsip_transac_nictState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Trying_2_Trying_X_timerE(ctxt);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Trying_sm_timerF
|
||||
static void tsip_transac_nict_Trying_sm_timerF(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Trying_2_Terminated_X_timerF(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Trying_sm_transportError
|
||||
static void tsip_transac_nict_Trying_sm_transportError(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Trying_2_Terminated_X_transportError(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nictState tsip_transac_nict_Trying = { POPULATE_STATE(tsip_transac_nict_Trying), "tsip_transac_nict_Trying", 1 };
|
||||
|
||||
#undef tsip_transac_nict_Proceeding_sm_1xx
|
||||
static void tsip_transac_nict_Proceeding_sm_1xx(struct tsip_transac_nictContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
const struct tsip_transac_nictState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(ctxt, msg);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Proceeding_sm_200_to_699
|
||||
static void tsip_transac_nict_Proceeding_sm_200_to_699(struct tsip_transac_nictContext *fsm, const tsip_message_t* msg)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(ctxt, msg);
|
||||
setState(fsm, &tsip_transac_nict_Completed);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Proceeding_sm_timerE
|
||||
static void tsip_transac_nict_Proceeding_sm_timerE(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
const struct tsip_transac_nictState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(ctxt);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Proceeding_sm_timerF
|
||||
static void tsip_transac_nict_Proceeding_sm_timerF(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Proceeding_2_Terminated_X_timerF(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nict_Proceeding_sm_transportError
|
||||
static void tsip_transac_nict_Proceeding_sm_transportError(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Proceeding_2_Terminated_X_transportError(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nictState tsip_transac_nict_Proceeding = { POPULATE_STATE(tsip_transac_nict_Proceeding), "tsip_transac_nict_Proceeding", 2 };
|
||||
|
||||
#undef tsip_transac_nict_Completed_sm_timerK
|
||||
static void tsip_transac_nict_Completed_sm_timerK(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nict_Completed_2_Terminated_X_timerK(ctxt);
|
||||
setState(fsm, &tsip_transac_nict_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nictState tsip_transac_nict_Completed = { POPULATE_STATE(tsip_transac_nict_Completed), "tsip_transac_nict_Completed", 3 };
|
||||
|
||||
#undef tsip_transac_nict_Terminated_Entry
|
||||
void tsip_transac_nict_Terminated_Entry(struct tsip_transac_nictContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nict *ctxt = getOwner(fsm);
|
||||
|
||||
tsip_transac_nict_OnTerminated(ctxt);
|
||||
}
|
||||
|
||||
const struct tsip_transac_nictState tsip_transac_nict_Terminated = { POPULATE_STATE(tsip_transac_nict_Terminated), "tsip_transac_nict_Terminated", 4 };
|
||||
|
||||
void tsip_transac_nictContext_Init(struct tsip_transac_nictContext* fsm, struct tsip_transac_nict* owner)
|
||||
{
|
||||
FSM_INIT(fsm, &tsip_transac_nict_Started);
|
||||
fsm->_owner = owner;
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_EnterStartState(struct tsip_transac_nictContext* fsm)
|
||||
{
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_1xx(struct tsip_transac_nictContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_1xx");
|
||||
state->sm_1xx(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_200_to_699(struct tsip_transac_nictContext* fsm, const tsip_message_t* msg)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_200_to_699");
|
||||
state->sm_200_to_699(fsm, msg);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_send(struct tsip_transac_nictContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_send");
|
||||
state->sm_send(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_timerE(struct tsip_transac_nictContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_timerE");
|
||||
state->sm_timerE(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_timerF(struct tsip_transac_nictContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_timerF");
|
||||
state->sm_timerF(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_timerK(struct tsip_transac_nictContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_timerK");
|
||||
state->sm_timerK(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nictContext_sm_transportError(struct tsip_transac_nictContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nictState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_transportError");
|
||||
state->sm_transportError(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -1,353 +0,0 @@
|
|||
/*
|
||||
* ex: set ro:
|
||||
* DO NOT EDIT.
|
||||
* generated by smc (http://smc.sourceforge.net/)
|
||||
* from file : tsip_transac_nist.sm
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tsip_transac_nist.sm
|
||||
* @brief SIP Non-INVITE Server Transaction as per RFC 3261 subclause 17.2.2.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include "tinysip/transactions/tsip_transac_nist.h"
|
||||
#include "tinysip/smc/tsip_transac_nist_sm.h"
|
||||
|
||||
#define getOwner(fsm) \
|
||||
(fsm)->_owner
|
||||
|
||||
#define POPULATE_STATE(state) \
|
||||
state##_Entry, \
|
||||
state##_sm_request, \
|
||||
state##_sm_send_1xx, \
|
||||
state##_sm_send_200_to_699, \
|
||||
state##_sm_timerJ, \
|
||||
state##_sm_transportError, \
|
||||
state##_Default
|
||||
|
||||
#define ENTRY_STATE(state) \
|
||||
if ((state)->Entry != NULL) { \
|
||||
(state)->Entry(fsm); \
|
||||
}
|
||||
|
||||
#define EXIT_STATE(state)
|
||||
|
||||
static void tsip_transac_nistState_sm_request(struct tsip_transac_nistContext *fsm, const tsip_request_t* request)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nistState_sm_send_1xx(struct tsip_transac_nistContext *fsm, const tsip_response_t* response)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nistState_sm_send_200_to_699(struct tsip_transac_nistContext *fsm, const tsip_response_t* response)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nistState_sm_timerJ(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nistState_sm_transportError(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
getState(fsm)->Default(fsm);
|
||||
}
|
||||
|
||||
static void tsip_transac_nistState_Default(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
State_Default(fsm);
|
||||
}
|
||||
|
||||
#define tsip_transac_nist_Started_sm_request tsip_transac_nistState_sm_request
|
||||
#define tsip_transac_nist_Started_sm_send_1xx tsip_transac_nistState_sm_send_1xx
|
||||
#define tsip_transac_nist_Started_sm_send_200_to_699 tsip_transac_nistState_sm_send_200_to_699
|
||||
#define tsip_transac_nist_Started_sm_timerJ tsip_transac_nistState_sm_timerJ
|
||||
#define tsip_transac_nist_Started_sm_transportError tsip_transac_nistState_sm_transportError
|
||||
#define tsip_transac_nist_Started_Default tsip_transac_nistState_Default
|
||||
#define tsip_transac_nist_Started_Entry NULL
|
||||
#define tsip_transac_nist_Started_Exit NULL
|
||||
#define tsip_transac_nist_Trying_sm_request tsip_transac_nistState_sm_request
|
||||
#define tsip_transac_nist_Trying_sm_send_1xx tsip_transac_nistState_sm_send_1xx
|
||||
#define tsip_transac_nist_Trying_sm_send_200_to_699 tsip_transac_nistState_sm_send_200_to_699
|
||||
#define tsip_transac_nist_Trying_sm_timerJ tsip_transac_nistState_sm_timerJ
|
||||
#define tsip_transac_nist_Trying_sm_transportError tsip_transac_nistState_sm_transportError
|
||||
#define tsip_transac_nist_Trying_Default tsip_transac_nistState_Default
|
||||
#define tsip_transac_nist_Trying_Entry NULL
|
||||
#define tsip_transac_nist_Trying_Exit NULL
|
||||
#define tsip_transac_nist_Proceeding_sm_request tsip_transac_nistState_sm_request
|
||||
#define tsip_transac_nist_Proceeding_sm_send_1xx tsip_transac_nistState_sm_send_1xx
|
||||
#define tsip_transac_nist_Proceeding_sm_send_200_to_699 tsip_transac_nistState_sm_send_200_to_699
|
||||
#define tsip_transac_nist_Proceeding_sm_timerJ tsip_transac_nistState_sm_timerJ
|
||||
#define tsip_transac_nist_Proceeding_sm_transportError tsip_transac_nistState_sm_transportError
|
||||
#define tsip_transac_nist_Proceeding_Default tsip_transac_nistState_Default
|
||||
#define tsip_transac_nist_Proceeding_Entry NULL
|
||||
#define tsip_transac_nist_Proceeding_Exit NULL
|
||||
#define tsip_transac_nist_Completed_sm_request tsip_transac_nistState_sm_request
|
||||
#define tsip_transac_nist_Completed_sm_send_1xx tsip_transac_nistState_sm_send_1xx
|
||||
#define tsip_transac_nist_Completed_sm_send_200_to_699 tsip_transac_nistState_sm_send_200_to_699
|
||||
#define tsip_transac_nist_Completed_sm_timerJ tsip_transac_nistState_sm_timerJ
|
||||
#define tsip_transac_nist_Completed_sm_transportError tsip_transac_nistState_sm_transportError
|
||||
#define tsip_transac_nist_Completed_Default tsip_transac_nistState_Default
|
||||
#define tsip_transac_nist_Completed_Entry NULL
|
||||
#define tsip_transac_nist_Completed_Exit NULL
|
||||
#define tsip_transac_nist_Terminated_sm_request tsip_transac_nistState_sm_request
|
||||
#define tsip_transac_nist_Terminated_sm_send_1xx tsip_transac_nistState_sm_send_1xx
|
||||
#define tsip_transac_nist_Terminated_sm_send_200_to_699 tsip_transac_nistState_sm_send_200_to_699
|
||||
#define tsip_transac_nist_Terminated_sm_timerJ tsip_transac_nistState_sm_timerJ
|
||||
#define tsip_transac_nist_Terminated_sm_transportError tsip_transac_nistState_sm_transportError
|
||||
#define tsip_transac_nist_Terminated_Default tsip_transac_nistState_Default
|
||||
#define tsip_transac_nist_Terminated_Entry NULL
|
||||
#define tsip_transac_nist_Terminated_Exit NULL
|
||||
#define tsip_transac_nist_DefaultState_sm_request tsip_transac_nistState_sm_request
|
||||
#define tsip_transac_nist_DefaultState_sm_send_1xx tsip_transac_nistState_sm_send_1xx
|
||||
#define tsip_transac_nist_DefaultState_sm_send_200_to_699 tsip_transac_nistState_sm_send_200_to_699
|
||||
#define tsip_transac_nist_DefaultState_sm_timerJ tsip_transac_nistState_sm_timerJ
|
||||
#define tsip_transac_nist_DefaultState_sm_transportError tsip_transac_nistState_sm_transportError
|
||||
|
||||
#undef tsip_transac_nist_Started_sm_transportError
|
||||
#define tsip_transac_nist_Started_sm_transportError tsip_transac_nist_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nist_Trying_sm_transportError
|
||||
#define tsip_transac_nist_Trying_sm_transportError tsip_transac_nist_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nist_Proceeding_sm_transportError
|
||||
#define tsip_transac_nist_Proceeding_sm_transportError tsip_transac_nist_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nist_Completed_sm_transportError
|
||||
#define tsip_transac_nist_Completed_sm_transportError tsip_transac_nist_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nist_Terminated_sm_transportError
|
||||
#define tsip_transac_nist_Terminated_sm_transportError tsip_transac_nist_DefaultState_sm_transportError
|
||||
#undef tsip_transac_nist_DefaultState_sm_transportError
|
||||
static void tsip_transac_nist_DefaultState_sm_transportError(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Any_2_Terminated_X_transportError(ctxt);
|
||||
setState(fsm, &tsip_transac_nist_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nist_Started_Default
|
||||
#define tsip_transac_nist_Started_Default tsip_transac_nist_DefaultState_Default
|
||||
#undef tsip_transac_nist_Trying_Default
|
||||
#define tsip_transac_nist_Trying_Default tsip_transac_nist_DefaultState_Default
|
||||
#undef tsip_transac_nist_Proceeding_Default
|
||||
#define tsip_transac_nist_Proceeding_Default tsip_transac_nist_DefaultState_Default
|
||||
#undef tsip_transac_nist_Completed_Default
|
||||
#define tsip_transac_nist_Completed_Default tsip_transac_nist_DefaultState_Default
|
||||
#undef tsip_transac_nist_Terminated_Default
|
||||
#define tsip_transac_nist_Terminated_Default tsip_transac_nist_DefaultState_Default
|
||||
#undef tsip_transac_nist_DefaultState_Default
|
||||
static void tsip_transac_nist_DefaultState_Default(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#undef tsip_transac_nist_Started_sm_request
|
||||
static void tsip_transac_nist_Started_sm_request(struct tsip_transac_nistContext *fsm, const tsip_request_t* request)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Started_2_Trying_X_request(ctxt, request);
|
||||
setState(fsm, &tsip_transac_nist_Trying);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nistState tsip_transac_nist_Started = { POPULATE_STATE(tsip_transac_nist_Started), "tsip_transac_nist_Started", 0 };
|
||||
|
||||
#undef tsip_transac_nist_Trying_sm_send_1xx
|
||||
static void tsip_transac_nist_Trying_sm_send_1xx(struct tsip_transac_nistContext *fsm, const tsip_response_t* response)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(ctxt, response);
|
||||
setState(fsm, &tsip_transac_nist_Proceeding);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
#undef tsip_transac_nist_Trying_sm_send_200_to_699
|
||||
static void tsip_transac_nist_Trying_sm_send_200_to_699(struct tsip_transac_nistContext *fsm, const tsip_response_t* response)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(ctxt, response);
|
||||
setState(fsm, &tsip_transac_nist_Completed);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nistState tsip_transac_nist_Trying = { POPULATE_STATE(tsip_transac_nist_Trying), "tsip_transac_nist_Trying", 1 };
|
||||
|
||||
#undef tsip_transac_nist_Proceeding_sm_request
|
||||
static void tsip_transac_nist_Proceeding_sm_request(struct tsip_transac_nistContext *fsm, const tsip_request_t* request)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
const struct tsip_transac_nistState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Proceeding_2_Proceeding_X_request(ctxt, request);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_transac_nist_Proceeding_sm_send_1xx
|
||||
static void tsip_transac_nist_Proceeding_sm_send_1xx(struct tsip_transac_nistContext *fsm, const tsip_response_t* response)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
const struct tsip_transac_nistState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(ctxt, response);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_transac_nist_Proceeding_sm_send_200_to_699
|
||||
static void tsip_transac_nist_Proceeding_sm_send_200_to_699(struct tsip_transac_nistContext *fsm, const tsip_response_t* response)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(ctxt, response);
|
||||
setState(fsm, &tsip_transac_nist_Completed);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nistState tsip_transac_nist_Proceeding = { POPULATE_STATE(tsip_transac_nist_Proceeding), "tsip_transac_nist_Proceeding", 2 };
|
||||
|
||||
#undef tsip_transac_nist_Completed_sm_request
|
||||
static void tsip_transac_nist_Completed_sm_request(struct tsip_transac_nistContext *fsm, const tsip_request_t* request)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
const struct tsip_transac_nistState* EndStateName = getState(fsm);
|
||||
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Completed_2_Completed_X_request(ctxt, request);
|
||||
setState(fsm, EndStateName);
|
||||
}
|
||||
|
||||
#undef tsip_transac_nist_Completed_sm_timerJ
|
||||
static void tsip_transac_nist_Completed_sm_timerJ(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nist* ctxt = getOwner(fsm);
|
||||
|
||||
EXIT_STATE(getState(fsm));
|
||||
clearState(fsm);
|
||||
tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(ctxt);
|
||||
setState(fsm, &tsip_transac_nist_Terminated);
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
const struct tsip_transac_nistState tsip_transac_nist_Completed = { POPULATE_STATE(tsip_transac_nist_Completed), "tsip_transac_nist_Completed", 3 };
|
||||
|
||||
#undef tsip_transac_nist_Terminated_Entry
|
||||
void tsip_transac_nist_Terminated_Entry(struct tsip_transac_nistContext *fsm)
|
||||
{
|
||||
struct tsip_transac_nist *ctxt = getOwner(fsm);
|
||||
|
||||
tsip_transac_nist_OnTerminated(ctxt);
|
||||
}
|
||||
|
||||
const struct tsip_transac_nistState tsip_transac_nist_Terminated = { POPULATE_STATE(tsip_transac_nist_Terminated), "tsip_transac_nist_Terminated", 4 };
|
||||
|
||||
void tsip_transac_nistContext_Init(struct tsip_transac_nistContext* fsm, struct tsip_transac_nist* owner)
|
||||
{
|
||||
FSM_INIT(fsm, &tsip_transac_nist_Started);
|
||||
fsm->_owner = owner;
|
||||
}
|
||||
|
||||
void tsip_transac_nistContext_EnterStartState(struct tsip_transac_nistContext* fsm)
|
||||
{
|
||||
ENTRY_STATE(getState(fsm));
|
||||
}
|
||||
|
||||
void tsip_transac_nistContext_sm_request(struct tsip_transac_nistContext* fsm, const tsip_request_t* request)
|
||||
{
|
||||
const struct tsip_transac_nistState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_request");
|
||||
state->sm_request(fsm, request);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nistContext_sm_send_1xx(struct tsip_transac_nistContext* fsm, const tsip_response_t* response)
|
||||
{
|
||||
const struct tsip_transac_nistState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_send_1xx");
|
||||
state->sm_send_1xx(fsm, response);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nistContext_sm_send_200_to_699(struct tsip_transac_nistContext* fsm, const tsip_response_t* response)
|
||||
{
|
||||
const struct tsip_transac_nistState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_send_200_to_699");
|
||||
state->sm_send_200_to_699(fsm, response);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nistContext_sm_timerJ(struct tsip_transac_nistContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nistState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_timerJ");
|
||||
state->sm_timerJ(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
void tsip_transac_nistContext_sm_transportError(struct tsip_transac_nistContext* fsm)
|
||||
{
|
||||
const struct tsip_transac_nistState* state = getState(fsm);
|
||||
|
||||
assert(state != NULL);
|
||||
setTransition(fsm, "sm_transportError");
|
||||
state->sm_transportError(fsm);
|
||||
setTransition(fsm, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* buffer-read-only: t
|
||||
* End:
|
||||
*/
|
|
@ -42,8 +42,6 @@ int tsip_transac_init(tsip_transac_t *self, const tsip_stack_handle_t * stack, t
|
|||
{
|
||||
if(self && !self->initialized)
|
||||
{
|
||||
tsk_safeobj_init(self);
|
||||
|
||||
self->stack = stack;
|
||||
self->timer_mgr = tsip_stack_get_timer_mgr(stack);
|
||||
self->type = type;
|
||||
|
@ -67,8 +65,6 @@ int tsip_transac_deinit(tsip_transac_t *self)
|
|||
TSK_FREE(self->cseq_method);
|
||||
TSK_FREE(self->callid);
|
||||
|
||||
tsk_safeobj_deinit(self);
|
||||
|
||||
self->initialized = 0;
|
||||
|
||||
return 0;
|
||||
|
@ -125,7 +121,7 @@ int tsip_transac_cmp(const tsip_transac_t *t1, const tsip_transac_t *t2)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int tsip_transac_remove_callback(const tsip_transac_t* self, tsk_timer_id_t timer_id)
|
||||
int tsip_transac_remove(const tsip_transac_t* self)
|
||||
{
|
||||
return tsip_transac_layer_remove(TSIP_STACK(self->stack)->layer_transac, TSIP_TRANSAC(self));
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
#include "tinysip/transactions/tsip_transac_ict.h"
|
||||
|
||||
void tsip_transac_ict_init(tsip_transac_ict_t *self)
|
||||
int tsip_transac_ict_init(tsip_transac_ict_t *self)
|
||||
{
|
||||
tsip_transac_ictContext_Init(&self->_fsm, self);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
#include "tinysip/transactions/tsip_transac_ist.h"
|
||||
|
||||
void tsip_transac_ist_init(tsip_transac_ist_t *self)
|
||||
int tsip_transac_ist_init(tsip_transac_ist_t *self)
|
||||
{
|
||||
tsip_transac_istContext_Init(&self->_fsm, self);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,53 @@
|
|||
|
||||
#define TRANSAC_NICT_TIMER_SCHEDULE(TX) TRANSAC_TIMER_SCHEDULE(nict, TX)
|
||||
|
||||
/* ======================== internal functions ======================== */
|
||||
int tsip_transac_nict_init(tsip_transac_nict_t *self);
|
||||
int tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self);
|
||||
|
||||
/* ======================== transitions ======================== */
|
||||
int tsip_transac_nict_Started_2_Trying_X_send(va_list *app);
|
||||
int tsip_transac_nict_Trying_2_Trying_X_timerE(va_list *app);
|
||||
int tsip_transac_nict_Trying_2_Terminated_X_timerF(va_list *app);
|
||||
int tsip_transac_nict_Trying_2_Terminated_X_transportError(va_list *app);
|
||||
int tsip_transac_nict_Trying_2_Proceedding_X_1xx(va_list *app);
|
||||
int tsip_transac_nict_Trying_2_Completed_X_200_to_699(va_list *app);
|
||||
int tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(va_list *app);
|
||||
int tsip_transac_nict_Proceeding_2_Terminated_X_timerF(va_list *app);
|
||||
int tsip_transac_nict_Proceeding_2_Terminated_X_transportError(va_list *app);
|
||||
int tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(va_list *app);
|
||||
int tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(va_list *app);
|
||||
int tsip_transac_nict_Completed_2_Terminated_X_timerK(va_list *app);
|
||||
int tsip_transac_nict_Any_2_Terminated_X_transportError(va_list *app);
|
||||
int tsip_transac_nict_Any_2_Terminated_X_Error(va_list *app);
|
||||
|
||||
/* ======================== conds ======================== */
|
||||
|
||||
/* ======================== actions ======================== */
|
||||
typedef enum _fsm_action_e
|
||||
{
|
||||
_fsm_action_send,
|
||||
_fsm_action_timerE,
|
||||
_fsm_action_timerF,
|
||||
_fsm_action_timerK,
|
||||
_fsm_action_1xx,
|
||||
_fsm_action_200_to_699,
|
||||
_fsm_action_transporterror,
|
||||
_fsm_action_error,
|
||||
}
|
||||
_fsm_action_t;
|
||||
|
||||
/* ======================== states ======================== */
|
||||
typedef enum _fsm_state_e
|
||||
{
|
||||
_fsm_state_Started,
|
||||
_fsm_state_Trying,
|
||||
_fsm_state_Proceeding,
|
||||
_fsm_state_Completed,
|
||||
_fsm_state_Terminated
|
||||
}
|
||||
_fsm_state_t;
|
||||
|
||||
|
||||
/**
|
||||
* @fn int tsip_transac_nict_event_callback(const void *arg, tsip_transac_event_type_t type,
|
||||
|
@ -97,8 +144,8 @@
|
|||
* @return Zero if succeed and no-zero error code otherwise.
|
||||
**/
|
||||
int tsip_transac_nict_event_callback(const tsip_transac_nict_t *self, tsip_transac_event_type_t type, const tsip_message_t *msg)
|
||||
{
|
||||
TSIP_TRANSAC_SYNC_BEGIN(self);
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
|
@ -108,11 +155,11 @@ int tsip_transac_nict_event_callback(const tsip_transac_nict_t *self, tsip_trans
|
|||
{
|
||||
if(TSIP_RESPONSE_IS_1XX(msg))
|
||||
{
|
||||
tsip_transac_nictContext_sm_1xx(&TSIP_TRANSAC_NICT(self)->_fsm, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_1xx, self, msg, self, msg);
|
||||
}
|
||||
else if(TSIP_RESPONSE_IS_23456(msg))
|
||||
{
|
||||
tsip_transac_nictContext_sm_200_to_699(&TSIP_TRANSAC_NICT(self)->_fsm, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_200_to_699, self, msg, self, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -123,34 +170,24 @@ int tsip_transac_nict_event_callback(const tsip_transac_nict_t *self, tsip_trans
|
|||
}
|
||||
|
||||
case tsip_transac_canceled:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_terminated:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_timedout:
|
||||
{
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case tsip_transac_error:
|
||||
{
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_error, self, msg, self, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_transport_error:
|
||||
{
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_transporterror, self, msg, self, msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TSIP_TRANSAC_SYNC_END(self);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int tsip_transac_nict_timer_callback(const tsip_transac_nict_t* self, tsk_timer_id_t timer_id)
|
||||
|
@ -159,32 +196,25 @@ int tsip_transac_nict_timer_callback(const tsip_transac_nict_t* self, tsk_timer_
|
|||
|
||||
if(self)
|
||||
{
|
||||
TSIP_TRANSAC_SYNC_BEGIN(self);
|
||||
|
||||
if(timer_id == self->timerE.id)
|
||||
{
|
||||
tsip_transac_nictContext_sm_timerE(&TSIP_TRANSAC_NICT(self)->_fsm);
|
||||
ret = 0;
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_timerE, self, TSK_NULL, self, TSK_NULL);
|
||||
}
|
||||
else if(timer_id == self->timerF.id)
|
||||
{
|
||||
tsip_transac_nictContext_sm_timerF(&TSIP_TRANSAC_NICT(self)->_fsm);
|
||||
ret = 0;
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_timerF, self, TSK_NULL, self, TSK_NULL);
|
||||
}
|
||||
else if(timer_id == self->timerK.id)
|
||||
{
|
||||
tsip_transac_nictContext_sm_timerK(&TSIP_TRANSAC_NICT(self)->_fsm);
|
||||
ret = 0;
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_timerK, self, TSK_NULL, self, TSK_NULL);
|
||||
}
|
||||
|
||||
TSIP_TRANSAC_SYNC_END(self);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn void tsip_transac_nict_init(tsip_transac_nict_t *self)
|
||||
* @fn int tsip_transac_nict_init(tsip_transac_nict_t *self)
|
||||
*
|
||||
* @brief Initializes the transaction.
|
||||
*
|
||||
|
@ -193,20 +223,72 @@ int tsip_transac_nict_timer_callback(const tsip_transac_nict_t* self, tsk_timer_
|
|||
*
|
||||
* @param [in,out] self The transaction to initialize.
|
||||
**/
|
||||
void tsip_transac_nict_init(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_init(tsip_transac_nict_t *self)
|
||||
{
|
||||
/* Initialize the state machine.
|
||||
*/
|
||||
tsip_transac_nictContext_Init(&self->_fsm, self);
|
||||
/* Initialize the state machine. */
|
||||
tsk_fsm_set(self->fsm,
|
||||
|
||||
/*=======================
|
||||
* === Started ===
|
||||
*/
|
||||
// Started -> (Send) -> Trying
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_send, _fsm_state_Trying, tsip_transac_nict_Started_2_Trying_X_send, "tsip_transac_nict_Started_2_Trying_X_send"),
|
||||
// Started -> (Any) -> Started
|
||||
TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_nict_Started_2_Started_X_any"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Trying ===
|
||||
*/
|
||||
// Trying -> (timerE) -> Trying
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_timerE, _fsm_state_Trying, tsip_transac_nict_Trying_2_Trying_X_timerE, "tsip_transac_nict_Trying_2_Trying_X_timerE"),
|
||||
// Trying -> (timerF) -> Trying
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_timerF, _fsm_state_Terminated, tsip_transac_nict_Trying_2_Terminated_X_timerF, "tsip_transac_nict_Trying_2_Terminated_X_timerF"),
|
||||
// Trying -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Trying_2_Terminated_X_transportError, "tsip_transac_nict_Trying_2_Terminated_X_transportError"),
|
||||
// Trying -> (1xx) -> Proceeding
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_nict_Trying_2_Proceedding_X_1xx, "tsip_transac_nict_Trying_2_Proceedding_X_1xx"),
|
||||
// Trying -> (200 to 699) -> Completed
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_200_to_699, _fsm_state_Completed, tsip_transac_nict_Trying_2_Completed_X_200_to_699, "tsip_transac_nict_Trying_2_Completed_X_200_to_699"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Proceeding ===
|
||||
*/
|
||||
// Proceeding -> (timerE) -> Proceeding
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_timerE, _fsm_state_Proceeding, tsip_transac_nict_Proceeding_2_Proceeding_X_timerE, "tsip_transac_nict_Proceeding_2_Proceeding_X_timerE"),
|
||||
// Proceeding -> (timerF) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_timerF, _fsm_state_Terminated, tsip_transac_nict_Proceeding_2_Terminated_X_timerF, "tsip_transac_nict_Proceeding_2_Terminated_X_timerF"),
|
||||
// Proceeding -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Proceeding_2_Terminated_X_transportError, "tsip_transac_nict_Proceeding_2_Terminated_X_transportError"),
|
||||
// Proceeding -> (1xx) -> Proceeding
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_1xx, _fsm_state_Proceeding, tsip_transac_nict_Proceeding_2_Proceeding_X_1xx, "tsip_transac_nict_Proceeding_2_Proceeding_X_1xx"),
|
||||
// Proceeding -> (200 to 699) -> Completed
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_200_to_699, _fsm_state_Completed, tsip_transac_nict_Proceeding_2_Completed_X_200_to_699, "tsip_transac_nict_Proceeding_2_Completed_X_200_to_699"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Completed ===
|
||||
*/
|
||||
// Completed -> (timer K) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerK, _fsm_state_Terminated, tsip_transac_nict_Completed_2_Terminated_X_timerK, "tsip_transac_nict_Completed_2_Terminated_X_timerK"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Any ===
|
||||
*/
|
||||
// Any -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_transportError, "tsip_transac_nict_Any_2_Terminated_X_transportError"),
|
||||
// Any -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_nict_Any_2_Terminated_X_Error, "tsip_transac_nict_Any_2_Terminated_X_Error"),
|
||||
|
||||
|
||||
TSK_FSM_ADD_NULL());
|
||||
|
||||
/* Set callback function to call when new messages arrive or errors happen in
|
||||
the transport layer.
|
||||
*/
|
||||
TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK(tsip_transac_nict_event_callback);
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUG)
|
||||
setDebugFlag(&(self->_fsm), DEBUG_STATE_MACHINE);
|
||||
#endif
|
||||
|
||||
self->timerE.id = TSK_INVALID_TIMER_ID;
|
||||
self->timerF.id = TSK_INVALID_TIMER_ID;
|
||||
|
@ -215,6 +297,8 @@ void tsip_transac_nict_init(tsip_transac_nict_t *self)
|
|||
self->timerE.timeout = TSIP_TIMER_GET(E);
|
||||
self->timerF.timeout = TSIP_TIMER_GET(F);
|
||||
self->timerK.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(K); /* RFC 3261 - 17.1.2.2*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -236,9 +320,6 @@ int tsip_transac_nict_start(tsip_transac_nict_t *self, const tsip_request_t* req
|
|||
int ret = -1;
|
||||
if(self && request && !TSIP_TRANSAC(self)->running)
|
||||
{
|
||||
/* Set state machine state to started */
|
||||
setState(&self->_fsm, &tsip_transac_nict_Started);
|
||||
|
||||
/* Add branch to the new client transaction. */
|
||||
TSIP_TRANSAC(self)->branch = tsk_strdup(TSIP_TRANSAC_MAGIC_COOKIE);
|
||||
{
|
||||
|
@ -249,9 +330,8 @@ int tsip_transac_nict_start(tsip_transac_nict_t *self, const tsip_request_t* req
|
|||
|
||||
TSIP_TRANSAC(self)->running = 1;
|
||||
self->request = tsk_object_ref((void*)request);
|
||||
tsip_transac_nictContext_sm_send(&self->_fsm);
|
||||
|
||||
ret = 0;
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_send, self, TSK_NULL, self, TSK_NULL);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -265,14 +345,16 @@ int tsip_transac_nict_start(tsip_transac_nict_t *self, const tsip_request_t* req
|
|||
|
||||
|
||||
|
||||
//========================================================
|
||||
// State Machine
|
||||
//
|
||||
|
||||
//--------------------------------------------------------
|
||||
// == STATE MACHINE BEGIN ==
|
||||
//--------------------------------------------------------
|
||||
/* Started -> (send) -> Trying
|
||||
*/
|
||||
void tsip_transac_nict_Started_2_Trying_X_send(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Started_2_Trying_X_send(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
//== Send the request
|
||||
tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, TSIP_MESSAGE(self->request));
|
||||
|
||||
|
@ -291,12 +373,17 @@ void tsip_transac_nict_Started_2_Trying_X_send(tsip_transac_nict_t *self)
|
|||
{
|
||||
TRANSAC_NICT_TIMER_SCHEDULE(E);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying -> (Timer E) -> Trying
|
||||
*/
|
||||
void tsip_transac_nict_Trying_2_Trying_X_timerE(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Trying_2_Trying_X_timerE(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
//== Send the request
|
||||
tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
|
||||
|
||||
|
@ -309,12 +396,17 @@ void tsip_transac_nict_Trying_2_Trying_X_timerE(tsip_transac_nict_t *self)
|
|||
*/
|
||||
self->timerE.timeout = TSK_MIN(self->timerE.timeout*2, TSIP_TIMER_GET(T2));
|
||||
TRANSAC_NICT_TIMER_SCHEDULE(E);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying -> (Timer F) -> Terminated
|
||||
*/
|
||||
void tsip_transac_nict_Trying_2_Terminated_X_timerF(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Trying_2_Terminated_X_timerF(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* RFC 3261 - 17.1.2.2
|
||||
If Timer F fires while the client transaction is still in the
|
||||
"Trying" state, the client transaction SHOULD inform the TU about the
|
||||
|
@ -324,21 +416,31 @@ void tsip_transac_nict_Trying_2_Terminated_X_timerF(tsip_transac_nict_t *self)
|
|||
/* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_transport_error, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying -> (Transport Error) -> Terminated
|
||||
*/
|
||||
void tsip_transac_nict_Trying_2_Terminated_X_transportError(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Trying_2_Terminated_X_transportError(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_transport_error, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying -> (1xx) -> Proceeding
|
||||
*/
|
||||
void tsip_transac_nict_Trying_2_Proceedding_X_1xx(tsip_transac_nict_t *self, const tsip_message_t* msg)
|
||||
int tsip_transac_nict_Trying_2_Proceedding_X_1xx(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* RFC 3261 - 17.1.2.2
|
||||
If a provisional response is received while in the "Trying" state, the
|
||||
response MUST be passed to the TU, and then the client transaction
|
||||
|
@ -352,13 +454,18 @@ void tsip_transac_nict_Trying_2_Proceedding_X_1xx(tsip_transac_nict_t *self, con
|
|||
}
|
||||
TRANSAC_TIMER_CANCEL(F);
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, msg);
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying -> (200-699) -> Completed
|
||||
*/
|
||||
void tsip_transac_nict_Trying_2_Completed_X_200_to_699(tsip_transac_nict_t *self, const tsip_message_t* msg)
|
||||
int tsip_transac_nict_Trying_2_Completed_X_200_to_699(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* RFC 3261 - 17.1.2.2
|
||||
If a final response (status codes 200-699) is received while in the "Trying" state, the response
|
||||
MUST be passed to the TU, and the client transaction MUST transition
|
||||
|
@ -373,22 +480,21 @@ void tsip_transac_nict_Trying_2_Completed_X_200_to_699(tsip_transac_nict_t *self
|
|||
}
|
||||
TRANSAC_TIMER_CANCEL(F);
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, msg);
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
|
||||
|
||||
/* SCHEDULE timer K */
|
||||
TRANSAC_NICT_TIMER_SCHEDULE(K);
|
||||
}
|
||||
|
||||
/* Trying -> (unknown) -> Trying
|
||||
*/
|
||||
void tsip_transac_nict_Trying_2_Trying_X_unknown(tsip_transac_nict_t *self)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding -> (TimerE) -> Proceeding
|
||||
*/
|
||||
void tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
//== Send the request
|
||||
tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->request);
|
||||
|
||||
|
@ -399,12 +505,17 @@ void tsip_transac_nict_Proceeding_2_Proceeding_X_timerE(tsip_transac_nict_t *sel
|
|||
*/
|
||||
self->timerE.timeout = TSK_MIN(self->timerE.timeout*2, TSIP_TIMER_GET(T2));
|
||||
TRANSAC_NICT_TIMER_SCHEDULE(E);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding -> (Timer F) -> Proceeding
|
||||
*/
|
||||
void tsip_transac_nict_Proceeding_2_Terminated_X_timerF(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Proceeding_2_Terminated_X_timerF(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* RFC 3261 - 17.1.2.2
|
||||
If timer F fires while in the "Proceeding" state, the TU MUST be informed of a timeout, and the
|
||||
client transaction MUST transition to the terminated state.
|
||||
|
@ -413,31 +524,46 @@ void tsip_transac_nict_Proceeding_2_Terminated_X_timerF(tsip_transac_nict_t *sel
|
|||
/* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_transport_error, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding -> (Transport error) -> Terminated
|
||||
*/
|
||||
void tsip_transac_nict_Proceeding_2_Terminated_X_transportError(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Proceeding_2_Terminated_X_transportError(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* Timers will be canceles by On */
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_transport_error, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding -> (1xx) -> Proceeding
|
||||
*/
|
||||
void tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(tsip_transac_nict_t *self, const tsip_message_t* msg)
|
||||
int tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
if(!TSIP_TRANSAC(self)->reliable)
|
||||
{
|
||||
TRANSAC_TIMER_CANCEL(E);
|
||||
}
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, msg);
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding -> (200-699) -> Completed
|
||||
*/
|
||||
void tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(tsip_transac_nict_t *self, const tsip_message_t* msg)
|
||||
int tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* RFC 3261 - 17.1.2.2
|
||||
If a final response (status codes 200-699) is received while in the
|
||||
"Proceeding" state, the response MUST be passed to the TU, and the
|
||||
|
@ -461,16 +587,21 @@ void tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(tsip_transac_nict_t *
|
|||
TRANSAC_TIMER_CANCEL(E);
|
||||
}
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, msg);
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
|
||||
|
||||
/* SCHEDULE timer K */
|
||||
TRANSAC_NICT_TIMER_SCHEDULE(K);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Completed -> (Timer K) -> Terminated
|
||||
*/
|
||||
void tsip_transac_nict_Completed_2_Terminated_X_timerK(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Completed_2_Terminated_X_timerK(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* RFC 3261 - 17.1.2.2
|
||||
If Timer K fires while in this state (Completed), the client transaction
|
||||
MUST transition to the "Terminated" state.
|
||||
|
@ -483,22 +614,46 @@ void tsip_transac_nict_Completed_2_Terminated_X_timerK(tsip_transac_nict_t *self
|
|||
/* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
|
||||
|
||||
//TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_transac_ok, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Any -> (Transport Error) -> Terminated
|
||||
*/
|
||||
void tsip_transac_nict_Any_2_Terminated_X_transportError(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_Any_2_Terminated_X_transportError(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
/* Timers will be canceled by "tsip_transac_nict_OnTerminated" */
|
||||
|
||||
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_transport_error, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Any -> (Error) -> Terminated
|
||||
*/
|
||||
int tsip_transac_nict_Any_2_Terminated_X_Error(va_list *app)
|
||||
{
|
||||
tsip_transac_nict_t *self = va_arg(*app, tsip_transac_nict_t *);
|
||||
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// == STATE MACHINE END ==
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
|
||||
|
||||
/*== TERMINATED
|
||||
*/
|
||||
void tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self)
|
||||
int tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self)
|
||||
{
|
||||
/* Cancel timers */
|
||||
if(!TSIP_TRANSAC(self)->reliable)
|
||||
|
@ -512,7 +667,8 @@ void tsip_transac_nict_OnTerminated(tsip_transac_nict_t *self)
|
|||
|
||||
TSK_DEBUG_INFO("=== NICT terminated ===");
|
||||
|
||||
TRANSAC_REMOVE_SCHEDULE();
|
||||
/* Remove (and destroy) the transaction from the layer. */
|
||||
return tsip_transac_remove(TSIP_TRANSAC(self));
|
||||
}
|
||||
|
||||
|
||||
|
@ -544,6 +700,11 @@ static void* tsip_transac_nict_create(void * self, va_list * app)
|
|||
const char *cseq_method = va_arg(*app, const char *);
|
||||
const char *callid = va_arg(*app, const char *);
|
||||
|
||||
/* create FSM */
|
||||
transac->fsm = TSK_FSM_CREATE(_fsm_state_Started, _fsm_state_Terminated);
|
||||
transac->fsm->debug = DEBUG_STATE_MACHINE;
|
||||
tsk_fsm_set_callback_terminated(transac->fsm, TSK_FSM_ONTERMINATED(tsip_transac_nict_OnTerminated), (const void*)transac);
|
||||
|
||||
/* Initialize base class */
|
||||
tsip_transac_init(TSIP_TRANSAC(transac), stack, tsip_nict, reliable, cseq_value, cseq_method, callid);
|
||||
|
||||
|
@ -563,6 +724,9 @@ static void* tsip_transac_nict_destroy(void * self)
|
|||
|
||||
/* DeInitialize base class */
|
||||
tsip_transac_deinit(TSIP_TRANSAC(transac));
|
||||
|
||||
/* FSM */
|
||||
TSK_OBJECT_SAFE_FREE(transac->fsm);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -79,12 +79,51 @@
|
|||
|
||||
#define TRANSAC_NIST_TIMER_SCHEDULE(TX) TRANSAC_TIMER_SCHEDULE(nist, TX)
|
||||
|
||||
|
||||
/* ======================== internal functions ======================== */
|
||||
int tsip_transac_nist_init(tsip_transac_nist_t *self);
|
||||
int tsip_transac_nist_handle_request(const tsip_transac_nist_t *self, const tsip_request_t* request);
|
||||
int tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self);
|
||||
|
||||
/* ======================== transitions ======================== */
|
||||
int tsip_transac_nist_Started_2_Trying_X_request(va_list *app);
|
||||
int tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(va_list *app);
|
||||
int tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(va_list *app);
|
||||
int tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(va_list *app);
|
||||
int tsip_transac_nist_Proceeding_2_Proceeding_X_request(va_list *app);
|
||||
int tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(va_list *app);
|
||||
int tsip_transac_nist_Completed_2_Completed_X_request(va_list *app);
|
||||
int tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(va_list *app);
|
||||
int tsip_transac_nist_Any_2_Terminated_X_transportError(va_list *app);
|
||||
int tsip_transac_nist_Any_2_Terminated_X_Error(va_list *app);
|
||||
|
||||
/* ======================== conds ======================== */
|
||||
|
||||
/* ======================== actions ======================== */
|
||||
typedef enum _fsm_action_e
|
||||
{
|
||||
_fsm_action_request,
|
||||
_fsm_action_send_1xx,
|
||||
_fsm_action_send_200_to_699,
|
||||
_fsm_action_timerJ,
|
||||
_fsm_action_transporterror,
|
||||
_fsm_action_error,
|
||||
}
|
||||
_fsm_action_t;
|
||||
|
||||
/* ======================== states ======================== */
|
||||
typedef enum _fsm_state_e
|
||||
{
|
||||
_fsm_state_Started,
|
||||
_fsm_state_Trying,
|
||||
_fsm_state_Proceeding,
|
||||
_fsm_state_Completed,
|
||||
_fsm_state_Terminated
|
||||
}
|
||||
_fsm_state_t;
|
||||
|
||||
int tsip_transac_nist_event_callback(const tsip_transac_nist_t *self, tsip_transac_event_type_t type, const tsip_message_t *msg)
|
||||
{
|
||||
TSIP_TRANSAC_SYNC_BEGIN(self);
|
||||
int ret = -1;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
|
@ -92,7 +131,7 @@ int tsip_transac_nist_event_callback(const tsip_transac_nist_t *self, tsip_trans
|
|||
{
|
||||
if(msg && TSIP_MESSAGE_IS_REQUEST(msg))
|
||||
{
|
||||
tsip_transac_nist_handle_request(self, msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_request, self, msg, self, msg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -103,45 +142,35 @@ int tsip_transac_nist_event_callback(const tsip_transac_nist_t *self, tsip_trans
|
|||
{
|
||||
if(TSIP_RESPONSE_IS_1XX(msg))
|
||||
{
|
||||
tsip_transac_nistContext_sm_send_1xx(&(TSIP_TRANSAC_NIST(self)->_fsm), msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_send_1xx, self, msg, self, msg);
|
||||
}
|
||||
else if(TSIP_RESPONSE_IS_23456(msg))
|
||||
{
|
||||
tsip_transac_nistContext_sm_send_200_to_699(&(TSIP_TRANSAC_NIST(self)->_fsm), msg);
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_send_200_to_699, self, msg, self, msg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_canceled:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_terminated:
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_timedout:
|
||||
{
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case tsip_transac_error:
|
||||
{
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_error, self, msg, self, msg);
|
||||
break;
|
||||
}
|
||||
|
||||
case tsip_transac_transport_error:
|
||||
{
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_transporterror, self, msg, self, msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TSIP_TRANSAC_SYNC_END(self);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int tsip_transac_nist_timer_callback(const tsip_transac_nist_t* self, tsk_timer_id_t timer_id)
|
||||
|
@ -150,36 +179,78 @@ int tsip_transac_nist_timer_callback(const tsip_transac_nist_t* self, tsk_timer_
|
|||
|
||||
if(self)
|
||||
{
|
||||
TSIP_TRANSAC_SYNC_BEGIN(self);
|
||||
|
||||
if(timer_id == self->timerJ.id)
|
||||
{
|
||||
tsip_transac_nistContext_sm_timerJ(&(TSIP_TRANSAC_NIST(self)->_fsm));
|
||||
ret = 0;
|
||||
ret = tsk_fsm_act(self->fsm, _fsm_action_timerJ, self, TSK_NULL, self, TSK_NULL);
|
||||
}
|
||||
|
||||
TSIP_TRANSAC_SYNC_END(self);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void tsip_transac_nist_init(tsip_transac_nist_t *self)
|
||||
int tsip_transac_nist_init(tsip_transac_nist_t *self)
|
||||
{
|
||||
/* Initialize the state machine.
|
||||
*/
|
||||
tsip_transac_nistContext_Init(&self->_fsm, self);
|
||||
tsk_fsm_set(self->fsm,
|
||||
|
||||
/*=======================
|
||||
* === Started ===
|
||||
*/
|
||||
// Started -> (receive request) -> Trying
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Started, _fsm_action_request, _fsm_state_Trying, tsip_transac_nist_Started_2_Trying_X_request, "tsip_transac_nist_Started_2_Trying_X_request"),
|
||||
// Started -> (Any) -> Started
|
||||
TSK_FSM_ADD_ALWAYS_NOTHING(_fsm_state_Started, "tsip_transac_nist_Started_2_Started_X_any"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Trying ===
|
||||
*/
|
||||
// Trying -> (send 1xx) -> Proceeding
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_send_1xx, _fsm_state_Proceeding, tsip_transac_nist_Trying_2_Proceeding_X_send_1xx, "tsip_transac_nist_Trying_2_Proceeding_X_send_1xx"),
|
||||
// Trying -> (send 200 to 699) -> Completed
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Trying, _fsm_action_send_200_to_699, _fsm_state_Completed, tsip_transac_nist_Trying_2_Completed_X_send_200_to_699, "tsip_transac_nist_Trying_2_Completed_X_send_200_to_699"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Proceeding ===
|
||||
*/
|
||||
// Proceeding -> (send 1xx) -> Proceeding
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_send_1xx, _fsm_state_Proceeding, tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx, "tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx"),
|
||||
// Proceeding -> (send 200 to 699) -> Completed
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_send_200_to_699, _fsm_state_Completed, tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699, "tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699"),
|
||||
// Proceeding -> (receive request) -> Proceeding
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Proceeding, _fsm_action_request, _fsm_state_Proceeding, tsip_transac_nist_Proceeding_2_Proceeding_X_request, "tsip_transac_nist_Proceeding_2_Proceeding_X_request"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Completed ===
|
||||
*/
|
||||
// Completed -> (receive request) -> Completed
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_request, _fsm_state_Completed, tsip_transac_nist_Completed_2_Completed_X_request, "tsip_transac_nist_Completed_2_Completed_X_request"),
|
||||
// Completed -> (timer J) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(_fsm_state_Completed, _fsm_action_timerJ, _fsm_state_Terminated, tsip_transac_nist_Completed_2_Terminated_X_tirmerJ, "tsip_transac_nist_Completed_2_Terminated_X_tirmerJ"),
|
||||
|
||||
|
||||
/*=======================
|
||||
* === Any ===
|
||||
*/
|
||||
// Any -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_transporterror, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_transportError, "tsip_transac_nist_Any_2_Terminated_X_transportError"),
|
||||
// Any -> (transport error) -> Terminated
|
||||
TSK_FSM_ADD_ALWAYS(tsk_fsm_state_any, _fsm_action_error, _fsm_state_Terminated, tsip_transac_nist_Any_2_Terminated_X_Error, "tsip_transac_nist_Any_2_Terminated_X_Error"),
|
||||
|
||||
|
||||
TSK_FSM_ADD_NULL());
|
||||
|
||||
/* Set callback function to call when new messages arrive or errors happen in
|
||||
the transport layer.
|
||||
*/
|
||||
TSIP_TRANSAC(self)->callback = TSIP_TRANSAC_EVENT_CALLBACK(tsip_transac_nist_event_callback);
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUG)
|
||||
setDebugFlag(&(self->_fsm), DEBUG_STATE_MACHINE);
|
||||
#endif
|
||||
|
||||
self->timerJ.timeout = TSIP_TRANSAC(self)->reliable ? 0 : TSIP_TIMER_GET(J); /* RFC 3261 - 17.2.2*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tsip_transac_nist_start(tsip_transac_nist_t *self, const tsip_request_t* request)
|
||||
|
@ -198,18 +269,33 @@ int tsip_transac_nist_start(tsip_transac_nist_t *self, const tsip_request_t* req
|
|||
|
||||
int tsip_transac_nist_handle_request(const tsip_transac_nist_t *self, const tsip_request_t* request)
|
||||
{
|
||||
/* Alert the state machine */
|
||||
tsip_transac_nistContext_sm_request(&(TSIP_TRANSAC_NIST(self)->_fsm), request);
|
||||
|
||||
/* Alert the dialog */
|
||||
return TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, request);
|
||||
int ret = -1;
|
||||
if(!(ret = tsk_fsm_act(self->fsm, _fsm_action_request, self, TSK_NULL, self, TSK_NULL))){
|
||||
/* Alert the dialog */
|
||||
ret = TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, request);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------
|
||||
// == STATE MACHINE BEGIN ==
|
||||
//--------------------------------------------------------
|
||||
|
||||
/* Started --> (INCOMING REQUEST) --> Trying
|
||||
*/
|
||||
void tsip_transac_nist_Started_2_Trying_X_request(tsip_transac_nist_t *self, const tsip_request_t* request)
|
||||
int tsip_transac_nist_Started_2_Trying_X_request(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
The state machine is initialized in the "Trying" state and is passed
|
||||
a request other than INVITE or ACK when initialized. This request is
|
||||
|
@ -218,12 +304,17 @@ void tsip_transac_nist_Started_2_Trying_X_request(tsip_transac_nist_t *self, con
|
|||
matches the same server transaction, using the rules specified in
|
||||
Section 17.2.3.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying --> (1xx) --> Proceeding
|
||||
*/
|
||||
void tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(tsip_transac_nist_t *self, const tsip_response_t* response)
|
||||
int tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
While in the "Trying" state, if the TU passes a provisional response
|
||||
to the server transaction, the server transaction MUST enter the
|
||||
|
@ -235,12 +326,17 @@ void tsip_transac_nist_Trying_2_Proceeding_X_send_1xx(tsip_transac_nist_t *self,
|
|||
/* Update last response */
|
||||
TSK_OBJECT_SAFE_FREE(self->lastResponse);
|
||||
self->lastResponse = tsk_object_ref((void*)response);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Trying --> (200-699) --> Completed
|
||||
*/
|
||||
void tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(tsip_transac_nist_t *self, const tsip_response_t* response)
|
||||
int tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, response);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
|
@ -253,12 +349,17 @@ void tsip_transac_nist_Trying_2_Completed_X_send_200_to_699(tsip_transac_nist_t
|
|||
/* Update last response */
|
||||
TSK_OBJECT_SAFE_FREE(self->lastResponse);
|
||||
self->lastResponse = tsk_object_ref((void*)response);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding --> (1xx) --> Proceeding
|
||||
*/
|
||||
void tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(tsip_transac_nist_t *self, const tsip_response_t* response)
|
||||
int tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
Any further provisional responses that are
|
||||
received from the TU while in the "Proceeding" state MUST be passed
|
||||
|
@ -269,12 +370,17 @@ void tsip_transac_nist_Proceeding_2_Proceeding_X_send_1xx(tsip_transac_nist_t *s
|
|||
/* Update last response */
|
||||
TSK_OBJECT_SAFE_FREE(self->lastResponse);
|
||||
self->lastResponse = tsk_object_ref((void*)response);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding -> (INCOMING REQUEST) -> Proceeding
|
||||
*/
|
||||
void tsip_transac_nist_Proceeding_2_Proceeding_X_request(tsip_transac_nist_t *self, const tsip_request_t* request)
|
||||
int tsip_transac_nist_Proceeding_2_Proceeding_X_request(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
If a retransmission of the request is received while in the "Proceeding" state, the most
|
||||
recently sent provisional response MUST be passed to the transport
|
||||
|
@ -284,12 +390,17 @@ void tsip_transac_nist_Proceeding_2_Proceeding_X_request(tsip_transac_nist_t *se
|
|||
{
|
||||
tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Proceeding --> (200-699) --> Completed
|
||||
*/
|
||||
void tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(tsip_transac_nist_t *self, const tsip_response_t* response)
|
||||
int tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
If the TU passes a final response (status
|
||||
codes 200-699) to the server while in the "Proceeding" state, the
|
||||
|
@ -308,12 +419,17 @@ void tsip_transac_nist_Proceeding_2_Completed_X_send_200_to_699(tsip_transac_nis
|
|||
/* Update last response */
|
||||
TSK_OBJECT_SAFE_FREE(self->lastResponse);
|
||||
self->lastResponse = tsk_object_ref((void*)response);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Completed --> (INCOMING REQUEST) --> Completed
|
||||
*/
|
||||
void tsip_transac_nist_Completed_2_Completed_X_request(tsip_transac_nist_t *self, const tsip_request_t* request)
|
||||
int tsip_transac_nist_Completed_2_Completed_X_request(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
While in the "Completed" state, the server transaction MUST pass the final response to the transport
|
||||
layer for retransmission whenever a retransmission of the request is received.
|
||||
|
@ -322,12 +438,17 @@ void tsip_transac_nist_Completed_2_Completed_X_request(tsip_transac_nist_t *self
|
|||
{
|
||||
tsip_transac_send(TSIP_TRANSAC(self), TSIP_TRANSAC(self)->branch, self->lastResponse);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Complete --> (Timer J) --> Terminated
|
||||
*/
|
||||
void tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(tsip_transac_nist_t *self)
|
||||
int tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
/* RFC 3261 - 17.2.2
|
||||
The server transaction remains in this state (Completed) until Timer J fires, at
|
||||
which point it MUST transition to the "Terminated" state.
|
||||
|
@ -336,19 +457,40 @@ void tsip_transac_nist_Completed_2_Terminated_X_tirmerJ(tsip_transac_nist_t *sel
|
|||
/* RFC 3261 - 17.2.2
|
||||
THE SERVER TRANSACTION MUST BE DESTROYED THE INSTANT IT ENTERS THE "TERMINATED" STATE.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Any --> (Transport error) --> Terminated
|
||||
*/
|
||||
void tsip_transac_nist_Any_2_Terminated_X_transportError(tsip_transac_nist_t *self)
|
||||
int tsip_transac_nist_Any_2_Terminated_X_transportError(va_list *app)
|
||||
{
|
||||
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Any --> (error) --> Terminated
|
||||
*/
|
||||
int tsip_transac_nist_Any_2_Terminated_X_Error(va_list *app)
|
||||
{
|
||||
tsip_transac_nist_t *self = va_arg(*app, tsip_transac_nist_t *);
|
||||
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// == STATE MACHINE END ==
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*== Callback function called when the state machine enter in the "terminated" state.
|
||||
*/
|
||||
void tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self)
|
||||
int tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self)
|
||||
{
|
||||
/* Cancel timers */
|
||||
TRANSAC_TIMER_CANCEL(J);
|
||||
|
@ -357,7 +499,8 @@ void tsip_transac_nist_OnTerminated(tsip_transac_nist_t *self)
|
|||
|
||||
TSK_DEBUG_INFO("=== NIST terminated ===");
|
||||
|
||||
TRANSAC_REMOVE_SCHEDULE();
|
||||
/* Remove (and destroy) the transaction from the layer. */
|
||||
return tsip_transac_remove(TSIP_TRANSAC(self));
|
||||
}
|
||||
|
||||
|
||||
|
@ -394,6 +537,11 @@ static void* tsip_transac_nist_create(void * self, va_list * app)
|
|||
const char *cseq_method = va_arg(*app, const char *);
|
||||
const char *callid = va_arg(*app, const char *);
|
||||
|
||||
/* create FSM */
|
||||
transac->fsm = TSK_FSM_CREATE(_fsm_state_Started, _fsm_state_Terminated);
|
||||
transac->fsm->debug = DEBUG_STATE_MACHINE;
|
||||
tsk_fsm_set_callback_terminated(transac->fsm, TSK_FSM_ONTERMINATED(tsip_transac_nist_OnTerminated), (const void*)transac);
|
||||
|
||||
/* Initialize base class */
|
||||
tsip_transac_init(TSIP_TRANSAC(transac), stack, tsip_nist, reliable, cseq_value, cseq_method, callid);
|
||||
|
||||
|
@ -413,6 +561,9 @@ static void* tsip_transac_nist_destroy(void * self)
|
|||
|
||||
/* DeInitialize base class */
|
||||
tsip_transac_deinit(TSIP_TRANSAC(transac));
|
||||
|
||||
/* FSM */
|
||||
TSK_OBJECT_SAFE_FREE(transac->fsm);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ int tsip_registration_callback(const tsip_register_event_t *sipevent)
|
|||
|
||||
void test_stack()
|
||||
{
|
||||
|
||||
/*
|
||||
tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
|
||||
TSIP_STACK_SET_DISPLAY_NAME("2233392625"),
|
||||
TSIP_STACK_SET_PUBLIC_IDENTITY("sip:2233392625@sip2sip.info"),
|
||||
|
@ -108,7 +108,7 @@ void test_stack()
|
|||
TSIP_STACK_SET_MOBILITY("fixed"),
|
||||
TSIP_STACK_SET_DEVICE_ID("DD1289FA-C3D7-47bd-A40D-F1F1B2CC5FFC"),
|
||||
TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
|
||||
|
||||
*/
|
||||
/*
|
||||
tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
|
||||
TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
|
||||
|
@ -126,6 +126,22 @@ void test_stack()
|
|||
TSIP_STACK_SET_DEVICE_ID("DD1289FA-C3D7-47bd-A40D-F1F1B2CC5FFC"),
|
||||
TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
|
||||
*/
|
||||
tsip_stack_handle_t *stack = tsip_stack_create(test_stack_callback,
|
||||
TSIP_STACK_SET_DISPLAY_NAME("Mamadou"),
|
||||
TSIP_STACK_SET_PUBLIC_IDENTITY("sip:mamadou@ims.inexbee.com"),
|
||||
TSIP_STACK_SET_PRIVATE_IDENTITY("mamadou@ims.inexbee.com"),
|
||||
TSIP_STACK_SET_PASSWORD("mamadou"),
|
||||
TSIP_STACK_SET_REALM("sip:ims.inexbee.com"), // FIXME: without sip:
|
||||
TSIP_STACK_SET_LOCAL_IP(LOCAL_IP),
|
||||
//TSIP_STACK_SET_DISCOVERY_NAPTR(1),
|
||||
TSIP_STACK_SET_PROXY_CSCF("192.168.16.225", "udp", 0),
|
||||
//TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0),
|
||||
TSIP_STACK_SET_PROXY_CSCF_PORT(4060),
|
||||
TSIP_STACK_SET_SEC_AGREE_MECH("ipsec-3gpp"),
|
||||
TSIP_STACK_SET_MOBILITY("fixed"),
|
||||
TSIP_STACK_SET_DEVICE_ID("DD1289FA-C3D7-47bd-A40D-F1F1B2CC5FFC"),
|
||||
TSIP_STACK_SET_NETINFO("ADSL;utran-cell-id-3gpp=00000000"),
|
||||
|
||||
TSIP_STACK_SET_NULL());
|
||||
|
||||
tsip_operation_handle_t *op = TSIP_OPERATION_CREATE(stack,
|
||||
|
@ -148,9 +164,9 @@ void test_stack()
|
|||
{
|
||||
tsip_operation_handle_t *op2 = TSIP_OPERATION_CREATE(stack,
|
||||
TSIP_OPERATION_SET_PARAM("expires", "30"),
|
||||
TSIP_OPERATION_SET_PARAM("package", "presence"),
|
||||
TSIP_OPERATION_SET_PARAM("package", "reg"),
|
||||
TSIP_OPERATION_SET_PARAM("accept", "application/reginfo+xml"),
|
||||
TSIP_OPERATION_SET_PARAM("to", "sip:2233392625@sip2sip.info"),
|
||||
TSIP_OPERATION_SET_PARAM("to", "sip:mamadou@ims.inexbee.com"),
|
||||
|
||||
TSIP_OPERATION_SET_NULL());
|
||||
tsip_subscribe(stack, op2);
|
||||
|
|
Loading…
Reference in New Issue