SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Fri Mar 29, 2024 06:05
SMSTools3 Community » Help and support Bottom

[answered] SMS to execute a script howto

  This topic is locked

Page:  1

Author Post
Member
Registered:
Apr 2010
Location: Malaysia
Operating system name and version: Linux CentOS 4.8
Version of smsd: 3.1.11
Smsd installed from: sources
Name and model of a modem / phone: Wavecomm Fastrak Supreme 10
Interface: Serial


Hi,
I have a Helpdesk system written on PHP, to service our clients.

1) Whenever there is a problem, a client will issue a ticket (from the online Helpdesk system) and a technician who is in charge, will receive an SMS alert.

2) Upon completing his task, the technician will go into the Helpdesk system and look for the ticket number and closes that ticket

3) The Helpdesk System will then run close.php and closes that particular ticket


Question: Instead of step 2) above, I would like to have the technician to just reply to the SMS from step 1) with something like:
ticket 123456 close
which means that he had already troubleshoot ticket number 123456 and would like to close it. I know it can be done but have no idea how to begin with. I appreciate all advises and sample scripts if at all possible.

I thank you all in advance.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
This kind of a functionality can be made with an eventhandler. Here in this forum are some samples available, but not exactly containing a functionality you need. So, I wrote a new sample.

In the smsd.conf, define an eventhandler. It can be global setting, or modem setting:

eventhandler = /usr/local/bin/smsd_eventhandler.sh

Create this script with the following content, and make it executable (chmod 755 ...):

#!/bin/bash

if [ "$1" = "RECEIVED" ]; then

  FROM=`formail -zx From: < $2 | sed 's/"//g'`
  TEXT=`sed -e '1,/^$/ d' < $2`

  # Make text uppercase:
  TEXT=`echo "$TEXT" | tr "a-z" "A-Z"`

  # Get the first word:
  KEYWORD=`echo "$TEXT" | cut -d" " -f1`

  case $KEYWORD in
    TICKET)
      TICKET=`echo "$TEXT" | cut -d" " -f2`
      ACTION=`echo "$TEXT" | cut -d" " -f3`

      case $ACTION in
        CLOSE)
          /call/your/close.php "$TICKET"
        ;;
        REOPEN)
          /call/your/reopen.php "$TICKET"
        ;;
      esac
    ;;
  esac

fi
 
 
'bash' Syntax Highlight powered by GeSHi


Member
Registered:
Apr 2010
Location: Malaysia
Topic owner
Hi Keke,
I didn't know that it is that easy. Your script is a good head start. And thank you so much.

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.