sipheader.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * ser osp module.
  3. *
  4. * This module enables ser to communicate with an Open Settlement
  5. * Protocol (OSP) server. The Open Settlement Protocol is an ETSI
  6. * defined standard for Inter-Domain VoIP pricing, authorization
  7. * and usage exchange. The technical specifications for OSP
  8. * (ETSI TS 101 321 V4.1.1) are available at www.etsi.org.
  9. *
  10. * Uli Abend was the original contributor to this module.
  11. *
  12. * Copyright (C) 2001-2005 Fhg Fokus
  13. *
  14. * This file is part of ser, a free SIP server.
  15. *
  16. * ser is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License as published by
  18. * the Free Software Foundation; either version 2 of the License, or
  19. * (at your option) any later version
  20. *
  21. * For a license to use the ser software under conditions
  22. * other than those described here, or to purchase support for this
  23. * software, please contact iptel.org by e-mail at the following addresses:
  24. * [email protected]
  25. *
  26. * ser is distributed in the hope that it will be useful,
  27. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. * GNU General Public License for more details.
  30. *
  31. * You should have received a copy of the GNU General Public License
  32. * along with this program; if not, write to the Free Software
  33. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  34. */
  35. #ifndef _OSP_MOD_SIPHEADER_H_
  36. #define _OSP_MOD_SIPHEADER_H_
  37. #include <osp/osp.h>
  38. #include "../../parser/msg_parser.h"
  39. #define OSP_TOKEN_HEADER "P-OSP-Auth-Token: "
  40. #define OSP_HEADER_SIZE strlen(OSP_TOKEN_HEADER)
  41. void ospCopyStrToBuffer(str* source, char* buffer, int buffersize);
  42. int ospGetFromUserpart(struct sip_msg* msg, char* fromuser, int buffersize);
  43. int ospGetRpidUserpart(struct sip_msg* msg, char* fromuser, int buffersize);
  44. int ospGetToUserpart(struct sip_msg* msg, char* touser, int buffersize);
  45. int ospGetUriUserpart(struct sip_msg* msg, char* touser, int buffersize);
  46. int ospAddOspHeader(struct sip_msg* msg, unsigned char* token, unsigned int tokensize);
  47. int ospGetOspHeader(struct sip_msg* msg, unsigned char* token, unsigned int* tokensize);
  48. int ospGetSourceAddress(struct sip_msg* msg, char* sourceaddress, int buffersize);
  49. int ospGetCallId(struct sip_msg* msg, OSPTCALLID** callid);
  50. int ospGetRouteParameters(struct sip_msg* msg, char* routeparams, int buffersize);
  51. int ospRebuildDestionationUri(str* newuri, char* called, char* dest, char* port, int format);
  52. void ospGetNextHop(struct sip_msg* msg, char* nexthop, int buffersize);
  53. int ospGetDirection(struct sip_msg* msg);
  54. #endif /* _OSP_MOD_SIPHEADER_H_ */