Ozeki NG SMS Gateway logo OZEKI NG SMS Gateway
"The World's most reliable SMS gateway software!"

OZEKI NG SMS Gateway - Product Guide

SQL SMS API Contents | SearchSMS API functions

Home > Product Manual > Developers Guide > C Sharp SMS API

 


Automated phone calls?
Ozeki Phone System XE VoIP PBX software is an advanced PBX built for automated voice calls and 2 way SMS messaging. It has outstanding APIs for software developers. It can be used for:

Phone calls from SQL
Phone calls from HTTP
Voice and SMS applications

Callcenter developers
If you are working on telephone solutions, please check out the Ozeki VoIP SIP SDK.
It can be used to create VoIP client and server software.

Contact Us!
If you wish to get further information, do not hesitate to contact us!

E-mail: info@ozekisms.com

If you have a technical question, please submit a support request on-line.

C#.NET SMS API

This page gives you information on how you can use C# to send/receive SMS messages. A C#.NET SMS demo project is provided with full source code, that illustrates how to connect to Ozeki NG - SMS Gateway. The demo project makes it possible to send/receive SMS messages using a GSM Modem or an IP SMS connection, such as SMPP, CIMD2 or UCP/EMI. In my previous article (How to send SMS messages from C# using an SQL database) I have explained how you can send/receive SMS messages from C# using databases. The information I present here is useful if you would like to Interface directly with the SMS gateway without a database server.


Prerequisites

To get started using this C#.Net example, you need to download the example project by clicking on the following link. In this zip file you will find the source code of the project explained in this document.

Download: CsNETDll_v3.zip (57,3 Kb - Updated 22.07.2010.)

Open in Visual Studio
Figure 1 - Open 'SMSDemo.sln' by using Microsoft Visual Studio

Introduction to the C# SMS API

The C# SMS API is a client software, that can be used to connect to Ozeki NG - SMS Gateway directly to send and receive SMS messages from any C#.NET application. The API can be used to connect locally or remotely (over a LAN or the Internet) to the SMS Gateway. The API provides a classic example on how to use the .NET TCP/IP networking to make two applications (Your application and the SMS Gateway) work together. It uses the advantages provided by IP connectivity to create a client-server model. The API comes with an example. The C# SMS example is a working GUI application that can be used to send and receive SMS messages to get information about delivery status (Figure 1).


Figure 2. - Example application

How to use the C# SMS API

To use the C# SMS API you must have a working installation of Ozeki NG SMS Gateway in your system. To get a working installation, you need to follow the steps in the Ozeki SMS Gateway installation guide and the steps in the SMS quick start guide to verify if sending and receiving works.

After you have a working SMS gateway, you can download and extract the C# SMS client. Note, that Ozeki NG SMS Gateway does not necessary have to be installed on the same computer where your C# SMS application is running. You can have Ozeki NG SMS Gateway on one computer and you can use Visual Studio to build your C# SMS application on a different computer.

The C# SMS API reference

The C# SMS API provides methods that allow you to send various message types, such as WAP Push, Flash SMS, Ringtones, VCard, VCalendar, etc. It also has events that help you track your SMS messages. For example you can subscribe for a notification about when a message was delivered to the network and when a message was delivered to the handset. The C# SMS API can also be used to receive SMS messages. This gives you the option to create applications like SMS voting, quiz games, or stock market data querying quickly. A complete documentation of the C# SMS API is available on the following webpage:

C# SMS API Reference

Alternatively you might find the following guide useful:

How to send and receive SMS messages from C# using an SQL compatible database

Server side configuration

In order to use the C# api, you need to configure the SMPP server in Ozeki NG SMS Gateway. You will need to setup an SMPP user account that can be used by the C# client to send and receive SMS messages.

Enable SMPP in SMS Gateway
Figure 3 - Enable the SMPP server of Ozeki SMS Gateway

Modify Port
Figure 4 - Change the port number of the SMPP server

Create User
Figure 5 - Install any type of user in Ozeki SMS Gateway

Client side configuration

Once you have created the server side configuration, you need to enter the appropriate server details into the code of the C# SMS client. You will enter the IP address and port of the server, and the username and password.

Provide Login Data
Figure 6 - Set login data for the SMPP server by providing the user credentials in 'Program.cs'

Testing your code

You can test your code and send your first message by launching the project in Visual Studio. Simply click on the build button, and the application will start.

Start Project
Figure 7 - Start 'SMSDemoConsole' project in the C# integrated development environment

Sending Message from Console
Figure 8 - The console application sends SMS message from console

Reading the logs

After sending your first SMS messages, we recommend you to read the logs in the Ozeki NG SMS Gateway user interface. You can do this by opening the details page of the SMS gateway.

Message Sent
Figure 9 - The message sent event logs of the user you have been connected to in Ozeki SMS Gateway

Set SMSDemo as Startup Project
Figure 10 - Set 'SMSDemo' as StartUp Project

Start SMSDemo
Figure 11 - Start 'SMSDemo' project

Connect to SMS Gateway
Figure 12 - Connect to Ozeki SMS Gateway's SMPP server

Send Test Message
Figure 13 - Send test message from the C# GUI of the 'SMSDemo' project

Message Sent
Figure 14 - The message sent event logs in Ozeki SMS Gateway

How to specify the validity period for your messages

Ozeki NG SMS Gateway allows you to send SMS messages from various applications. If you use C# SMS API for sending messages, you can set the validity period for your messages. For specifying the validity period, please use the following parameter:

&vp=2022.07.26.+10%3A07%3A58

Please note that 2022.07.26.+10%3A07%3A58 is the Urlencoded form of 2022.07.26. 10:07:58.

With the use of this parameter, you can send validity information to the service provider. Therefore, the service provider can set messages to be valid for the specified period.

Read more






Next page: SMS API functions
Copyright © 2000- - Ozeki Ltd | info@ozeki.hu
Home > Product Manual > Developers Guide > C Sharp SMS API
Legal | Privacy | Terms of use | 2315
34.200.222.93 | 87.229.102.173 | Login