Project Description
DEDSMSGateway is a full source code solution that deploy a Windows Service on a server that can connect to a SMSC host server and sends SMS using SMPP Protocol.

It uses InetLab.DLL to connect and communicate with SMSC server, so you need to download the DLL file (free evaluation

Introduction

DEDSMSGateway is a full source code solution that deploy a Windows Service on a server that can connect to a SMSC host server and sends SMS using SMPP Protocol.

It uses InetLab.DLL to connect and communicate with SMSC server, so you need to download the DLL file (free evaluation period) from http://www.inetlab.com and copy it in the BIN folder of DEDSMSSend project, and you might need to reference it inside the project.

Background

When you need to access SMS server using SMPP, you need to know Socket programming, but with InetLab DLL file you can use its API's easily, but the problem is to get the logic behind the API's, and that's where I created this project to help having a fully funcional SMS gateway for your company.

Using the code

The project consists of :
  1. SMSTable : Database table stored in any database
  2. DEDSMSSend: VB Windows Service Project
  3. DEDLogger: VB Class Project
  4. DEDSMSGateway2Setup: Setup and Deployment Project
!!! SMSTable structure:
Create the SMSTable in the databse, use the following code:
     CREATE TABLE [dbo].[SMSTable](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[phone] [nvarchar](50) NULL,
	[sms] [nvarchar](250) NULL,
	[status] [nvarchar](50) NULL,
	[etisalatID] [nvarchar](max) NULL,
	[AppID] [nvarchar](50) NULL,
      CONSTRAINT [PK_SMSTable] PRIMARY KEY CLUSTERED 
     (
	[id] ASC
     )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
     ) ON [PRIMARY]


!!! DEDSMSSend ((app.config)):
You need to set the variables in the APP.CONFIG file, these settings should be provided by your SMSC host.
  <appSettings>
    <add key="SrcAddr" value="####" />
    <add key="SystemType" value="SMPP" />
    <add key="hostName" value="###.###.###.###" />
    <add key="port" value="####" />
    <add key="systemId" value="#########" />
    <add key="password" value="#########" />
    <add key="ssl" value="False" />  <!-- using SSL for Connection? -->
  </appSettings>

You need to change the ConnectionString to point to your database, where you created the SMSTable
    <connectionStrings>
        <add name="DED.Application.My.MySettings.VIPInvitationsConnectionString"
            connectionString="UPDATE HERE YOUR CONNECTION STRING, DO NOT CHANGE THE NAME"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

Points of Interest

While developing this solution, I have faced an issue of connecting to the host, and after further invistigation, i figure it out that the InetLab.DLL are compatible with .NET Framework 2.0, so I rebuild the soultion on .NET 2.0, and that solved the problem.

Another thing you need to keep in mind is that the server where you install the DEDSMSGateway Windows Service must have an open port with the Server host, and that should be configured on the your server and the SMSC host server.

History

This is version 1.0 of the soution, I will try to update it with recieving SMS later if I find time :)

Last edited Apr 25, 2011 at 2:45 PM by saedshaar, version 5