dlg_load.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * dialog module - basic support for dialog tracking
  3. *
  4. * Copyright (C) 2006 Voice Sistem SRL
  5. *
  6. * This file is part of Kamailio, a free SIP server.
  7. *
  8. * Kamailio is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version
  12. *
  13. * Kamailio is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. */
  23. /*!
  24. * \file
  25. * \brief Functions related to dialog handling
  26. * \ingroup dialog
  27. * Module: \ref dialog
  28. */
  29. #ifndef _DIALOG_DLG_LOAD_H_
  30. #define _DIALOG_DLG_LOAD_H_
  31. #include "dlg_cb.h"
  32. #include "../../sr_module.h"
  33. /* terminate_dlg function prototype */
  34. typedef int (*terminate_dlg_f)(struct dlg_cell* dlg, str *hdrs);
  35. typedef struct dlg_cell *(*get_dlg_f)(struct sip_msg *msg);
  36. typedef void (*release_dlg_f)(struct dlg_cell *dlg);
  37. struct dlg_binds {
  38. register_dlgcb_f register_dlgcb;
  39. terminate_dlg_f terminate_dlg;
  40. set_dlg_variable_f set_dlg_var;
  41. get_dlg_variable_f get_dlg_var;
  42. get_dlg_f get_dlg;
  43. release_dlg_f release_dlg;
  44. };
  45. typedef int(*load_dlg_f)( struct dlg_binds *dlgb );
  46. int load_dlg( struct dlg_binds *dlgb);
  47. static inline int load_dlg_api( struct dlg_binds *dlgb )
  48. {
  49. load_dlg_f load_dlg;
  50. /* import the DLG auto-loading function */
  51. if ( !(load_dlg=(load_dlg_f)find_export("load_dlg", 0, 0)))
  52. return -1;
  53. /* let the auto-loading function load all DLG stuff */
  54. if (load_dlg( dlgb )==-1)
  55. return -1;
  56. return 0;
  57. }
  58. #endif