27.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. # test publish and subscribe for presence
  3. # Copyright (C) 2007 1&1 Internet AG
  4. #
  5. # This file is part of Kamailio, a free SIP server.
  6. #
  7. # Kamailio is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version
  11. #
  12. # Kamailio is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. . include/common
  21. . include/require.sh
  22. . include/database.sh
  23. if ! (check_sipp && check_kamailio && check_module "db_mysql" \
  24. && check_module "presence" && check_module "presence_xml" \
  25. && check_mysql); then
  26. exit 0
  27. fi ;
  28. CFG=presence.cfg
  29. $BIN -L $MOD_DIR -Y $RUN_DIR -P $PIDFILE -w . -f $CFG -a no >/dev/null
  30. ret=$?
  31. sleep 1
  32. if [ "$ret" -eq 0 ] ; then
  33. sipp -sf publish_scenario.xml -i 127.0.0.1 -p 5061 -inf publish.csv 127.0.0.1:5059 -recv_timeout 500000 -m 1 >/dev/null 2>&1 &
  34. ret=$?
  35. fi
  36. if [ "$ret" -eq 0 ] ; then
  37. sipp -sf subscribe_notify_scenario.xml -i 127.0.0.1 -p 5061 -inf subscribe_notify.csv 127.0.0.1:5059 -recv_timeout 500000 -m 1 >/dev/null 2>&1 &
  38. ret=$?
  39. fi
  40. sleep 1
  41. #cleanup:
  42. kill_kamailio
  43. killall -9 sipp >/dev/null 2>&1
  44. exit $ret