api.h 507 B

12345678910111213141516171819202122232425262728
  1. #ifndef _TMX_API_H_
  2. #define _TMX_API_H_
  3. typedef int (*tmx_t_suspend_f)(struct sip_msg*, char*, char*);
  4. typedef struct tmx_api {
  5. tmx_t_suspend_f t_suspend;
  6. } tmx_api_t;
  7. typedef int (*bind_tmx_f)(tmx_api_t* api);
  8. static inline int load_tmx_api(tmx_api_t *api)
  9. {
  10. bind_tmx_f bindtmx;
  11. bindtmx = (bind_tmx_f)find_export("bind_tmx", 1, 0);
  12. if(bindtmx == 0) {
  13. LM_ERR("cannot find bind_tmx\n");
  14. return -1;
  15. }
  16. if(bindtmx(api)<0)
  17. {
  18. LM_ERR("cannot bind tmx api\n");
  19. return -1;
  20. }
  21. return 0;
  22. }
  23. #endif