tm_load.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 Fhg Fokus
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  8. * ser 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. * For a license to use the ser software under conditions
  14. * other than those described here, or to purchase support for this
  15. * software, please contact iptel.org by e-mail at the following addresses:
  16. * [email protected]
  17. *
  18. * ser is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  26. */
  27. #include "tm_load.h"
  28. #include "uac.h"
  29. #define LOAD_ERROR "ERROR: tm_bind: TM module function "
  30. int load_tm( struct tm_binds *tmb)
  31. {
  32. if (!( tmb->register_tmcb=(register_tmcb_f)
  33. find_export("register_tmcb", NO_SCRIPT)) ) {
  34. LOG(L_ERR, LOAD_ERROR "'register_tmcb' not found\n");
  35. return -1;
  36. }
  37. if (!( tmb->t_relay_to=find_export(T_RELAY_TO, 2)) ) {
  38. LOG(L_ERR, LOAD_ERROR "'t_relay_to' not found\n");
  39. return -1;
  40. }
  41. if (!( tmb->t_relay=find_export(T_RELAY, 0)) ) {
  42. LOG(L_ERR, LOAD_ERROR "'t_relay' not found\n");
  43. return -1;
  44. }
  45. if (!(tmb->t_uac=(tuac_f)find_export(T_UAC, NO_SCRIPT)) ) {
  46. LOG( L_ERR, LOAD_ERROR "'t_uac' not found\n");
  47. return -1;
  48. }
  49. if (!(tmb->t_reply=(treply_f)find_export(T_REPLY, 2)) ) {
  50. LOG( L_ERR, LOAD_ERROR "'t_reply' not found\n");
  51. return -1;
  52. }
  53. if (!(tmb->t_reply_unsafe=(treply_f)find_export(T_REPLY_UNSAFE, 2)) ) {
  54. LOG( L_ERR, LOAD_ERROR "'t_reply_unsafe' not found\n");
  55. return -1;
  56. }
  57. if (!(tmb->t_forward_nonack=(tfwd_f)find_export(T_FORWARD_NONACK , 2)) ) {
  58. LOG( L_ERR, LOAD_ERROR "'t_forward_nonack' not found\n");
  59. return -1;
  60. }
  61. return 1;
  62. }