
Hello!
Now I will tell you how my colleagues launched a “fan” SMS service for a week (an hour a day) and how it is done. In general, I was wondering how to properly fasten SMS-notifications to the online store, but here it is just a whole case microproject. Immediately I say, if you know well how the SMS aggregator, SMS gateway and other things work, this “first brick” will seem trivial to you.
The task before the mini-startup was simple:- Create a cool thing on the "knee" for a minimum of time
- Spend less than 1000 rubles per start (time is not considered)
- Build a running monetized service
UDP: in the comments there are still statistics during habraeffekt and an enchanting end of the story from the aggregator.So, given: a company of people that deals with software for telecoms. Before the New Year, they had accumulated a lot of positively destructive energy that would surely form into “Easter eggs” if it were not for the idea to make a gift for children. The idea is simple - sending SMS from Santa Claus and other characters.
')
Why is that? Yes, because our guys have been joking a couple of times with the replacement of the sender. The child of the team leader, who received a letter from Santa Claus himself, was simply unmeasuredly happy: “Dad, mom, Santa Claus sent me an email! Look here! ” True, then, with the meticulousness of the investigator, it began: “Dad, how did he know my phone number?”.
How it works for the user:
- He chooses a hero (Father Frost, Snow Maiden and others)
- Writes a message on behalf of this character.
- Enter the recipient's number
- Sets the time to send a message.
- Pays 15 rubles using your SMS.
They used it for themselves: they planned a gift for someone and set a timer for 1 minute after the presentation. At home, it worked just super.
Interestingly, with the start of beta tests inside the company, the girls asked Snegurka and began to write almost erotic SMS to their loved ones - so we learned about another side of the functional.
However, the main focus is a bit of New Year's magic for the child, personally, who was written by Santa Claus. For us, this idea is slightly absurd, but the children believe and are simply wildly happy.
How is this technically implemented
- Hosting with PHP + MySQL to support the site
- HTTP access to SMS gateway to send messages
- Contract with aggregator for making payments
Masterhost was chosen to be the hosting (not because of hopelessness, but because the project was already there - that is, the payment was only 150 rubles).
Principle
- The user clogs the data into the interface on the site.
- Information is stored in the database pending payment.
- Payment by SMS is offered.
- User pays.
- The aggregator receives an SMS from the mobile operator and calls the handler on our site, the handler's response is returned to the subscriber in the form of an SMS.
- Periodically, Cron launches another script to retrieve paid orders from the database and contacts the SMS gateway to send a message.
- On the subscriber's phone comes greetings.
Gate
As an SMS gateway, they used infobip.com, but they only work with legal entities, a more affordable option, which has already been written on Habré, is littlesms.ru. Here
in Q & A there are more options.
To get access to the gate, you just need to sign up or call the support service, voice the number of SMS messages that you plan to send (the sending price depends on it, the larger the package - the lower the cost), provide passport details (for individuals) and throw On account of a certain amount of money. After that they give an API. Different SMS gateways provide different connection methods (SMPP, HTTP POST, HTTP GET), we have chosen the simplest type of HTTP GET. Accordingly, the request for sending SMS in this case looks like this:
mysmsgate.com/SMSservice/SendSMS.aspx?user=xxx&password=xxxx&sender=xxx&SMSText=messagetext&phone=79101234567
SMS gateway returns one of the codes by which you can determine the success or failure of the request.
Immediately agreed on the allocation of a beautiful prefix moroz and access to the gateway with post-payment after the fact. Just phoned on Skype with support services and outlined the idea of service. Cash costs for this operation - 0 rub.
Aggregator
The aggregator is needed exclusively for the monetization of the resource, that is, technically everything works without it. But we live in the real world, and this thing is needed to complete the constructor.
In principle, you can use many different schemes for receiving money (Yandex-money, WebMoney, QIWI, etc.), but stopped at the most simple - paid SMS. This is a micro-payment method, when the operator takes the main profit, and you receive the balance from the SMS payment.
The service works with A1 (because it can be quickly signed), but other companies can also be used. All of them provide similar basic interfaces and differ only in the number of countries covered, the features of the personal account and the percentage of contributions to partners.
There are first-level aggregators that have a connection directly to the SMS centers of operators and subaggregators that are engaged in the resale of the services of first-level aggregators.
Of course, it is preferable to work with first-level aggregators, although the requirements for their partners are usually higher. Colleagues managed to work with Russian Billing (no longer on the market), Plastic Media, i-Free and A1Agregator. If you are interested in a specific experience with these companies, write in a personal
Antonsub , he can tell all the ins and outs.
To activate the services of the aggregator, you must write to the support service and explain your requests. In the simplest case (physical person), you will immediately get an account and provide access to your personal account, where you can already start projects, select prefixes, execute test SMS messages and view statistics. By experience, connecting the service to a new SMS aggregator usually takes no more than 3-4 days, including writing scripts-handlers.
Here is an example of an HTTP request coming from the aggregator if the subscriber sends a paid SMS with your prefix:
mysite.ru/handler.php?date=2008-03-28+17%3A13%3A33&msg=prefix+text&operator_id=120&country_id=45909&user_id=79099080375&smsid=5094&cost_rur=0.54&test=1&num=1121&retry=1&try=2&sign=ceec8c15aea1bbe12379f35ffeae38ae
prefix - the send prefix, that is, the recipient's identifier (in our case, moroz)
smsid - the message identifier in the system
cost_rur - amount credited to the partner’s account in rubles
test - optional parameter, it comes only with a test SMS.
num - short number to which the subscriber sent a request
retry - SMS retry parameter, if one is equal to means SMS retry. When SMS is repeated, all other parameters duplicate the first unsuccessful SMS.
try - The sequence number of the attempt to send an SMS message through different proxy servers.
sign - MD5 hash from other parameters
smsid - used in the response, a required parameter for the response.
Sample answer:smsid: 1034
status: reply
Usluga oplachena.
Total:
- A week an hour a day for the implementation of the service (no one released the team from the main work, it was done at lunch and in the morning)
- 3 simple PHP scripts (one for processing requests from the SMS aggregator, the second for accessing the SMS gateway, the third for launching via Cron)
- 150 rub. for domain name registration
The result is a happy daughter's friend, who received an SMS from Santa Claus himself.
Why does this thing work for the New Year when everything is lying
Usually, on December 31, SMS is tricky and can come in an hour or a day.
Everything is much faster, and here's why:- SMS immediately enters the SMS center: the operation of message delivery from the sender's phone to the base station and further to the operator is excluded.
- Operators allocate SMS to gateways with a certain quota in traffic that the subscriber-subscriber is not involved in the usual parcels.
The result - the first brick "SMS-Lego". You can screw anything on it.
How is monetized
The service is not designed to receive super profits. From 15 rub. about half spent by the user goes to the operator, another 5% goes to the SMS aggregator, i.e. The account receives about 6-7 rubles, of which SMS gateway and hosting services are paid.
See and feel
Here is the service itself:
e-moroz.ru . Here you can make a free test by sending a sample greeting to any phone from Santa Claus and see how it works. Please do not blame the site - it is so vigorous because it was painted by children and made up on Friday evening. Most importantly, he conveys how it works.
About colleagues
The wonderful people I’m talking about are developing e-voting systems using mobile devices, from the
system of automatic voice independent recognition of continuous Russian speech (this is an interesting topic, they have an alpha service that allows you to dictate directly in LJ), mobile applications and logic games for iPhone and JavaME. Well, in general, a different software for telecoms.
The author of the
Antonsub service, who laid out all this on my fingers, can tell you about the above described things in the following topics, if this one was interesting to you.
UPD : persuaded Anton to share statistics on payment and shipment.
Here it is .
UPD 2 : Fan is
over , the forester came and dispersed everyone.