C++ SMS source code on how to send SMS text messages using HTTP


/ Published in: C++
Save to your folder(s)

Hey Guys,

This is a short and straightforward article (or let’s say „tip” or „mini-review”) that presents how to send SMS messages from your own C++ (Cpp / C plus plus) application through HTTP. You will see, it is gonna be really easy. I will focus on the necessary code, but I would like to draw your attention to all the hardware and software requirements that are essentially needed for SMS messaging.

Briefly about SMS technology for better understanding

If you are proficient in SMS technology, just skip this paragraph and move on to the next one. So well, if you want to send SMS messages from your C++ application, first you need to connect your software and an SMS gateway to each other. Why? Because your application let you compose the SMS messages (including the text, the recipient’s phone number, etc.), but if you want to send out the SMS, you need to connect to the SMSC (Short Message Service Center that stores, forwards, converts and delivers SMS messages). An SMS gateway is able to connect to the SMSC of the Mobile Service Provider via SMPP IP SMS connection or a GSM modem, so actually the SMS gateway can send out your message. To establish connection between the SMS gateway and the C++ application, I used HTTP requests and responses. For sending SMS messages through HTTP, your SMS gateway should have a built-in webserver (e.g. Ozeki NG – www.ozekisms.com). The built-in webserver allows you to send SMS messages from your C++ application by calling an URL (HTTP Get) or using the HTTP Post method.

So that, all you need to have for sending SMS from your C++ application using HTTP is Microsoft Visual Studio for C++ development, an SMS gateway and my code snippet!

Okay and finally a few lines about testing. To test your software by sending out SMS message(s) actually, you need to install a GSM modem connection or an IP SMS connection. Buti f you have not contracted with any mobile service provider (e.g. AT&T or T-Mobile), you can test the SMS sending by simulating it (e.g. Ozeki NG provides „HTTP Server Connection” that can be used for this purpose). For more details related to the configuration of the SMS gateway, please contact the vendor of your SMS gateway.

Happy coding! :)

URL: http://www.ozekisms.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.