sip_tel_uri.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  3. * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  4. *
  5. * This program 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 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program 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 this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef __PJSIP_TEL_URI_H__
  20. #define __PJSIP_TEL_URI_H__
  21. /**
  22. * @file sip_tel_uri.h
  23. * @brief Tel: URI
  24. */
  25. #include <pjsip/sip_uri.h>
  26. /**
  27. * @addtogroup PJSIP_TEL_URI tel URI Scheme
  28. * @ingroup PJSIP_URI
  29. * @brief Support for "tel:" URI scheme.
  30. * @{
  31. */
  32. PJ_BEGIN_DECL
  33. /**
  34. * tel: URI.
  35. */
  36. typedef struct pjsip_tel_uri
  37. {
  38. pjsip_uri_vptr *vptr; /**< Pointer to virtual function table. */
  39. pj_str_t number; /**< Global or local phone number */
  40. pj_str_t context; /**< Phone context (for local number). */
  41. pj_str_t ext_param; /**< Extension param. */
  42. pj_str_t isub_param; /**< ISDN sub-address param. */
  43. pjsip_param other_param;/**< Other parameter. */
  44. } pjsip_tel_uri;
  45. /**
  46. * Create a new tel: URI.
  47. *
  48. * @param pool The pool.
  49. *
  50. * @return New instance of tel: URI.
  51. */
  52. PJ_DECL(pjsip_tel_uri*) pjsip_tel_uri_create(pj_pool_t *pool);
  53. /**
  54. * This function compares two numbers for equality, according to rules as
  55. * specified in RFC 3966.
  56. *
  57. * @param nb1 The first number.
  58. * @param nb2 The second number.
  59. *
  60. * @return Zero if equal, -1 if nb1 is less than nb2, or +1 if
  61. * nb1 is greater than nb2.
  62. */
  63. PJ_DECL(int) pjsip_tel_nb_cmp(const pj_str_t *nb1, const pj_str_t *nb2);
  64. PJ_END_DECL
  65. /**
  66. * @}
  67. */
  68. #endif /* __PJSIP_TEL_URI_H__ */