resource_endpoints.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2012 - 2013, Digium, Inc.
  5. *
  6. * David M. Lee, II <dlee@digium.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*! \file
  19. *
  20. * \brief Generated file - declares stubs to be implemented in
  21. * res/ari/resource_endpoints.c
  22. *
  23. * Endpoint resources
  24. *
  25. * \author David M. Lee, II <dlee@digium.com>
  26. */
  27. /*
  28. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. * !!!!! DO NOT EDIT !!!!!
  30. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  31. * This file is generated by a mustache template. Please see the original
  32. * template in rest-api-templates/ari_resource.h.mustache
  33. */
  34. #ifndef _ASTERISK_RESOURCE_ENDPOINTS_H
  35. #define _ASTERISK_RESOURCE_ENDPOINTS_H
  36. #include "asterisk/ari.h"
  37. /*! Argument struct for ast_ari_endpoints_list() */
  38. struct ast_ari_endpoints_list_args {
  39. };
  40. /*!
  41. * \brief List all endpoints.
  42. *
  43. * \param headers HTTP headers
  44. * \param args Swagger parameters
  45. * \param[out] response HTTP response
  46. */
  47. void ast_ari_endpoints_list(struct ast_variable *headers, struct ast_ari_endpoints_list_args *args, struct ast_ari_response *response);
  48. /*! Argument struct for ast_ari_endpoints_send_message() */
  49. struct ast_ari_endpoints_send_message_args {
  50. /*! The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp. */
  51. const char *to;
  52. /*! The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp. */
  53. const char *from;
  54. /*! The body of the message */
  55. const char *body;
  56. struct ast_json *variables;
  57. };
  58. /*!
  59. * \brief Body parsing function for /endpoints/sendMessage.
  60. * \param body The JSON body from which to parse parameters.
  61. * \param[out] args The args structure to parse into.
  62. * \retval zero on success
  63. * \retval non-zero on failure
  64. */
  65. int ast_ari_endpoints_send_message_parse_body(
  66. struct ast_json *body,
  67. struct ast_ari_endpoints_send_message_args *args);
  68. /*!
  69. * \brief Send a message to some technology URI or endpoint.
  70. *
  71. * \param headers HTTP headers
  72. * \param args Swagger parameters
  73. * \param[out] response HTTP response
  74. */
  75. void ast_ari_endpoints_send_message(struct ast_variable *headers, struct ast_ari_endpoints_send_message_args *args, struct ast_ari_response *response);
  76. /*! Argument struct for ast_ari_endpoints_list_by_tech() */
  77. struct ast_ari_endpoints_list_by_tech_args {
  78. /*! Technology of the endpoints (sip,iax2,...) */
  79. const char *tech;
  80. };
  81. /*!
  82. * \brief List available endoints for a given endpoint technology.
  83. *
  84. * \param headers HTTP headers
  85. * \param args Swagger parameters
  86. * \param[out] response HTTP response
  87. */
  88. void ast_ari_endpoints_list_by_tech(struct ast_variable *headers, struct ast_ari_endpoints_list_by_tech_args *args, struct ast_ari_response *response);
  89. /*! Argument struct for ast_ari_endpoints_get() */
  90. struct ast_ari_endpoints_get_args {
  91. /*! Technology of the endpoint */
  92. const char *tech;
  93. /*! ID of the endpoint */
  94. const char *resource;
  95. };
  96. /*!
  97. * \brief Details for an endpoint.
  98. *
  99. * \param headers HTTP headers
  100. * \param args Swagger parameters
  101. * \param[out] response HTTP response
  102. */
  103. void ast_ari_endpoints_get(struct ast_variable *headers, struct ast_ari_endpoints_get_args *args, struct ast_ari_response *response);
  104. /*! Argument struct for ast_ari_endpoints_send_message_to_endpoint() */
  105. struct ast_ari_endpoints_send_message_to_endpoint_args {
  106. /*! Technology of the endpoint */
  107. const char *tech;
  108. /*! ID of the endpoint */
  109. const char *resource;
  110. /*! The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp. */
  111. const char *from;
  112. /*! The body of the message */
  113. const char *body;
  114. struct ast_json *variables;
  115. };
  116. /*!
  117. * \brief Body parsing function for /endpoints/{tech}/{resource}/sendMessage.
  118. * \param body The JSON body from which to parse parameters.
  119. * \param[out] args The args structure to parse into.
  120. * \retval zero on success
  121. * \retval non-zero on failure
  122. */
  123. int ast_ari_endpoints_send_message_to_endpoint_parse_body(
  124. struct ast_json *body,
  125. struct ast_ari_endpoints_send_message_to_endpoint_args *args);
  126. /*!
  127. * \brief Send a message to some endpoint in a technology.
  128. *
  129. * \param headers HTTP headers
  130. * \param args Swagger parameters
  131. * \param[out] response HTTP response
  132. */
  133. void ast_ari_endpoints_send_message_to_endpoint(struct ast_variable *headers, struct ast_ari_endpoints_send_message_to_endpoint_args *args, struct ast_ari_response *response);
  134. #endif /* _ASTERISK_RESOURCE_ENDPOINTS_H */