Kamailio.pm 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # $Id$
  3. #
  4. # Perl module for Kamailio
  5. #
  6. # Copyright (C) 2006 Collax GmbH
  7. # (Bastian Friedrich <[email protected]>)
  8. #
  9. # This file is part of Kamailio, a free SIP server.
  10. #
  11. # Kamailio is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version
  15. #
  16. # Kamailio is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. #
  25. package Kamailio;
  26. require Exporter;
  27. require DynaLoader;
  28. @ISA = qw(Exporter DynaLoader);
  29. @EXPORT = qw ( t );
  30. @EXPORT_OK = qw ( log );
  31. use Kamailio::Message;
  32. use Kamailio::Constants;
  33. use Kamailio::Utils::Debug;
  34. bootstrap Kamailio;
  35. BEGIN {
  36. $SIG{'__DIE__'} = sub {
  37. Kamailio::Message::log(undef, L_ERR, "perl error: $_[0]\n");
  38. };
  39. $SIG{'__WARN__'} = sub {
  40. Kamailio::Message::log(undef, L_ERR, "perl warning: $_[0]\n");
  41. };
  42. }
  43. 1;