app_mono_api.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * $Id$
  3. *
  4. * Copyright (C) 2011 Daniel-Constantin Mierla (asipto.com)
  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. #ifndef _APP_MONO_API_H_
  24. #define _APP_MONO_API_H_
  25. #include <mono/jit/jit.h>
  26. #include <mono/metadata/environment.h>
  27. #include <stdlib.h>
  28. #include "../../parser/msg_parser.h"
  29. typedef struct _sr_mono_env
  30. {
  31. MonoDomain *domain;
  32. MonoAssembly *assembly;
  33. sip_msg_t *msg;
  34. unsigned int flags;
  35. } sr_mono_env_t;
  36. sr_mono_env_t *sr_mono_env_get(void);
  37. int mono_sr_initialized(void);
  38. int mono_sr_init_mod(void);
  39. int mono_sr_init_child(void);
  40. int mono_sr_init_load(void);
  41. void mono_sr_destroy(void);
  42. int mono_sr_init_probe(void);
  43. int sr_mono_assembly_loaded(void);
  44. int sr_mono_load_script(char *script);
  45. int sr_mono_register_module(char *mname);
  46. int app_mono_exec(struct sip_msg *msg, char *script, char *param);
  47. int app_mono_run(sip_msg_t *msg, char *arg);
  48. typedef struct sr_M_export {
  49. char *name;
  50. void* method;
  51. } sr_M_export_t;
  52. #endif