eX_message.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. eXosip - This is the eXtended osip library.
  3. Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com
  4. eXosip is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. eXosip is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. In addition, as a special exception, the copyright holders give
  16. permission to link the code of portions of this program with the
  17. OpenSSL library under certain conditions as described in each
  18. individual source file, and distribute linked combinations
  19. including the two.
  20. You must obey the GNU General Public License in all respects
  21. for all of the code used other than OpenSSL. If you modify
  22. file(s) with this exception, you may extend this exception to your
  23. version of the file(s), but you are not obligated to do so. If you
  24. do not wish to do so, delete this exception statement from your
  25. version. If you delete this exception statement from all source
  26. files in the program, then also delete it here.
  27. */
  28. #ifdef ENABLE_MPATROL
  29. #include <mpatrol.h>
  30. #endif
  31. #ifndef __EX_MESSAGE_H__
  32. #define __EX_MESSAGE_H__
  33. #include <osipparser2/osip_parser.h>
  34. #include <time.h>
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. /**
  39. * @file eX_message.h
  40. * @brief eXosip request API
  41. *
  42. * This file provide the API needed to control requests. You can use it to:
  43. *
  44. * <ul>
  45. * <li>build any requests.</li>
  46. * <li>send any requests.</li>
  47. * <li>build any answers.</li>
  48. * <li>send any answers.</li>
  49. * </ul>
  50. */
  51. /**
  52. * @defgroup eXosip2_message eXosip2 request outside of dialog
  53. * @ingroup eXosip2_msg
  54. * @{
  55. */
  56. /**
  57. * Build a default request message.
  58. *
  59. * This method will be updated to send any message outside of dialog
  60. * In this later case, you'll specify the method to use in the second argument.
  61. *
  62. * @param excontext eXosip_t instance.
  63. * @param message Pointer for the SIP request to build.
  64. * @param method request method. (like "MESSAGE" or "PING"...)
  65. * @param to SIP url for callee.
  66. * @param from SIP url for caller.
  67. * @param route Route header for request. (optional)
  68. */
  69. int eXosip_message_build_request(struct eXosip_t *excontext, osip_message_t **message, const char *method, const char *to, const char *from, const char *route);
  70. /**
  71. * Send an request.
  72. *
  73. * @param excontext eXosip_t instance.
  74. * @param message SIP request to send.
  75. */
  76. int eXosip_message_send_request(struct eXosip_t *excontext, osip_message_t *message);
  77. /**
  78. * Build answer for a request.
  79. *
  80. * @param excontext eXosip_t instance.
  81. * @param tid id of transaction.
  82. * @param status status for SIP answer to build.
  83. * @param answer The SIP answer to build.
  84. */
  85. int eXosip_message_build_answer(struct eXosip_t *excontext, int tid, int status, osip_message_t **answer);
  86. /**
  87. * Send answer for a request.
  88. *
  89. * @param excontext eXosip_t instance.
  90. * @param tid id of transaction.
  91. * @param status status for SIP answer to send.
  92. * @param answer The SIP answer to send. (default will be sent if NULL)
  93. */
  94. int eXosip_message_send_answer(struct eXosip_t *excontext, int tid, int status, osip_message_t *answer);
  95. /** @} */
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif