sipheader.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Kamailio osp module.
  3. *
  4. * This module enables Kamailio 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 Kamailio, a free SIP server.
  15. *
  16. * Kamailio 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. * Kamailio is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  29. */
  30. #ifndef _OSP_MOD_SIPHEADER_H_
  31. #define _OSP_MOD_SIPHEADER_H_
  32. #include <osp/osp.h>
  33. #include "../../parser/msg_parser.h"
  34. #define OSP_TOKEN_HEADER "P-OSP-Auth-Token: "
  35. #define OSP_HEADER_SIZE strlen(OSP_TOKEN_HEADER)
  36. void ospCopyStrToBuffer(str* source, char* buffer, int buffersize);
  37. int ospGetFromUserpart(struct sip_msg* msg, char* fromuser, int buffersize);
  38. int ospGetRpidUserpart(struct sip_msg* msg, char* fromuser, int buffersize);
  39. int ospGetToUserpart(struct sip_msg* msg, char* touser, int buffersize);
  40. int ospGetUriUserpart(struct sip_msg* msg, char* touser, int buffersize);
  41. int ospAddOspHeader(struct sip_msg* msg, unsigned char* token, unsigned int tokensize);
  42. int ospGetOspHeader(struct sip_msg* msg, unsigned char* token, unsigned int* tokensize);
  43. int ospGetSourceAddress(struct sip_msg* msg, char* sourceaddress, int buffersize);
  44. int ospGetCallId(struct sip_msg* msg, OSPTCALLID** callid);
  45. int ospGetRouteParameters(struct sip_msg* msg, char* routeparams, int buffersize);
  46. int ospRebuildDestionationUri(str* newuri, char* called, char* dest, char* port, int format);
  47. void ospGetNextHop(struct sip_msg* msg, char* nexthop, int buffersize);
  48. #endif /* _OSP_MOD_SIPHEADER_H_ */