usage.h 2.5 KB

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