tsip_dialog_register.common.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as publishd by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. #ifndef TINYSIP_DIALOG_REGISTER_COMMON_H
  23. #define TINYSIP_DIALOG_REGISTER_COMMON_H
  24. #include "tinysip/api/tsip_api_register.h"
  25. #define DEBUG_STATE_MACHINE 1
  26. #define TSIP_DIALOG_REGISTER_TIMER_SCHEDULE(TX) TSIP_DIALOG_TIMER_SCHEDULE(register, TX)
  27. #define TSIP_DIALOG_REGISTER_SIGNAL(self, type, code, phrase, message) \
  28. tsip_register_event_signal(type, TSIP_DIALOG(self)->ss, code, phrase, message)
  29. /* ======================== actions ======================== */
  30. typedef enum _fsm_action_e {
  31. _fsm_action_accept = tsip_atype_accept,
  32. _fsm_action_reject = tsip_atype_hangup,
  33. _fsm_action_hangup = tsip_atype_hangup,
  34. _fsm_action_oREGISTER = tsip_atype_register,
  35. _fsm_action_cancel = tsip_atype_cancel,
  36. _fsm_action_shutdown = tsip_atype_shutdown,
  37. _fsm_action_transporterror = tsip_atype_transport_error,
  38. _fsm_action_1xx = 0xFF,
  39. _fsm_action_2xx,
  40. _fsm_action_401_407_421_494,
  41. _fsm_action_423,
  42. _fsm_action_300_to_699,
  43. _fsm_action_iREGISTER,
  44. _fsm_action_shutdown_timedout, /* Any -> Terminated */
  45. _fsm_action_error,
  46. }
  47. _fsm_action_t;
  48. /* ======================== states ======================== */
  49. typedef enum _fsm_state_e {
  50. _fsm_state_Started,
  51. _fsm_state_InProgress, // Outgoing (Client)
  52. _fsm_state_Incoming, // Incoming (Server)
  53. _fsm_state_Connected,
  54. _fsm_state_Terminated
  55. }
  56. _fsm_state_t;
  57. #define _fsm_cond_silent_shutdown _fsm_cond_silent_hangup
  58. #define _fsm_cond_not_silent_shutdown _fsm_cond_not_silent_hangup
  59. #else
  60. #error "This file must only be included in a source(.c or .cxx)"
  61. #endif /* TINYSIP_DIALOG_REGISTER_COMMON_H */