ActionConfig.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (C) 2010-2011 Mamadou Diop.
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with DOUBANGO.
  17. */
  18. #ifndef TINYWRAP_ACTIONCONFIG_H
  19. #define TINYWRAP_ACTIONCONFIG_H
  20. #include "tinyWRAP_config.h"
  21. #include "tinysip.h"
  22. #include "Common.h"
  23. class TINYWRAP_API ActionConfig
  24. {
  25. public:
  26. ActionConfig();
  27. virtual ~ActionConfig();
  28. bool addHeader(const char* name, const char* value);
  29. bool addPayload(const void* payload, unsigned len);
  30. bool setActiveMedia(twrap_media_type_t type);
  31. ActionConfig* setResponseLine(short code, const char* phrase);
  32. ActionConfig* setMediaString(twrap_media_type_t type, const char* key, const char* value);
  33. ActionConfig* setMediaInt(twrap_media_type_t type, const char* key, int value);
  34. private:
  35. tsip_action_handle_t* m_pHandle;
  36. #if !defined(SWIG)
  37. public:
  38. const inline tsip_action_handle_t* getHandle()const {
  39. return m_pHandle;
  40. }
  41. #endif
  42. };
  43. #endif /* TINYWRAP_ACTIONCONFIG_H */