usage.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_USAGE_H_
  36. #define _OSP_MOD_USAGE_H_
  37. #include <osp/osp.h>
  38. #include "../../parser/msg_parser.h"
  39. /* This module reports originating and terminating call set up and duration usage
  40. * for OSP transactions.
  41. *
  42. * Call set-up usage is reported based on the osp_dest structures stored as AVPs.
  43. * It includes OSP transaction id, response codes, start time, alert time,
  44. * connect time, etc.
  45. *
  46. * Duration usage is reported based on the OSP cooky recorded into the route set
  47. * (using add_rr_param) after requesting routing/authorization on the originating
  48. * side, and validating authorization on the terminating side. It include
  49. * OSP transaction id, duration, stop time, etc.
  50. *
  51. * Actual conversation duration maybe calculated using connect time (from the call
  52. * set up usage) and stop time (from the duration usage).
  53. */
  54. void ospRecordOrigTransaction(struct sip_msg* msg, unsigned long long transid, char* uac, char* from, char* to, time_t authtime, unsigned destinationCount);
  55. void ospRecordTermTransaction(struct sip_msg* msg, unsigned long long transid, char* uac, char* from, char* to, time_t authtime);
  56. void ospReportOrigSetupUsage(void);
  57. void ospReportTermSetupUsage(void);
  58. int ospReportUsage(struct sip_msg* msg, char* ignore1, char* ignore2);
  59. #endif /* _OSP_MOD_USAGE_H_ */