Community discussions

MikroTik App
just joined
Topic Author
Posts: 21
Joined: Mon Jan 26, 2009 7:51 pm

SMS Sender Source Code.

Thu Jun 24, 2010 1:35 pm


this is a VERY CRUDE VB6 program, which I use to send SMS messages from the Dude.

It consists of two parts:

1) DudeLogger.exe
2) SMS Send Message

Dude Logger is a very simple VB program, which takes anything passed to it on the command line, and writes it out as a simple text file. There may be other ways of achieving this in the Dude, but this seemed very simple to me.

SMS Send Message is a console App (not a service, sorry), which then polls the same directory, looking for text messages, and sends them out via a Modem connected to the Dude server. I'm using a US Robotics USB Modem, but I dare say any modem will work, provided VB can talk to it over a COM port. Mine shows up as COM4.

The SMS Sender program is also very crude - I pre-programmed it with the TAP for Vodaphone UK, which seems to work. Other TAPs in the UK seem to have stopped working, so you will need to find a TAP and verify that it works for you.

I also pre-programmed it with the Cellphone numbers of two recipients - these are garbage numbers that you will need to replace with whoever you want to receive the SMS Alerts.

I was going to make the interface a bit nicer, and let the user edit recipient and TAP access numebrs, but I never got around to it.

In the Dude, you need to add a new notification:

Name: Dude Logger
Type: execute on server
Command: DudeLogger.exe Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])

On the 'Advanced' Tab, I JUST check the following:


of course, you can add what you like.

Pick a device and add a simple service such as ping. Double click on that service, and on the Notifications tab, put a tick against Dude Logger, which should appear as a new Notification type.

Every time Ping fails, it'll create a simple text message with a name along the lines of:

c:\DudeAlerts\YYYYMMDDhhmmss_rnd.txt where rnd is a random value to try and avoid the creation of duplicate messages during the same second.

This text file will contain something like "Service ping on MY DEVICE is now down (timeout)".

You will need to create the following directories:


OR, you can simply modify the code so that it writes stuff to where you'd like it to.

OK. On to the second part.

SMSSender.exe is a Windows Console app - it's not a service, it has to be run as an Administrator and must be running all the time. Yes, I know this isn't ideal, but it suits my environment, where I have The Dude running on a small 1U Windows server, and I simply VNC into it. Note that RDC doesn't open the main widows console, but VNC does, so you have to use VNC to load and run the app. Or plug in a screen and keyboard.

This program makes use of a VB Class Module called cTapProtocol.cls which was written by Mike Ball from Staffordshire: I am very grateful to him for making his code freely available, and thereby pointing me in the direction of UK TAPs.

Both of these programs are attached below as VB6 projects. You will HAVE to modify them to work in your environment, and they are provided as-is, there is absolutely no warranty whatsoever. I cannot give you any support, and I will not be held accountable if they don't work in your environment.

You will need to compile them into .exe files, and build a package that can be deployed, so that it will install all the VB Runtime stuff. If you're not familiar with writing, compiling and deploying VB6 Windows applications, you may struggle and I'm sorry, but I cannot help you.

Please do not ask me to fix these apps or to explain to you why they don't work in your environment. I am simply trying to give something back to the community, as I have found The Dude to be completely invaluable.

Richard R. Goodwin
You do not have the required permissions to view the files attached to this post.
just joined
Posts: 1
Joined: Tue Aug 31, 2010 5:16 pm

Re: SMS Sender Source Code.

Tue Aug 31, 2010 5:20 pm

Im Mike Ball Writer of the cTapProtocol Class
Glad to see my code has come to some use :) :)
User avatar
Frequent Visitor
Frequent Visitor
Posts: 79
Joined: Thu Jun 25, 2009 12:34 pm

Re: SMS Sender Source Code.

Tue Sep 28, 2010 8:45 pm

Sending SMS to Dude for Ukraine:
Russian language: (.
I hope this will be useful.
Long time Member
Long time Member
Posts: 556
Joined: Wed Sep 05, 2007 10:34 am
Location: Spain

Re: SMS Sender Source Code.

Tue Sep 28, 2010 10:30 pm

this is a VERY CRUDE VB6 program
Less crude than the underlying Windows operating system !

Well done !
Don't forget to give me at least a tenner a month, every month
just joined
Posts: 1
Joined: Thu Nov 18, 2010 11:12 pm

Re: SMS Sender Source Code.

Thu Nov 18, 2010 11:24 pm

I have created an GSM SMS service in VB2005, it uses AT commands for anyone who needs source code or binary files.

I will need to do some documentation first.

Please let me know; and I will make the effort.

Who is online

Users browsing this forum: No registered users and 26 guests