contact_ops.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * $Id$
  3. *
  4. * mangler module
  5. *
  6. * Copyright (C) 2001-2003 FhG Fokus
  7. *
  8. * This file is part of SIP-router, a free SIP server.
  9. *
  10. * SIP-router is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version
  14. *
  15. * SIP-router is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * History:
  25. * --------
  26. * 2003-04-07 first version.
  27. */
  28. /*!
  29. * \file
  30. * \brief SIP-utils :: Mangler module
  31. * \ingroup siputils
  32. * - Module; \ref siputils
  33. *
  34. * \todo :decode2format unpleasant
  35. */
  36. /* TODO :decode2format unpleasant */
  37. #ifndef CONTACT_OPS_H
  38. #define CONTACT_OPS_H
  39. /* if you want to parse all contacts not just de first one */
  40. #include "../../parser/msg_parser.h" /* struct sip_msg */
  41. #define ENCODE_ALL_CONTACTS 1
  42. #define DECODE_ALL_CONTACTS 1
  43. #define DEFAULT_SEPARATOR "*"
  44. char *contact_flds_separator;
  45. struct uri_format
  46. {
  47. str username;
  48. str password;
  49. str ip;
  50. str port;
  51. str protocol;
  52. int first;
  53. int second;
  54. };
  55. typedef struct uri_format contact_fields_t;
  56. int encode_contact (struct sip_msg *msg, char *encoding_prefix,char *public_ip);
  57. int decode_contact (struct sip_msg *msg, char *unused1,char *unused2);
  58. int decode_contact_header (struct sip_msg *msg, char *unused1,char *unused2);
  59. int encode2format (str uri, struct uri_format *format);
  60. int decode2format (str uri, char separator, struct uri_format *format);
  61. int encode_uri (str uri, char *encoding_prefix, char *public_ip,char separator, str * result);
  62. int decode_uri (str uri, char separator, str * result);
  63. #endif