sip_api.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2012, Digium, Inc.
  5. *
  6. * Mark Michelson <mmichelson@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. #ifndef __ASTERISK_SIP_H
  19. #define __ASTERISK_SIP_H
  20. #if defined(__cplusplus) || defined(c_plusplus)
  21. extern "C" {
  22. #endif
  23. #include "asterisk/config.h"
  24. #define AST_SIP_API_VERSION 1
  25. struct ast_sip_api_tech {
  26. const int version;
  27. const char *name;
  28. int (*sipinfo_send)(struct ast_channel *chan,
  29. struct ast_variable *headers, const char *content_type,
  30. const char *content, const char *useragent_filter);
  31. };
  32. /*!
  33. * \brief Send a customized SIP INFO request
  34. *
  35. * \param chan Channel
  36. * \param headers The headers to add to the INFO request
  37. * \param content_type The content type header to add
  38. * \param content The body of the INFO request
  39. * \param useragent_filter If non-NULL, only send the INFO if the
  40. * recipient's User-Agent contains useragent_filter as a substring
  41. *
  42. * \retval 0 Success
  43. * \retval non-zero Failure
  44. */
  45. int ast_sipinfo_send(struct ast_channel *chan,
  46. struct ast_variable *headers,
  47. const char *content_type,
  48. const char *content,
  49. const char *useragent_filter);
  50. /*!
  51. * \brief Register a SIP API provider
  52. *
  53. * This will fail if a provider has already registered or if the
  54. * provider is using an incorrect version.
  55. *
  56. * \param provider The provider to register
  57. * \retval 0 Success
  58. * \retval -1 Failure
  59. */
  60. int ast_sip_api_provider_register(const struct ast_sip_api_tech *provider);
  61. /*!
  62. * \brief Unregister a SIP API provider
  63. */
  64. void ast_sip_api_provider_unregister(void);
  65. #if defined(__cplusplus) || defined(c_plusplus)
  66. }
  67. #endif
  68. #endif /* __ASTERISK_SIP_H */